2 lines
24 KiB
JavaScript
2 lines
24 KiB
JavaScript
(function(e){function t(t){for(var r,s,l=t[0],c=t[1],a=t[2],f=0,u=[];f<l.length;f++)s=l[f],Object.prototype.hasOwnProperty.call(o,s)&&o[s]&&u.push(o[s][0]),o[s]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);h&&h(t);while(u.length)u.shift()();return n.push.apply(n,a||[]),i()}function i(){for(var e,t=0;t<n.length;t++){for(var i=n[t],r=!0,l=1;l<i.length;l++){var c=i[l];0!==o[c]&&(r=!1)}r&&(n.splice(t--,1),e=s(s.s=i[0]))}return e}var r={},o={app:0},n=[];function s(t){if(r[t])return r[t].exports;var i=r[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,s),i.l=!0,i.exports}s.m=e,s.c=r,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(i,r,function(t){return e[t]}.bind(null,r));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],c=l.push.bind(l);l.push=t,l=l.slice();for(var a=0;a<l.length;a++)t(l[a]);var h=c;n.push([0,"chunk-vendors"]),i()})({0:function(e,t,i){e.exports=i("56d7")},"034f":function(e,t,i){"use strict";i("85ec")},"0494":function(e,t,i){},"050b":function(e,t,i){},"07b4":function(e,t,i){},"0dbf":function(e,t,i){"use strict";i("b25d")},1:function(e,t){},"1da8":function(e,t,i){"use strict";i("3c1e")},2:function(e,t){},3:function(e,t){},"3c1e":function(e,t,i){},4:function(e,t){},5:function(e,t){},"56d7":function(e,t,i){"use strict";i.r(t);i("e260"),i("e6cf"),i("cca6"),i("a79d");var r=i("2b0e"),o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"app"}},[i("Main",{attrs:{msg:"EAF can now use Vue.js to write applications!"}})],1)},n=[],s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"page"},[i("div",{staticClass:"content"},[i("div",{staticClass:"file-area"},[i("div",{staticClass:"current-path",style:{color:e.headerForegroundColor()}},[i("span",{staticClass:"current-path-first-part"},[e._v(e._s(e.pathFirstPart))]),i("span",{staticClass:"current-path-second-part"},[e._v(e._s(e.pathSecondPart))])]),""!==e.searchRegex?i("div",{staticClass:"search-keyword",style:{color:e.infoForegroundColor()}},[e._v(" search: "+e._s(e.searchStr)+" "+e._s(e.files.length)+' files matched "'+e._s(e.searchRegex)+'" ')]):e._e(),""!==e.gitLog?i("div",{staticClass:"git-log",style:{color:e.infoForegroundColor()}},[e._v(" git: "+e._s(e.gitLog)+" ")]):e._e(),i("div",{ref:"filelist",staticClass:"file-list"},e._l(e.files,(function(t){return i("div",{key:t.path,staticClass:"file",style:{background:e.itemBackgroundColor(t),color:e.itemForegroundColor(t)},on:{click:function(i){return e.selectFile(t)}}},["true"===e.showIcon?i("img",{staticClass:"file-icon",attrs:{src:e.fileIconPath(t.icon)}}):e._e(),i("div",{staticClass:"eaf-file-manager-file-name"},[e._v(" "+e._s(t.name)+" ")]),i("div",{staticClass:"file-size"},[e._v(" "+e._s(t.size)+" ")])])})),0)]),"true"===e.showPreview?i("div",{staticClass:"preview"},["file"==e.previewType&&"image"==e.previewMime?i("PreviewImage",{attrs:{file:e.previewPath+"?"+Math.random().toString()}}):e._e(),"file"==e.previewType&&"html"==e.previewMime?i("PreviewHtml",{attrs:{file:e.previewPath}}):e._e(),"file"==e.previewType&&"text"==e.previewMime?i("PreviewCode",{attrs:{file:e.previewPath,size:e.previewSize,backgroundColor:e.backgroundColor}}):e._e(),"file"==e.previewType&&"pdf"==e.previewMime?i("PreviewPdf",{attrs:{file:e.previewPath}}):e._e(),"file"==e.previewType&&"video"==e.previewMime?i("PreviewVideo",{attrs:{file:e.previewPath}}):e._e(),"file"==e.previewType&&"audio"==e.previewMime?i("PreviewAudio",{attrs:{file:e.previewPath,barColor:e.foregroundColor}}):e._e(),"file"==e.previewType&&"office"==e.previewMime?i("PreviewOffice",{attrs:{file:e.previewPath}}):e._e(),"directory"==e.previewType&&e.previewFiles.length>0?i("PreviewDirectory",{attrs:{files:e.previewFiles,openFile:e.openFile,itemBackgroundColor:e.itemBackgroundColor,itemForegroundColor:e.itemForegroundColor,fileIconPath:e.fileIconPath,showIcon:e.showIcon}}):e._e(),"directory"==e.previewType&&0==e.previewFiles.length?i("PreviewEmpty"):e._e(),"symlink"==e.previewType?i("PreviewSymlink"):e._e()],1):e._e()])])},l=[],c=(i("99af"),i("ac1f"),i("466d"),i("d81d"),i("1276"),i("159b"),i("4de4"),i("b0c0"),i("a434"),i("2ca0"),i("2a3c")),a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"video-box"},[i("video",{key:e.dynamicKey,ref:"player",staticClass:"video",attrs:{controls:""}},[i("source",{attrs:{src:e.file}})])])},h=[],f={name:"PreviewVideo",props:{file:String},watch:{file:function(){this.dynamicKey=Math.random(1e4)}},data:function(){return{dynamicKey:""}},mounted:function(){var e=this;this.$root.$on("previewToggle",(function(){e.$refs.player.paused?e.$refs.player.play():e.$refs.player.pause()}))},created:function(){},methods:{}},u=f,p=(i("0dbf"),i("2877")),d=Object(p["a"])(u,a,h,!1,null,"2023ecdd",null),w=d.exports,m=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"box",staticClass:"visual"},[i("av-circle",{key:e.dynamicKey,attrs:{"ref-link":"player","playtime-font":"30px monospace","canv-width":e.visualCanvasWidth,"canv-height":e.visualCanvasWidth,"bar-color":e.barColor,"progress-color":e.barColor,"playtime-color":e.barColor,"outline-width":0,"progress-width":5,"outline-meter-space":5,playtime:!0}}),i("audio",{key:e.dynamicKey,ref:"player",staticClass:"audio",attrs:{controls:""}},[i("source",{attrs:{src:e.file}})])],1)},v=[],g={name:"PreviewAudio",props:{file:String,barColor:String},watch:{file:function(){this.dynamicKey=Math.random(1e4)}},data:function(){return{dynamicKey:"",visualCanvasWidth:0}},mounted:function(){var e=this;this.$refs.player.pause(),this.$root.$on("previewToggle",(function(){e.$refs.player.paused?e.$refs.player.play():e.$refs.player.pause()}))},created:function(){this.visualCanvasWidth=window.innerWidth/3},methods:{}},y=g,$=(i("7ba9"),Object(p["a"])(y,m,v,!1,null,"cda50672",null)),F=$.exports,b=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"scrollArea",staticClass:"pdf-box"},[i("pdf",{key:e.dynamicKey,attrs:{src:e.file}})],1)},C=[],P=i("10ee"),_={name:"PreviewPdf",components:{pdf:P["a"]},props:{file:String},watch:{file:function(){this.dynamicKey=Math.random(1e4)}},data:function(){return{dynamicKey:""}},mounted:function(){var e=this;this.$refs.scrollArea.scrollTop=0,this.$root.$on("previewToggle",(function(){e.scrollUp()})),this.$root.$on("scrollUp",(function(){e.scrollUp()})),this.$root.$on("scrollDown",(function(){e.scrollDown()})),this.$root.$on("scrollUpLine",(function(){e.scrollUpLine()})),this.$root.$on("scrollDownLine",(function(){e.scrollDownLine()}))},created:function(){},methods:{scrollUp:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+this.$refs.scrollArea.clientHeight},scrollDown:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-this.$refs.scrollArea.clientHeight},scrollUpLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+50},scrollDownLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-50}}},x=_,k=(i("f090"),Object(p["a"])(x,b,C,!1,null,"0c9b7d1c",null)),T=k.exports,S=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"scrollArea",staticClass:"code-box"},[i("pre",{staticClass:"code"},[e._v(e._s(e.content))])])},A=[],D=(i("a9e3"),{name:"PreviewCode",components:{},props:{file:String,size:Number,backgroundColor:String},watch:{file:function(){this.readFileContent(),this.$refs.scrollArea.scrollTop=0}},data:function(){return{content:""}},mounted:function(){var e=this;this.$root.$on("previewToggle",(function(){e.scrollUp()})),this.$root.$on("scrollUp",(function(){e.scrollUp()})),this.$root.$on("scrollDown",(function(){e.scrollDown()})),this.$root.$on("scrollUpLine",(function(){e.scrollUpLine()})),this.$root.$on("scrollDownLine",(function(){e.scrollDownLine()}))},created:function(){this.readFileContent()},methods:{readFileContent:function(){var e=this,t=new XMLHttpRequest;t.open("get",this.file,!0),t.responseType="arraybuffer",t.onload=function(){if(0==t.status){var i=new TextDecoder;e.content=i.decode(t.response)}},t.send()},scrollUp:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+this.$refs.scrollArea.clientHeight},scrollDown:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-this.$refs.scrollArea.clientHeight},scrollUpLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+50},scrollDownLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-50}}}),L=D,I=(i("ac0d"),Object(p["a"])(L,S,A,!1,null,"8c047684",null)),M=I.exports,U=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"scrollArea",staticClass:"box"},[i("div",{domProps:{innerHTML:e._s(e.content)}})])},j=[],O={name:"PreviewHtml",props:{file:String},watch:{file:function(){this.readFileContent()}},data:function(){return{content:""}},mounted:function(){var e=this;this.$refs.scrollArea.scrollTop=0,this.$root.$on("previewToggle",(function(){e.scrollUp()})),this.$root.$on("scrollUp",(function(){e.scrollUp()})),this.$root.$on("scrollDown",(function(){e.scrollDown()})),this.$root.$on("scrollUpLine",(function(){e.scrollUpLine()})),this.$root.$on("scrollDownLine",(function(){e.scrollDownLine()}))},created:function(){this.readFileContent()},methods:{readFileContent:function(){var e=this,t=new XMLHttpRequest;t.open("get",this.file,!0),t.responseType="arraybuffer",t.onload=function(){if(0==t.status){var i=new TextDecoder;e.content=i.decode(t.response),print(e.content)}},t.send()},scrollUp:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+this.$refs.scrollArea.clientHeight},scrollDown:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-this.$refs.scrollArea.clientHeight},scrollUpLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+50},scrollDownLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-50}}},N=O,B=(i("c600"),Object(p["a"])(N,U,j,!1,null,"c19f3248",null)),E=B.exports,H=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"image-box"},[i("img",{staticClass:"image",attrs:{src:e.file}})])},K=[],W={name:"PreviewImage",components:{},props:{file:String},watch:{},data:function(){return{}},mounted:function(){},created:function(){},methods:{}},z=W,R=(i("1da8"),Object(p["a"])(z,H,K,!1,null,"4739484b",null)),V=R.exports,q=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},G=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"empty-directory"},[i("div",{staticClass:"empty-directory-info"},[e._v(" Empty directory. ")])])}],X={name:"PreviewEmpty",props:{},watch:{},data:function(){return{}},mounted:function(){},created:function(){},methods:{}},J=X,Q=(i("c4eb"),Object(p["a"])(J,q,G,!1,null,"59b2019c",null)),Y=Q.exports,Z=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div")},ee=[],te={name:"PreviewSymlink",props:{},watch:{},data:function(){return{}},mounted:function(){},created:function(){},methods:{}},ie=te,re=Object(p["a"])(ie,Z,ee,!1,null,"2e14fe0b",null),oe=re.exports,ne=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"scrollArea",staticClass:"box"},e._l(e.files,(function(t){return i("div",{key:t.path,staticClass:"file",style:{background:e.itemBackgroundColor(t),color:e.itemForegroundColor(t)},on:{click:function(i){return e.openFile(t)}}},["true"===e.showIcon?i("img",{staticClass:"file-icon",attrs:{src:e.fileIconPath(t.icon)}}):e._e(),i("div",{staticClass:"eaf-file-manager-preview-file-name"},[e._v(" "+e._s(t.name)+" ")]),i("div",{staticClass:"file-size"},[e._v(" "+e._s(t.size)+" ")])])})),0)},se=[],le={name:"PreviewDirectory",props:{files:Array,openFile:Function,itemBackgroundColor:Function,itemForegroundColor:Function,fileIconPath:Function,showIcon:String},watch:{},data:function(){return{}},mounted:function(){var e=this;this.$root.$on("previewToggle",(function(){e.scrollUp()})),this.$root.$on("scrollUp",(function(){e.scrollUp()})),this.$root.$on("scrollDown",(function(){e.scrollDown()})),this.$root.$on("scrollUpLine",(function(){e.scrollUpLine()})),this.$root.$on("scrollDownLine",(function(){e.scrollDownLine()}))},created:function(){},methods:{scrollUp:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+this.$refs.scrollArea.clientHeight},scrollDown:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-this.$refs.scrollArea.clientHeight},scrollUpLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+50},scrollDownLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-50}}},ce=le,ae=(i("964e"),Object(p["a"])(ce,ne,se,!1,null,"99eaeb9a",null)),he=ae.exports,fe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"scrollArea",staticClass:"office-box"},[i("div",{domProps:{innerHTML:e._s(e.wordText)}})])},ue=[],pe=(i("d3b7"),i("5cc6"),i("9a8c"),i("a975"),i("735e"),i("c1ac"),i("d139"),i("3a7b"),i("d5d6"),i("82f8"),i("e91f"),i("60bd"),i("5f96"),i("3280"),i("3fcc"),i("ca91"),i("25a1"),i("cd26"),i("3c5d"),i("2954"),i("649e"),i("219c"),i("170b"),i("b39a"),i("72f7"),i("c343")),de=i.n(pe),we={name:"PreviewOffice",components:{},props:{file:String},watch:{file:function(){this.getWordText()}},data:function(){return{wordText:""}},mounted:function(){var e=this;this.$refs.scrollArea.scrollTop=0,this.$root.$on("previewToggle",(function(){e.scrollUp()})),this.$root.$on("scrollUp",(function(){e.scrollUp()})),this.$root.$on("scrollDown",(function(){e.scrollDown()})),this.$root.$on("scrollUpLine",(function(){e.scrollUpLine()})),this.$root.$on("scrollDownLine",(function(){e.scrollDownLine()}))},created:function(){this.getWordText()},methods:{getWordText:function(){var e=this,t=new XMLHttpRequest;t.open("get",this.file,!0),t.responseType="arraybuffer",t.onload=function(){0==t.status&&de.a.convertToHtml({arrayBuffer:new Uint8Array(t.response)}).then((function(t){e.$nextTick((function(){e.wordText=t.value}))}))},t.send()},scrollUp:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+this.$refs.scrollArea.clientHeight},scrollDown:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-this.$refs.scrollArea.clientHeight},scrollUpLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop+50},scrollDownLine:function(){this.$refs.scrollArea.scrollTop=this.$refs.scrollArea.scrollTop-50}}},me=we,ve=(i("9afb"),Object(p["a"])(me,fe,ue,!1,null,"34c5b1fb",null)),ge=ve.exports,ye={name:"Main",components:{PreviewVideo:w,PreviewAudio:F,PreviewPdf:T,PreviewCode:M,PreviewHtml:E,PreviewImage:V,PreviewEmpty:Y,PreviewSymlink:oe,PreviewDirectory:he,PreviewOffice:ge},props:{msg:String},watch:{currentIndex:{handler:function(e,t){this.files.length>0&&(this.currentPath=this.files[e].path),window.pyobject.vue_update_current_index(e)}},files:{handler:function(e,t){window.pyobject.vue_update_files(e)},deep:!0},path:{handler:function(e,t){this.pathFirstPart=e.substring(0,e.length/2),this.pathSecondPart=e.substring(e.length/2,e.length)}}},data:function(){return{path:"",pathFirstPart:"",pathSecondPart:"",searchRegex:"",gitLog:"",searchStr:"finding",files:[],currentIndex:0,currentPath:"",backgroundColor:"",foregroundColor:"",headerColor:"",markColor:"",fileColor:"",directoryColor:"",symlinkColor:"",selectColor:"",searchMatchColor:"",searchKeywordColor:"",previewPath:"",previewType:"",previewFiles:[],previewMime:"",previewSize:"",pathSep:"",iconCacheDir:"",showPreview:"false",showIcon:"false",themeMode:""}},mounted:function(){window.changePath=this.changePath,window.updateGitLog=this.updateGitLog,window.initSearch=this.initSearch,window.appendSearch=this.appendSearch,window.finishSearch=this.finishSearch,window.init=this.init,window.selectNextFile=this.selectNextFile,window.selectPrevFile=this.selectPrevFile,window.selectFirstFile=this.selectFirstFile,window.selectLastFile=this.selectLastFile,window.scrollUpSelectFile=this.scrollUpSelectFile,window.scrollDownSelectFile=this.scrollDownSelectFile,window.openCurrentFile=this.openCurrentFile,window.upDirectory=this.upDirectory,window.setPreview=this.setPreview,window.setPreviewOption=this.setPreviewOption,window.markFile=this.markFile,window.markFileByExtension=this.markFileByExtension,window.markChangeFiles=this.markChangeFiles,window.unmarkFile=this.unmarkFile,window.unmarkAllFiles=this.unmarkAllFiles,window.toggleMarkFile=this.toggleMarkFile,window.getMarkFileNumber=this.getMarkFileNumber,window.removeMarkFiles=this.removeMarkFiles,window.removeSelectFile=this.removeSelectFile,window.renameFile=this.renameFile,window.renameFiles=this.renameFiles,window.rename=this.rename,window.copyFileName=this.copyFileName,window.copyFilePath=this.copyFilePath,window.addNewFile=this.addNewFile,window.addNewDirectory=this.addNewDirectory,window.openFileByName=this.openFileByName,window.openPreviewFileByName=this.openPreviewFileByName,window.previewScrollUp=this.previewScrollUp,window.previewScrollDown=this.previewScrollDown,window.previewScrollUpLine=this.previewScrollUpLine,window.previewScrollDownLine=this.previewScrollDownLine,window.previewToggle=this.previewToggle,window.selectFileByIndex=this.selectFileByIndex,window.setSearchMatchFiles=this.setSearchMatchFiles},created:function(){new c["QWebChannel"](qt.webChannelTransport,(function(e){window.pyobject=e.objects.pyobject}))},methods:{changePath:function(e,t,i){this.path=e,this.files=t,this.currentIndex=i,this.files.length>0&&(this.currentPath=this.files[this.currentIndex].path),this.$nextTick((function(){this.keepSelectVisible()})),this.searchRegex=""},updateGitLog:function(e){this.gitLog=e},initSearch:function(e,t){this.path=e,this.files=[],this.searchRegex=t,this.currentIndex=0,this.currentPath="",this.searchStr="finding"},appendSearch:function(e){this.files=this.files.concat(e),""==this.currentPath&&(this.currentPath=this.files[this.currentIndex].path)},finishSearch:function(){this.searchStr="found"},init:function(e,t,i,r,o,n,s,l,c,a,h,f,u,p){this.backgroundColor=e,this.foregroundColor=t,this.fileColor=t,this.headerColor=i,this.directoryColor=r,this.symlinkColor=o,this.markColor=n,this.selectColor=s,this.searchMatchColor=l,this.searchKeywordColor=c,this.iconCacheDir=a,this.pathSep=h,this.showPreview=f,this.showIcon=u,this.themeMode=p},itemBackgroundColor:function(e){return e.path==this.currentPath?this.selectColor:this.backgroundColor},itemForegroundColor:function(e){return"match"==e.match?this.searchMatchColor:"mark"==e.mark?this.markColor:"directory"==e.type?this.directoryColor:"file"==e.type?this.fileColor:"symlink"==e.type?this.symlinkColor:void 0},headerForegroundColor:function(){return this.headerColor},infoForegroundColor:function(){return this.searchKeywordColor},setSearchMatchFiles:function(e){var t=this;this.files.map((function(e){e.match=""})),e.map((function(e){t.files[e].match="match"}))},selectFileByIndex:function(e){e>=this.files.length?this.currentIndex=this.files.length-1:this.currentIndex=e<=0?0:e,this.keepSelectVisible(),this.updatePreview()},selectNextFile:function(){this.selectFileByIndex(this.currentIndex+1)},selectPrevFile:function(){this.selectFileByIndex(this.currentIndex-1)},selectFirstFile:function(){this.selectFileByIndex(0)},selectLastFile:function(){this.selectFileByIndex(this.files.length-1)},scrollUpSelectFile:function(){this.selectFileByIndex(this.currentIndex+this.getSceenElementNumber())},scrollDownSelectFile:function(){this.selectFileByIndex(this.currentIndex-this.getSceenElementNumber())},markFile:function(){this.files[this.currentIndex].mark="mark",this.selectNextFile()},markFileByExtension:function(e){for(var t=0;t<this.files.length;t++){var i=this.files[t]["path"].split(".").pop();i==e&&(this.files[t].mark="mark")}},markChangeFiles:function(e){var t=this;e.forEach((function(e){t.files[e].mark="mark"}))},unmarkFile:function(){this.files[this.currentIndex].mark="",this.selectNextFile()},unmarkAllFiles:function(){this.files.forEach((function(e){e.mark=""}))},toggleMarkFile:function(){this.files.map((function(e){"mark"==e.mark?e.mark="":e.mark="mark"}))},getMarkFileNumber:function(){return this.files.filter((function(e){return"mark"==e.mark})).length},removeMarkFiles:function(){this.files=this.files.filter((function(e){return"mark"!=e.mark}))},removeSelectFile:function(){var e=this;this.files=this.files.filter((function(t){return t.path!=e.currentPath}))},getSceenElementNumber:function(){return Math.floor(window.innerHeight/this.$refs.filelist.children[this.currentIndex].clientHeight)},selectFile:function(e){void 0!==e&&(this.currentIndex=this.files.map((function(e){return e.path})).indexOf(e.path),this.updatePreview())},keepSelectVisible:function(){var e=this.$refs.filelist.children[this.currentIndex];void 0!==e&&e.scrollIntoViewIfNeeded(!1)},openCurrentFile:function(){this.openFile(this.files[this.currentIndex])},upDirectory:function(){window.pyobject.change_up_directory(this.currentPath)},updatePreview:function(){window.pyobject.update_preview(this.files[this.currentIndex].path)},renameFile:function(){window.pyobject.rename_file(this.files[this.currentIndex].path)},renameFiles:function(e){this.files=e},rename:function(e,t,i){for(var r=0;r<this.files.length;r++)if(this.files[r]["path"]==e){this.files[r]["path"]=t,this.files[r]["name"]=i;break}},fileIconPath:function(e){return this.iconCacheDir+this.pathSep+e},copyFileName:function(){var e=this.files[this.currentIndex];window.pyobject.eval_emacs_function("kill-new",[e.name]),window.pyobject.eval_emacs_function("message",["Copy '"+e.name+"'"])},copyFilePath:function(){var e=this.files[this.currentIndex];window.pyobject.eval_emacs_function("kill-new",[e.path]),window.pyobject.eval_emacs_function("message",["Copy '"+e.path+"'"])},addNewFile:function(e){this.currentIndex=this.files.push(e)-1,this.currentPath=e.path},addNewDirectory:function(e){var t=this.files.filter((function(e){return"directory"==e.type})).length;this.files.splice(t,0,e),this.currentIndex=t,this.selectFileByIndex(t)},openFileByName:function(e){for(var t=0;t<this.files.length;t++)if(this.files[t]["name"]==e){this.openFile(this.files[t]);break}},openPreviewFileByName:function(e){for(var t=0;t<this.previewFiles.length;t++)if(this.previewFiles[t]["name"]==e){this.openFile(this.previewFiles[t]);break}},openFile:function(e){"directory"==e.type?window.pyobject.change_directory(e.path,""):"file"==e.type&&window.pyobject.eval_emacs_function("find-file",[e.path])},previewScrollUp:function(){this.$root.$emit("scrollUp")},previewScrollDown:function(){this.$root.$emit("scrollDown")},previewScrollUpLine:function(){this.$root.$emit("scrollUpLine")},previewScrollDownLine:function(){this.$root.$emit("scrollDownLine")},previewToggle:function(){this.$root.$emit("previewToggle")},setPreviewOption:function(e){this.showPreview=e},setPreview:function(e,t,i){if(this.previewPath=e,this.previewType=t,this.previewFiles=i,"file"==t){var r=i[0]["mime"];console.log("***** ",e,r),r.startsWith("image-")?this.previewMime="image":"text-html"==r?this.previewMime="html":r.startsWith("text-")||"application-json"==r||"application-x-yaml"==r?this.previewMime="text":"application-pdf"==r?this.previewMime="pdf":r.startsWith("video-")?this.previewMime="video":r.startsWith("audio-")?this.previewMime="audio":"application-wps-office.docx"==r&&(this.previewMime="office"),this.previewSize=i[0]["size"]}}}},$e=ye,Fe=(i("f22a"),Object(p["a"])($e,s,l,!1,null,"97e35fe2",null)),be=Fe.exports,Ce={name:"App",components:{Main:be},mounted:function(){}},Pe=Ce,_e=(i("034f"),Object(p["a"])(Pe,o,n,!1,null,null,null)),xe=_e.exports,ke=i("3304");r["a"].use(ke["a"]),r["a"].config.productionTip=!1,new r["a"]({render:function(e){return e(xe)}}).$mount("#app")},6:function(e,t){},"697b":function(e,t,i){},7:function(e,t){},"77a9":function(e,t,i){},"7ba9":function(e,t,i){"use strict";i("697b")},"85ec":function(e,t,i){},"964e":function(e,t,i){"use strict";i("a327")},"9afb":function(e,t,i){"use strict";i("050b")},a327:function(e,t,i){},ac0d:function(e,t,i){"use strict";i("f576")},b25d:function(e,t,i){},c4eb:function(e,t,i){"use strict";i("d953")},c600:function(e,t,i){"use strict";i("77a9")},d953:function(e,t,i){},f090:function(e,t,i){"use strict";i("0494")},f22a:function(e,t,i){"use strict";i("07b4")},f576:function(e,t,i){}});
|
|
//# sourceMappingURL=app.a5c46ada.js.map
|