/** * Kendo UI v2016.1.112 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define("kendo.imagebrowser.min",["kendo.filebrowser.min"],e)}(function(){return function(e,t){function a(e,a){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+a}function i(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}var n,o,s=window.kendo,r=s.ui.FileBrowser,l=e.isPlainObject,d=e.proxy,p=e.extend,c=s.support.browser,u=s.isFunction,f=/(^\/|\/$)/g,m="error",h=".kendoImageBrowser",g="name",_="size",y="type",k={field:y,dir:"asc"},v=s.template('
  • ${text}
  • ');p(!0,s.data,{schemas:{imagebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),p(!0,s.data,{transports:{imagebrowser:s.data.RemoteTransport.extend({init:function(t){s.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,a){a.data=e.extend({},a.data,{path:this.options.path()}),u(this.options[t])?this.options[t].call(this,a):s.data.RemoteTransport.fn[t].call(this,a)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),n=c.msie&&8>c.version?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},o=r.extend({init:function(e,t){var a=this;t=t||{},r.fn.init.call(a,e,t),a.element.addClass("k-imagebrowser")},options:{name:"ImageBrowser",fileTypes:"*.png,*.gif,*.jpg,*.jpeg"},value:function(){var e,i=this,n=i._selectedItem(),o=i.options.transport.imageUrl;return n&&"f"===n.get(y)?(e=a(i.path(),n.get(g)).replace(f,""),o&&(e=u(o)?o(e):s.format(o,encodeURIComponent(e))),e):t},_fileUpload:function(e){var t,a=this,i=a.options,n=i.fileTypes,o=RegExp(("("+n.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),r=e.files[0].name,l=g,d=_;o.test(r)?(e.data={path:a.path()},t=a._createFile(r),t?(t._uploading=!0,a.upload.one("success",function(e){delete t._uploading,t.set(l,e.response[a._getFieldName(l)]),t.set(d,e.response[a._getFieldName(d)]),a._tiles=a.listView.items().filter("["+s.attr("type")+"=f]"),a._scroll()})):e.preventDefault()):(e.preventDefault(),a._showMessage(s.format(i.messages.invalidFileType,r,n)))},_content:function(){var t=this;t.list=e('