Changeset 531

Show
Ignore:
Timestamp:
09/06/08 14:24:20 (3 months ago)
Author:
jf.hovinne
Message:

Use typeof to check variables.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/wymeditor/jquery.wymeditor.js

    r530 r531  
    23752375      return false; 
    23762376    } 
    2377     return this._tags[tag] != undefined
     2377    return typeof this._tags[tag] != 'undefined'
    23782378  }, 
    23792379  getPossibleTagAttributes : function(tag) 
     
    26232623{ 
    26242624  var mode = mode || "accept"; 
    2625   if (this._regexes[mode] == undefined) { 
     2625  if (typeof this._regexes[mode] == 'undefined') { 
    26262626    this._regexes[mode] = new WYMeditor.ParallelRegex(this._case); 
    26272627  } 
    26282628  this._regexes[mode].addPattern(pattern); 
    2629   if (this._mode_handlers[mode] == undefined) { 
     2629  if (typeof this._mode_handlers[mode] == 'undefined') { 
    26302630    this._mode_handlers[mode] = mode; 
    26312631  } 
     
    26472647WYMeditor.Lexer.prototype.addEntryPattern = function(pattern, mode, new_mode) 
    26482648{ 
    2649   if (this._regexes[mode] == undefined) { 
     2649  if (typeof this._regexes[mode] == 'undefined') { 
    26502650    this._regexes[mode] = new WYMeditor.ParallelRegex(this._case); 
    26512651  } 
    26522652  this._regexes[mode].addPattern(pattern, new_mode); 
    2653   if (this._mode_handlers[new_mode] == undefined) { 
     2653  if (typeof this._mode_handlers[new_mode] == 'undefined') { 
    26542654    this._mode_handlers[new_mode] = new_mode; 
    26552655  } 
     
    26662666WYMeditor.Lexer.prototype.addExitPattern = function(pattern, mode) 
    26672667{ 
    2668   if (this._regexes[mode] == undefined) { 
     2668  if (typeof this._regexes[mode] == 'undefined') { 
    26692669    this._regexes[mode] = new WYMeditor.ParallelRegex(this._case); 
    26702670  } 
    26712671  this._regexes[mode].addPattern(pattern, "__exit"); 
    2672   if (this._mode_handlers[mode] == undefined) { 
     2672  if (typeof this._mode_handlers[mode] == 'undefined') { 
    26732673    this._mode_handlers[mode] = mode; 
    26742674  } 
     
    26892689WYMeditor.Lexer.prototype.addSpecialPattern =  function(pattern, mode, special) 
    26902690{ 
    2691   if (this._regexes[mode] == undefined) { 
     2691  if (typeof this._regexes[mode] == 'undefined') { 
    26922692    this._regexes[mode] = new WYMeditor.ParallelRegex(this._case); 
    26932693  } 
    26942694  this._regexes[mode].addPattern(pattern, '_'+special); 
    2695   if (this._mode_handlers[special] == undefined) { 
     2695  if (typeof this._mode_handlers[special] == 'undefined') { 
    26962696    this._mode_handlers[special] = special; 
    26972697  } 
     
    27212721WYMeditor.Lexer.prototype.parse = function(raw) 
    27222722{ 
    2723   if (this._parser == undefined) { 
     2723  if (typeof this._parser == 'undefined') { 
    27242724    return false; 
    27252725  } 
     
    35253525WYMeditor.WymCssLexer = function(parser, only_wym_blocks) 
    35263526{ 
    3527   var only_wym_blocks = (only_wym_blocks == undefined ? true : only_wym_blocks); 
     3527  var only_wym_blocks = (typeof only_wym_blocks == 'undefined' ? true : only_wym_blocks); 
    35283528 
    35293529  jQuery.extend(this, new WYMeditor.Lexer(parser, (only_wym_blocks?'Ignore':'WymCss'))); 
     
    35613561WYMeditor.WymCssParser.prototype.parse = function(raw, only_wym_blocks) 
    35623562{ 
    3563   var only_wym_blocks = (only_wym_blocks == undefined ? this.only_wym_blocks : only_wym_blocks); 
     3563  var only_wym_blocks = (typeof only_wym_blocks == 'undefined' ? this.only_wym_blocks : only_wym_blocks); 
    35643564  this._Lexer = new WYMeditor.WymCssLexer(this, only_wym_blocks); 
    35653565  this._Lexer.parse(raw);