[ Index ]
 

Code source de GeekLog 1.4.1

Accdez au Source d'autres logiciels libres

title

Body

[fermer]

/public_html/fckeditor/editor/_source/internals/ -> fckxhtmlentities.js (source)

   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: fckxhtmlentities.js
  14   *     This file define the HTML entities handled by the editor.
  15   * 
  16   * File Authors:
  17   *         Frederico Caldeira Knabben (fredck@fckeditor.net)
  18   */
  19  
  20  var FCKXHtmlEntities = new Object() ;
  21  
  22  FCKXHtmlEntities.Initialize = function()
  23  {
  24      if ( FCKXHtmlEntities.Entities )
  25          return ;
  26  
  27      if ( FCKConfig.ProcessHTMLEntities )
  28      {
  29          FCKXHtmlEntities.Entities = {
  30              // Latin-1 Entities
  31              ' ':'nbsp',
  32              '¡':'iexcl',
  33              '¢':'cent',
  34              '£':'pound',
  35              '¤':'curren',
  36              '¥':'yen',
  37              '¦':'brvbar',
  38              '§':'sect',
  39              '¨':'uml',
  40              '©':'copy',
  41              'ª':'ordf',
  42              '«':'laquo',
  43              '¬':'not',
  44              '­':'shy',
  45              '®':'reg',
  46              '¯':'macr',
  47              '°':'deg',
  48              '±':'plusmn',
  49              '²':'sup2',
  50              '³':'sup3',
  51              '´':'acute',
  52              'µ':'micro',
  53              '¶':'para',
  54              '·':'middot',
  55              '¸':'cedil',
  56              '¹':'sup1',
  57              'º':'ordm',
  58              '»':'raquo',
  59              '¼':'frac14',
  60              '½':'frac12',
  61              '¾':'frac34',
  62              '¿':'iquest',
  63              '×':'times',
  64              '÷':'divide',
  65  
  66              // Symbols and Greek Letters 
  67  
  68              'ƒ':'fnof',
  69              '•':'bull',
  70              '…':'hellip',
  71              '′':'prime',
  72              '″':'Prime',
  73              '‾':'oline',
  74              '⁄':'frasl',
  75              '℘':'weierp',
  76              'ℑ':'image',
  77              'ℜ':'real',
  78              '™':'trade',
  79              'ℵ':'alefsym',
  80              '←':'larr',
  81              '↑':'uarr',
  82              '→':'rarr',
  83              '↓':'darr',
  84              '↔':'harr',
  85              '↵':'crarr',
  86              '⇐':'lArr',
  87              '⇑':'uArr',
  88              '⇒':'rArr',
  89              '⇓':'dArr',
  90              '⇔':'hArr',
  91              '∀':'forall',
  92              '∂':'part',
  93              '∃':'exist',
  94              '∅':'empty',
  95              '∇':'nabla',
  96              '∈':'isin',
  97              '∉':'notin',
  98              '∋':'ni',
  99              '∏':'prod',
 100              '∑':'sum',
 101              '−':'minus',
 102              '∗':'lowast',
 103              '√':'radic',
 104              '∝':'prop',
 105              '∞':'infin',
 106              '∠':'ang',
 107              '∧':'and',
 108              '∨':'or',
 109              '∩':'cap',
 110              '∪':'cup',
 111              '∫':'int',
 112              '∴':'there4',
 113              '∼':'sim',
 114              '≅':'cong',
 115              '≈':'asymp',
 116              '≠':'ne',
 117              '≡':'equiv',
 118              '≤':'le',
 119              '≥':'ge',
 120              '⊂':'sub',
 121              '⊃':'sup',
 122              '⊄':'nsub',
 123              '⊆':'sube',
 124              '⊇':'supe',
 125              '⊕':'oplus',
 126              '⊗':'otimes',
 127              '⊥':'perp',
 128              '⋅':'sdot',
 129              '◊':'loz',
 130              '♠':'spades',
 131              '♣':'clubs',
 132              '♥':'hearts',
 133              '♦':'diams',
 134  
 135              // Other Special Characters 
 136  
 137              '"':'quot',
 138          //    '&':'amp',        // This entity is automatically handled by the XHTML parser.
 139          //    '<':'lt',        // This entity is automatically handled by the XHTML parser.
 140          //    '>':'gt',        // This entity is automatically handled by the XHTML parser.
 141              'ˆ':'circ',
 142              '˜':'tilde',
 143              ' ':'ensp',
 144              ' ':'emsp',
 145              ' ':'thinsp',
 146              '‌':'zwnj',
 147              '‍':'zwj',
 148              '‎':'lrm',
 149              '‏':'rlm',
 150              '–':'ndash',
 151              '—':'mdash',
 152              '‘':'lsquo',
 153              '’':'rsquo',
 154              '‚':'sbquo',
 155              '“':'ldquo',
 156              '”':'rdquo',
 157              '„':'bdquo',
 158              '†':'dagger',
 159              '‡':'Dagger',
 160              '‰':'permil',
 161              '‹':'lsaquo',
 162              '›':'rsaquo',
 163              '€':'euro'
 164          } ;
 165  
 166          FCKXHtmlEntities.Chars = '' ;
 167  
 168          // Process Base Entities.
 169          for ( var e in FCKXHtmlEntities.Entities )
 170              FCKXHtmlEntities.Chars += e ;
 171  
 172          // Include Latin Letters Entities.
 173          if ( FCKConfig.IncludeLatinEntities )
 174          {
 175              var oEntities = {
 176                  'À':'Agrave',
 177                  'Á':'Aacute',
 178                  'Â':'Acirc',
 179                  'Ã':'Atilde',
 180                  'Ä':'Auml',
 181                  'Å':'Aring',
 182                  'Æ':'AElig',
 183                  'Ç':'Ccedil',
 184                  'È':'Egrave',
 185                  'É':'Eacute',
 186                  'Ê':'Ecirc',
 187                  'Ë':'Euml',
 188                  'Ì':'Igrave',
 189                  'Í':'Iacute',
 190                  'Î':'Icirc',
 191                  'Ï':'Iuml',
 192                  'Ð':'ETH',
 193                  'Ñ':'Ntilde',
 194                  'Ò':'Ograve',
 195                  'Ó':'Oacute',
 196                  'Ô':'Ocirc',
 197                  'Õ':'Otilde',
 198                  'Ö':'Ouml',
 199                  'Ø':'Oslash',
 200                  'Ù':'Ugrave',
 201                  'Ú':'Uacute',
 202                  'Û':'Ucirc',
 203                  'Ü':'Uuml',
 204                  'Ý':'Yacute',
 205                  'Þ':'THORN',
 206                  'ß':'szlig',
 207                  'à':'agrave',
 208                  'á':'aacute',
 209                  'â':'acirc',
 210                  'ã':'atilde',
 211                  'ä':'auml',
 212                  'å':'aring',
 213                  'æ':'aelig',
 214                  'ç':'ccedil',
 215                  'è':'egrave',
 216                  'é':'eacute',
 217                  'ê':'ecirc',
 218                  'ë':'euml',
 219                  'ì':'igrave',
 220                  'í':'iacute',
 221                  'î':'icirc',
 222                  'ï':'iuml',
 223                  'ð':'eth',
 224                  'ñ':'ntilde',
 225                  'ò':'ograve',
 226                  'ó':'oacute',
 227                  'ô':'ocirc',
 228                  'õ':'otilde',
 229                  'ö':'ouml',
 230                  'ø':'oslash',
 231                  'ù':'ugrave',
 232                  'ú':'uacute',
 233                  'û':'ucirc',
 234                  'ü':'uuml',
 235                  'ý':'yacute',
 236                  'þ':'thorn',
 237                  'ÿ':'yuml',
 238                  'Œ':'OElig',
 239                  'œ':'oelig',
 240                  'Š':'Scaron',
 241                  'š':'scaron',
 242                  'Ÿ':'Yuml'
 243              } ; 
 244              
 245              for ( var e in oEntities )
 246              {
 247                  FCKXHtmlEntities.Entities[ e ] = oEntities[ e ] ;
 248                  FCKXHtmlEntities.Chars += e ;
 249              }
 250              
 251              oEntities = null ;
 252          }
 253  
 254          // Include Greek Letters Entities.
 255          if ( FCKConfig.IncludeGreekEntities )
 256          {
 257              var oEntities = {
 258                  'Α':'Alpha',
 259                  'Β':'Beta',
 260                  'Γ':'Gamma',
 261                  'Δ':'Delta',
 262                  'Ε':'Epsilon',
 263                  'Ζ':'Zeta',
 264                  'Η':'Eta',
 265                  'Θ':'Theta',
 266                  'Ι':'Iota',
 267                  'Κ':'Kappa',
 268                  'Λ':'Lambda',
 269                  'Μ':'Mu',
 270                  'Ν':'Nu',
 271                  'Ξ':'Xi',
 272                  'Ο':'Omicron',
 273                  'Π':'Pi',
 274                  'Ρ':'Rho',
 275                  'Σ':'Sigma',
 276                  'Τ':'Tau',
 277                  'Υ':'Upsilon',
 278                  'Φ':'Phi',
 279                  'Χ':'Chi',
 280                  'Ψ':'Psi',
 281                  'Ω':'Omega',
 282                  'α':'alpha',
 283                  'β':'beta',
 284                  'γ':'gamma',
 285                  'δ':'delta',
 286                  'ε':'epsilon',
 287                  'ζ':'zeta',
 288                  'η':'eta',
 289                  'θ':'theta',
 290                  'ι':'iota',
 291                  'κ':'kappa',
 292                  'λ':'lambda',
 293                  'μ':'mu',
 294                  'ν':'nu',
 295                  'ξ':'xi',
 296                  'ο':'omicron',
 297                  'π':'pi',
 298                  'ρ':'rho',
 299                  'ς':'sigmaf',
 300                  'σ':'sigma',
 301                  'τ':'tau',
 302                  'υ':'upsilon',
 303                  'φ':'phi',
 304                  'χ':'chi',
 305                  'ψ':'psi',
 306                  'ω':'omega'
 307              } ;
 308  
 309              for ( var e in oEntities )
 310              {
 311                  FCKXHtmlEntities.Entities[ e ] = oEntities[ e ] ;
 312                  FCKXHtmlEntities.Chars += e ;
 313              }
 314  
 315              oEntities = null ;
 316          }
 317  
 318          // Create and Compile the Regex used to separate the entities from the text.
 319          FCKXHtmlEntities.EntitiesRegex = new RegExp('[' + FCKXHtmlEntities.Chars + ']|[^' + FCKXHtmlEntities.Chars + ']+','g') ;
 320      //    FCKXHtmlEntities.EntitiesRegex.compile( '[' + FCKXHtmlEntities.Chars + ']|[^' + FCKXHtmlEntities.Chars + ']+', 'g' ) ;
 321      }
 322      else
 323      {
 324          // Even if we are not processing the entities, we must respect the &nbsp;.
 325          FCKXHtmlEntities.Entities = { ' ':'nbsp' } ;
 326          FCKXHtmlEntities.EntitiesRegex = /[ ]|[^ ]+/g ;
 327      }
 328  }


Gnr le : Wed Nov 21 12:27:40 2007 par Balluche grce PHPXref 0.7
  Clicky Web Analytics