Skip to content

Commit c345804

Browse files
committed
fileTree updated
1 parent 833ea64 commit c345804

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+174
-6
lines changed

public/assets/css/jquery.contextMenu.min.css

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/editor/css/_main.css

+8-1
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,11 @@ body{position:fixed;top:0;left:0;right:0;bottom:0;overflow:hidden;line-height:1.
115115

116116
.online{background-color:#00ff00;}
117117
.offline{background-color:#ff0000;}
118-
.till{padding-left:5px;}
118+
.till{padding-left:5px;}
119+
120+
.alert{position:absolute;top:0;z-index:99999;}
121+
.alert ul{background-color:#111111;border:1px solid #000000;padding:5px 10px;}
122+
.alert li{color:#ff4040;}
123+
.alert li.success{color:#40ff40;}
124+
.alert li{text-align:center;height:25px;line-height:25px;border-bottom:1px solid #111111;}
125+
.alert li:last-child{border:none;}

public/assets/editor/css/fileTree.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
.fileTree{}
1+
.fileTree{height:100%;width:100%;overflow:auto;}
2+
.fileTree li{cursor:default;line-height:25px;padding:0 5px;border-bottom:1px solid #222222;background-repeat:no-repeat;background-size:15px 15px;background-position:center left;text-indent:13px;}
3+
.fileTree li:last-child{border:none;}

public/assets/editor/js/_main.js

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/editor/js/fileTree.js

+50-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,50 @@
1-
ch.fileTree=(function(){})();
1+
ch.fileTree=(function(){
2+
var context={
3+
file: {
4+
edit:{name:"Edit",icon:"edit",callback:function(key,opt){alert("Edit!");}},
5+
cut:{name:"Cut",icon:"cut",callback:function(key,opt){alert("Cut!");}},
6+
copy:{name:"Copy",icon:"copy",callback:function(key,opt){alert("Edit!");}},
7+
delete:{name:"Delete",icon:"delete",callback:function(key,opt){alert("Delete!")}},
8+
rename:{name:"Rename",icon:"",callback:function(key,opt){alert("Rename!");}},
9+
sep1: "----------",
10+
share:{name:"Share",icon:"",callback:function(key,opt){alert("Share!");}},
11+
fold1: {
12+
name: "Download",
13+
items: {
14+
"fold1-key1":{name:"As file",icon:"",callback:function(key,opt){alert("Share!");}},
15+
"fold1-key2":{name:"As ZIP",icon:"",callback:function(key,opt){alert("Share!");}}
16+
}
17+
},
18+
"sep2": "---------",
19+
properties:{name:"Properties",icon:"properties",callback:function(key,opt){alert("Propertise!");}}
20+
},
21+
dir: {
22+
move:{name:"Move",icon:"move",callback:function(key,opt){alert("Move!");}},
23+
copy:{name:"Copy",icon:"copy",callback:function(key,opt){alert("Copy!");}},
24+
delete:{name:"Delete",icon:"delete",callback:function(key,opt){alert("Delete!")}},
25+
rename:{name:"Rename",icon:"",callback:function(key,opt){alert("Rename!");}},
26+
sep1: "----------",
27+
share:{name:"Share",icon:"",callback:function(key,opt){alert("Share!");}},
28+
fold1: {
29+
name: "Download",
30+
items: {
31+
"fold1-key1":{name:"As gz",icon:"",callback:function(key,opt){alert("Share!");}},
32+
"fold1-key2":{name:"As ZIP",icon:"",callback:function(key,opt){alert("Share!");}}
33+
}
34+
},
35+
"sep2": "---------",
36+
properties:{name:"Properties",icon:"properties",callback:function(key,opt){alert("Propertise!");}}
37+
}
38+
};
39+
40+
$.contextMenu({
41+
selector:"#fileTree li[data-type='file']",
42+
items:context.file
43+
});
44+
$.contextMenu({
45+
selector:"#fileTree li[data-type='dir']",
46+
items:context.dir
47+
});
48+
49+
return {};
50+
})();
3.3 KB
Binary file not shown.
3.1 KB
Binary file not shown.
2.02 KB
Binary file not shown.
1.53 KB
Binary file not shown.
464 Bytes

public/assets/img/fileTree/bmp.png

9.55 KB

public/assets/img/fileTree/code.png

603 Bytes

public/assets/img/fileTree/css.png

618 Bytes

public/assets/img/fileTree/db.png

579 Bytes

public/assets/img/fileTree/dir.png

2.71 KB

public/assets/img/fileTree/doc.png

651 Bytes

public/assets/img/fileTree/file.png

294 Bytes

public/assets/img/fileTree/film.png

653 Bytes

public/assets/img/fileTree/flash.png

582 Bytes
583 Bytes

public/assets/img/fileTree/html.png

734 Bytes

public/assets/img/fileTree/java.png

633 Bytes

public/assets/img/fileTree/js.png

859 Bytes

public/assets/img/fileTree/linux.png

668 Bytes

public/assets/img/fileTree/music.png

385 Bytes

public/assets/img/fileTree/pdf.png

591 Bytes

public/assets/img/fileTree/php.png

538 Bytes
606 Bytes

public/assets/img/fileTree/ppt.png

588 Bytes

public/assets/img/fileTree/psd.png

856 Bytes

public/assets/img/fileTree/rar.png

9.19 KB

public/assets/img/fileTree/ruby.png

626 Bytes
2.47 KB

public/assets/img/fileTree/txt.png

9.79 KB

public/assets/img/fileTree/xls.png

663 Bytes

public/assets/img/fileTree/zip.png

12 KB

public/assets/js/jquery.contextMenu.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/js/jquery.hotKeyMap-1.0.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
* jQuery Hotkeys Plugin
3+
* Copyright 2010, John Resig
4+
* Dual licensed under the MIT or GPL Version 2 licenses.
5+
*
6+
* Based upon the plugin by Tzury Bar Yochay:
7+
* http://github.com/tzuryby/hotkeys
8+
*
9+
* Original idea by:
10+
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
11+
*/
12+
13+
(function(jQuery){
14+
15+
jQuery.hotkeys = {
16+
version: "0.8",
17+
18+
specialKeys: {
19+
8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
20+
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
21+
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
22+
96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
23+
104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
24+
112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
25+
120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta"
26+
},
27+
28+
shiftNums: {
29+
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
30+
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
31+
".": ">", "/": "?", "\\": "|"
32+
}
33+
};
34+
35+
function keyHandler( handleObj ) {
36+
// Only care when a possible input has been specified
37+
if ( typeof handleObj.data !== "string" ) {
38+
return;
39+
}
40+
41+
var origHandler = handleObj.handler,
42+
keys = handleObj.data.toLowerCase().split(" ");
43+
44+
handleObj.handler = function( event ) {
45+
// Don't fire in text-accepting inputs that we didn't directly bind to
46+
if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
47+
event.target.type === "text") ) {
48+
return;
49+
}
50+
51+
// Keypress represents characters, not special keys
52+
var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
53+
character = String.fromCharCode( event.which ).toLowerCase(),
54+
key, modif = "", possible = {};
55+
56+
// check combinations (alt|ctrl|shift+anything)
57+
if ( event.altKey && special !== "alt" ) {
58+
modif += "alt+";
59+
}
60+
61+
if ( event.ctrlKey && special !== "ctrl" ) {
62+
modif += "ctrl+";
63+
}
64+
65+
// TODO: Need to make sure this works consistently across platforms
66+
if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
67+
modif += "meta+";
68+
}
69+
70+
if ( event.shiftKey && special !== "shift" ) {
71+
modif += "shift+";
72+
}
73+
74+
if ( special ) {
75+
possible[ modif + special ] = true;
76+
77+
} else {
78+
possible[ modif + character ] = true;
79+
possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
80+
81+
// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
82+
if ( modif === "shift+" ) {
83+
possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
84+
}
85+
}
86+
87+
for ( var i = 0, l = keys.length; i < l; i++ ) {
88+
if ( possible[ keys[i] ] ) {
89+
return origHandler.apply( this, arguments );
90+
}
91+
}
92+
};
93+
}
94+
95+
jQuery.each([ "keydown", "keyup", "keypress" ], function() {
96+
jQuery.event.special[ this ] = { add: keyHandler };
97+
});
98+
99+
})( jQuery );

resources/views/editor.htm

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<asset src="assets/js/jquery.contextMenu.min.js" priority="8" type="js" />
2+
<asset src="assets/js/jquery.hotkeys-0.8.js" priority="8" type="js" />
3+
<asset src="assets/js/jquery.hotKeyMap-1.0.min.js" priority="8" type="js" />
4+
<asset src="assets/css/jquery.contextMenu.min.css" priority="8" type="css" />
15
<asset src="assets/codemirror/codemirror.css" priority="9" type="css" />
26
<asset src="assets/codemirror/codemirror.js" priority="9" type="js" />
37
<asset src="assets/editor/css/_main.css" priority="8" type="css" />

resources/views/editor/fileTree.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div id="fileTree" class="fileTree">
55
<ul>
66
<repeat group="{{ @fileTree }}" key="{{ @key}}" value="{{ @value }}">
7-
<li><h4>{{ @key }}</h4></li>
7+
<li data-type="{{ @value['type'] }}" style="background-image:url(/assets/img/fileTree/{{ @value['type'] !== 'dir' ? @value['extension'] : @value['type'] }}.png)"><h4>{{ @key }}</h4></li>
88
</repeat>
99
</ul>
1010
</div>

resources/views/partials/errors.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<repeat group="{{ Flash::instance()->getMessages() }}" value="{{ @msg }}">
22
<div class="alert">
33
<ul>
4-
<li class ="{{ @msg.status }}">{{ @msg.text | esc }}</li>
4+
<li class="{{ @msg.status }}">{{ @msg.text | esc }}</li>
55
</ul>
66
</div>
77
</repeat>

0 commit comments

Comments
 (0)