BVB Source Codes

Jie Yang v0.6.3 article system Show fck_paste.html Source code

Return Download Jie Yang v0.6.3 article system: download fck_paste.html Source code - Download Jie Yang v0.6.3 article system Source code - Type:.html
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <!--
  3. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  4. * Copyright (C) 2003-2008 Frederico Caldeira Knabben
  5. *
  6. * == BEGIN LICENSE ==
  7. *
  8. * Licensed under the terms of any of the following licenses at your
  9. * choice:
  10. *
  11. *  - GNU General Public License Version 2 or later (the "GPL")
  12. *    http://www.gnu.org/licenses/gpl.html
  13. *
  14. *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  15. *    http://www.gnu.org/licenses/lgpl.html
  16. *
  17. *  - Mozilla Public License Version 1.1 or later (the "MPL")
  18. *    http://www.mozilla.org/MPL/MPL-1.1.html
  19. *
  20. * == END LICENSE ==
  21. *
  22. * This dialog is shown when, for some reason (usually security settings),
  23. * the user is not able to paste data from the clipboard to the editor using
  24. * the toolbar buttons or the context menu.
  25. -->
  26. <html xmlns="http://www.w3.org/1999/xhtml">
  27. <head>
  28.         <title></title>
  29.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  30.         <meta name="robots" content="noindex, nofollow" />
  31.         <script src="common/fck_dialog_common.js" type="text/javascript"></script>
  32.         <script type="text/javascript">
  33. var dialog = window.parent ;
  34. var oEditor = dialog.InnerDialogLoaded() ;
  35. var FCK = oEditor.FCK;
  36. var FCKTools    = oEditor.FCKTools ;
  37. var FCKConfig   = oEditor.FCKConfig ;
  38. var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
  39.  
  40. window.onload = function ()
  41. {
  42.         // First of all, translate the dialog box texts
  43.         oEditor.FCKLanguageManager.TranslatePage(document) ;
  44.  
  45.         var sPastingType = dialog.Args().CustomValue ;
  46.  
  47.         if ( sPastingType == 'Word' || sPastingType == 'Security' )
  48.         {
  49.                 if ( sPastingType == 'Security' )
  50.                         document.getElementById( 'xSecurityMsg' ).style.display = '' ;
  51.  
  52.                 // For document.domain compatibility (#123) we must do all the magic in
  53.                 // the URL for IE.
  54.                 var sFrameUrl = !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE ?
  55.                         'javascript:void(0)' :
  56.                         'javascript:void( (function(){' +
  57.                                 'document.open() ;' +
  58.                                 'document.domain=\'' + document.domain + '\' ;' +
  59.                                 'document.write(\'<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>\') ;' +
  60.                                 'document.close() ;' +
  61.                                 'document.body.contentEditable = true ;' +
  62.                                 'window.focus() ;' +
  63.                                 '})() )' ;
  64.  
  65.                 var eFrameSpace = document.getElementById( 'xFrameSpace' ) ;
  66.                 eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' +
  67.                                         'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"></iframe>' ;
  68.  
  69.                 var oFrame = eFrameSpace.firstChild ;
  70.  
  71.                 if ( !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE )
  72.                 {
  73.                         // Avoid errors if the pasted content has any script that fails: #389
  74.                         var oDoc = oFrame.contentWindow.document ;
  75.                         oDoc.open() ;
  76.                         oDoc.write('<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>') ;
  77.                         oDoc.close() ;
  78.  
  79.                         if ( FCKBrowserInfo.IsIE )
  80.                                 oDoc.body.contentEditable = true ;
  81.                         else
  82.                                 oDoc.designMode = 'on' ;
  83.  
  84.                         oFrame.contentWindow.focus();
  85.                 }
  86.         }
  87.         else
  88.         {
  89.                 document.getElementById('txtData').style.display = '' ;
  90.         }
  91.  
  92.         if ( sPastingType != 'Word' )
  93.                 document.getElementById('oWordCommands').style.display = 'none' ;
  94.  
  95.         dialog.SetOkButton( true ) ;
  96.         dialog.SetAutoSize( true ) ;
  97. }
  98.  
  99. function Ok()
  100. {
  101.         // Before doing anything, save undo snapshot.
  102.         oEditor.FCKUndo.SaveUndoStep() ;
  103.  
  104.         var sHtml ;
  105.  
  106.         var sPastingType = dialog.Args().CustomValue ;
  107.  
  108.         if ( sPastingType == 'Word' || sPastingType == 'Security' )
  109.         {
  110.                 var oFrame = document.getElementById('frmData') ;
  111.                 var oBody ;
  112.  
  113.                 if ( oFrame.contentDocument )
  114.                         oBody = oFrame.contentDocument.body ;
  115.                 else
  116.                         oBody = oFrame.contentWindow.document.body ;
  117.  
  118.                 if ( sPastingType == 'Word' )
  119.                 {
  120.                         // If a plugin creates a FCK.CustomCleanWord function it will be called instead of the default one
  121.                         if ( typeof( FCK.CustomCleanWord ) == 'function' )
  122.                                 sHtml = FCK.CustomCleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
  123.                         else
  124.                                 sHtml = CleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
  125.                 }
  126.                 else
  127.                         sHtml = oBody.innerHTML ;
  128.  
  129.                 // Fix relative anchor URLs (IE automatically adds the current page URL).
  130.                 var re = new RegExp( window.location + "#", "g" ) ;
  131.                 sHtml = sHtml.replace( re, '#') ;
  132.         }
  133.         else
  134.         {
  135.                 sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value )  ;
  136.                 sHtml = FCKTools.ProcessLineBreaks( oEditor, FCKConfig, sHtml ) ;
  137.  
  138.                 // FCK.InsertHtml() does not work for us, since document fragments cannot contain node fragments. :(
  139.                 // Use the marker method instead. It's primitive, but it works.
  140.                 var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
  141.                 var oDoc = oEditor.FCK.EditorDocument ;
  142.                 dialog.Selection.EnsureSelection() ;
  143.                 range.MoveToSelection() ;
  144.                 range.DeleteContents() ;
  145.                 var marker = [] ;
  146.                 for ( var i = 0 ; i < 5 ; i++ )
  147.                         marker.push( parseInt(Math.random() * 100000, 10 ) ) ;
  148.                 marker = marker.join( "" ) ;
  149.                 range.InsertNode ( oDoc.createTextNode( marker ) ) ;
  150.                 var bookmark = range.CreateBookmark() ;
  151.  
  152.                 // Now we've got a marker indicating the paste position in the editor document.
  153.                 // Find its position in the HTML code.
  154.                 var htmlString = oDoc.body.innerHTML ;
  155.                 var index = htmlString.indexOf( marker ) ;
  156.                 // Split it the HTML code up, add the code we generated, and put them back together.
  157.                 var htmlList = [] ;
  158.                 htmlList.push( htmlString.substr( 0, index ) ) ;
  159.                 htmlList.push( sHtml ) ;
  160.                 htmlList.push( htmlString.substr( index + marker.length ) ) ;
  161.                 htmlString = htmlList.join( "" ) ;
  162.                 if ( oEditor.FCKBrowserInfo.IsIE )
  163.                         oEditor.FCK.SetInnerHtml( htmlString ) ;
  164.                 else
  165.                         oDoc.body.innerHTML = htmlString ;
  166.                 range.MoveToBookmark( bookmark ) ;
  167.                 range.Collapse( false ) ;
  168.                 range.Select() ;
  169.                 range.Release() ;
  170.                 return true ;
  171.         }
  172.         oEditor.FCK.InsertHtml( sHtml ) ;
  173.         return true ;
  174. }
  175. // This function will be called from the PasteFromWord dialog (fck_paste.html)
  176. // Input: oNode a DOM node that contains the raw paste from the clipboard
  177. // bIgnoreFont, bRemoveStyles booleans according to the values set in the dialog
  178. // Output: the cleaned string
  179. function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
  180. {
  181.         var html = oNode.innerHTML ;
  182.         html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
  183.         html = html.replace(/<o:p>.*?<\/o:p>/g, '&nbsp;') ;
  184.  
  185.         // Remove mso-xxx styles.
  186.         html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
  187.  
  188.         // Remove margin styles.
  189.         html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
  190.         html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
  191.  
  192.         html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
  193.         html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
  194.  
  195.         html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
  196.  
  197.         html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
  198.  
  199.         html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
  200.  
  201.         html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
  202.         html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
  203.  
  204.         // Remove FONT face attributes.
  205.         if ( bIgnoreFont )
  206.         {
  207.                 html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
  208.                 html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
  209.  
  210.                 html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
  211.         }
  212.  
  213.         // Remove Class attributes
  214.         html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
  215.         // Remove styles.
  216.         if ( bRemoveStyles )
  217.                 html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
  218.         // Remove empty styles.
  219.         html =  html.replace( /\s*style="\s*"/gi, '' ) ;
  220.         html = html.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ;
  221.  
  222.         html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
  223.  
  224.         // Remove Lang attributes
  225.         html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
  226.         html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ;
  227.  
  228.         html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ;
  229.  
  230.         // Remove XML elements and declarations
  231.         html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
  232.  
  233.         // Remove Tags with XML namespace declarations: <o:p><\/o:p>
  234.         html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
  235.  
  236.         // Remove comments [SF BUG-1481861].
  237.         html = html.replace(/<\!--.*?-->/g, '' ) ;
  238.  
  239.         html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
  240.  
  241.         html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
  242.  
  243.         // Remove "display:none" tags.
  244.         html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none(.*?)<\/\1>/ig, '' ) ;
  245.  
  246.         // Remove language tags
  247.         html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
  248.         // Remove onmouseover and onmouseout events (from MS Word comments effect)
  249.         html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3") ;
  250.         html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3") ;
  251.         if ( FCKConfig.CleanWordKeepsStructure )
  252.         {
  253.                 // The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px">
  254.                 html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
  255.  
  256.                 // Word likes to insert extra <font> tags, when using MSIE. (Wierd).
  257.                 html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
  258.                 html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
  259.         }
  260.         else
  261.         {
  262.                 html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
  263.                 html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
  264.                 html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
  265.                 html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
  266.                 html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
  267.                 html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
  268.  
  269.                 html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
  270.  
  271.                 // Transform <P> to <DIV>
  272.                 var re = new RegExp( '(<P)([^>]*>.*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error
  273.                 html = html.replace( re, '<div$2<\/div>' ) ;
  274.  
  275.                 // Remove empty tags (three times, just to be sure).
  276.                 // This also removes any empty anchor
  277.                 html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
  278.                 html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
  279.                 html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
  280.         }
  281.  
  282.         return html ;
  283. }
  284.  
  285.         </script>
  286.  
  287. </head>
  288. <body style="overflow: hidden">
  289.         <table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 98%">
  290.                 <tr>
  291.                         <td>
  292.                                 <div id="xSecurityMsg" style="display: none">
  293.                                         <span fcklang="DlgPasteSec">Because of your browser security settings,
  294.                                                 the editor is not able to access your clipboard data directly. You are required
  295.                                                 to paste it again in this window.</span><br />
  296.                                         &nbsp;
  297.                                 </div>
  298.                                 <div>
  299.                                         <span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard
  300.                                                 (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span><br />
  301.                                         &nbsp;
  302.                                 </div>
  303.                         </td>
  304.                 </tr>
  305.                 <tr>
  306.                         <td id="xFrameSpace" valign="top" height="100%" style="border: #000000 1px solid">
  307.                                 <textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none;
  308.                                         width: 99%; height: 98%"></textarea>
  309.                         </td>
  310.                 </tr>
  311.                 <tr id="oWordCommands">
  312.                         <td>
  313.  
  314.                                         <input id="chkRemoveFont" type="checkbox" checked="checked" />
  315.                                         <label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont">
  316.                                                 Ignore Font Face definitions</label>
  317.                                         <br />
  318.                                         <input id="chkRemoveStyles" type="checkbox" />
  319.                                         <label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles">
  320.                                                 Remove Styles definitions</label>
  321.  
  322.                         </td>
  323.                 </tr>
  324.         </table>
  325. </body>
  326. </html>
  327.  
downloadfck_paste.html Source code - Download Jie Yang v0.6.3 article system Source code
Related Source Codes/Software:
Jilin classification information release system v5.0 trial version - A ready-made classifieds site publishing system, h... 2016-09-21
Linyi CMS v6.5 market classification information - A. supply and demand information function: informa... 2016-09-21
Tesco discount net SQL version - And presentations, faster. 2016-09-21
- electronic enterprise website management system In a fully functional version - Super suitable for enterprise agents build a corpo... 2016-09-21
Rio mesh network hard disk system v3.0 - System functions: 1, increase the progress of Asp... 2016-09-21
Classified information network business in suzhou - Overall module: classification of supply and deman... 2016-09-21
NPOINT virtual host v1.7.0 formal version management system - The system main function is introduced 2016-09-21
IDC sales web site - Beautiful IDC sales web site source code 2016-09-21
Oo 126 CMS movie site system - This procedure ASP + ACC/ASP + SQL, using new kern... 2016-09-21
Pcook CMS bubble guest v3.0 SDCMS version - Developed by Asp+Access, and meet the needs of sma... 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