/* * Kendo UI v2015.3.1111 (http://www.telerik.com/kendo-ui) * Copyright 2015 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.filebrowser.min"],e)}(function(){return function(e,t){function n(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}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 o,r,s=window.kendo,a=s.ui.FileBrowser,l=e.isPlainObject,c=e.proxy,u=e.extend,h=s.support.browser,d=s.isFunction,f=/(^\/|\/$)/g,p="error",g=".kendoImageBrowser",m="name",v="size",_="type",w={field:_,dir:"asc"},b=s.template('
  • ${text}
  • ');u(!0,s.data,{schemas:{imagebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),u(!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,n){n.data=e.extend({},n.data,{path:this.options.path()}),d(this.options[t])?this.options[t].call(this,n):s.data.RemoteTransport.fn[t].call(this,n)},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"}}})}}),o=h.msie&&8>h.version?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},r=a.extend({init:function(e,t){var n=this;t=t||{},a.fn.init.call(n,e,t),n.element.addClass("k-imagebrowser")},options:{name:"ImageBrowser",fileTypes:"*.png,*.gif,*.jpg,*.jpeg"},value:function(){var e,i=this,o=i._selectedItem(),r=i.options.transport.imageUrl;return o&&"f"===o.get(_)?(e=n(i.path(),o.get(m)).replace(f,""),r&&(e=d(r)?r(e):s.format(r,encodeURIComponent(e))),e):t},_fileUpload:function(e){var t,n=this,i=n.options,o=i.fileTypes,r=RegExp(("("+o.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),a=e.files[0].name,l=m,c=v;r.test(a)?(e.data={path:n.path()},t=n._createFile(a),t?(t._uploading=!0,n.upload.one("success",function(e){delete t._uploading,t.set(l,e.response[n._getFieldName(l)]),t.set(c,e.response[n._getFieldName(c)]),n._tiles=n.listView.items().filter("["+s.attr("type")+"=f]"),n._scroll()})):e.preventDefault()):(e.preventDefault(),n._showMessage(s.format(i.messages.invalidFileType,a,o)))},_content:function(){var t=this;t.list=e('