BVB Source Codes

Pcook CMS bubble guest v3.0 SDCMS version Show main.js Source code

Return Download Pcook CMS bubble guest v3.0 SDCMS version: download main.js Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code - Type:.js
  1. var onloadOverrided = false;
  2.  
  3. function onload_new()
  4.   {
  5.   onload_original();  
  6.   setMozEdit();
  7.   }
  8.  
  9. function onload_original()
  10.   {
  11.   }  
  12.  
  13. function setMozEdit(idIframe)
  14.   {
  15.     if ((idIframe != null) && (idIframe!="")) {
  16.         try {document.getElementById(idIframe).contentDocument.designMode="on";} catch(e) {}
  17.     } else {
  18.         for (var i=0; i<oUtil.arrIframe.length; i++)
  19.         {
  20.         try {document.getElementById(oUtil.arrIframe[i]).contentDocument.designMode="on";} catch(e) {alert(e)}
  21.         }
  22.     }
  23.   }
  24.  
  25. function getHTMLBody(idIframe)
  26.         {
  27.     var oEditor=document.getElementById(idIframe).contentWindow;
  28.     sHTML=oEditor.document.body.innerHTML;
  29.     sHTML=String(sHTML).replace(/ contentEditable=true/g,"");
  30.     sHTML = String(sHTML).replace(/\<PARAM NAME=\"Play\" VALUE=\"0\">/ig,"<PARAM NAME=\"Play\" VALUE=\"-1\">");
  31.     return sHTML;
  32.         }
  33.  
  34. /*Insert custon HTML function*/
  35. function insertHTML(idIframe, sHTML)
  36.   {
  37.   var oEditor=document.getElementById(idIframe).contentWindow;
  38.   var oSel=oEditor.getSelection();
  39.   var range = oSel.getRangeAt(0);
  40.    
  41.   var docFrag = range.createContextualFragment(sHTML);
  42.   range.collapse(true);
  43.   var lastNode = docFrag.childNodes[docFrag.childNodes.length-1];
  44.   range.insertNode(docFrag);
  45.   try { oEditor.document.designMode="on"; } catch (e) {}
  46.   if (lastNode.nodeType==Node.TEXT_NODE)
  47.     {
  48.     range = oEditor.document.createRange();
  49.     range.setStart(lastNode, lastNode.nodeValue.length);
  50.     range.setEnd(lastNode, lastNode.nodeValue.length);
  51.     oSel = oEditor.getSelection();
  52.     oSel.removeAllRanges();
  53.     oSel.addRange(range);
  54.     }
  55.   }
  56.  
  57. function doCmd(idIframe,sCmd,sOption)
  58.         {
  59.     var oEditor=document.getElementById(idIframe).contentWindow;
  60.     oEditor.document.execCommand(sCmd,false,sOption);
  61.     }
  62.    
  63. function toggleViewSource(chk, idIframe) {
  64.     if (chk.checked) {
  65.         //view souce
  66.         viewSource(idIframe);
  67.     } else {
  68.         //wysiwyg mode
  69.         applySource(idIframe);
  70.     }
  71. }
  72.  
  73. function viewSource(idIframe) {
  74.     var oEditor=document.getElementById(idIframe).contentWindow;
  75.    
  76.     var sHTML="";
  77.     sHTML = oEditor.document.body.innerHTML;
  78.     sHTML = sHTML.replace(/>\s+</gi, "><"); //replace space between tag
  79.     sHTML = sHTML.replace(/\r/gi, ""); //replace space between tag
  80.     sHTML = sHTML.replace(/(<br>)\s+/gi, "$1"); //replace space between BR and text
  81.  
  82.     var docBody = oEditor.document.body;
  83.     docBody.innerHTML = "";
  84.     docBody.appendChild(oEditor.document.createTextNode(sHTML));
  85. }
  86.  
  87. function applySource(idIframe) {
  88.     var oEditor=document.getElementById(idIframe).contentWindow;
  89.    
  90.     var range = oEditor.document.body.ownerDocument.createRange();
  91.     range.selectNodeContents(oEditor.document.body);
  92.     oEditor.document.body.innerHTML = range.toString();
  93. }
  94.    
downloadmain.js Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code
Related Source Codes/Software:
Oo 126 CMS movie site system - This procedure ASP + ACC/ASP + SQL, using new kern... 2016-09-21
IDC sales web site - Beautiful IDC sales web site source code 2016-09-21
NPOINT virtual host v1.7.0 formal version management system - The system main function is introduced 2016-09-21
Classified information network business in suzhou - Overall module: classification of supply and deman... 2016-09-21
Jie Yang v0.6.3 article system - System functions: 1, the system settings A confi... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
C9 v2.1.1 static post system - Program USES ASP + ACC structure design and develo... 2016-09-21
Imitation green download station perfect version - Before increased | software home page, on the basi... 2016-09-21
Subdomain hosting edition v1.9 s taobao, pat - The background site admin 2016-09-21
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top