[ Index ] |
|
Code source de GeekLog 1.4.1 |
1 /* 2 * FCKeditor - The text editor for internet 3 * Copyright (C) 2003-2006 Frederico Caldeira Knabben 4 * 5 * Licensed under the terms of the GNU Lesser General Public License: 6 * http://www.opensource.org/licenses/lgpl-license.php 7 * 8 * For further information visit: 9 * http://www.fckeditor.net/ 10 * 11 * "Support Open Source software. What about a donation today?" 12 * 13 * File Name: fckregexlib.js 14 * These are some Regular Expresions used by the editor. 15 * 16 * File Authors: 17 * Frederico Caldeira Knabben (fredck@fckeditor.net) 18 */ 19 20 var FCKRegexLib = new Object() ; 21 22 // This is the Regular expression used by the SetHTML method for the "'" entity. 23 FCKRegexLib.AposEntity = /'/gi ; 24 25 // Used by the Styles combo to identify styles that can't be applied to text. 26 FCKRegexLib.ObjectElements = /^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i ; 27 28 // START iCM MODIFICATIONS 29 // Added TABLE and CAPTION to the block elements for ENTER key handling 30 // Block Elements. 31 /* 32 FCKRegexLib.BlockElements = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TABLE|CAPTION)$/i ; 33 */ 34 // END iCM MODIFICATIONS 35 FCKRegexLib.BlockElements = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TH)$/i ; 36 37 // Elements marked as empty "Empty" in the XHTML DTD. 38 FCKRegexLib.EmptyElements = /^(?:BASE|META|LINK|HR|BR|PARAM|IMG|AREA|INPUT)$/i ; 39 40 // List all named commands (commands that can be interpreted by the browser "execCommand" method. 41 FCKRegexLib.NamedCommands = /^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i ; 42 43 FCKRegexLib.BodyContents = /([\s\S]*\<body[^\>]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i ; 44 45 // Temporary text used to solve some browser specific limitations. 46 FCKRegexLib.ToReplace = /___fcktoreplace:([\w]+)/ig ; 47 48 // Get the META http-equiv attribute from the tag. 49 FCKRegexLib.MetaHttpEquiv = /http-equiv\s*=\s*["']?([^"' ]+)/i ; 50 51 FCKRegexLib.HasBaseTag = /<base /i ; 52 53 FCKRegexLib.HeadOpener = /<head\s?[^>]*>/i ; 54 FCKRegexLib.HeadCloser = /<\/head\s*>/i ; 55 56 FCKRegexLib.TableBorderClass = /\s*FCK__ShowTableBorders\s*/ ; 57 58 // Validate element names. 59 FCKRegexLib.ElementName = /(^[A-Za-z_:][\w.\-:]*\w$)|(^[A-Za-z_]$)/ ; 60 61 // Used in conjuction with the FCKConfig.ForceSimpleAmpersand configuration option. 62 FCKRegexLib.ForceSimpleAmpersand = /___FCKAmp___/g ; 63 64 // Get the closing parts of the tags with no closing tags, like <br/>... gets the "/>" part. 65 FCKRegexLib.SpaceNoClose = /\/>/g ; 66 67 FCKRegexLib.EmptyParagraph = /^<(p|div)>\s*<\/\1>$/i ; 68 69 FCKRegexLib.TagBody = /></ ; 70 71 // START iCM MODIFICATIONS 72 /* 73 // HTML table cell elements 74 FCKRegexLib.TableCellElements = /^(?:TD|TH)$/i ; 75 // Block elements that can themselves contain block elements - used within the FCKTools.SplitNode 76 // function. I know BODY isn't really a block element but means can do the check in one hit. 77 FCKRegexLib.SpecialBlockElements = /^(?:BODY|TH|TD|CAPTION)$/i ; 78 // Block elements that can validly contain a nested table. Ditto above for the BODY entry. 79 FCKRegexLib.TableBlockElements = /^(?:BODY|DIV|LI|TD|TH)$/i ; 80 // List elements 81 FCKRegexLib.ListElements = /^(?:OL|UL)$/i ; 82 // Used to remove empty tags after the split process used on ENTER key press 83 FCKRegexLib.EmptyElement = /<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|SPAN|A)[^\>]*>\s*<\/\1>/gi ; 84 */ 85 // END iCM MODIFICATIONS 86 87 FCKRegexLib.StrongOpener = /<STRONG([ \>])/gi ; 88 FCKRegexLib.StrongCloser = /<\/STRONG>/gi ; 89 FCKRegexLib.EmOpener = /<EM([ \>])/gi ; 90 FCKRegexLib.EmCloser = /<\/EM>/gi ; 91 92 FCKRegexLib.GeckoEntitiesMarker = /#\?-\:/g ; 93 94 FCKRegexLib.ProtectUrlsAApo = /(<a\s.*?href=)("|')(.+?)\2/gi ; 95 FCKRegexLib.ProtectUrlsANoApo = /(<a\s.*?href=)([^"'][^ >]+)/gi ; 96 97 FCKRegexLib.ProtectUrlsImgApo = /(<img\s.*?src=)("|')(.+?)\2/gi ; 98 FCKRegexLib.ProtectUrlsImgNoApo = /(<img\s.*?src=)([^"'][^ >]+)/gi ; 99 100 FCKRegexLib.Html4DocType = /HTML 4\.0 Transitional/i ;
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 12:27:40 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |