Pman.Dialog.CmsBlog.Old.bjs
authoredward <edward@roojs.com>
Tue, 19 Dec 2017 05:10:50 +0000 (13:10 +0800)
committeredward <edward@roojs.com>
Tue, 19 Dec 2017 05:10:50 +0000 (13:10 +0800)
Pman.Dialog.CmsBlog.Old.js

Pman.Dialog.CmsBlog.Old.bjs

index 071398a..e21389a 100644 (file)
       "render" : "function (_self)\n{\n  _this.cpanel = _self;\n}"
      },
      "autoScroll" : true,
-     "region" : "center",
      "fitToFrame" : true,
+     "region" : "center",
      "xtype" : "ContentPanel",
      "$ xns" : "Roo",
      "items" : [
             },
             {
              "hideLabels" : true,
-             "style" : "height:30px;overflow:hidden",
              "xtype" : "Row",
+             "style" : "height:30px;overflow:hidden",
              "labelWidth" : 0,
              "width" : 600,
              "$ xns" : "Roo.form",
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/core_enum.php'",
-                   "method" : "GET",
                    "xtype" : "HttpProxy",
+                   "method" : "GET",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
             },
             {
              "hideLabels" : true,
-             "style" : "height:30px;overflow:hidden",
              "xtype" : "Row",
+             "style" : "height:30px;overflow:hidden",
              "labelWidth" : 0,
              "width" : 540,
              "$ xns" : "Roo.form",
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/core_person'",
-               "method" : "GET",
                "xtype" : "HttpProxy",
+               "method" : "GET",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
               "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    o.params.page_type_id_name= 'CATEGORY';\n    // set more here\n}\n"
              },
              "xtype" : "Store",
-             "$ sortInfo" : "{ field: 'title', dir: 'ASC' }",
              "$ xns" : "Roo.data",
+             "$ sortInfo" : "{ field: 'title', dir: 'ASC' }",
              "* prop" : "store",
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/cms_page.php'",
-               "xtype" : "HttpProxy",
                "method" : "GET",
+               "xtype" : "HttpProxy",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/cms_page.php'",
-               "xtype" : "HttpProxy",
                "method" : "GET",
+               "xtype" : "HttpProxy",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
            "name" : "target_url"
           },
           {
+           "alwaysQuery" : true,
            "listWidth" : 400,
            "$ tpl" : "'<div class=\"x-grid-cell-text x-btn button\"><b>{template_clean}</b></div>'\n",
-           "alwaysQuery" : true,
            "triggerAction" : "all",
            "fieldLabel" : "Layout",
            "forceSelection" : true,
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/Cms_template'",
-               "xtype" : "HttpProxy",
                "method" : "GET",
+               "xtype" : "HttpProxy",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/Cms_template_element'",
-               "xtype" : "HttpProxy",
                "method" : "GET",
+               "xtype" : "HttpProxy",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/cms_page.php'",
-               "xtype" : "HttpProxy",
                "method" : "GET",
+               "xtype" : "HttpProxy",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
                 "beforequery" : "function (combo, query, forceAll, cancel, e)\n{\n \n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save Document First before adding images\");\n        return false;\n    }\n}",
                 "select" : "function (combo, record, index)\n{\n    Roo.log(record);\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n    \n    var editor = _this.form.findField('body').editorcore;\n    \n    var curnode = editor.getSelectedNode();\n    \n    if (curnode && curnode.tagName == 'IMG') {\n        curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',\n                baseURL,  record.data.id, record.data.filename\n            );\n            // note -forces an update... hopefully...\n        editor.owner.fireEvent('editorevent', editor, false);\n    } else {\n    \n        editor.insertAtCursor(\n            String.format('<img src=\"{0}/Images/{1}/{2}#attachment-{1}\">',\n            baseURL,  record.data.id, record.data.filename\n            )\n        );\n\n    }\n    \n}"
                },
+               "alwaysQuery" : true,
                "listWidth" : 400,
                "$ tpl" : "'<div class=\"x-grid-cell-text x-btn button\"><img src=\"' + baseURL + '/Images/Thumb/150x150/{id}.jpg\" height=\"150\" width=\"150\"><b>{filename}</b> </div>'",
-               "alwaysQuery" : true,
                "triggerAction" : "all",
                "fieldLabel" : "Images",
                "forceSelection" : true,
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/Images.php'",
-                   "method" : "GET",
                    "xtype" : "HttpProxy",
+                   "method" : "GET",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/cms_page.php'",
-                   "xtype" : "HttpProxy",
                    "method" : "GET",
+                   "xtype" : "HttpProxy",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/Images.php'",
-                   "method" : "GET",
                    "xtype" : "HttpProxy",
+                   "method" : "GET",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/cms_page.php'",
-                   "xtype" : "HttpProxy",
                    "method" : "GET",
+                   "xtype" : "HttpProxy",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
             },
             {
              "xtype" : "ToolbarContext",
-             "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}",
              "$ xns" : "Roo.form.HtmlEditor",
+             "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}",
              "* prop" : "toolbars[]"
             }
            ]
             "render" : "function (_self)\n{\n    _this.interests = _self;\n    /*\n    _self.combo.addicon.setStyle( {\n        position : 'absolute',\n        right: '9px',\n        top : '2px',\n        float : 'left'\n    });\n    */\n}"
            },
            "fieldLabel" : "Interests",
-           "hiddenName" : "interest",
            "xtype" : "ComboBoxArray",
+           "hiddenName" : "interest",
            "width" : 300,
            "$ xns" : "Roo.form",
            "name" : "interest_name",
                "items" : [
                 {
                  "$ url" : "baseURL + '/Roo/Core_enum.php'",
-                 "xtype" : "HttpProxy",
                  "method" : "GET",
+                 "xtype" : "HttpProxy",
                  "$ xns" : "Roo.data",
                  "* prop" : "proxy"
                 },
      "listeners" : {
       "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
      },
+     "fitToframe" : true,
      "background" : false,
      "region" : "east",
-     "fitToframe" : true,
      "title" : "Images / Attachments",
      "xtype" : "GridPanel",
      "fitContainer" : true,
          "items" : [
           {
            "$ url" : "baseURL + '/Roo/Images.php'",
-           "xtype" : "HttpProxy",
            "method" : "GET",
+           "xtype" : "HttpProxy",
            "$ xns" : "Roo.data",
            "* prop" : "proxy"
           },
         },
         {
          "xtype" : "ColumnModel",
-         "header" : "Filename",
          "width" : 100,
+         "header" : "Filename",
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "header" : "Order",
          "width" : 50,
+         "header" : "Order",
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
               "focus" : "function (_self)\n{\n    if (this.value == 0) {\n        this.el.dom.value = '';\n    }\n}"
              },
              "xtype" : "NumberField",
-             "decimalPrecision" : 0,
              "$ xns" : "Roo.form",
+             "decimalPrecision" : 0,
              "* prop" : "field"
             }
            ]
         },
         {
          "xtype" : "ColumnModel",
-         "header" : "Title",
          "width" : 100,
+         "header" : "Title",
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "header" : "URL",
          "width" : 300,
+         "header" : "URL",
          "$ renderer" : "function(v)\n{\n    return String.format('{0}', (v) ? v : '');\n}",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
       "render" : "function (_self)\n{\n  _this.trpanel = _self;\n}"
      },
      "autoScroll" : true,
-     "region" : "west",
      "fitToFrame" : true,
+     "region" : "west",
      "xtype" : "ContentPanel",
      "$ xns" : "Roo",
      "items" : [
                "items" : [
                 {
                  "$ url" : "baseURL + '/Roo/Cms_page.php'",
-                 "xtype" : "HttpProxy",
                  "method" : "GET",
+                 "xtype" : "HttpProxy",
                  "$ xns" : "Roo.data",
                  "* prop" : "proxy"
                 },
                 "beforequery" : "function (combo, query, forceAll, cancel, e)\n{\n \n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save press release first\");\n        return false;\n    }\n}",
                 "select" : "function (combo, record, index)\n{\n    Roo.log(record);\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n    \n    var editor = _this.trform.findField('body').editorcore;\n    \n    var curnode = editor.getSelectedNode();\n    \n    if (curnode && curnode.tagName == 'IMG') {\n        curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',\n                baseURL,  record.data.id, record.data.filename\n            );\n            // note -forces an update... hopefully...\n        editor.owner.fireEvent('editorevent', editor, false);\n    } else {\n    \n        editor.insertAtCursor(\n            String.format('<img src=\"{0}/Images/{1}/{2}#attachment-{1}\">',\n            baseURL,  record.data.id, record.data.filename\n            )\n        );\n\n    }\n    \n}"
                },
+               "alwaysQuery" : true,
                "listWidth" : 400,
                "$ tpl" : "'<div class=\"x-grid-cell-text x-btn button\"><img src=\"' + baseURL + '/Images/Thumb/150x150/{id}.jpg\" height=\"150\" width=\"150\"><b>{filename}</b> </div>'",
-               "alwaysQuery" : true,
                "triggerAction" : "all",
                "fieldLabel" : "Images",
                "forceSelection" : true,
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/Images.php'",
-                   "method" : "GET",
                    "xtype" : "HttpProxy",
+                   "method" : "GET",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/cms_page.php'",
-                   "xtype" : "HttpProxy",
                    "method" : "GET",
+                   "xtype" : "HttpProxy",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
             },
             {
              "xtype" : "ToolbarContext",
-             "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}",
              "$ xns" : "Roo.form.HtmlEditor",
+             "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}",
              "* prop" : "toolbars[]"
             }
            ]