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 "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
16 "1a0ce561842e3caef9098f46ecaa1dcf" : "Add Images with Settings",
17 "7dce122004969d56ae2e0245cb754d35" : "Edit",
18 "78d0f5aac952e2ce840a381976a3b01e" : "Image Details",
19 "708ea0e601087e73c4764d5086e3ea3c" : "File Name:",
20 "e0a53da57dd79cca5d3b6a7c42e463ef" : "File Type:",
21 "3f986fa4066f6bded1376eb69de18da2" : "File Size:",
22 "d3d2e617335f08df83599665eef8a418" : "Close",
23 "84378f54966381befd040dafbdc221d6" : "<i class=\"fa fa-plus\"></i> Add into the email",
24 "361bacb1a72a350ee34e2f31a6a91dab" : "Alignment:",
25 "4d1c8263ba1036754f8db14a98f9f006" : "Reload",
26 "f48f7c7bccb5e29c83d87984c49ad8d4" : "Show image for this email",
27 "ed807858fcb68abdd180481f1fcba5c5" : "<i class=\"fa fa-trash\"></i> Delete",
28 "031fa343a28d221a25d2bcd942437174" : "Alternate Text:",
29 "48ccf48dcf2218a413ce473262f21a0c" : "Width: ",
30 "d0042a700e9bdf79689d63ee6846dc0e" : "Description:",
31 "15685a688679bfdd0f6d064f6d5375a4" : "<i class=\"fas fa-filter\"></i>",
32 "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
33 "d6d93f0d6b7c6018d8949e73ed6efb6c" : "<i class=\"fa fa-save\"></i> Save Changes",
34 "e933dc24fb245d863a43b4fefe9b45f5" : "Height:"
37 "align_fieldLabel" : "361bacb1a72a350ee34e2f31a6a91dab",
38 "filename_fieldLabel" : "708ea0e601087e73c4764d5086e3ea3c",
39 "add_html" : "84378f54966381befd040dafbdc221d6",
40 "created_fieldLabel" : "14834a16229091f47cf1810177d07916",
41 "height_fieldLabel" : "e933dc24fb245d863a43b4fefe9b45f5",
42 "mimetype_fieldLabel" : "e0a53da57dd79cca5d3b6a7c42e463ef",
43 "close_html" : "d3d2e617335f08df83599665eef8a418",
44 "imageUpload_fieldLabel" : "ef797d5638c2e1c6b6225b2247541ea5",
45 "width_fieldLabel" : "48ccf48dcf2218a413ce473262f21a0c",
46 "filesize_fieldLabel" : "3f986fa4066f6bded1376eb69de18da2",
47 "descript_fieldLabel" : "d0042a700e9bdf79689d63ee6846dc0e"
52 "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}"
54 "String cls" : "modal-body-enable-overflow-y pman-badmin-image-manager",
55 "Boolean fitwindow" : true,
57 "$ xns" : "Roo.bootstrap",
58 "String title" : "Image Manager",
62 "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}"
65 "$ xns" : "Roo.bootstrap",
66 "String html" : "Close",
67 "string weight" : "default",
68 "* prop" : "buttons[]",
69 "string name" : "close"
73 "$ xns" : "Roo.bootstrap",
77 "$ 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.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.showTypeBtn.isActive() ? _this.data.onid : 0);\n _this.form.doAction('submit');\n \n //_this.dialog.uploadProgress.defer(1000, _this.dialog);\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 "xtype" : "Container",
148 "$ xns" : "Roo.bootstrap",
152 "render" : "function (_self)\n{\n _this.toolbar = this;\n}"
155 "$ xns" : "Roo.bootstrap",
160 "$ xns" : "Roo.bootstrap",
164 "$ xns" : "Roo.bootstrap",
165 "String html" : "<i class=\"fas fa-filter\"></i>",
166 "String style" : "float:left;",
170 "$ xns" : "Roo.bootstrap",
175 "click" : "function (_self, e)\n{\n Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){\n _this.group_grid.store.load({});\n });\n}"
177 "Boolean preventDefault" : true,
178 "xtype" : "MenuItem",
179 "String fa" : "fa fa-plus",
180 "$ xns" : "Roo.bootstrap",
181 "Boolean isContainer" : false,
182 "String html" : "Add"
186 "click" : "function (_self, e)\n{\n var sel = _this.group_grid.getSelectionModel().getSelected();\n \n if(!sel){\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');\n return;\n }\n \n if(sel.data.id * 1 < 1){\n Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');\n return;\n }\n \n Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){\n _this.group_grid.store.load({});\n });\n}"
188 "Boolean preventDefault" : true,
189 "xtype" : "MenuItem",
190 "String fa" : "fa fa-pencil",
191 "$ xns" : "Roo.bootstrap",
192 "Boolean isContainer" : false,
193 "String html" : "Edit"
197 "click" : "function (_self, e)\n{\n var sel = _this.group_grid.getSelectionModel().getSelected();\n \n if(!sel){\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');\n return;\n }\n \n if(sel.data.id * 1 < 1){\n Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');\n return;\n }\n \n var deleteIt = function()\n {\n new Pman.Request({\n url: baseURL + '/Roo/Core_group',\n method: 'POST',\n params: {\n _delete : sel.data.id\n },\n success: function(res){\n _this.group_grid.store.load({});\n return;\n }\n });\n }\n \n Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {\n \n if(ret == 'no'){\n return;\n }\n \n deleteIt();\n \n }, this);\n \n \n}"
199 "Boolean preventDefault" : true,
200 "xtype" : "MenuItem",
201 "String fa" : "fa fa-trash",
202 "$ xns" : "Roo.bootstrap",
203 "Boolean isContainer" : false,
204 "String html" : "Delete"
208 "click" : "function (_self, e)\n{\n _this.group_grid.store.load({});\n}"
210 "Boolean preventDefault" : true,
211 "xtype" : "MenuItem",
212 "String fa" : "fa fa-refresh",
213 "$ xns" : "Roo.bootstrap",
214 "Boolean isContainer" : false,
215 "String html" : "Reload"
223 "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}",
224 "render" : "function (_self)\n{\n _this.showTypeBtn = this;\n}"
226 "bool pressed" : false,
228 "$ xns" : "Roo.bootstrap",
229 "String html" : "Show image for this email",
230 "String style" : "float:left;"
234 "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}",
235 "render" : "function (_self)\n{\n _this.searchBox = this;\n}"
238 "string placeholder" : "search for image",
239 "$ xns" : "Roo.bootstrap",
240 "String style" : "float:left; width: 300px; margin-left: 15px;",
244 "click" : "function (_self, e)\n{\n _this.masonry.clearAll();\n _this.masonry.load();\n}"
247 "$ xns" : "Roo.bootstrap",
248 "String html" : "<i class=\"fa fa-search\"></i>",
257 "String cls" : "text-right",
259 "$ xns" : "Roo.bootstrap",
263 "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}"
266 "$ xns" : "Roo.bootstrap",
267 "String html" : "<i class=\"fa fa-upload\"></i> Upload Image",
268 "string weight" : "primary"
272 "render" : "function (_self)\n{\n _this.deleteBtn = this;\n \n this.hide();\n}",
273 "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}"
275 "String weight" : "default",
277 "$ xns" : "Roo.bootstrap",
278 "String html" : "<i class=\"fa fa-trash\"></i> Delete",
279 "String style" : "margin-left: 15px;"
287 "render" : "function (_self)\n{\n _this.document_container = this;\n \n this.el.setStyle('overflow', 'auto');\n}"
290 "$ xns" : "Roo.bootstrap",
291 "String style" : "margin-top: 15px;",
296 "$ xns" : "Roo.bootstrap",
300 "render" : "function (_self)\n{\n _this.masonry = this;\n \n}"
302 "Boolean isLayoutInstant" : false,
303 "| 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}",
304 "Number boxWidth" : 250,
305 "xtype" : "LayoutMasonry",
306 "$ xns" : "Roo.bootstrap",
307 "string activeClass" : "active",
308 "Boolean isAutoInitial" : false
320 "$ xns" : "Roo.bootstrap",
325 "$ xns" : "Roo.bootstrap",
330 "$ xns" : "Roo.bootstrap",
334 "render" : "function (_self)\n{\n _this.setting_form = this;\n}"
336 "$ string url" : "baseURL + '/Roo/Images'\n",
338 "$ xns" : "Roo.bootstrap",
339 "Boolean loadMask" : true,
342 "String header" : "Add Images with Settings",
343 "$ String panel" : "'default'",
344 "xtype" : "Container",
345 "$ xns" : "Roo.bootstrap",
346 "String style" : "width: 100%;",
350 "$ xns" : "Roo.bootstrap",
355 "$ xns" : "Roo.bootstrap",
358 "String name" : "descript",
360 "string fieldLabel" : "Alternate Text:",
362 "$ xns" : "Roo.bootstrap",
363 "Number labelWidth" : 4
371 "$ xns" : "Roo.bootstrap",
376 "$ xns" : "Roo.bootstrap",
377 "String style" : "margin-top:15px;",
380 "String name" : "height",
382 "string fieldLabel" : "Height:",
384 "$ xns" : "Roo.bootstrap",
385 "Number labelWidth" : 4
393 "$ xns" : "Roo.bootstrap",
398 "$ xns" : "Roo.bootstrap",
399 "String style" : "margin-top:15px;",
402 "String name" : "width",
404 "string fieldLabel" : "Width: ",
406 "$ xns" : "Roo.bootstrap",
407 "Number labelWidth" : 4
415 "$ xns" : "Roo.bootstrap",
420 "$ xns" : "Roo.bootstrap",
421 "String style" : "margin-top:15px;",
424 "Boolean allowBlank" : true,
425 "Boolean selectOnFocus" : true,
426 "String name" : "align",
427 "String mode" : "local",
428 "String valueField" : "code",
429 "xtype" : "ComboBox",
430 "Boolean editable" : false,
431 "String triggerAction" : "all",
432 "string fieldLabel" : "Alignment:",
433 "Boolean alwaysQuery" : true,
435 "$ xns" : "Roo.bootstrap",
436 "Number labelWidth" : 4,
437 "String displayField" : "value",
438 "Boolean forceSelection" : true,
441 "$ Array fields" : "['code', 'value']",
442 "xtype" : "SimpleStore",
443 "$ xns" : "Roo.data",
445 "| Array data" : "[\n ['left', 'left'],\n ['right', 'right'],\n ['middle', 'middle'],\n ['top', 'top'],\n ['bottom', 'bottom']\n]"
455 "$ xns" : "Roo.bootstrap",
459 "String cls" : "text-center",
461 "$ xns" : "Roo.bootstrap",
462 "String style" : "margin-top:15px;",
466 "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}"
468 "String weight" : "default",
470 "$ xns" : "Roo.bootstrap",
471 "String html" : "<i class=\"fa fa-plus\"></i> Add into the email",
488 "$ xns" : "Roo.bootstrap",
493 "$ xns" : "Roo.bootstrap",
497 "render" : "function (_self)\n{\n _this.detail_form = this;\n}"
500 "$ xns" : "Roo.bootstrap",
501 "Boolean loadMask" : true,
502 "$ String url" : "baseURL + '/Roo/Images'",
505 "xtype" : "Container",
506 "string header" : "Image Details",
507 "$ xns" : "Roo.bootstrap",
508 "String style" : "width: 100%; padding: 0",
509 "$ string panel" : "'default'",
513 "$ xns" : "Roo.bootstrap",
518 "$ xns" : "Roo.bootstrap",
521 "String name" : "filename",
522 "style" : "padding: 0;",
524 "string fieldLabel" : "File Name:",
526 "Boolean disabled" : true,
527 "$ xns" : "Roo.bootstrap",
528 "Number labelWidth" : 4
536 "$ xns" : "Roo.bootstrap",
541 "$ xns" : "Roo.bootstrap",
542 "String style" : "margin-top:15px;",
545 "String name" : "mimetype",
547 "string fieldLabel" : "File Type:",
549 "Boolean disabled" : true,
550 "$ xns" : "Roo.bootstrap",
551 "Number labelWidth" : 4
559 "$ xns" : "Roo.bootstrap",
564 "$ xns" : "Roo.bootstrap",
565 "String style" : "margin-top:15px;",
568 "String name" : "filesize",
570 "string fieldLabel" : "File Size:",
572 "Boolean disabled" : true,
573 "$ xns" : "Roo.bootstrap",
574 "Number labelWidth" : 4
582 "$ xns" : "Roo.bootstrap",
587 "$ xns" : "Roo.bootstrap",
588 "String style" : "margin-top:15px;",
591 "String name" : "created",
593 "string fieldLabel" : "Created Date:",
595 "Boolean disabled" : true,
596 "$ xns" : "Roo.bootstrap",
597 "Number labelWidth" : 4
605 "$ xns" : "Roo.bootstrap",
610 "$ xns" : "Roo.bootstrap",
611 "String style" : "margin-top:15px;",
614 "String name" : "descript",
616 "string fieldLabel" : "Description:",
618 "$ xns" : "Roo.bootstrap",
619 "Number labelWidth" : 4
626 "String name" : "id",
628 "String inputType" : "hidden",
629 "$ xns" : "Roo.bootstrap"
633 "$ xns" : "Roo.bootstrap",
637 "String cls" : "text-center",
639 "$ xns" : "Roo.bootstrap",
640 "String style" : "margin-top:15px;",
644 "click" : "function (_self, e)\n{\n _this.detail_form.doAction('submit');\n}"
646 "String weight" : "default",
648 "$ xns" : "Roo.bootstrap",
649 "String html" : "<i class=\"fa fa-save\"></i> Save Changes"