2 "name" : "Pman.Dialog.BAdminImageManager",
4 "title" : "Pman.Dialog.BAdminImageManager",
5 "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.BAdminImageManager.bjs",
9 "ef797d5638c2e1c6b6225b2247541ea5" : "Upload Image or File:",
10 "d9787032e54a7facd5c7b1db2ae61c7b" : "Image Manager",
11 "37c1097cf82226d511586ecd99ed97cf" : "search for image",
12 "cdb6b6bab1fd18b9dbfe3fb84a5d34ae" : "<i class=\"fa fa-search\"></i>",
13 "5350277f16d9998c57fa7e1d17be2a76" : "<i class=\"fa fa-upload\"></i> Upload Image",
14 "14834a16229091f47cf1810177d07916" : "Created Date:",
15 "1a0ce561842e3caef9098f46ecaa1dcf" : "Add Images with Settings",
16 "78d0f5aac952e2ce840a381976a3b01e" : "Image Details",
17 "708ea0e601087e73c4764d5086e3ea3c" : "File Name:",
18 "e0a53da57dd79cca5d3b6a7c42e463ef" : "File Type:",
19 "3f986fa4066f6bded1376eb69de18da2" : "File Size:",
20 "d3d2e617335f08df83599665eef8a418" : "Close",
21 "84378f54966381befd040dafbdc221d6" : "<i class=\"fa fa-plus\"></i> Add into the email",
22 "361bacb1a72a350ee34e2f31a6a91dab" : "Alignment:",
23 "f48f7c7bccb5e29c83d87984c49ad8d4" : "Show image for this email",
24 "ed807858fcb68abdd180481f1fcba5c5" : "<i class=\"fa fa-trash\"></i> Delete",
25 "031fa343a28d221a25d2bcd942437174" : "Alternate Text:",
26 "48ccf48dcf2218a413ce473262f21a0c" : "Width: ",
27 "d0042a700e9bdf79689d63ee6846dc0e" : "Description:",
28 "d6d93f0d6b7c6018d8949e73ed6efb6c" : "<i class=\"fa fa-save\"></i> Save Changes",
29 "e933dc24fb245d863a43b4fefe9b45f5" : "Height:"
32 "align_fieldLabel" : "361bacb1a72a350ee34e2f31a6a91dab",
33 "filename_fieldLabel" : "708ea0e601087e73c4764d5086e3ea3c",
34 "add_html" : "84378f54966381befd040dafbdc221d6",
35 "created_fieldLabel" : "14834a16229091f47cf1810177d07916",
36 "height_fieldLabel" : "e933dc24fb245d863a43b4fefe9b45f5",
37 "mimetype_fieldLabel" : "e0a53da57dd79cca5d3b6a7c42e463ef",
38 "close_html" : "d3d2e617335f08df83599665eef8a418",
39 "imageUpload_fieldLabel" : "ef797d5638c2e1c6b6225b2247541ea5",
40 "width_fieldLabel" : "48ccf48dcf2218a413ce473262f21a0c",
41 "filesize_fieldLabel" : "3f986fa4066f6bded1376eb69de18da2",
42 "descript_fieldLabel" : "d0042a700e9bdf79689d63ee6846dc0e"
47 "resize" : "function (_self)\n{\n if (_this.dialog && _this.container && _this.toolbar) {\n \n _this.document_container.el.setHeight(\n _this.dialog.bodyEl.getHeight() -\n _this.dialog.headerEl.getHeight() -\n _this.toolbar.el.dom.offsetHeight -\n _this.dialog.footerEl.getHeight()\n );\n \n }\n}"
49 "String cls" : "modal-body-enable-overflow-y pman-badmin-image-manager",
50 "Boolean fitwindow" : true,
52 "$ xns" : "Roo.bootstrap",
53 "String title" : "Image Manager",
57 "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}"
60 "$ xns" : "Roo.bootstrap",
61 "String html" : "Close",
62 "string weight" : "default",
63 "* prop" : "buttons[]",
64 "string name" : "close"
68 "$ xns" : "Roo.bootstrap",
72 "$ xns" : "Roo.bootstrap",
77 "actionfailed" : "function (_self, action)\n{\n if (action.type == 'submit') {\n Roo.log(\"Upload error\");\n Roo.log(action);\n \n try {\n \n Roo.MessageBox.alert(\"Error\", action.result.errorMsg.split(/\\n/).join('<BR/>'));\n \n } catch(e) {\n \n Roo.MessageBox.alert(\"Error\", \"Saving failed = fix errors and try again\");\n }\n return;\n }\n \n Roo.MessageBox.alert(\"Error\", \"Error loading details\"); \n}",
78 "actioncomplete" : "function(_self,action)\n{\n if (action.type == 'setdata') { \n \n this.url = _this.data._url ? baseURL + _this.data._url : baseURL + '/Roo/Images.php';\n \n this.el.dom.action = this.url;\n \n if (typeof(_this.data.timeout) != 'undefined') {\n this.timeout = _this.data.timeout;\n }\n \n this.findField('UPLOAD_IDENTIFIER').setValue(\n (new Date() * 1) + '' + Math.random());\n \n _this.masonry.load();\n \n return;\n }\n \n \n if (action.type == 'load') {\n \n _this.data = action.result.data;\n \n return;\n }\n \n \n if (action.type == 'submit') { // only submitted here if we are \n \n _this.masonry.load();\n \n return; \n }\n \n\n \n}\n",
79 "render" : "function (_self)\n{\n _this.form = this;\n \n}"
81 "style" : "display: none;",
83 "Number timeout" : 300,
84 "$ xns" : "Roo.bootstrap",
85 "Boolean fileUpload" : true,
86 "String method" : "POST",
87 "$ String url" : "baseURL + '/Roo/Images.php'",
91 "render" : "function (_self)\n{\n _this.uploadDL = this;\n \n _this.uploadDL.inputEl().on(\"change\",function(){\n \n _this.form.findField('onid').setValue(_this.showTypeBtn.isActive() ? _this.data.onid : 0);\n _this.form.doAction('submit');\n \n //_this.dialog.uploadProgress.defer(1000, _this.dialog);\n });\n \n \n}"
93 "String name" : "imageUpload",
95 "string fieldLabel" : "Upload Image or File:",
96 "String inputType" : "file",
97 "$ xns" : "Roo.bootstrap",
98 "Number labelWidth" : 4
101 "String name" : "UPLOAD_IDENTIFIER",
103 "String inputType" : "hidden",
104 "$ xns" : "Roo.bootstrap"
107 "String name" : "post_max_size",
109 "String inputType" : "hidden",
110 "$ xns" : "Roo.bootstrap"
113 "String name" : "upload_max_filesize",
115 "String inputType" : "hidden",
116 "$ xns" : "Roo.bootstrap"
119 "String name" : "ontable",
121 "String inputType" : "hidden",
122 "$ xns" : "Roo.bootstrap"
125 "String name" : "onid",
127 "String inputType" : "hidden",
128 "$ xns" : "Roo.bootstrap"
131 "String name" : "id",
133 "String inputType" : "hidden",
134 "$ xns" : "Roo.bootstrap"
140 "render" : "function (_self)\n{\n _this.container = this;\n \n}"
142 "xtype" : "Container",
143 "$ xns" : "Roo.bootstrap",
147 "render" : "function (_self)\n{\n _this.toolbar = this;\n}"
150 "$ xns" : "Roo.bootstrap",
155 "$ xns" : "Roo.bootstrap",
159 "toggle" : "function (b, e, pressed)\n{\n _this.showTypeBtn.setText(!pressed ? 'Show all images' : 'Show image for this email');\n \n _this.masonry.load();\n}",
160 "render" : "function (_self)\n{\n _this.showTypeBtn = this;\n}"
162 "bool pressed" : false,
164 "$ xns" : "Roo.bootstrap",
165 "String html" : "Show image for this email",
166 "String style" : "float:left;"
170 "specialkey" : "function (_self, e)\n{ \n \n var image_name = \"\";\n \n if(e.keyCode == e.ENTER) {\n _this.masonry.clearAll();\n _this.masonry.load();\n \n }\n}",
171 "render" : "function (_self)\n{\n _this.searchBox = this;\n}"
174 "string placeholder" : "search for image",
175 "$ xns" : "Roo.bootstrap",
176 "String style" : "float:left; width: 300px; margin-left: 15px;",
180 "click" : "function (_self, e)\n{\n _this.masonry.clearAll();\n _this.masonry.load();\n}"
183 "$ xns" : "Roo.bootstrap",
184 "String html" : "<i class=\"fa fa-search\"></i>",
193 "String cls" : "text-right",
195 "$ xns" : "Roo.bootstrap",
199 "click" : "function (_self, e)\n{\n var id = _this.data.onid;\n \n if(id*1 < 1){\n Roo.MessageBox.alert('Error', 'Please save the email template first');\n return;\n }\n \n _this.uploadDL.inputEl().dom.click();\n}"
202 "$ xns" : "Roo.bootstrap",
203 "String html" : "<i class=\"fa fa-upload\"></i> Upload Image",
204 "string weight" : "primary"
208 "render" : "function (_self)\n{\n _this.deleteBtn = this;\n \n this.hide();\n}",
209 "click" : "function (_self, e)\n{\n if (_this.masonry.getSelected().length > 1) {\n Roo.bootstrap.MessageBox.alert('Cannot delete the images !','Please select one image only');\n return;\n }\n \n if (_this.masonry.getSelected().length < 1) {\n Roo.bootstrap.MessageBox.alert('Cannot delete any image!', 'Please select an image');\n return;\n }\n \n Roo.bootstrap.MessageBox.confirm(\"Confirm\", \"Are sure you want to delete this image?\", function (v){\n if (v != 'yes') {\n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/Images.php',\n method: 'POST',\n params : {\n _delete : Roo.bootstrap.MasonryBrick.get(_this.masonry.getSelected()[0]).imageObj.id\n },\n success : function()\n {\n// _this.masonry.removeBrick(_this.masonry.getSelected()[0]);\n _this.masonry.load();\n }\n });\n });\n}"
211 "String weight" : "default",
213 "$ xns" : "Roo.bootstrap",
214 "String html" : "<i class=\"fa fa-trash\"></i> Delete",
215 "String style" : "margin-left: 15px;"
223 "render" : "function (_self)\n{\n _this.document_container = this;\n \n this.el.setStyle('overflow', 'auto');\n}"
226 "$ xns" : "Roo.bootstrap",
227 "String style" : "margin-top: 15px;",
232 "$ xns" : "Roo.bootstrap",
236 "render" : "function (_self)\n{\n _this.masonry = this;\n \n}"
238 "Boolean isLayoutInstant" : false,
239 "| function load" : "function() \n{\n _this.setting_form.reset();\n _this.detail_form.reset();\n \n _this.setting_form.hide();\n _this.detail_form.hide();\n \n _this.masonry.clearAll();\n \n new Pman.Request({\n url: baseURL + '/Roo/Images',\n method: 'GET',\n params: {\n ontable : 'core_email',\n onid : _this.showTypeBtn.isActive() ? _this.data.onid : 0,\n 'search[filename]' : _this.searchBox.getValue()\n },\n success: function(ret) {\n \n if(!ret.data.length){\n return;\n }\n \n Roo.each(ret.data, function(r){\n \n _this.masonry.addBrick({\n size: 'md',\n boxWidth: 150,\n cls: 'coba-image-mgmt-masonry-brick',\n active: false,\n activeClass: 'active',\n preventDefault: true,\n bgimage : baseURL + '/Images/' + r.id + '/' + r.filename.replace('%', '-'),\n imageObj: r,\n listeners : {\n click : function (_self)\n {\n _this.setting_form.reset();\n _this.detail_form.reset();\n \n _this.setting_form.hide();\n _this.detail_form.hide();\n \n _this.deleteBtn.hide();\n \n if(!this.isSelected()){\n return;\n }\n \n if(_this.masonry.getSelected().length == 1){\n _this.deleteBtn.show();\n }\n \n new Pman.Request({\n url: baseURL + '/Roo/Images.php',\n method : 'GET',\n params : {\n _id: _self.imageObj.id\n }, \n success : function(rr) {\n \n _this.setting_form.show();\n _this.detail_form.show();\n \n _this.detail_form.setValues(rr.data);\n _this.setting_form.setValues(rr.data);\n \n _this.setting_form.findField('align').setValue(\"left\");\n \n _self.imageObj = rr.data;\n }\n });\n \n }\n }\n })\n \n });\n \n _this.masonry.initial();\n \n },\n \n failure: function(res) {\n Roo.log('cannot read Coba/Roo/Images');\n }\n });\n}",
240 "Number boxWidth" : 250,
241 "xtype" : "LayoutMasonry",
242 "$ xns" : "Roo.bootstrap",
243 "string activeClass" : "active",
244 "Boolean isAutoInitial" : false
256 "$ xns" : "Roo.bootstrap",
261 "$ xns" : "Roo.bootstrap",
266 "$ xns" : "Roo.bootstrap",
270 "render" : "function (_self)\n{\n _this.setting_form = this;\n}"
272 "$ string url" : "baseURL + '/Roo/Images'\n",
274 "$ xns" : "Roo.bootstrap",
275 "Boolean loadMask" : true,
278 "String header" : "Add Images with Settings",
279 "$ String panel" : "'default'",
280 "xtype" : "Container",
281 "$ xns" : "Roo.bootstrap",
282 "String style" : "width: 100%;",
286 "$ xns" : "Roo.bootstrap",
291 "$ xns" : "Roo.bootstrap",
294 "String name" : "descript",
296 "string fieldLabel" : "Alternate Text:",
298 "$ xns" : "Roo.bootstrap",
299 "Number labelWidth" : 4
307 "$ xns" : "Roo.bootstrap",
312 "$ xns" : "Roo.bootstrap",
313 "String style" : "margin-top:15px;",
316 "String name" : "height",
318 "string fieldLabel" : "Height:",
320 "$ xns" : "Roo.bootstrap",
321 "Number labelWidth" : 4
329 "$ xns" : "Roo.bootstrap",
334 "$ xns" : "Roo.bootstrap",
335 "String style" : "margin-top:15px;",
338 "String name" : "width",
340 "string fieldLabel" : "Width: ",
342 "$ xns" : "Roo.bootstrap",
343 "Number labelWidth" : 4
351 "$ xns" : "Roo.bootstrap",
356 "$ xns" : "Roo.bootstrap",
357 "String style" : "margin-top:15px;",
360 "Boolean allowBlank" : true,
361 "Boolean selectOnFocus" : true,
362 "String name" : "align",
363 "String mode" : "local",
364 "String valueField" : "code",
365 "xtype" : "ComboBox",
366 "Boolean editable" : false,
367 "String triggerAction" : "all",
368 "string fieldLabel" : "Alignment:",
369 "Boolean alwaysQuery" : true,
371 "$ xns" : "Roo.bootstrap",
372 "Number labelWidth" : 4,
373 "String displayField" : "value",
374 "Boolean forceSelection" : true,
377 "$ Array fields" : "['code', 'value']",
378 "xtype" : "SimpleStore",
379 "$ xns" : "Roo.data",
381 "| Array data" : "[\n ['left', 'left'],\n ['right', 'right'],\n ['middle', 'middle'],\n ['top', 'top'],\n ['bottom', 'bottom']\n]"
391 "$ xns" : "Roo.bootstrap",
395 "String cls" : "text-center",
397 "$ xns" : "Roo.bootstrap",
398 "String style" : "margin-top:15px;",
402 "click" : "function (_self, e)\n{\n var b = _this.masonry.getSelected();\n \n if (b.length < 1) {\n \n Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please select an image');\n return;\n }\n \n var brick = Roo.bootstrap.MasonryBrick.get(b[0]);\n \n _this.dialog.hide();\n\n if(_this.callback){\n \n var data = {\n id : brick.imageObj.id,\n filename : brick.imageObj.filename,\n width : _this.setting_form.findField('width').getValue(),\n height : _this.setting_form.findField('height').getValue(),\n descript : _this.setting_form.findField('descript').getValue(),\n align : _this.setting_form.findField('align').getValue()\n };\n \n _this.callback.call(_this, data);\n \n }\n}"
404 "String weight" : "default",
406 "$ xns" : "Roo.bootstrap",
407 "String html" : "<i class=\"fa fa-plus\"></i> Add into the email",
424 "$ xns" : "Roo.bootstrap",
429 "$ xns" : "Roo.bootstrap",
433 "render" : "function (_self)\n{\n _this.detail_form = this;\n}"
436 "$ xns" : "Roo.bootstrap",
437 "Boolean loadMask" : true,
438 "$ String url" : "baseURL + '/Roo/Images'",
441 "xtype" : "Container",
442 "string header" : "Image Details",
443 "$ xns" : "Roo.bootstrap",
444 "String style" : "width: 100%; padding: 0",
445 "$ string panel" : "'default'",
449 "$ xns" : "Roo.bootstrap",
454 "$ xns" : "Roo.bootstrap",
457 "String name" : "filename",
458 "style" : "padding: 0;",
460 "string fieldLabel" : "File Name:",
462 "Boolean disabled" : true,
463 "$ xns" : "Roo.bootstrap",
464 "Number labelWidth" : 4
472 "$ xns" : "Roo.bootstrap",
477 "$ xns" : "Roo.bootstrap",
478 "String style" : "margin-top:15px;",
481 "String name" : "mimetype",
483 "string fieldLabel" : "File Type:",
485 "Boolean disabled" : true,
486 "$ xns" : "Roo.bootstrap",
487 "Number labelWidth" : 4
495 "$ xns" : "Roo.bootstrap",
500 "$ xns" : "Roo.bootstrap",
501 "String style" : "margin-top:15px;",
504 "String name" : "filesize",
506 "string fieldLabel" : "File Size:",
508 "Boolean disabled" : true,
509 "$ xns" : "Roo.bootstrap",
510 "Number labelWidth" : 4
518 "$ xns" : "Roo.bootstrap",
523 "$ xns" : "Roo.bootstrap",
524 "String style" : "margin-top:15px;",
527 "String name" : "created",
529 "string fieldLabel" : "Created Date:",
531 "Boolean disabled" : true,
532 "$ xns" : "Roo.bootstrap",
533 "Number labelWidth" : 4
541 "$ xns" : "Roo.bootstrap",
546 "$ xns" : "Roo.bootstrap",
547 "String style" : "margin-top:15px;",
550 "String name" : "descript",
552 "string fieldLabel" : "Description:",
554 "$ xns" : "Roo.bootstrap",
555 "Number labelWidth" : 4
562 "String name" : "id",
564 "String inputType" : "hidden",
565 "$ xns" : "Roo.bootstrap"
569 "$ xns" : "Roo.bootstrap",
573 "String cls" : "text-center",
575 "$ xns" : "Roo.bootstrap",
576 "String style" : "margin-top:15px;",
580 "click" : "function (_self, e)\n{\n _this.detail_form.doAction('submit');\n}"
582 "String weight" : "default",
584 "$ xns" : "Roo.bootstrap",
585 "String html" : "<i class=\"fa fa-save\"></i> Save Changes"