Changed docs/json/roodata.jsondocs/src/Roo_HtmlEditorCore.js.htmldocs/src/Roo_form_Ht...
authorAlan Knowles <alan@roojs.com>
Wed, 28 Jul 2021 05:17:37 +0000 (13:17 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 28 Jul 2021 05:17:37 +0000 (13:17 +0800)
docs/json/roodata.json
docs/src/Roo_HtmlEditorCore.js.html
docs/src/Roo_form_HtmlEditor.js.html
docs/symbols/Roo.HtmlEditorCore.json
docs/symbols/Roo.form.HtmlEditor.json
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 368178f..fb34ff9 100644 (file)
         "desc" : "which property holds the element that used for  hide() / show() / disable() / enable()\ndefault is 'el' for forms you probably want to set this to fieldEl",
         "memberOf" : "Roo.Component"
       },
+      {
+        "name" : "allowComments",
+        "type" : "boolean",
+        "desc" : "- default false - allow comments in HTML source - by default they are stripped - if you are editing email you may need this.",
+        "memberOf" : ""
+      },
       {
         "name" : "allowDomMove",
         "type" : "Boolean",
         "desc" : "which property holds the element that used for  hide() / show() / disable() / enable()\ndefault is 'el' for forms you probably want to set this to fieldEl",
         "memberOf" : "Roo.Component"
       },
+      {
+        "name" : "allowComments",
+        "type" : "boolean",
+        "desc" : "- default false - allow comments in HTML source - by default they are stripped - if you are editing email you may need this.",
+        "memberOf" : ""
+      },
       {
         "name" : "allowDomMove",
         "type" : "Boolean",
index 41e1e51..db967c2 100644 (file)
      */
     </span><span class="jsdoc-var">stylesheets</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
 
+    </span><span class="jsdoc-comment">/**
+     * @cfg {boolean} allowComments - default false - allow comments in HTML source - by default they are stripped - if you are editing email you may need this.
+     */
+
+    </span><span class="jsdoc-var">allowComments</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
     </span><span class="jsdoc-comment">// id of frame..
     </span><span class="jsdoc-var">frameId</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
 
             </span><span class="jsdoc-comment">// clean up silly Windows -- stuff?
             </span><span class="jsdoc-keyword">return</span><span class="jsdoc-syntax">;
         }
-        </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">node.nodeName </span><span class="jsdoc-syntax">== </span><span class="jsdoc-string">&quot;#comment&quot;</span><span class="jsdoc-syntax">) {
+        </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">node.nodeName </span><span class="jsdoc-syntax">== </span><span class="jsdoc-string">&quot;#comment&quot; </span><span class="jsdoc-syntax">&amp;&amp; !</span><span class="jsdoc-var">this.allowComments</span><span class="jsdoc-syntax">) {
             </span><span class="jsdoc-var">node.parentNode.removeChild</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">node</span><span class="jsdoc-syntax">);
             </span><span class="jsdoc-comment">// clean up silly Windows -- stuff?
             </span><span class="jsdoc-keyword">return</span><span class="jsdoc-syntax">;
index c78be38..8d6ff55 100644 (file)
      * 
      */
     </span><span class="jsdoc-var">white</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
+    </span><span class="jsdoc-comment">/**
+     * @cfg {boolean} allowComments - default false - allow comments in HTML source - by default they are stripped - if you are editing email you may need this.
+     */
+    </span><span class="jsdoc-var">allowComments</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
 
     </span><span class="jsdoc-comment">// id of frame..
     </span><span class="jsdoc-var">frameId</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
index 0823e82..d2d1d91 100644 (file)
       "memberOf" : "Roo.util.Observable",
       "optvals" : []
     },
+    {
+      "name" : "allowComments",
+      "type" : "boolean",
+      "desc" : "- default false - allow comments in HTML source - by default they are stripped - if you are editing email you may need this.",
+      "memberOf" : "Roo.HtmlEditorCore",
+      "optvals" : []
+    },
     {
       "name" : "the",
       "type" : "Roo.form.HtmlEditor|Roo.bootstrap.HtmlEditor",
index 869e2ca..ce64d42 100644 (file)
       "optvals" : []
     },
     {
-      "name" : "listeners",
-      "type" : "Object",
-      "desc" : "list of events and functions to call for this object, \nFor example :\n<pre><code>\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  </code></pre>",
-      "memberOf" : "Roo.util.Observable",
-      "optvals" : []
+      "name" : "hideMode",
+      "type" : "String",
+      "desc" : "y)\nHow this component should hidden. Supported values are\n\"visibility\" (css visibility), \"offsets\" (negative offset position) and\n\"display\" (css display) - defaults to \"display\".",
+      "memberOf" : "Roo.Component",
+      "optvals" : [
+        "display",
+        "visibility"
+      ]
     },
     {
-      "name" : "fieldLabel",
-      "type" : "String",
-      "desc" : "Label to use when rendering a form.",
+      "name" : "disabled",
+      "type" : "Boolean",
+      "desc" : "True to disable the field (defaults to false).",
       "memberOf" : "Roo.form.Field",
       "optvals" : []
     },
     {
-      "name" : "validationDelay",
-      "type" : "Number",
-      "desc" : "The length of time in milliseconds after user input begins until validation is initiated (defaults to 250)",
+      "name" : "name",
+      "type" : "String",
+      "desc" : "The field's HTML name attribute.",
       "memberOf" : "Roo.form.Field",
       "optvals" : []
     },
     {
-      "name" : "msgTarget",
+      "name" : "resizable",
       "type" : "String",
-      "desc" : "The location where error text should display.  Should be one of the following values (defaults to 'qtip'):\n<pre>\nValue         Description\n-----------   ----------------------------------------------------------------------\nqtip          Display a quick tip when the user hovers over the field\ntitle         Display a default browser title attribute popup\nunder         Add a block div beneath the field containing the error text\nside          Add an error icon to the right of the field with a popup on hover\n[element id]  Add the error text directly to the innerHTML of the specified element\n</pre>",
-      "memberOf" : "Roo.form.Field",
+      "desc" : "'s' or 'se' or 'e' - wrapps the element in a\n                       Roo.resizable.",
+      "memberOf" : "Roo.form.HtmlEditor",
       "optvals" : []
     },
     {
-      "name" : "hideMode",
-      "type" : "String",
-      "desc" : "y)\nHow this component should hidden. Supported values are\n\"visibility\" (css visibility), \"offsets\" (negative offset position) and\n\"display\" (css display) - defaults to \"display\".",
-      "memberOf" : "Roo.Component",
-      "optvals" : [
-        "display",
-        "visibility"
-      ]
+      "name" : "toolbars",
+      "type" : "Array",
+      "desc" : "Array of toolbars. - defaults to just the Standard one",
+      "memberOf" : "Roo.form.HtmlEditor",
+      "optvals" : []
     },
     {
-      "name" : "disabled",
-      "type" : "Boolean",
-      "desc" : "True to disable the field (defaults to false).",
-      "memberOf" : "Roo.form.Field",
+      "name" : "width",
+      "type" : "Number",
+      "desc" : "(in pixels)",
+      "memberOf" : "Roo.form.HtmlEditor",
       "optvals" : []
     },
     {
-      "name" : "value",
-      "type" : "Mixed",
-      "desc" : "A value to initialize this field with.",
-      "memberOf" : "Roo.form.Field",
+      "name" : "allowComments",
+      "type" : "boolean",
+      "desc" : "- default false - allow comments in HTML source - by default they are stripped - if you are editing email you may need this.",
+      "memberOf" : "Roo.form.HtmlEditor",
       "optvals" : []
     },
     {
       "optvals" : []
     },
     {
-      "name" : "tabIndex",
+      "name" : "height",
       "type" : "Number",
-      "desc" : "The tabIndex for this field. Note this only applies to fields that are rendered, not those which are built via applyTo (defaults to undefined).",
-      "memberOf" : "Roo.form.Field",
+      "desc" : "(in pixels)",
+      "memberOf" : "Roo.form.HtmlEditor",
       "optvals" : []
     },
     {
-      "name" : "readOnly",
+      "name" : "clearUp",
       "type" : "Boolean",
-      "desc" : "True to mark the field as readOnly in HTML (defaults to false) -- Note: this only sets the element's readOnly DOM attribute.",
-      "memberOf" : "Roo.form.Field",
+      "desc" : "",
+      "memberOf" : "Roo.form.HtmlEditor",
       "optvals" : []
     },
     {
-      "name" : "cls",
-      "type" : "String",
-      "desc" : "A CSS class to apply to the field's underlying element.",
+      "name" : "value",
+      "type" : "Mixed",
+      "desc" : "A value to initialize this field with.",
       "memberOf" : "Roo.form.Field",
       "optvals" : []
     },
-    {
-      "name" : "toolbars",
-      "type" : "Array",
-      "desc" : "Array of toolbars. - defaults to just the Standard one",
-      "memberOf" : "Roo.form.HtmlEditor",
-      "optvals" : []
-    },
     {
       "name" : "actionMode",
       "type" : "String",
       "optvals" : []
     },
     {
-      "name" : "width",
-      "type" : "Number",
-      "desc" : "(in pixels)",
-      "memberOf" : "Roo.form.HtmlEditor",
+      "name" : "msgTarget",
+      "type" : "String",
+      "desc" : "The location where error text should display.  Should be one of the following values (defaults to 'qtip'):\n<pre>\nValue         Description\n-----------   ----------------------------------------------------------------------\nqtip          Display a quick tip when the user hovers over the field\ntitle         Display a default browser title attribute popup\nunder         Add a block div beneath the field containing the error text\nside          Add an error icon to the right of the field with a popup on hover\n[element id]  Add the error text directly to the innerHTML of the specified element\n</pre>",
+      "memberOf" : "Roo.form.Field",
       "optvals" : []
     },
     {
-      "name" : "resizable",
-      "type" : "String",
-      "desc" : "'s' or 'se' or 'e' - wrapps the element in a\n                       Roo.resizable.",
-      "memberOf" : "Roo.form.HtmlEditor",
+      "name" : "listeners",
+      "type" : "Object",
+      "desc" : "list of events and functions to call for this object, \nFor example :\n<pre><code>\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  </code></pre>",
+      "memberOf" : "Roo.util.Observable",
       "optvals" : []
     },
     {
-      "name" : "validationEvent",
-      "type" : "String/Boolean",
-      "desc" : "The event that should initiate field validation. Set to false to disable\n      automatic validation (defaults to \"keyup\").",
+      "name" : "readOnly",
+      "type" : "Boolean",
+      "desc" : "True to mark the field as readOnly in HTML (defaults to false) -- Note: this only sets the element's readOnly DOM attribute.",
       "memberOf" : "Roo.form.Field",
       "optvals" : []
     },
     {
-      "name" : "height",
-      "type" : "Number",
-      "desc" : "(in pixels)",
-      "memberOf" : "Roo.form.HtmlEditor",
+      "name" : "cls",
+      "type" : "String",
+      "desc" : "A CSS class to apply to the field's underlying element.",
+      "memberOf" : "Roo.form.Field",
       "optvals" : []
     },
     {
-      "name" : "name",
-      "type" : "String",
-      "desc" : "The field's HTML name attribute.",
+      "name" : "validationEvent",
+      "type" : "String/Boolean",
+      "desc" : "The event that should initiate field validation. Set to false to disable\n      automatic validation (defaults to \"keyup\").",
       "memberOf" : "Roo.form.Field",
       "optvals" : []
     },
     {
-      "name" : "qtip",
+      "name" : "fieldLabel",
       "type" : "String",
-      "desc" : "Mouse over tip",
+      "desc" : "Label to use when rendering a form.",
       "memberOf" : "Roo.form.Field",
       "optvals" : []
     },
       "memberOf" : "Roo.Component",
       "optvals" : []
     },
+    {
+      "name" : "validationDelay",
+      "type" : "Number",
+      "desc" : "The length of time in milliseconds after user input begins until validation is initiated (defaults to 250)",
+      "memberOf" : "Roo.form.Field",
+      "optvals" : []
+    },
     {
       "name" : "stylesheets",
       "type" : "Array",
       "memberOf" : "Roo.form.HtmlEditor",
       "optvals" : []
     },
+    {
+      "name" : "tabIndex",
+      "type" : "Number",
+      "desc" : "The tabIndex for this field. Note this only applies to fields that are rendered, not those which are built via applyTo (defaults to undefined).",
+      "memberOf" : "Roo.form.Field",
+      "optvals" : []
+    },
     {
       "name" : "blacklist",
       "type" : "Array",
       "optvals" : []
     },
     {
-      "name" : "clearUp",
-      "type" : "Boolean",
-      "desc" : "",
-      "memberOf" : "Roo.form.HtmlEditor",
+      "name" : "qtip",
+      "type" : "String",
+      "desc" : "Mouse over tip",
+      "memberOf" : "Roo.form.Field",
       "optvals" : []
     }
   ],
index 053261f..2a9d14f 100644 (file)
@@ -25609,6 +25609,11 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
      */
     stylesheets: false,
     
+    /**
+     * @cfg {boolean} allowComments - default false - allow comments in HTML source - by default they are stripped - if you are editing email you may need this.
+     */
+    
+    allowComments: false,
     // id of frame..
     frameId: false,
     
@@ -26522,7 +26527,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
             // clean up silly Windows -- stuff?
             return; 
         }
-        if (node.nodeName == "#comment") {
+        if (node.nodeName == "#comment" && !this.allowComments) {
             node.parentNode.removeChild(node);
             // clean up silly Windows -- stuff?
             return; 
index 22247fb..bcdd937 100644 (file)
@@ -1076,7 +1076,7 @@ this.errorMsg='';return true;},CharacterSetChecks:function(A){this.type=A;this.f
 break;}}}var E=0;for(var D=0;D<B.length;++D){if(B[D].fResult){++E;}}if(E<nb){return false;}return true;},ClientSideStrongPassword:function(A){return this.IsLongEnough(A,8)&&this.SpansEnoughCharacterSets(A,3);},ClientSideMediumPassword:function(A){return this.IsLongEnough(A,7)&&this.SpansEnoughCharacterSets(A,2);
 },ClientSideWeakPassword:function(A){return this.IsLongEnough(A,6)||!this.IsLongEnough(A,0);}})
 // Roo/HtmlEditorCore.js
-Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',getDocMarkup:function(){var st='';
+Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,allowComments:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',getDocMarkup:function(){var st='';
 if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);
 });}else if(!this.stylesheets.length){st='<style type="text/css">'+'body{border:0;margin:0;padding:3px;height:98%;cursor:text;}'+'</style>';}else{for(var i in this.stylesheets){st+='<link rel="stylesheet" href="'+this.stylesheets[i]+'" type="text/css">';}
 }st+='<style type="text/css">'+'IMG { cursor: pointer } '+'</style>';var A='roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return '<html><head>'+st+' </head><body contenteditable="true" data-enable-grammerly="true" class="'+A+'"></body></html>';
@@ -1114,7 +1114,7 @@ try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}var D=A.cloneRange();D.co
 },rangeCompareNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}A.collapse(true);C.collapse(true);var ss=A.compareBoundaryPoints(Range.START_TO_START,C);var ee=A.compareBoundaryPoints(Range.END_TO_END,C);
 var D=ss==1;var E=ee==-1;if(D&&E){return 0;}if(!D&&E){return 1;}if(D&&!E){return 2;}return 3;},cleanUpPaste:function(){Roo.log('cleanuppaste');this.cleanUpChildren(this.doc.body);var A=this.cleanWordChars(this.doc.body.innerHTML);if(A!=this.doc.body.innerHTML){this.doc.body.innerHTML=A;
 }},cleanWordChars:function(A){var he=Roo.HtmlEditorCore;var B=A;Roo.each(he.swapCodes,function(sw){var C=new RegExp("\\u"+sw[0].toString(16),"g");B=B.replace(C,sw[1]);});return B;},cleanUpChildren:function(n){if(!n.childNodes.length){return;}for(var i=n.childNodes.length-1;
-i>-1;i--){this.cleanUpChild(n.childNodes[i]);}},cleanUpChild:function(A){var ed=this;if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);return;}var B=A.tagName.toLowerCase();if(this.black.indexOf(B)>-1&&this.clearUp){A.parentNode.removeChild(A);
+i>-1;i--){this.cleanUpChild(n.childNodes[i]);}},cleanUpChild:function(A){var ed=this;if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"&&!this.allowComments){A.parentNode.removeChild(A);return;}var B=A.tagName.toLowerCase();if(this.black.indexOf(B)>-1&&this.clearUp){A.parentNode.removeChild(A);
 return;}var C=Roo.HtmlEditorCore.remove.indexOf(A.tagName.toLowerCase())>-1;if((!A.attributes||!A.attributes.length)&&B=='span'){C=true;}if(C){this.cleanUpChildren(A);while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);A.parentNode.insertBefore(cn,A);
 }A.parentNode.removeChild(A);return;}if(!A.attributes||!A.attributes.length){this.cleanUpChildren(A);return;}function cleanAttr(n,v){if(v.match(/^\./)||v.match(/^\//)){return;}if(v.match(/^(http|https):\/\//)||v.match(/^mailto:/)||v.match(/^ftp:/)){return;
 }if(v.match(/^#/)){return;}if(v.match(/^\{/)){return;}A.removeAttribute(n);}var D=this.cwhite;var E=this.cblack;function cleanStyle(n,v){if(v.match(/expression/)){A.removeAttribute(n);return;}var F=v.split(/;/);var G=[];Roo.each(F,function(p){p=p.replace(/^\s+/g,'').replace(/\s+$/g,'');