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 "53ab4599d0106e32d015649175a70d7b" : "<i class=\"fa fa-filter\"></i> Filter",
12 "37c1097cf82226d511586ecd99ed97cf" : "search for image",
13 "cdb6b6bab1fd18b9dbfe3fb84a5d34ae" : "<i class=\"fa fa-search\"></i>",
14 "5350277f16d9998c57fa7e1d17be2a76" : "<i class=\"fa fa-upload\"></i> Upload Image",
15 "14834a16229091f47cf1810177d07916" : "Created Date:",
16 "1a0ce561842e3caef9098f46ecaa1dcf" : "Add Images with Settings",
17 "78d0f5aac952e2ce840a381976a3b01e" : "Image Details",
18 "708ea0e601087e73c4764d5086e3ea3c" : "File Name:",
19 "e0a53da57dd79cca5d3b6a7c42e463ef" : "File Type:",
20 "3f986fa4066f6bded1376eb69de18da2" : "File Size:",
21 "179d4ab94c43ccb7cd6d2b3d82c7fe1f" : "Show images for this email",
22 "d3d2e617335f08df83599665eef8a418" : "Close",
23 "84378f54966381befd040dafbdc221d6" : "<i class=\"fa fa-plus\"></i> Add into the email",
24 "361bacb1a72a350ee34e2f31a6a91dab" : "Alignment:",
25 "2cd3a1900dd0060540b418b2a60f6eec" : "Show all images",
26 "ed807858fcb68abdd180481f1fcba5c5" : "<i class=\"fa fa-trash\"></i> Delete",
27 "031fa343a28d221a25d2bcd942437174" : "Alternate Text:",
28 "48ccf48dcf2218a413ce473262f21a0c" : "Width: ",
29 "d0042a700e9bdf79689d63ee6846dc0e" : "Description:",
30 "d6d93f0d6b7c6018d8949e73ed6efb6c" : "<i class=\"fa fa-save\"></i> Save Changes",
31 "e933dc24fb245d863a43b4fefe9b45f5" : "Height:"
34 "align_fieldLabel" : "361bacb1a72a350ee34e2f31a6a91dab",
35 "filename_fieldLabel" : "708ea0e601087e73c4764d5086e3ea3c",
36 "add_html" : "84378f54966381befd040dafbdc221d6",
37 "created_fieldLabel" : "14834a16229091f47cf1810177d07916",
38 "height_fieldLabel" : "e933dc24fb245d863a43b4fefe9b45f5",
39 "mimetype_fieldLabel" : "e0a53da57dd79cca5d3b6a7c42e463ef",
40 "close_html" : "d3d2e617335f08df83599665eef8a418",
41 "imageUpload_fieldLabel" : "ef797d5638c2e1c6b6225b2247541ea5",
42 "width_fieldLabel" : "48ccf48dcf2218a413ce473262f21a0c",
43 "filesize_fieldLabel" : "3f986fa4066f6bded1376eb69de18da2",
44 "descript_fieldLabel" : "d0042a700e9bdf79689d63ee6846dc0e"
49 "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}"
51 "String cls" : "modal-body-enable-overflow-y pman-badmin-image-manager",
52 "Boolean fitwindow" : true,
54 "$ xns" : "Roo.bootstrap",
55 "String title" : "Image Manager",
59 "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}"
62 "$ xns" : "Roo.bootstrap",
63 "String html" : "Close",
64 "string weight" : "default",
65 "* prop" : "buttons[]",
66 "string name" : "close"
70 "$ xns" : "Roo.bootstrap",
74 "render" : "function (_self)\n{\n _this.masonryBlock = this;\n}"
78 "$ xns" : "Roo.bootstrap",
82 "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}",
83 "actioncomplete" : "function(_self,action)\n{\n if (action.type == 'setdata') { \n \n _this.showType = 'public';\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",
84 "render" : "function (_self)\n{\n _this.form = this;\n \n}"
86 "style" : "display: none;",
88 "Number timeout" : 300,
89 "$ xns" : "Roo.bootstrap",
90 "Boolean fileUpload" : true,
91 "String method" : "POST",
92 "$ String url" : "baseURL + '/Roo/Images.php'",
96 "render" : "function (_self)\n{\n _this.uploadDL = this;\n \n _this.uploadDL.inputEl().on(\"change\",function(){\n \n _this.form.findField('onid').setValue((_this.showType == 'private') ? _this.data.onid : 0);\n _this.form.doAction('submit');\n });\n \n \n}"
98 "String name" : "imageUpload",
100 "string fieldLabel" : "Upload Image or File:",
101 "String inputType" : "file",
102 "$ xns" : "Roo.bootstrap",
103 "Number labelWidth" : 4
106 "String name" : "UPLOAD_IDENTIFIER",
108 "String inputType" : "hidden",
109 "$ xns" : "Roo.bootstrap"
112 "String name" : "post_max_size",
114 "String inputType" : "hidden",
115 "$ xns" : "Roo.bootstrap"
118 "String name" : "upload_max_filesize",
120 "String inputType" : "hidden",
121 "$ xns" : "Roo.bootstrap"
124 "String name" : "ontable",
126 "String inputType" : "hidden",
127 "$ xns" : "Roo.bootstrap"
130 "String name" : "onid",
132 "String inputType" : "hidden",
133 "$ xns" : "Roo.bootstrap"
136 "String name" : "id",
138 "String inputType" : "hidden",
139 "$ xns" : "Roo.bootstrap"
145 "render" : "function (_self)\n{\n _this.container = this;\n \n}"
147 "String cls" : "col-md-12",
148 "xtype" : "Container",
149 "$ xns" : "Roo.bootstrap",
153 "render" : "function (_self)\n{\n _this.toolbar = this;\n}"
156 "$ xns" : "Roo.bootstrap",
161 "$ xns" : "Roo.bootstrap",
166 "$ xns" : "Roo.bootstrap",
167 "String html" : "<i class=\"fa fa-filter\"></i> Filter",
171 "$ xns" : "Roo.bootstrap",
176 "click" : "function (_self, e)\n{\n _this.showType = 'private';\n \n _this.masonry.load();\n}"
178 "Boolean preventDefault" : true,
179 "xtype" : "MenuItem",
180 "$ xns" : "Roo.bootstrap",
181 "Boolean isContainer" : false,
182 "String html" : "Show images for this email"
186 "click" : "function (_self, e)\n{\n _this.showType = 'public';\n \n _this.masonry.load();\n}"
188 "Boolean preventDefault" : true,
189 "xtype" : "MenuItem",
190 "$ xns" : "Roo.bootstrap",
191 "Boolean isContainer" : false,
192 "String html" : "Show all images"
200 "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}",
201 "render" : "function (_self)\n{\n _this.searchBox = this;\n}"
204 "string placeholder" : "search for image",
205 "$ xns" : "Roo.bootstrap",
206 "String style" : "width: 200px; margin-left: 15px;display: inline-block; margin-bottom: 0px; vertical-align: middle;",
210 "click" : "function (_self, e)\n{\n _this.masonry.clearAll();\n _this.masonry.load();\n}"
213 "$ xns" : "Roo.bootstrap",
214 "String html" : "<i class=\"fa fa-search\"></i>",
223 "String cls" : "text-right",
225 "$ xns" : "Roo.bootstrap",
230 "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}"
232 "String size" : "sm",
234 "$ xns" : "Roo.bootstrap",
235 "String html" : "<i class=\"fa fa-upload\"></i> Upload Image",
236 "string weight" : "primary"
240 "render" : "function (_self)\n{\n _this.deleteBtn = this;\n \n this.hide();\n}",
241 "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}"
243 "String size" : "sm",
244 "String weight" : "default",
246 "$ xns" : "Roo.bootstrap",
247 "String html" : "<i class=\"fa fa-trash\"></i> Delete",
248 "String style" : "margin-left: 15px;"
256 "render" : "function (_self)\n{\n _this.document_container = this;\n \n this.el.setStyle('overflow', 'auto');\n}"
259 "$ xns" : "Roo.bootstrap",
260 "String style" : "margin-top: 15px;",
265 "$ xns" : "Roo.bootstrap",
269 "render" : "function (_self)\n{\n _this.masonry = this;\n \n}"
271 "Boolean isLayoutInstant" : false,
272 "| 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 var params = {\n ontable : 'core_email',\n 'search[filename]' : _this.searchBox.getValue()\n };\n \n if(_this.showType == 'private'){\n params.onid = _this.data.onid;\n }\n \n new Pman.Request({\n url: baseURL + '/Roo/Images',\n method: 'GET',\n params: params,\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 _this.masonryBlock.el.removeClass(['col-md-12','col-md-8']).addClass('col-md-12');\n \n if(!this.isSelected()){\n return;\n }\n \n _this.masonryBlock.el.removeClass(['col-md-12','col-md-8']).addClass('col-md-8');\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}",
273 "Number boxWidth" : 250,
274 "xtype" : "LayoutMasonry",
275 "$ xns" : "Roo.bootstrap",
276 "string activeClass" : "active",
277 "Boolean isAutoInitial" : false
290 "$ xns" : "Roo.bootstrap",
294 "$ xns" : "Roo.bootstrap",
299 "$ xns" : "Roo.bootstrap",
303 "render" : "function (_self)\n{\n _this.setting_form = this;\n}"
305 "$ string url" : "baseURL + '/Roo/Images'\n",
307 "$ xns" : "Roo.bootstrap",
308 "Boolean loadMask" : true,
311 "String header" : "Add Images with Settings",
312 "$ String panel" : "'default'",
313 "xtype" : "Container",
314 "$ xns" : "Roo.bootstrap",
315 "String style" : "width: 100%;",
319 "$ xns" : "Roo.bootstrap",
324 "$ xns" : "Roo.bootstrap",
327 "String name" : "descript",
329 "string fieldLabel" : "Alternate Text:",
331 "$ xns" : "Roo.bootstrap",
332 "Number labelWidth" : 4
340 "$ xns" : "Roo.bootstrap",
345 "$ xns" : "Roo.bootstrap",
346 "String style" : "margin-top:15px;",
349 "String name" : "height",
351 "string fieldLabel" : "Height:",
353 "$ xns" : "Roo.bootstrap",
354 "Number labelWidth" : 4
362 "$ xns" : "Roo.bootstrap",
367 "$ xns" : "Roo.bootstrap",
368 "String style" : "margin-top:15px;",
371 "String name" : "width",
373 "string fieldLabel" : "Width: ",
375 "$ xns" : "Roo.bootstrap",
376 "Number labelWidth" : 4
384 "$ xns" : "Roo.bootstrap",
389 "$ xns" : "Roo.bootstrap",
390 "String style" : "margin-top:15px;",
393 "Boolean allowBlank" : true,
394 "Boolean selectOnFocus" : true,
395 "String name" : "align",
396 "String mode" : "local",
397 "String valueField" : "code",
398 "xtype" : "ComboBox",
399 "Boolean editable" : false,
400 "String triggerAction" : "all",
401 "string fieldLabel" : "Alignment:",
402 "Boolean alwaysQuery" : true,
404 "$ xns" : "Roo.bootstrap",
405 "Number labelWidth" : 4,
406 "String displayField" : "value",
407 "Boolean forceSelection" : true,
410 "$ Array fields" : "['code', 'value']",
411 "xtype" : "SimpleStore",
412 "$ xns" : "Roo.data",
414 "| Array data" : "[\n ['left', 'left'],\n ['right', 'right'],\n ['middle', 'middle'],\n ['top', 'top'],\n ['bottom', 'bottom']\n]"
424 "$ xns" : "Roo.bootstrap",
428 "String cls" : "text-center",
430 "$ xns" : "Roo.bootstrap",
431 "String style" : "margin-top:15px;",
435 "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}"
437 "String weight" : "default",
439 "$ xns" : "Roo.bootstrap",
440 "String html" : "<i class=\"fa fa-plus\"></i> Add into the email",
457 "$ xns" : "Roo.bootstrap",
462 "$ xns" : "Roo.bootstrap",
466 "render" : "function (_self)\n{\n _this.detail_form = this;\n}"
469 "$ xns" : "Roo.bootstrap",
470 "Boolean loadMask" : true,
471 "$ String url" : "baseURL + '/Roo/Images'",
474 "xtype" : "Container",
475 "string header" : "Image Details",
476 "$ xns" : "Roo.bootstrap",
477 "String style" : "width: 100%; padding: 0",
478 "$ string panel" : "'default'",
482 "$ xns" : "Roo.bootstrap",
487 "$ xns" : "Roo.bootstrap",
490 "String name" : "filename",
491 "style" : "padding: 0;",
493 "string fieldLabel" : "File Name:",
495 "Boolean disabled" : true,
496 "$ xns" : "Roo.bootstrap",
497 "Number labelWidth" : 4
505 "$ xns" : "Roo.bootstrap",
510 "$ xns" : "Roo.bootstrap",
511 "String style" : "margin-top:15px;",
514 "String name" : "mimetype",
516 "string fieldLabel" : "File Type:",
518 "Boolean disabled" : true,
519 "$ xns" : "Roo.bootstrap",
520 "Number labelWidth" : 4
528 "$ xns" : "Roo.bootstrap",
533 "$ xns" : "Roo.bootstrap",
534 "String style" : "margin-top:15px;",
537 "String name" : "filesize",
539 "string fieldLabel" : "File Size:",
541 "Boolean disabled" : true,
542 "$ xns" : "Roo.bootstrap",
543 "Number labelWidth" : 4
551 "$ xns" : "Roo.bootstrap",
556 "$ xns" : "Roo.bootstrap",
557 "String style" : "margin-top:15px;",
560 "String name" : "created",
562 "string fieldLabel" : "Created Date:",
564 "Boolean disabled" : true,
565 "$ xns" : "Roo.bootstrap",
566 "Number labelWidth" : 4
574 "$ xns" : "Roo.bootstrap",
579 "$ xns" : "Roo.bootstrap",
580 "String style" : "margin-top:15px;",
583 "String name" : "descript",
585 "string fieldLabel" : "Description:",
587 "$ xns" : "Roo.bootstrap",
588 "Number labelWidth" : 4
595 "String name" : "id",
597 "String inputType" : "hidden",
598 "$ xns" : "Roo.bootstrap"
602 "$ xns" : "Roo.bootstrap",
606 "String cls" : "text-center",
608 "$ xns" : "Roo.bootstrap",
609 "String style" : "margin-top:15px;",
613 "click" : "function (_self, e)\n{\n _this.detail_form.doAction('submit');\n}"
615 "String weight" : "default",
617 "$ xns" : "Roo.bootstrap",
618 "String html" : "<i class=\"fa fa-save\"></i> Save Changes"