-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.xml
More file actions
177 lines (170 loc) · 7.6 KB
/
save.xml
File metadata and controls
177 lines (170 loc) · 7.6 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
168
169
170
171
172
173
174
175
176
177
<a:application xmlns:a="http://ajax.org/2005/aml">
<a:script><![CDATA[
function filesort(value, args, xmlNode) {
return (xmlNode.tagName == "folder" ? 0 : 1) + value.toLowerCase();
}
]]></a:script>
<a:window
id = "winCloseConfirm"
title = "Save this file?"
icon = ""
center = "true"
render = "runtime"
width = "512"
skin = "bk-window2"
draggable = "true"
class = "relative"
onkeydown = "
if(event.keyCode == 89) {
btnSaveYes.dispatchEvent('click', {htmlEvent: {}});
}
if(event.keyCode == 78) {
btnSaveNo.dispatchEvent('click', {htmlEvent: {}});
}
">
<a:vbox id="fileDesc" padding="10" edge="15 20 25 20">
</a:vbox>
<a:hbox edge="6 10 10" pack="end" padding="8">
<a:button id="btnYesAll" caption="Yes to all" skin="btn-default-css3" />
<a:button id="btnNoAll" caption="No to all" skin="btn-default-css3"/>
<a:filler />
<a:button id="btnSaveYes" default="3" class="btn-green" caption="Yes" skin="btn-default-css3"/>
<a:button id="btnSaveNo" class="btn-red" caption="No" skin="btn-default-css3"/>
<a:button id="btnSaveCancel" skin="btn-default-css3">Cancel</a:button>
</a:hbox>
</a:window>
<a:script><![CDATA[
function chooseSaveAsFolder(folder) {
var fooPath = folder.getAttribute("path");
if (folder.getAttribute("type") != "folder" && folder.tagName != "folder") {
var fooPath = fooPath.split("/");
txtSaveAs.setValue(fooPath.pop());
fooPath = fooPath.join("/");
}
lblPath.setProperty('caption', fooPath + '/');
}
]]></a:script>
<a:window
id = "winSaveAs"
center = "true"
height = "395"
icon = ""
buttons = "close"
skin = "bk-window2"
kbclose = "true"
resizable = "true"
title = "Save As"
onshow = "require('ext/save/save').expandTree();"
width = "480"
draggable = "true">
<a:vbox
anchors = "10 10 0 10"
padding = "5">
<a:hbox
align = "center"
padding = "5">
<a:label class="lbl_saveas">Save as:</a:label>
<a:textbox
id = "txtSaveAs"
flex = "7"
focusselect = "true"
onkeydown = "if (event.keyCode == 13) require('ext/save/save').choosePath(lblPath.getProperty('caption') + this.getValue())" />
</a:hbox>
<a:hbox
align = "center"
padding = "5">
<a:label class="lbl_saveas">Where:</a:label>
<a:label id="lblPath" class="lbl_filepath" />
</a:hbox>
<div class="dgLikeContaier" flex="1">
<div class="heading">Project folder</div>
<a:hbox
anchors = "20 0 0 0"
overflow = "hidden">
<a:tree
id = "trSaveAs"
class = "trDgLike"
flex = "1"
scrollbar = "sbShared 2 2 2"
model = "{require('ext/filesystem/filesystem').model}"
contextmenu = "mnuCtxSaveTree"
canrename = "true"
onafterselect = "chooseSaveAsFolder(this.selected)"
onafterchoose = "chooseSaveAsFolder(this.selected)">
<a:each match="[project|file|folder]" sort="[@name]" sort-method="filesort">
<a:insert
match = "[folder]"
get = "{location.host && davProject.readdir([@path])}" />
<a:caption match="[@name]" />
<a:icon
match = "[folder]"
value = "folder.png" />
<a:icon
match = "[file]"
value = "{require('core/util').getFileIcon(%[.])}" />
<a:css match="[file]" value="file_item"></a:css>
</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 match="[file|folder[not(@root)]]" set="{require('ext/save/save').renameFile(%[.])}" />
<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:hbox>
</div>
<a:hbox padding="15" align="center">
<a:button
width = "104"
icon = "folder_new.png"
class = "btnIconOnly smallCaption newFolder"
onclick = "require('ext/filesystem/filesystem').createFolder('New Folder', trSaveAs)"
tooltip = "Create folder">
Create folder
</a:button>
<a:filler />
<a:checkbox
skin = "checkbox_grey"
checked = "true"
width = "120"
margin = "4 0 0"
onafterchange="
if(this.checked)
trSaveAs.$ext.className = trSaveAs.$ext.className.replace(/hidefiles/, '');
else
apf.setStyleClass(trSaveAs.$ext, 'hidefiles');
">Show files in tree</a:checkbox>
</a:hbox>
<a:hbox edge="23 0 10" pack="end" padding = "8">
<a:button
skin = "btn-default-css3"
caption = "Cancel"
margin = "0 10 0 0"
onclick = "winSaveAs.hide()"
/>
<a:button
class = "btn-green"
caption = "Save"
default = "2"
margin = "0 0 0 10"
skin = "btn-default-css3"
onclick = "require('ext/save/save').confirmSaveAs()"
/>
</a:hbox>
</a:vbox>
</a:window>
<a:menu id="mnuCtxSaveTree" disabled="{{!stServerConnected.active}}" render="runtime">
<a:item match="[file|folder[not(@root)]]" onclick="trSaveAs.startRename()">Rename</a:item>
<a:item match="[file|folder[not(@root)]]" onclick="trSaveAs.remove()">Delete</a:item>
<a:divider />
<a:item id="itemCtxTreeNewFile" match="[file|folder|project]" onclick="
require('ext/filesystem/filesystem').createFile('Untitled', null, trSaveAs);
">New File</a:item>
<a:item match="[file|folder|project]" onclick="
require('ext/filesystem/filesystem').createFolder('New Folder', trSaveAs);
">New Folder</a:item>
</a:menu>
</a:application>