8 " if (!dlg.haveProgress) {",
9 " Roo.MessageBox.progress(\"Uploading\", \"Uploading\");",
12 " if (dlg.haveProgress == 2) {",
13 " // it's been closed elsewhere..",
16 " if (dlg.uploadComplete) {",
17 " Roo.MessageBox.hide();",
21 " dlg.haveProgress = 1;",
23 " var uid = _this.form.findField('UPLOAD_IDENTIFIER').getValue();",
24 " new Pman.Request({",
25 " url : baseURL + '/Core/UploadProgress.php',",
30 " success : function(res){",
31 " //console.log(data);",
32 " var data = res.data;",
33 " if (dlg.haveProgress == 2) {",
34 " // it's been closed elsewhere..",
38 " if (dlg.uploadComplete) {",
39 " Roo.MessageBox.hide();",
44 " Roo.MessageBox.updateProgress(data.bytes_uploaded/data.bytes_total,",
45 " Math.floor((data.bytes_total - data.bytes_uploaded)/1000) + 'k remaining'",
48 " Roo.MessageBox.updateProgress(1,",
49 " \"Upload Complete - processing\"",
53 " dlg.uploadProgress.defer(2000,dlg);",
55 " failure: function(data) {",
56 " // console.log('fail');",
57 " // console.log(data);",
66 "collapsible" : false,
67 "haveProgress" : false,
73 "xtype" : "LayoutRegion"
77 "Boolean fitContainer" : true,
81 "$ url" : "baseURL + '/Roo/Images.php'",
87 "name" : "UPLOAD_IDENTIFIER",
92 "name" : "post_max_size",
98 "name" : "upload_max_filesize",
103 "$ xns" : "Roo.form",
104 "fieldLabel" : "Upload Image or File",
105 "inputType" : "file",
106 "name" : "imageUpload",
108 "xtype" : "TextField"
111 "$ xns" : "Roo.form",
112 "String actionMode" : "fieldEl",
114 "alwaysQuery" : true,
115 "displayField" : "display_name",
116 "emptyText" : "Select image type",
117 "fieldLabel" : "Image Type",
118 "forceSelection" : true,
119 "hiddenName" : "imgtype",
122 "$ sortInfo" : "{ direction : 'ASC', field: 'name' }",
123 "$ xns" : "Roo.data",
127 "$ url" : "baseURL + '/Roo/Core_enum'",
128 "$ xns" : "Roo.data",
131 "xtype" : "HttpProxy"
134 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
135 "$ xns" : "Roo.data",
139 "totalProperty" : "total",
140 "xtype" : "JsonReader"
145 "function (_self, o){",
146 " o.params = o.params || {};",
148 " o.params.etype = 'ImageType';",
150 " o.params.active = 1;",
160 "loadingText" : "Searching...",
162 "name" : "imgtype_name",
164 "qtip" : "Select image type",
165 "queryParam" : "query[search]",
166 "selectOnFocus" : true,
167 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> {name}</div>",
168 "triggerAction" : "all",
170 "valueField" : "name",
175 "$ xns" : "Roo.form",
180 "$ xns" : "Roo.form",
185 "$ xns" : "Roo.form",
193 "function (_self, act)",
197 " _this.dialog.uploadComplete = true;",
198 " // _this.dialog.el.unmask();",
200 " _this.dialog.haveProgress = 2; ",
201 " if (act.type == 'submit') {",
202 " Roo.log(\"Upload error\");",
206 " Roo.MessageBox.alert(\"Error\", act.result.errorMsg.split(/\\n/).join('<BR/>'));",
209 " Roo.MessageBox.alert(\"Error\", \"Saving failed = fix errors and try again\"); ",
214 " // what about load failing..",
215 " Roo.MessageBox.alert(\"Error\", \"Error loading details\"); ",
218 "|actioncomplete" : [
219 "function(_self,act)",
221 " _this.dialog.uploadComplete = true;",
222 " _this.dialog.haveProgress = 2; ",
223 " Roo.MessageBox.hide(); // force hiding",
224 " //_this.dialog.el.unmask();",
226 " if (act.type == 'setdata') { ",
228 " _this.form.findField('imgtype').hide();",
230 " _this.dialog.resizeTo(500, 140);",
232 " if(_this.data._show_image_type){",
233 " _this.form.findField('imgtype').show();",
234 " _this.dialog.resizeTo(500, 170);",
237 " this.url = _this.data._url ? _this.data._url : baseURL + '/Roo/Images.php';",
238 " this.el.dom.action = this.url;",
239 " if (typeof(_this.data.timeout) != 'undefined') {",
240 " this.timeout = _this.data.timeout;",
243 " this.findField('UPLOAD_IDENTIFIER').setValue(",
244 " (new Date() * 1) + '' + Math.random());",
250 " if (act.type == 'load') {",
251 " // should this happen? ",
252 " _this.data = act.result.data;",
253 " // _this.loaded();",
258 " if (act.type == 'submit') { // only submitted here if we are ",
259 " _this.dialog.hide();",
260 " Roo.log(\"Upload success\");",
262 " //console.log(act);",
263 " if (_this.callback) {",
264 " _this.callback.call(this, act.result.data, act.result.extra);",
277 " _this.form= form;",
283 "style" : "margin:10px;",
289 "xtype" : "ContentPanel"
293 "* prop" : "buttons[]",
296 "function (_self, e)",
298 " _this.dialog.hide();",
307 "* prop" : "buttons[]",
310 "function (_self, e)",
312 " // do some checks?",
314 " //_this.dialog.el.mask(\"Sending\");",
315 " _this.dialog.uploadComplete = false;",
316 " _this.form.doAction('submit', {",
318 " ts : Math.random()",
321 " _this.dialog.haveProgress = 0; // set to show..",
322 " _this.dialog.uploadProgress.defer(1000, _this.dialog);",
336 " // this does not really work - escape on the borders works..",
337 " // resize to fit.. if we have styled stuff...",
344 " var pad = d.el.getSize().height - (d.header.getSize().height +",
345 " d.footer.getSize().height + ",
346 " d.layout.getRegion('center').getPanel(0).el.getSize().height",
351 " d.header.getSize().height +",
352 " d.footer.getSize().height + ",
353 " d.layout.getRegion('center').getPanel(0).el.child('div').getSize().height",
355 " this.resizeTo(d.el.getSize().width, height);",
357 " if (this.keylistener) {",
360 " this.keylistener = this.addKeyListener(27, this.hide, this);",
368 "title" : "Upload an Image or File",
369 "uploadComplete" : false,
371 "xtype" : "LayoutDialog"
375 "name" : "Pman.Dialog.Image",
377 "imageUpload_fieldLabel" : "ea72bacd2fdfa818907bb9559e6905a1",
378 "imgtype_name_emptyText" : "dff0c70e4c11953e4e3ee1cf268fb96d",
379 "imgtype_name_fieldLabel" : "8e16a71b3d8217eb80b39b7d8dec4296",
380 "imgtype_name_loadingText" : "1243daf593fa297e07ab03bf06d925af",
381 "imgtype_name_qtip" : "dff0c70e4c11953e4e3ee1cf268fb96d",
382 "post_max_size_value" : "eb5d45750c7ab13aa8e6bacc80315a30",
383 "upload_max_filesize_value" : "eb5d45750c7ab13aa8e6bacc80315a30"
386 "path" : "/home/alan/gitlive/Pman.Core/Pman.Dialog.Image.bjs",
389 "1243daf593fa297e07ab03bf06d925af" : "Searching...",
390 "2859a4ae58ae4e25abdfc530f814e42f" : "Upload an Image or File",
391 "8e16a71b3d8217eb80b39b7d8dec4296" : "Image Type",
392 "91412465ea9169dfd901dd5e7c96dd99" : "Upload",
393 "dff0c70e4c11953e4e3ee1cf268fb96d" : "Select image type",
394 "ea4788705e6873b424c65e91c2846b19" : "Cancel",
395 "ea72bacd2fdfa818907bb9559e6905a1" : "Upload Image or File",
396 "eb5d45750c7ab13aa8e6bacc80315a30" : "32M"