forked from c9/cloud9
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.xml
More file actions
167 lines (160 loc) · 6.78 KB
/
Copy pathsave.xml
File metadata and controls
167 lines (160 loc) · 6.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<a:application xmlns:a="http://ajax.org/2005/aml">
<a:window
id = "winCloseConfirm"
title = "Would you like to save this file?"
icon = ""
center = "true"
render = "runtime"
width = "512"
skin = "change_photo">
<a:vbox padding="10" edge="15 20 10 20">
<h3 class="wheader">Save this file?</h3>
<div>This file has unsaved changes. Would you like to save the file before closing?</div>
</a:vbox>
<a:vbox>
<a:divider skin="hordivider" />
<a:hbox pack="end" padding="7" edge="10 10 5 10">
<a:button id="btnYesAll" caption="Yes to all" />
<a:button id="btnNoAll" caption="No to all" />
<a:filler />
<a:button id="btnSaveYes" width="80" default="3" class="ui-btn-green" caption="Yes" />
<a:button id="btnSaveNo" width="80" class="ui-btn-red" caption="No" />
<a:button id="btnSaveCancel" width="80">Cancel</a:button>
</a:hbox>
</a:vbox>
</a:window>
<a:script><![CDATA[
function gotoParent() {
var node = trSaveAs.selected.parentNode;
if (trSaveAs.getModel().data != node)
trSaveAs.expandAndSelect(node);
}
function chooseFolder(folder) {
txtSaveAs.setValue(folder.getAttribute("path"));
}
function chooseFile(file) {
if (file.getAttribute("type") == "file")
require("ext/save/save").saveas();
else
trSaveAs.expandAndSelect(file);
}
]]></a:script>
<a:window
id = "winSaveAs"
center = "true"
height = "400"
icon = ""
buttons = "close"
kbclose = "true"
resizable = "true"
title = "Save As"
width = "650">
<a:vbox
anchors = "5 5 0 5"
padding = "5">
<a:hbox padding="5">
<a:button
width = "29"
icon = "folder_up.png"
class = "btnIconOnly"
onclick = "gotoParent()"
tooltip = "Go to parent" />
<a:button
width = "29"
icon = "folder_new.png"
class = "btnIconOnly"
onclick = "require('ext/filesystem/filesystem').createFolder()"
tooltip = "Create folder" />
</a:hbox>
<a:hbox
flex = "1"
padding = "5"
splitters = "true">
<a:tree
id = "trSaveAs"
flex = "2"
model = "{require('ext/filesystem/filesystem').model}"
contextmenu = "mnuCtxTree"
onafterchoose = "chooseFolder(this.selected)">
<a:each match="[folder]">
<a:insert
match = "[folder]"
get = "{location.host and davProject.readdir([@path])}" />
<a:caption match="[@name]" />
<a:icon
match = "[folder]"
value = "folder.png" />
</a:each>
<a:add type="folder" get="{davProject.mkdir([@path], 'New Folder')}" />
<a:add type="file" get="{davProject.create([@path], 'New File.txt', '')}" />
<a:rename set="{alert('boe'); davProject.rename([@name], [@path])}"/>
<a:copy match="[file|folder]" set="{davProject.copy([@path], [../@path])}"/>
<a:move set="{davProject.move([@path], [../@path])}"/>
<a:remove match="[file|folder]" set="{require('ext/filesystem/filesystem').remove([@path])}"/>
<a:drag match="[folder|file]" />
<a:drop match="[folder|file]" target="[folder]"
action="tree-append" copy="{event.ctrlKey}" />
</a:tree>
<a:datagrid id="dgTest"
autoselect = "false"
flex = "3"
model = "{trSaveAs.selected}"
onafterselect = "txtSaveAs.setValue(this.selected.getAttribute('path'))"
onafterchoose = "chooseFile(this.selected)"
onkeydown = "if (event.keyCode == 8) { gotoParent(); return false; }"
loading-message = "Loading...">
<a:each
match = "[folder|file]"
filter = "{drpSaveAs.value.replace('*', '')}"
filter-fields = "@name"
sort = "[@name]"
sort-method = "filesort">
<a:load get="{ location.host and davProject.readdir([@path]) }" />
<a:column
caption = "Name"
value = "[@name]"
width = "60%"
icon = "{
if (#[self::folder])
'folder.png';
else
require('core/util').getFileIcon(%[.]);
}" />
<a:column
caption = "Size"
value = "[@size]"
align = "right"
width = "20%" />
<a:column
caption = "Type"
value = "[@type]"
width = "20%" />
</a:each>
<a:actions />
</a:datagrid>
</a:hbox>
<a:hbox
align = "center"
padding = "5">
<a:label flex="1">File name:</a:label>
<a:textbox
id = "txtSaveAs"
flex = "7"
onkeydown = "if (event.keyCode == 13) require('ext/save/save').choosePath(this.getValue())" />
</a:hbox>
<a:hbox
pack = "end"
padding = "5">
<a:button
class = "ui-btn-green"
onclick = "require('ext/save/save').saveFileAs()">
Save
</a:button>
<a:button
onclick = "winSaveAs.hide()">
Cancel
</a:button>
</a:hbox>
</a:vbox>
</a:window>
</a:application>