BVB Source Codes

Pcook CMS bubble guest v3.0 SDCMS version Show styles_cssText.htm Source code

Return Download Pcook CMS bubble guest v3.0 SDCMS version: download styles_cssText.htm Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code - Type:.htm
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <link href="../style/editor.css" rel="stylesheet" type="text/css">
  5. <script>
  6.   var sLangDir=window.opener.oUtil.langDir;
  7.   document.write("<scr"+"ipt src='../language/"+sLangDir+"/styles_cssText.js'></scr"+"ipt>");
  8. </script>
  9. <script>writeTitle()</script>
  10. <script>
  11. function doWindowFocus()
  12.     {  
  13.     window.opener.oUtil.onSelectionChanged=new Function("realTime()");
  14.     }
  15.    
  16. function bodyOnLoad()
  17.     {
  18.     var idPreview = document.getElementById("idPreview").contentWindow;
  19.    
  20.     window.onfocus=doWindowFocus;
  21.     window.opener.oUtil.onSelectionChanged=new Function("realTime()");
  22.  
  23.     var obj=window.opener.oUtil.obj;
  24.    
  25.     arrStyle = obj.arrStyle;
  26.     var sStyle=""
  27.     for(var i=0;i<arrStyle.length;i++)
  28.        {
  29.        sStyle+=arrStyle[i][0]+"{"+ arrStyle[i][3]+"}"+ "\n"
  30.        }          
  31.        
  32.    var sHTML="<HTML><HEAD><STYLE>"+sStyle+"</STYLE></HEAD><BODY margin-left=0 margin-top=0 margin-right=0 margin-bottom=0' id=idPreviewTarget></BODY></HTML>"
  33.     var oDoc=idPreview.document.open("text/html", "replace");
  34.     if(obj.publishingPath!="") oDoc.write("<BASE HREF=\""+obj.publishingPath+"\"/>" + sHTML);
  35.     else oDoc.write(sHTML);    
  36.     oDoc.close();
  37.            
  38.     realTime()
  39.     }
  40.    
  41. function realTime()
  42.     {
  43.     var idPreview = document.getElementById("idPreview").contentWindow;
  44.     var inpCssText = document.getElementById("inpCssText");
  45.     var inpClassName = document.getElementById("inpClassName");
  46.    
  47.     var oEditor=window.opener.oUtil.oEditor;
  48.     var oSel=oEditor.getSelection();
  49.     var isTextSel = window.opener.isTextSelected(oSel);
  50.    
  51.     var oElement;
  52.     if(window.opener.oUtil.activeElement)
  53.         oElement=window.opener.oUtil.activeElement
  54.     else
  55.         oElement = window.opener.getSelectedElement(oSel);
  56.      
  57.     var tagName=oElement.nodeName;
  58.    
  59.     if(tagName=="TD")
  60.         idPreview.document.getElementById("idPreviewTarget").innerHTML="<table caption='styles_cssText_internal_use'><tr>" + window.opener.getOuterHTML(oElement) + "</tr></table>"
  61.     else
  62.         idPreview.document.getElementById("idPreviewTarget").innerHTML=window.opener.getOuterHTML(oElement);
  63.  
  64.     inpCssText.value=oElement.style.cssText
  65.     inpClassName.value=oElement.className;
  66.     }
  67.        
  68. function doApply()
  69.     {
  70.    
  71.     var idPreview = document.getElementById("idPreview").contentWindow;
  72.     var inpCssText = document.getElementById("inpCssText");
  73.     var inpClassName = document.getElementById("inpClassName");    
  74.  
  75.     var oEditor=window.opener.oUtil.oEditor;
  76.     var oSel=oEditor.getSelection();
  77.  
  78.     var obj=window.opener.oUtil.obj;
  79.    
  80.     window.opener.oUtil.obj.saveForUndo();
  81.    
  82.     var oElement;
  83.     if(inpCssText.value=="" && inpClassName.value=="")//Selalu berarti me-remove style & class di CURRENT TAG!
  84.        {
  85.        oElement = window.opener.getSelectedElement(oSel);
  86.         if(oElement)
  87.             {
  88.             if(oElement.tagName!="BODY")
  89.                 {              
  90.                 oElement.removeAttribute("style");
  91.                 oElement.removeAttribute("class");
  92.  
  93.                 if(oElement.tagName=="FONT" && oElement.color=="" && oElement.face=="" && oElement.size=="" && oElement.id=="")
  94.                    obj.doCmd('RemoveFormat');
  95.                 }
  96.             else
  97.                 {
  98.                 alert(getTxt("You're selecting BODY element."));
  99.                 return;
  100.                 }
  101.             }
  102.         }  
  103.     else if(window.opener.oUtil.activeElement)
  104.         {
  105.         oElement=window.opener.oUtil.activeElement
  106.     if(oElement)
  107.       {
  108.             if(inpCssText.value=="") oElement.removeAttribute("style");
  109.             else oElement.style.cssText=inpCssText.value;
  110.                
  111.             if(inpClassName.value=="") oElement.removeAttribute("class");
  112.             else oElement.className=inpClassName.value;
  113.       }
  114.         }
  115.     else
  116.         {      
  117.     oElement=window.opener.getSelectedElement(oSel);
  118.     if (window.opener.isTextSelected(oSel))
  119.       {
  120.       if(oSel!="")
  121.         {
  122.         var idNewSpan=obj.applySpan();
  123.         if(idNewSpan)//if there is selected text
  124.           {
  125.           if(inpCssText.value=="") idNewSpan.removeAttribute("style");//jadi kalo CSS Text input dibuat empty, tetap akan melakukan remove
  126.           else idNewSpan.style.cssText=inpCssText.value;          
  127.                
  128.           if(inpClassName.value=="") idNewSpan.removeAttribute("class");
  129.           else idNewSpan.className=inpClassName.value;
  130.           }
  131.         }
  132.       else
  133.         {
  134.         if(oElement)
  135.         if(oElement.tagName!="BODY")
  136.           {
  137.           if(inpCssText.value=="") oElement.removeAttribute("style");
  138.           else oElement.style.cssText=inpCssText.value;
  139.                        
  140.           if(inpClassName.value=="") oElement.removeAttribute("class");
  141.           else oElement.className=inpClassName.value;
  142.           }
  143.         }
  144.       }
  145.     else
  146.       {
  147.       if(oElement)
  148.       if(oElement.tagName!="BODY")
  149.         {
  150.         if(inpCssText.value=="") oElement.removeAttribute("style");
  151.         else oElement.style.cssText=inpCssText.value;
  152.                      
  153.         if(inpClassName.value=="") oElement.removeAttribute("class");
  154.         else oElement.className=inpClassName.value;
  155.         }
  156.       }
  157.         }
  158.  
  159.     realTime()
  160.     }
  161.    
  162. function doCssTextChange()
  163.     {
  164.  
  165.     var idPreview = document.getElementById("idPreview").contentWindow;
  166.     var inpCssText = document.getElementById("inpCssText");
  167.     var inpClassName = document.getElementById("inpClassName");
  168.    
  169.     if(idPreview.document.getElementById("idPreviewTarget").innerHTML.substring(0,1)=="<")//means there is a tag for the style to be applied. Kalau tdk ada berarti BODY.
  170.        {
  171.        if(idPreview.document.getElementById("idPreviewTarget").innerHTML.substring(0,6)=="<TABLE")
  172.            {
  173.            if(idPreview.document.getElementById("idPreviewTarget").childNodes[0].caption=="styles_cssText_internal_use")
  174.                {//kalau yg di select text dalam table cell (TD)
  175.                idPreview.document.getElementById("idPreviewTarget").childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.cssText=inpCssText.value;
  176.                idPreview.document.getElementById("idPreviewTarget").childNodes[0].childNodes[0].childNodes[0].childNodes[0].className=inpClassName.value;
  177.                }
  178.            else
  179.                {//kalau yg di select TABLE
  180.                idPreview.document.getElementById("idPreviewTarget").childNodes[0].style.cssText=inpCssText.value;
  181.                idPreview.document.getElementById("idPreviewTarget").childNodes[0].className=inpClassName.value;
  182.                }
  183.            }
  184.        else
  185.            {
  186.            idPreview.document.getElementById("idPreviewTarget").childNodes[0].style.cssText=inpCssText.value;
  187.            idPreview.document.getElementById("idPreviewTarget").childNodes[0].className=inpClassName.value;
  188.            }
  189.        }
  190.    //else => BODY
  191.     //  idPreview.document.all.idPreviewTarget.style.cssText=inpCssText.value;      
  192.     }
  193. </script>
  194. </head>
  195. <body onload="loadTxt();bodyOnLoad()" style="overflow:hidden;">
  196.  
  197. <table width=100% height=100% align=center cellpadding=0 cellspacing=0>
  198. <tr>
  199. <td valign=top style="padding:5px;height:100%">
  200.     <table width=100%>
  201.     <tr>
  202.     <td nowrap>
  203.         <div style='font-family:Verdana;font-size:10px;padding-bottom:3'><b><span id=txtLang name=txtLang>CSS Text</span>:</b></div>
  204.         <textarea rows=8 style="width:100%;" id="inpCssText" name="inpCssText" onblur="doCssTextChange()" style="font-family:vardana;font-size:10px" class="inpTxt"></textarea>
  205.     </td>
  206.     </tr>
  207.     <tr>
  208.     <td nowrap>
  209.         <span style='font-family:Verdana;font-size:10px;'><b><span id=txtLang name=txtLang>Class Name</span>:</b></span>
  210.         <input type="text" name="inpClassName" id="inpClassName" onblur="doCssTextChange()" style="width:225" class="inpTxt">
  211.     </td>
  212.     </tr>
  213.     <tr>
  214.     <td nowrap style="padding-top:5px;padding-bottom:5px">
  215.         <iframe style="width:100%;height:75px;border:#d3d3d3 1px solid;background-color:#ffffff" name=idPreview id=idPreview></iframe>
  216.     </td>
  217.     </tr>
  218.     </table>    
  219. </td>
  220. </tr>
  221. <tr>
  222. <td class="dialogFooter" style="padding:13;padding-top:7;padding-bottom:7;" align="right">
  223.     <input type="button" name=btnCancel id=btnCancel value="cancel" onclick="self.close()" class="inpBtn" onmouseover="this.className='inpBtnOver';" onmouseout="this.className='inpBtnOut'">
  224.     <input type="button" name=btnApply id=btnApply value="apply" onclick="doApply();window.focus();" class="inpBtn" onmouseover="this.className='inpBtnOver';" onmouseout="this.className='inpBtnOut'">
  225.     <input type="button" name=btnOk id=btnOk value=" ok " onclick="doApply();self.close()" class="inpBtn" onmouseover="this.className='inpBtnOver';" onmouseout="this.className='inpBtnOut'">
  226. </td>
  227. </tr>
  228. </table>
  229.  
  230. </body>
  231. </html>
downloadstyles_cssText.htm 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