{ "gen_extended" : false, "items" : [ { "$ uploadProgress" : [ "function()", "{", " var dlg = this;", " if (!dlg.haveProgress) {", " Roo.MessageBox.progress(\"Uploading\", \"Uploading\");", " }", " ", " if (dlg.haveProgress == 2) {", " // it's been closed elsewhere..", " return;", " }", " if (dlg.uploadComplete) {", " Roo.MessageBox.hide();", " return;", " }", " ", " dlg.haveProgress = 1;", "", " var uid = _this.form.findField('UPLOAD_IDENTIFIER').getValue();", " new Pman.Request({", " url : baseURL + '/Core/UploadProgress.php',", " params: {", " id : uid", " },", " method: 'GET',", " success : function(res){", " //console.log(data);", " var data = res.data;", " if (dlg.haveProgress == 2) {", " // it's been closed elsewhere..", " return;", " }", " ", " if (dlg.uploadComplete) {", " Roo.MessageBox.hide();", " return;", " }", " ", " if (data){", " Roo.MessageBox.updateProgress(data.bytes_uploaded/data.bytes_total,", " Math.floor((data.bytes_total - data.bytes_uploaded)/1000) + 'k remaining'", " );", " } else {", " Roo.MessageBox.updateProgress(1,", " \"Upload Complete - processing\"", " );", " return;", " }", " dlg.uploadProgress.defer(2000,dlg);", " },", " failure: function(data) {", " // console.log('fail');", " // console.log(data);", " }", " })", " ", "}", "" ], "$ xns" : "Roo", "closable" : false, "collapsible" : false, "haveProgress" : false, "height" : 140, "items" : [ { "$ xns" : "Roo", "* prop" : "center", "xtype" : "LayoutRegion" }, { "$ xns" : "Roo", "Boolean fitContainer" : true, "fitToFrame" : true, "items" : [ { "$ url" : "baseURL + '/Roo/Images.php'", "$ xns" : "Roo.form", "fileUpload" : true, "items" : [ { "$ xns" : "Roo.form", "name" : "UPLOAD_IDENTIFIER", "xtype" : "Hidden" }, { "$ xns" : "Roo.form", "name" : "post_max_size", "value" : "32M", "xtype" : "Hidden" }, { "$ xns" : "Roo.form", "name" : "upload_max_filesize", "value" : "32M", "xtype" : "Hidden" }, { "$ xns" : "Roo.form", "Boolean allowBlank" : false, "fieldLabel" : "Upload Image or File", "inputType" : "file", "name" : "imageUpload", "width" : 200, "xtype" : "TextField" }, { "$ xns" : "Roo.form", "String actionMode" : "fieldEl", "allowBlank" : true, "alwaysQuery" : true, "displayField" : "display_name", "emptyText" : "Select image type", "fieldLabel" : "Image Type", "forceSelection" : true, "hiddenName" : "imgtype", "items" : [ { "$ sortInfo" : "{ direction : 'ASC', field: 'name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/Core_enum'", "$ xns" : "Roo.data", "* prop" : "proxy", "method" : "GET", "xtype" : "HttpProxy" }, { "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]", "$ xns" : "Roo.data", "* prop" : "reader", "id" : "id", "root" : "data", "totalProperty" : "total", "xtype" : "JsonReader" } ], "listeners" : { "|beforeload" : [ "function (_self, o){", " o.params = o.params || {};", " ", " o.params.etype = 'ImageType';", " ", " o.params.active = 1;", "}", "" ] }, "remoteSort" : true, "xtype" : "Store" } ], "listWidth" : 400, "loadingText" : "Searching...", "minChars" : 2, "name" : "imgtype_name", "pageSize" : 20, "qtip" : "Select image type", "queryParam" : "query[search]", "selectOnFocus" : true, "tpl" : "