├── .gitignore ├── README.md ├── startKarma.bat ├── _doc ├── ufinder.ppt ├── plan.oplx │ └── QuickLook │ │ └── Preview.png └── architecture.md ├── dist ├── ufinder-0.1.0.zip ├── themes │ ├── images │ │ ├── close.png │ │ ├── icons.png │ │ ├── file-icons.gif │ │ ├── file-icons.png │ │ ├── tree-icon.gif │ │ ├── tree-icon.png │ │ ├── message-icon.png │ │ ├── message-close.png │ │ ├── toolbar-icons.gif │ │ └── toolbar-icons.png │ └── css │ │ ├── separator.css │ │ ├── dialogsize.css │ │ ├── ufinder.css │ │ ├── finder.css │ │ ├── popup.css │ │ ├── list.css │ │ ├── tooltip.css │ │ ├── button.css │ │ ├── splitbutton.css │ │ ├── tree.css │ │ ├── tab.css │ │ ├── combobox.css │ │ ├── colorpicker.css │ │ ├── message.css │ │ ├── leaf.css │ │ ├── dialog.css │ │ ├── buttonicon.css │ │ └── file.css ├── lib │ └── webuploader │ │ ├── Uploader.swf │ │ └── webuploader.css ├── lang │ └── zh-cn │ │ └── zh-cn.js ├── index.html ├── dialogs │ ├── lookimage │ │ └── lookimage.js │ └── lookcode │ │ └── lookcode.js └── ufinder.config.js ├── themes ├── images │ ├── close.png │ ├── icons.png │ ├── file-icons.gif │ ├── file-icons.png │ ├── tree-icon.gif │ ├── tree-icon.png │ ├── message-icon.png │ ├── message-close.png │ ├── toolbar-icons.gif │ └── toolbar-icons.png └── css │ ├── separator.css │ ├── dialogsize.css │ ├── ufinder.css │ ├── finder.css │ ├── popup.css │ ├── list.css │ ├── tooltip.css │ ├── button.css │ ├── splitbutton.css │ ├── tree.css │ ├── tab.css │ ├── combobox.css │ ├── colorpicker.css │ ├── message.css │ ├── leaf.css │ ├── dialog.css │ ├── buttonicon.css │ └── file.css ├── _spec ├── tools │ ├── jscoverage │ │ ├── cov.bat │ │ └── jscoverage.exe │ ├── css │ │ ├── bg_button_a.gif │ │ ├── bg_button_span.gif │ │ └── test.css │ ├── report.php │ ├── config.php │ ├── lib │ │ └── jasmine-1.3.0 │ │ │ └── MIT.LICENSE │ ├── js │ │ ├── tools.js │ │ └── ext_jasmine.js │ ├── fileHelper.php │ ├── import.php │ ├── run.php │ └── list.php ├── coverage │ └── json_files │ │ └── readme.txt ├── startKarma.bat ├── testdesign │ └── Manual regression cases.xmind ├── index.php ├── karmaConfig.js ├── core │ ├── class.js │ └── finder.js ├── adapter │ └── adapter.js ├── runTest.bat ├── _runTest.bat ├── SpecHelper.js ├── import.js ├── karma.conf.js └── mergeCoverageForistanbul.js ├── lib └── webuploader │ ├── Uploader.swf │ └── webuploader.css ├── _src ├── core │ ├── ufinder.defaultoptions.js │ ├── ufinder.module.js │ ├── finder.select.js │ ├── request.js │ ├── selection.js │ ├── finder.command.js │ ├── finder.module.js │ ├── ufinder.js │ ├── finder.shortcutkeys.js │ ├── uploader.js │ ├── filenode.js │ ├── finder.js │ ├── datatree.js │ ├── utils.js │ ├── proxy.js │ └── finder.event.js ├── ui │ ├── panel.js │ ├── separator.js │ ├── toolbar.js │ ├── editablefile.js │ ├── buttoncombobox.js │ ├── menu.js │ ├── popup.js │ ├── tooltip.js │ ├── list.js │ ├── splitbutton.js │ ├── message.js │ ├── button.js │ ├── search.js │ ├── tree.js │ ├── dropmenu.js │ └── leaf.js ├── adapter │ ├── message.js │ ├── button.js │ ├── upload.js │ ├── tree.js │ └── dialog.js └── modules │ ├── lookcode.js │ ├── lookimage.js │ ├── init.js │ ├── download.js │ ├── pathchange.js │ ├── select.js │ ├── remove.js │ ├── open.js │ ├── rename.js │ ├── upload.js │ └── addfile.js ├── .editorconfig ├── lang └── zh-cn │ └── zh-cn.js ├── .jshintrc ├── LICENSE ├── package.json ├── dialogs ├── lookimage │ └── lookimage.js └── lookcode │ └── lookcode.js ├── karma.conf.js ├── index.html ├── ufinder.config.js └── Gruntfile.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ufinder 2 | ======= 3 | 4 | 基于页面级的文件管理应用 5 | -------------------------------------------------------------------------------- /startKarma.bat: -------------------------------------------------------------------------------- 1 | karma start ./karma.conf.js>./_spec/karmaLog.txt 2 | -------------------------------------------------------------------------------- /_doc/ufinder.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/_doc/ufinder.ppt -------------------------------------------------------------------------------- /dist/ufinder-0.1.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/ufinder-0.1.0.zip -------------------------------------------------------------------------------- /themes/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/close.png -------------------------------------------------------------------------------- /themes/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/icons.png -------------------------------------------------------------------------------- /_spec/tools/jscoverage/cov.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | jscoverage.exe --encoding=UTF-8 ../../../_src ../../coverage -------------------------------------------------------------------------------- /dist/themes/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/close.png -------------------------------------------------------------------------------- /dist/themes/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/icons.png -------------------------------------------------------------------------------- /lib/webuploader/Uploader.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/lib/webuploader/Uploader.swf -------------------------------------------------------------------------------- /themes/images/file-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/file-icons.gif -------------------------------------------------------------------------------- /themes/images/file-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/file-icons.png -------------------------------------------------------------------------------- /themes/images/tree-icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/tree-icon.gif -------------------------------------------------------------------------------- /themes/images/tree-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/tree-icon.png -------------------------------------------------------------------------------- /themes/images/message-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/message-icon.png -------------------------------------------------------------------------------- /_spec/tools/css/bg_button_a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/_spec/tools/css/bg_button_a.gif -------------------------------------------------------------------------------- /dist/lib/webuploader/Uploader.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/lib/webuploader/Uploader.swf -------------------------------------------------------------------------------- /dist/themes/images/file-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/file-icons.gif -------------------------------------------------------------------------------- /dist/themes/images/file-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/file-icons.png -------------------------------------------------------------------------------- /dist/themes/images/tree-icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/tree-icon.gif -------------------------------------------------------------------------------- /dist/themes/images/tree-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/tree-icon.png -------------------------------------------------------------------------------- /themes/images/message-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/message-close.png -------------------------------------------------------------------------------- /themes/images/toolbar-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/toolbar-icons.gif -------------------------------------------------------------------------------- /themes/images/toolbar-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/themes/images/toolbar-icons.png -------------------------------------------------------------------------------- /_spec/tools/css/bg_button_span.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/_spec/tools/css/bg_button_span.gif -------------------------------------------------------------------------------- /dist/themes/images/message-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/message-icon.png -------------------------------------------------------------------------------- /_doc/plan.oplx/QuickLook/Preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/_doc/plan.oplx/QuickLook/Preview.png -------------------------------------------------------------------------------- /_spec/coverage/json_files/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/_spec/coverage/json_files/readme.txt -------------------------------------------------------------------------------- /_spec/tools/jscoverage/jscoverage.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/_spec/tools/jscoverage/jscoverage.exe -------------------------------------------------------------------------------- /_src/core/ufinder.defaultoptions.js: -------------------------------------------------------------------------------- 1 | //这里只放不是由模块产生的默认参数 2 | UF.defaultOptions = { 3 | zIndex: 10, 4 | lang: 'zh-cn' 5 | }; -------------------------------------------------------------------------------- /dist/themes/images/message-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/message-close.png -------------------------------------------------------------------------------- /dist/themes/images/toolbar-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/toolbar-icons.gif -------------------------------------------------------------------------------- /dist/themes/images/toolbar-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/dist/themes/images/toolbar-icons.png -------------------------------------------------------------------------------- /_spec/startKarma.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal EnableDelayedExpansion 3 | del /q /s .\coverage\json_files\*.* 4 | karma start ./karma.conf.js -------------------------------------------------------------------------------- /_spec/testdesign/Manual regression cases.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fex-team/ufinder/HEAD/_spec/testdesign/Manual regression cases.xmind -------------------------------------------------------------------------------- /_spec/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_spec/karmaConfig.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: dongyancen 4 | * Date: 14-3-5 5 | * Time: 下午7:24 6 | * To change this template use File | Settings | File Templates. 7 | -------------------------------------------------------------------------------- /_spec/core/class.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by dongyancen on 14-3-5. 3 | */ 4 | describe("examples", function () { 5 | //toBe 相当于===,处理简单字面值和变量 6 | it("toBe相当于===", function () { 7 | var a = 12; 8 | var b = a; 9 | expect(a).toBe(b); 10 | }); 11 | }); -------------------------------------------------------------------------------- /_src/ui/panel.js: -------------------------------------------------------------------------------- 1 | UF.ui.define('panel', { 2 | tpl: '
', 3 | defaultOpt: { 4 | }, 5 | init: function (options) { 6 | var me = this; 7 | me.root($($.parseTmpl(me.tpl, options))); 8 | return me; 9 | } 10 | }); -------------------------------------------------------------------------------- /_spec/adapter/adapter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by dongyancen on 14-4-1. 3 | */ 4 | describe("examples", function () { 5 | //toBe 相当于===,处理简单字面值和变量 6 | it("toBe相当于===", function () { 7 | var a = 12; 8 | var b = a; 9 | expect(a).toBe(b); 10 | }); 11 | }); -------------------------------------------------------------------------------- /_spec/runTest.bat: -------------------------------------------------------------------------------- 1 | setlocal EnableDelayedExpansion 2 | del /q /s .\coverage\json_files\*.json 3 | for /f %%j in ('karma start ./karma.conf.js') do set karmaRe=%%j 4 | for /f %%i in ('node ./mergeCoverageForIstanbul.js') do set re=%%i 5 | istanbul report html coverage/json_files/%re%.json 6 | 7 | -------------------------------------------------------------------------------- /_src/ui/separator.js: -------------------------------------------------------------------------------- 1 | //button 类 2 | UF.ui.define('separator', { 3 | tpl: '
', 4 | init: function (options) { 5 | var me = this; 6 | me.root($($.parseTmpl(me.tpl, options))); 7 | return me; 8 | } 9 | }); -------------------------------------------------------------------------------- /_spec/_runTest.bat: -------------------------------------------------------------------------------- 1 | setlocal EnableDelayedExpansion 2 | del /q /s .\_spec\coverage\json_files\*.json 3 | for /f %%j in ('karma start _spec/karma.conf.js') do set karmaRe=%%j 4 | for /f %%i in ('node _spec/mergeCoverageForIstanbul.js') do set re=%%i 5 | istanbul report html _spec/coverage/json_files/%re%.json 6 | pause 7 | -------------------------------------------------------------------------------- /_spec/tools/report.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ufinder demo 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /lib/webuploader/webuploader.css: -------------------------------------------------------------------------------- 1 | .webuploader-pick { 2 | position: relative; 3 | display: inline-block; 4 | cursor: pointer; 5 | background: #00b7ee; 6 | padding: 10px 15px; 7 | color: #fff; 8 | text-align: center; 9 | border-radius: 3px; 10 | overflow: hidden; 11 | } 12 | .webuploader-pick-hover { 13 | background: #00a2d4; 14 | } 15 | 16 | .webuploader-pick-disable { 17 | opacity: 0.6; 18 | pointer-events:none; 19 | } 20 | 21 | .webuploader-dnd { 22 | width: 400px; 23 | height: 400px; 24 | border: 3px solid #ddd; 25 | } 26 | 27 | .webuploader-dnd-over { 28 | border-style: dashed; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /dist/lib/webuploader/webuploader.css: -------------------------------------------------------------------------------- 1 | .webuploader-pick { 2 | position: relative; 3 | display: inline-block; 4 | cursor: pointer; 5 | background: #00b7ee; 6 | padding: 10px 15px; 7 | color: #fff; 8 | text-align: center; 9 | border-radius: 3px; 10 | overflow: hidden; 11 | } 12 | .webuploader-pick-hover { 13 | background: #00a2d4; 14 | } 15 | 16 | .webuploader-pick-disable { 17 | opacity: 0.6; 18 | pointer-events:none; 19 | } 20 | 21 | .webuploader-dnd { 22 | width: 400px; 23 | height: 400px; 24 | border: 3px solid #ddd; 25 | } 26 | 27 | .webuploader-dnd-over { 28 | border-style: dashed; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /_src/modules/lookcode.js: -------------------------------------------------------------------------------- 1 | UF.registerModule("lookcodemodule", function () { 2 | var uf = this; 3 | return { 4 | "commands": { 5 | "lookcode": { 6 | execute: function (path) { 7 | uf.fire('selectFiles', path); 8 | uf.$toolbar.find('.ufui-btn-lookcode').trigger('click'); 9 | }, 10 | queryState: function () { 11 | var path = uf.getSelection().getSelectedFile(); 12 | return Utils.isCodePath(path) ? 0 : -1; 13 | } 14 | } 15 | } 16 | }; 17 | }); -------------------------------------------------------------------------------- /_src/modules/lookimage.js: -------------------------------------------------------------------------------- 1 | UF.registerModule("lookimagemodule", function () { 2 | var uf = this; 3 | return { 4 | "commands": { 5 | "lookimage": { 6 | execute: function (path) { 7 | uf.fire('selectFiles', path); 8 | uf.$toolbar.find('.ufui-btn-lookimage').trigger('click'); 9 | }, 10 | queryState: function () { 11 | var path = uf.getSelection().getSelectedFile(); 12 | return Utils.isImagePath(path) ? 0 : -1; 13 | } 14 | } 15 | } 16 | }; 17 | }); -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "undef" : true, 3 | "unused" : false, 4 | "strict" : false, 5 | "curly" : false, 6 | "newcap" : true, 7 | "trailing" : true, 8 | "white": false, 9 | "quotmark": false, 10 | "predef" : [ 11 | "module", 12 | "require", 13 | "console", 14 | "kity", 15 | "KityMinder", 16 | "KM", 17 | "Minder", 18 | "MinderNode", 19 | "MinderEvent", 20 | "Command", 21 | "KITYMINDER_CONFIG", 22 | "keymap", 23 | "Utils", 24 | "utils", 25 | "$", 26 | "KM", 27 | "keymap", 28 | "baidu" 29 | ] 30 | } -------------------------------------------------------------------------------- /themes/css/list.css: -------------------------------------------------------------------------------- 1 | .ufui-list{ 2 | position: relative; 3 | float: right; 4 | width: 80%; 5 | height: 500px; 6 | } 7 | .ufui-list-container{ 8 | height: 100%; 9 | border-left: 1px solid #eeeeee; 10 | padding: 0; 11 | list-style: none; 12 | overflow-y: auto; 13 | -webkit-tap-highlight-color: rgba(0,0,0,0); 14 | -webkit-user-select: none; 15 | } 16 | .ufui-list-container li{ 17 | margin: 5px; 18 | padding: 5px; 19 | list-style: none; 20 | border: 1px dotted #eeeeee; 21 | } 22 | .ufui-list-container .ufui-list-item { 23 | display: block; 24 | float: left; 25 | width: 80px; 26 | height: 80px; 27 | } -------------------------------------------------------------------------------- /dist/themes/css/list.css: -------------------------------------------------------------------------------- 1 | .ufui-list{ 2 | position: relative; 3 | float: right; 4 | width: 80%; 5 | height: 500px; 6 | } 7 | .ufui-list-container{ 8 | height: 100%; 9 | border-left: 1px solid #eeeeee; 10 | padding: 0; 11 | list-style: none; 12 | overflow-y: auto; 13 | -webkit-tap-highlight-color: rgba(0,0,0,0); 14 | -webkit-user-select: none; 15 | } 16 | .ufui-list-container li{ 17 | margin: 5px; 18 | padding: 5px; 19 | list-style: none; 20 | border: 1px dotted #eeeeee; 21 | } 22 | .ufui-list-container .ufui-list-item { 23 | display: block; 24 | float: left; 25 | width: 80px; 26 | height: 80px; 27 | } -------------------------------------------------------------------------------- /_src/ui/toolbar.js: -------------------------------------------------------------------------------- 1 | //toolbar 类 2 | (function () { 3 | UF.ui.define('toolbar', { 4 | tpl: '
', 5 | init: function () { 6 | var $root = this.root($(this.tpl)); 7 | this.data('$btnToolbar', $root.find('.ufui-btn-toolbar')); 8 | }, 9 | appendToBtnmenu: function (data) { 10 | var $cont = this.data('$btnToolbar'); 11 | data = $.isArray(data) ? data : [data]; 12 | $.each(data, function (i, $item) { 13 | $cont.append($item); 14 | }); 15 | } 16 | }); 17 | })(); 18 | -------------------------------------------------------------------------------- /_src/modules/init.js: -------------------------------------------------------------------------------- 1 | UF.registerModule("initmodule", function () { 2 | var uf = this; 3 | return { 4 | "init": function () { 5 | 6 | }, 7 | "commands": { 8 | "init": { 9 | execute: function () { 10 | uf.proxy.init(function (r) { 11 | uf.dataTree.setRoot(r.data.root); 12 | }); 13 | } 14 | } 15 | }, 16 | "events": { 17 | 'ready': function () { 18 | uf.execCommand('init'); 19 | }, 20 | 'dataReady': function () { 21 | uf.execCommand('open', '/'); 22 | } 23 | } 24 | }; 25 | }); -------------------------------------------------------------------------------- /_src/ui/editablefile.js: -------------------------------------------------------------------------------- 1 | UF.ui.define('file', { 2 | tpl: '
' + 3 | '
' + 4 | ' ' + 5 | ' ' + 6 | '
' + 7 | '
<%=title%>
' + 8 | '
', 9 | defaultOpt: { 10 | type: '', 11 | title: '', 12 | path: '', 13 | pers: 'wr', 14 | onRenameFinish: function () { 15 | 16 | } 17 | }, 18 | init: function (options) { 19 | var me = this; 20 | me.root($($.parseTmpl(me.tpl, options))); 21 | 22 | return me; 23 | } 24 | }, 'file'); -------------------------------------------------------------------------------- /_src/adapter/button.js: -------------------------------------------------------------------------------- 1 | UF.registerUI('open pathparent pathbackward pathforward touch mkdir rename remove', 2 | function (name) { 3 | var me = this; 4 | var $btn = $.ufuibutton({ 5 | icon: name, 6 | click: function (evt) { 7 | me.execCommand(name); 8 | evt.preventDefault(); 9 | return false; 10 | }, 11 | title: me.getLang('labelMap')[name] || '' 12 | }); 13 | 14 | me.on('selectionchange ready focus blur currentpathchange', function () { 15 | var state = me.queryCommandState(name); 16 | $btn.ufui().disabled(state == -1).active(state == 1); 17 | }); 18 | return $btn; 19 | } 20 | ); 21 | 22 | -------------------------------------------------------------------------------- /_spec/import.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by dongyancen on 14-3-5. 3 | */ 4 | ///import core/ufinder; 5 | ///import core/ufinder.browser; 6 | ///import core/ufinder.defaultoptions; 7 | ///import core/ufinder.module; 8 | ///import core/utils; 9 | ///import core/class; 10 | ///import core/finder; 11 | ///import core/finder.event; 12 | ///import core/finder.shortcutkeys; 13 | ///import core/finder.select; 14 | ///import core/finder.module; 15 | ///import core/finder.command; 16 | ///import core/selection; 17 | ///import core/datatree; 18 | ///import core/request; 19 | ///import core/uploader; 20 | ///import core/proxy; 21 | ///import adapter/adapter; 22 | ///import adapter/button; 23 | ///import adapter/list; 24 | ///import adapter/message; 25 | ///import adapter/tree; 26 | ///import adapter/upload; 27 | -------------------------------------------------------------------------------- /themes/css/tooltip.css: -------------------------------------------------------------------------------- 1 | .ufui-btn-toolbar .ufui-tooltip{ 2 | position: absolute; 3 | padding: 5px 0; 4 | display: none; 5 | /*opacity: 0.8;*/ 6 | /*filter: alpha(opacity=80);*/ 7 | z-index: 99999; 8 | } 9 | .ufui-tooltip .ufui-tooltip-arrow{ 10 | position: absolute; 11 | top: 0; 12 | _top: -19px; 13 | left: 50%; 14 | width: 0; 15 | height: 0; 16 | padding: 0; 17 | margin-left: -5px; 18 | border-color: transparent; 19 | border-style: dashed dashed solid dashed; 20 | border-bottom-color: #000000; 21 | border-width: 0 5px 5px; 22 | background: transparent; 23 | } 24 | .ufui-tooltip .ufui-tooltip-inner{ 25 | padding: 6px; 26 | color: #ffffff; 27 | text-align: center; 28 | text-decoration: none; 29 | font-size: 10px; 30 | background-color: #000000; 31 | white-space: nowrap; 32 | line-height: 12px; 33 | } -------------------------------------------------------------------------------- /dist/themes/css/tooltip.css: -------------------------------------------------------------------------------- 1 | .ufui-btn-toolbar .ufui-tooltip{ 2 | position: absolute; 3 | padding: 5px 0; 4 | display: none; 5 | /*opacity: 0.8;*/ 6 | /*filter: alpha(opacity=80);*/ 7 | z-index: 99999; 8 | } 9 | .ufui-tooltip .ufui-tooltip-arrow{ 10 | position: absolute; 11 | top: 0; 12 | _top: -19px; 13 | left: 50%; 14 | width: 0; 15 | height: 0; 16 | padding: 0; 17 | margin-left: -5px; 18 | border-color: transparent; 19 | border-style: dashed dashed solid dashed; 20 | border-bottom-color: #000000; 21 | border-width: 0 5px 5px; 22 | background: transparent; 23 | } 24 | .ufui-tooltip .ufui-tooltip-inner{ 25 | padding: 6px; 26 | color: #ffffff; 27 | text-align: center; 28 | text-decoration: none; 29 | font-size: 10px; 30 | background-color: #000000; 31 | white-space: nowrap; 32 | line-height: 12px; 33 | } -------------------------------------------------------------------------------- /themes/css/button.css: -------------------------------------------------------------------------------- 1 | /*普通按钮*/ 2 | .ufui-btn-toolbar .ufui-btn{ 3 | position: relative; 4 | display: inline-block; 5 | vertical-align: top; 6 | *display: inline; 7 | *zoom:1; 8 | width:auto; 9 | margin: 0 1px; 10 | padding:1px; 11 | border:none; 12 | background: none; 13 | } 14 | .ufui-btn-toolbar .ufui-btn .ufui-icon{ 15 | width: 20px; 16 | height: 20px; 17 | margin: 0; 18 | padding:0; 19 | background-repeat: no-repeat; 20 | background-image: url("../images/toolbar-icons.png"); 21 | background-image: url("../images/toolbar-icons.gif") \9; 22 | } 23 | 24 | /*状态反射*/ 25 | .ufui-btn-toolbar .ufui-btn.ufui-hover, 26 | .ufui-btn-toolbar .ufui-btn.ufui-active{ 27 | background-color: #d5e1f2; 28 | padding: 0; 29 | border: 1px solid #a3bde3; 30 | _z-index: 1; 31 | } 32 | .ufui-btn-toolbar .ufui-btn.ufui-disabled{ 33 | opacity: 0.3; 34 | filter: alpha(opacity = 30); 35 | } -------------------------------------------------------------------------------- /dist/themes/css/button.css: -------------------------------------------------------------------------------- 1 | /*普通按钮*/ 2 | .ufui-btn-toolbar .ufui-btn{ 3 | position: relative; 4 | display: inline-block; 5 | vertical-align: top; 6 | *display: inline; 7 | *zoom:1; 8 | width:auto; 9 | margin: 0 1px; 10 | padding:1px; 11 | border:none; 12 | background: none; 13 | } 14 | .ufui-btn-toolbar .ufui-btn .ufui-icon{ 15 | width: 20px; 16 | height: 20px; 17 | margin: 0; 18 | padding:0; 19 | background-repeat: no-repeat; 20 | background-image: url("../images/toolbar-icons.png"); 21 | background-image: url("../images/toolbar-icons.gif") \9; 22 | } 23 | 24 | /*状态反射*/ 25 | .ufui-btn-toolbar .ufui-btn.ufui-hover, 26 | .ufui-btn-toolbar .ufui-btn.ufui-active{ 27 | background-color: #d5e1f2; 28 | padding: 0; 29 | border: 1px solid #a3bde3; 30 | _z-index: 1; 31 | } 32 | .ufui-btn-toolbar .ufui-btn.ufui-disabled{ 33 | opacity: 0.3; 34 | filter: alpha(opacity = 30); 35 | } -------------------------------------------------------------------------------- /_src/core/request.js: -------------------------------------------------------------------------------- 1 | var Request = UF.Request = UF.createClass("Request", { 2 | constructor: function (data, callback) { 3 | this.id = 'r' + (+new Date()).toString(36); 4 | this.data = data; 5 | this.jqXhr = null; 6 | this.callback = callback; 7 | }, 8 | send: function () { 9 | var me = this; 10 | me.jqXhr = $.ajax(me.data).always(function (r) { 11 | try { 12 | me.responseJson = JSON ? JSON.parse(r) : eval(r); 13 | } catch (e) { 14 | me.responseJson = null; 15 | } 16 | me.responseText = r; 17 | console.log(me.responseJson || r); 18 | me.callback && me.callback(me.responseJson); 19 | }); 20 | }, 21 | abort: function () { 22 | this.cancel(); 23 | }, 24 | cancel: function () { 25 | this.jqXhr && this.jqXhr.abort(); 26 | }, 27 | callback: function () { 28 | 29 | } 30 | }); -------------------------------------------------------------------------------- /themes/css/splitbutton.css: -------------------------------------------------------------------------------- 1 | .ufui-btn-toolbar .ufui-splitbutton{ 2 | position: relative; 3 | display: inline-block ; 4 | vertical-align: top; 5 | *display: inline ; 6 | *zoom:1; 7 | margin:0 2px; 8 | } 9 | .ufui-splitbutton .ufui-btn{ 10 | margin: 0; 11 | } 12 | .ufui-splitbutton .ufui-caret{ 13 | position: relative; 14 | display: inline-block ; 15 | vertical-align: top; 16 | *display: inline ; 17 | *zoom:1; 18 | width: 8px; 19 | height: 20px; 20 | background: url(../images/icons.png) -741px 0; 21 | _background: url(../images/icons.gif) -741px 0; 22 | } 23 | 24 | .ufui-btn-toolbar .ufui-splitbutton, 25 | .ufui-btn-toolbar .ufui-splitbutton{ 26 | _border: none; 27 | } 28 | 29 | /*状态反射*/ 30 | .ufui-btn-toolbar .ufui-splitbutton.ufui-hover .ufui-btn{ 31 | background-color: #d5e1f2; 32 | } 33 | 34 | .ufui-btn-toolbar .ufui-splitbutton.ufui-disabled{ 35 | opacity: 0.3; 36 | filter: alpha(opacity = 30); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /dist/themes/css/splitbutton.css: -------------------------------------------------------------------------------- 1 | .ufui-btn-toolbar .ufui-splitbutton{ 2 | position: relative; 3 | display: inline-block ; 4 | vertical-align: top; 5 | *display: inline ; 6 | *zoom:1; 7 | margin:0 2px; 8 | } 9 | .ufui-splitbutton .ufui-btn{ 10 | margin: 0; 11 | } 12 | .ufui-splitbutton .ufui-caret{ 13 | position: relative; 14 | display: inline-block ; 15 | vertical-align: top; 16 | *display: inline ; 17 | *zoom:1; 18 | width: 8px; 19 | height: 20px; 20 | background: url(../images/icons.png) -741px 0; 21 | _background: url(../images/icons.gif) -741px 0; 22 | } 23 | 24 | .ufui-btn-toolbar .ufui-splitbutton, 25 | .ufui-btn-toolbar .ufui-splitbutton{ 26 | _border: none; 27 | } 28 | 29 | /*状态反射*/ 30 | .ufui-btn-toolbar .ufui-splitbutton.ufui-hover .ufui-btn{ 31 | background-color: #d5e1f2; 32 | } 33 | 34 | .ufui-btn-toolbar .ufui-splitbutton.ufui-disabled{ 35 | opacity: 0.3; 36 | filter: alpha(opacity = 30); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /themes/css/tree.css: -------------------------------------------------------------------------------- 1 | .ufui-tree{ 2 | position: relative; 3 | float: left; 4 | width: 20%; 5 | height: 500px; 6 | overflow: auto; 7 | background-color: #f7f7f7; 8 | } 9 | .ufui-tree-container{ 10 | border-right-width: 0; 11 | margin: 10px; 12 | padding: 0; 13 | list-style: none; 14 | overflow-y: scroll; 15 | -webkit-tap-highlight-color: rgba(0,0,0,0); 16 | -webkit-user-select: none; 17 | } 18 | .ufui-tree-container li{ 19 | margin: 4px 0; 20 | padding: 0; 21 | list-style: none; 22 | font-size: 14px; 23 | color: #ff6a00; 24 | } 25 | /* 孩子容器样式 */ 26 | .ufui-tree-branch{ 27 | list-style: none; 28 | margin: 0; 29 | padding-left: 13px; 30 | display: block; 31 | } 32 | .ufui-tree-branch.ufui-tree-branch-root{ 33 | margin: 8px 2px; 34 | padding-left: 0; 35 | display: block; 36 | } 37 | .ufui-tree-branch.ufui-tree-branch-opened{ 38 | display: block; 39 | } 40 | .ufui-tree-branch.ufui-tree-branch-closed{ 41 | display: none; 42 | } -------------------------------------------------------------------------------- /dist/themes/css/tree.css: -------------------------------------------------------------------------------- 1 | .ufui-tree{ 2 | position: relative; 3 | float: left; 4 | width: 20%; 5 | height: 500px; 6 | overflow: auto; 7 | background-color: #f7f7f7; 8 | } 9 | .ufui-tree-container{ 10 | border-right-width: 0; 11 | margin: 10px; 12 | padding: 0; 13 | list-style: none; 14 | overflow-y: scroll; 15 | -webkit-tap-highlight-color: rgba(0,0,0,0); 16 | -webkit-user-select: none; 17 | } 18 | .ufui-tree-container li{ 19 | margin: 4px 0; 20 | padding: 0; 21 | list-style: none; 22 | font-size: 14px; 23 | color: #ff6a00; 24 | } 25 | /* 孩子容器样式 */ 26 | .ufui-tree-branch{ 27 | list-style: none; 28 | margin: 0; 29 | padding-left: 13px; 30 | display: block; 31 | } 32 | .ufui-tree-branch.ufui-tree-branch-root{ 33 | margin: 8px 2px; 34 | padding-left: 0; 35 | display: block; 36 | } 37 | .ufui-tree-branch.ufui-tree-branch-opened{ 38 | display: block; 39 | } 40 | .ufui-tree-branch.ufui-tree-branch-closed{ 41 | display: none; 42 | } -------------------------------------------------------------------------------- /_src/adapter/upload.js: -------------------------------------------------------------------------------- 1 | UF.registerUI('upload', 2 | function (name) { 3 | var me = this, 4 | id = 'ufui-btn-upload-' + (+new Date()).toString(36), 5 | $btn = $.ufuibutton({ 6 | icon: name, 7 | click: function () { 8 | 9 | }, 10 | title: me.getLang('labelMap')[name] || '' 11 | }); 12 | 13 | /* 按钮状态反射 */ 14 | me.on('selectionchange ready focus blur currentpathchange', function () { 15 | var state = me.queryCommandState(name); 16 | $btn.ufui().disabled(state == -1).active(state == 1); 17 | if (me.webuploader) { 18 | state == -1 ? me.webuploader.disable() : me.webuploader.enable(); 19 | } 20 | }); 21 | 22 | $btn.attr('id', id); 23 | /* 绑定按钮到uploader */ 24 | me.on('initUploader', function () { 25 | me.webuploader.addButton({ 26 | id: '#' + id 27 | }); 28 | }); 29 | return $btn; 30 | } 31 | ); -------------------------------------------------------------------------------- /_src/core/selection.js: -------------------------------------------------------------------------------- 1 | var Selection = UF.Selection = UF.createClass("Selection", { 2 | constructor: function (finder) { 3 | this.finder = finder; 4 | this._selectedFiles = finder._selectedFiles || []; 5 | }, 6 | getSelectedFile: function () { 7 | return this._selectedFiles[0]; 8 | }, 9 | getSelectedFiles: function () { 10 | return this._selectedFiles; 11 | }, 12 | removeSelectedFiles: function (paths) { 13 | var me = this; 14 | $.each($.isArray(paths) ? paths : [paths], function (i, p) { 15 | var index; 16 | if (( index = me._selectedFiles.indexOf(p) ) === -1) return; 17 | me._selectedFiles.splice(index, 1); 18 | }); 19 | }, 20 | removeAllSelectedFiles: function () { 21 | this._selectedFiles = []; 22 | }, 23 | isFileSelected: function (path) { 24 | return this._selectedFiles.indexOf(path) !== -1; 25 | }, 26 | select: function () { 27 | this.finder.fire('selectfiles', this._selectedFiles); 28 | } 29 | }); -------------------------------------------------------------------------------- /_src/modules/download.js: -------------------------------------------------------------------------------- 1 | UF.registerModule("downloadmodule", function () { 2 | var uf = this; 3 | return { 4 | "commands": { 5 | "download": { 6 | execute: function (path) { 7 | uf.fire('selectFiles', path); 8 | var downloadUrl = uf.proxy.getRequestUrl({ 9 | 'cmd': 'download', 10 | 'target': path 11 | }); 12 | var $downloadIframe = $('