Changeset 704 for trunk


Ignore:
Timestamp:
01/29/07 13:53:12 (12 years ago)
Author:
ray
Message:

changed name of of colorPicker() to Xinha.colorPicker() see #923

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r703 r704  
    37383738    }; 
    37393739  } 
    3740   var picker = new colorPicker( 
     3740  var picker = new Xinha.colorPicker( 
    37413741  { 
    37423742        cellsize:editor.config.colorPickerCellSize, 
  • trunk/modules/ColorPicker/ColorPicker.js

    r700 r704  
    9393  } 
    9494  //the actual function is below 
    95   function colorPicker(params) 
     95  Xinha.colorPicker = function (params) 
    9696  { 
    9797    // if the savedColors is empty, try to read the savedColors from cookie 
    98     if ( colorPicker.savedColors.length === 0 ) 
    99     { 
    100       colorPicker.loadColors(); 
     98    if ( Xinha.colorPicker.savedColors.length === 0 ) 
     99    { 
     100      Xinha.colorPicker.loadColors(); 
    101101    } 
    102102    var picker = this; 
     
    501501                 } 
    502502            }; 
    503             td.ondblclick = function() { colorPicker.remember(this.colorCode, picker.savecolors); picker.callback(this.colorCode); picker.close(); }; 
     503            td.ondblclick = function() { Xinha.colorPicker.remember(this.colorCode, picker.savecolors); picker.callback(this.colorCode); picker.close(); }; 
    504504            td.appendChild(document.createTextNode(' ')); 
    505505            td.style.cursor = 'pointer'; 
     
    617617                   } 
    618618          }; 
    619           td.ondblclick = function() { colorPicker.remember(this.colorCode, picker.savecolors); picker.callback(this.colorCode); picker.close(); }; 
     619          td.ondblclick = function() { Xinha.colorPicker.remember(this.colorCode, picker.savecolors); picker.callback(this.colorCode); picker.close(); }; 
    620620          td.appendChild(document.createTextNode(' ')); 
    621621          td.style.cursor = 'pointer'; 
     
    661661        but.style.padding = '0px 4px'; 
    662662        but.style.cursor = 'pointer'; 
    663         but.onclick = function() { colorPicker.remember(picker.chosenColor.value, picker.savecolors); picker.callback(picker.chosenColor.value); picker.close(); }; 
     663        but.onclick = function() { Xinha.colorPicker.remember(picker.chosenColor.value, picker.savecolors); picker.callback(picker.chosenColor.value); picker.close(); }; 
    664664        but.appendChild(document.createTextNode('OK')); 
    665665        but.align = 'center'; 
     
    709709          savedColors.appendChild(div); 
    710710        } 
    711         for ( var savedCols = 0; savedCols < colorPicker.savedColors.length; savedCols++ ) 
    712         { 
    713           createSavedColors(colorPicker.savedColors[savedCols]); 
     711        for ( var savedCols = 0; savedCols < Xinha.colorPicker.savedColors.length; savedCols++ ) 
     712        { 
     713          createSavedColors(Xinha.colorPicker.savedColors[savedCols]); 
    714714        } 
    715715        td.appendChild(savedColors); 
     
    781781 
    782782// array of the saved colors 
    783 colorPicker.savedColors = []; 
     783Xinha.colorPicker.savedColors = []; 
    784784 
    785785// add the color to the savedColors 
    786 colorPicker.remember = function(color, savecolors) 
     786Xinha.colorPicker.remember = function(color, savecolors) 
    787787{ 
    788788  // check if this color is known 
    789   for ( var i = colorPicker.savedColors.length; i--; ) 
     789  for ( var i = Xinha.colorPicker.savedColors.length; i--; ) 
    790790  { 
    791     if ( colorPicker.savedColors[i] == color ) 
     791    if ( Xinha.colorPicker.savedColors[i] == color ) 
    792792    { 
    793793      return false; 
     
    795795  } 
    796796  // insert the new color 
    797   colorPicker.savedColors.splice(0, 0, color); 
     797  Xinha.colorPicker.savedColors.splice(0, 0, color); 
    798798  // limit elements 
    799   colorPicker.savedColors = colorPicker.savedColors.slice(0, savecolors); 
     799  Xinha.colorPicker.savedColors = Xinha.colorPicker.savedColors.slice(0, savecolors); 
    800800  //[mokhet] probably some more parameters to send to the cookie definition 
    801801  // like domain, secure and such, especially with https connection i presume 
     
    804804  expdate.setMonth(expdate.getMonth() + 1); 
    805805 
    806   document.cookie = 'XinhaColorPicker=' + escape (colorPicker.savedColors.join('-')) + ';expires=' + expdate.toGMTString(); 
     806  document.cookie = 'XinhaColorPicker=' + escape (Xinha.colorPicker.savedColors.join('-')) + ';expires=' + expdate.toGMTString(); 
    807807  return true; 
    808808}; 
    809809 
    810810// try to read the colors from the cookie 
    811 colorPicker.loadColors = function() 
     811Xinha.colorPicker.loadColors = function() 
    812812{ 
    813813  var index = document.cookie.indexOf('XinhaColorPicker'); 
     
    817817    var end = document.cookie.indexOf(';', index); 
    818818    if ( end == -1 ) { end = document.cookie.length; } 
    819     colorPicker.savedColors = unescape(document.cookie.substring(begin, end)).split('-'); 
     819    Xinha.colorPicker.savedColors = unescape(document.cookie.substring(begin, end)).split('-'); 
    820820  } 
    821821}; 
    822822 
    823 colorPicker._lc = function(string) { 
     823Xinha.colorPicker._lc = function(string) { 
    824824  return Xinha._lc(string); 
    825825} 
  • trunk/plugins/ExtendedFileManager/assets/manager.js

    r702 r704  
    7171     
    7272    var editor = window.dialogArguments.editor; 
    73     if (manager_mode == 'image' && typeof colorPicker != "undefined" && document.getElementById('bgCol_pick')) { 
     73    if (manager_mode == 'image' && typeof Xinha.colorPicker != "undefined" && document.getElementById('bgCol_pick')) { 
    7474        // Hookup color pickers 
    7575        var pickerConfig = { 
     
    8383        var f_backgroundColor = document.getElementById('f_backgroundColor'); 
    8484        pickerConfig.callback = function(color){f_backgroundColor.value=color;}; 
    85         var bgColPicker = new colorPicker(pickerConfig); 
     85        var bgColPicker = new Xinha.colorPicker(pickerConfig); 
    8686        bgCol_pick.onclick = function() { bgColPicker.open('top,right', f_backgroundColor ); } 
    8787 
     
    8989        var f_borderColor = document.getElementById('f_borderColor'); 
    9090        pickerConfig.callback = function(color){f_borderColor.value=color;}; 
    91         var bgColPicker = new colorPicker(pickerConfig); 
     91        var bgColPicker = new Xinha.colorPicker(pickerConfig); 
    9292        bdCol_pick.onclick = function() { bdColPicker.open('top,right', f_borderColor ); } 
    9393    } 
  • trunk/plugins/FullPage/popups/docprop.html

    r700 r704  
    3535  var bgCol_pick = document.getElementById('bgCol_pick'); 
    3636  var f_body_bgcolor = document.getElementById('f_body_bgcolor'); 
    37   var bgColPicker = new colorPicker({cellsize:'5px',callback:function(color){f_body_bgcolor.value=color;}}); 
     37  var bgColPicker = new Xinha.colorPicker({cellsize:'5px',callback:function(color){f_body_bgcolor.value=color;}}); 
    3838  bgCol_pick.onclick = function() { bgColPicker.open('top,right', f_body_bgcolor ); } 
    3939 
    4040  var fgCol_pick = document.getElementById('fgCol_pick'); 
    4141  var f_body_fgcolor = document.getElementById('f_body_fgcolor'); 
    42   var fgColPicker = new colorPicker({cellsize:'5px',callback:function(color){f_body_fgcolor.value=color;}}); 
     42  var fgColPicker = new Xinha.colorPicker({cellsize:'5px',callback:function(color){f_body_fgcolor.value=color;}}); 
    4343  fgCol_pick.onclick = function() { fgColPicker.open('top,right', f_body_fgcolor ); } 
    4444 
  • trunk/plugins/ImageManager/assets/manager.js

    r702 r704  
    4040    var bgCol_pick = document.getElementById('bgCol_pick'); 
    4141    var f_backgroundColor = document.getElementById('f_backgroundColor'); 
    42     var bgColPicker = new colorPicker({cellsize:'5px',callback:function(color){f_backgroundColor.value=color;}}); 
     42    var bgColPicker = new Xinha.colorPicker({cellsize:'5px',callback:function(color){f_backgroundColor.value=color;}}); 
    4343    bgCol_pick.onclick = function() { bgColPicker.open('top,right', f_backgroundColor ); } 
    4444 
    4545    var bdCol_pick = document.getElementById('bdCol_pick'); 
    4646    var f_borderColor = document.getElementById('f_borderColor'); 
    47     var bdColPicker = new colorPicker({cellsize:'5px',callback:function(color){f_borderColor.value=color;}}); 
     47    var bdColPicker = new Xinha.colorPicker({cellsize:'5px',callback:function(color){f_borderColor.value=color;}}); 
    4848    bdCol_pick.onclick = function() { bdColPicker.open('top,right', f_borderColor ); } 
    4949 
Note: See TracChangeset for help on using the changeset viewer.