Changeset 700


Ignore:
Timestamp:
01/28/07 01:52:59 (12 years ago)
Author:
ray
Message:

Ticket #923 colorPicker face lift & localisation

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r699 r700  
    15261526          else if ( typeof InsertTable != 'undefined') editor.registerPlugin('InsertTable'); 
    15271527        break; 
     1528        case "hilitecolor": 
     1529        case "forecolor": 
     1530          if ( typeof ColorPicker == 'undefined') 
     1531          { 
     1532            Xinha.loadPlugin("ColorPicker", function() { editor.generate(); } , _editor_url + 'modules/ColorPicker/ColorPicker.js'); 
     1533            return false; 
     1534          } 
     1535          else if ( typeof ColorPicker != 'undefined') editor.registerPlugin('ColorPicker'); 
     1536        break; 
     1537         
    15281538      } 
    15291539    } 
     
    36833693{ 
    36843694  var editor = this;    // for nested functions 
    3685    
    3686   if ( typeof colorPicker == 'undefined' ) 
    3687   { 
    3688     Xinha._loadback(_editor_url + 'modules/ColorPicker/ColorPicker.js', function () {editor._colorSelector(cmdID)}); 
    3689     return false; 
    3690   } 
    36913695 
    36923696  // backcolor only works with useCSS/styleWithCSS (see mozilla bug #279330 & Midas doc) 
     
    50585062 * @param context Case sensitive context name, eg 'Xinha', 'TableOperations', ... 
    50595063 */ 
    5060 Xinha._loadlang = function(context) 
    5061 { 
    5062   var url, lang; 
    5063   if (typeof context == 'object' && context.url) 
    5064   { 
    5065     url = context.url + _editor_lang + ".js"; 
    5066     context = context.context; 
    5067   } 
     5064Xinha._loadlang = function(context,url) 
     5065{ 
     5066  var lang; 
     5067   
    50685068  if ( typeof _editor_lcbackend == "string" ) 
    50695069  { 
     
    51155115Xinha._lc = function(string, context, replace) 
    51165116{ 
    5117   var ret; 
     5117  var url,ret; 
     5118  if (typeof context == 'object' && context.url && context.context) 
     5119  { 
     5120    url = context.url + _editor_lang + ".js"; 
     5121    context = context.context; 
     5122  } 
     5123 
    51185124  var m = null; 
    51195125  if (typeof string == 'string') m = string.match(/\$(.*?)=(.*?)\$/g); 
     
    51535159    if ( typeof Xinha._lc_catalog[context] == 'undefined' ) 
    51545160    { 
    5155       Xinha._lc_catalog[context] = Xinha._loadlang(context); 
     5161      Xinha._lc_catalog[context] = Xinha._loadlang(context,url); 
    51565162    } 
    51575163 
  • trunk/lang/de.js

    r471 r700  
    154154  "Register panel left": "Erzeugt linke Leiste", 
    155155  "Register panel top": "Erzeugt obere Leiste", 
    156   "Register panel bottom": "Erzeugt untere Leiste" 
     156  "Register panel bottom": "Erzeugt untere Leiste", 
     157   
     158  // ColorPicker 
     159  "Click a color..." : "Farbe wÀhlen", 
     160  "Sample" : "Beispiel", 
     161  "Web Safe: " : "Web Safe: ", 
     162  "Color: " : "Farbe: " 
    157163}; 
  • trunk/modules/ColorPicker/ColorPicker.js

    r694 r700  
    7777   * }}} 
    7878   */ 
    79  
     79  ColorPicker._pluginInfo = 
     80  { 
     81    name     : "colorPicker", 
     82    version  : "1.0", 
     83    developer: "James Sleeman", 
     84    developer_url: "http://www.gogo.co.nz/", 
     85    c_owner      : "Gogo Internet Services", 
     86    license      : "htmlArea", 
     87    sponsor      : "Gogo Internet Services", 
     88    sponsor_url  : "http://www.gogo.co.nz/" 
     89  }; 
     90  function ColorPicker()  
     91  { 
     92        // dummy function for Xinha plugin api, note the different names 
     93  } 
     94  //the actual function is below 
    8095  function colorPicker(params) 
    8196  { 
     
    102117    this.saved_cells = null; 
    103118    this.table = document.createElement('table'); 
     119    this.table.className = "dialog"; 
    104120    this.table.cellSpacing = this.table.cellPadding = 0; 
    105121    this.table.onmouseup = function() 
     
    111127    this.table.appendChild(this.tbody); 
    112128    this.table.style.border = '1px solid WindowFrame'; 
    113     this.table.style.backgroundColor = '#fff'; 
    114129    this.table.style.zIndex = '1000'; 
    115130    // Add a title bar and close button 
     
    118133    var td = document.createElement('td'); 
    119134    td.colSpan = this.side; 
    120     td.style.backgroundColor = '#ccc'; 
    121     td.style.color = '#000'; 
     135    td.className= "title"; 
    122136    td.style.fontFamily = 'small-caption,caption,sans-serif'; 
    123137    td.style.fontSize = 'x-small'; 
    124     td.appendChild(document.createTextNode('Click a color...')); 
     138    td.appendChild(document.createTextNode(Xinha._lc('Click a color...'))); 
    125139    td.style.borderBottom = '1px solid WindowFrame'; 
    126140    tr.appendChild(td); 
     
    128142 
    129143    var td = document.createElement('td'); 
     144    td.className= "title"; 
    130145    td.colSpan = 2; 
    131     td.style.backgroundColor = '#ccc'; //'ActiveCaption'; 
     146    td.style.fontFamily = 'Tahoma,Verdana,sans-serif'; 
    132147    td.style.borderBottom = '1px solid WindowFrame'; 
     148    td.style.paddingRight = '0'; 
    133149    tr.appendChild(td); 
     150     
    134151 
    135152    var but = document.createElement('div'); 
    136     but.style.height = '12px'; 
    137     but.style.width = '12px'; 
    138     but.style.border = '2px outset'; 
     153    but.title = Xinha._lc("Close"); 
     154    but.className= 'buttonColor'; 
     155    but.style.height = '11px'; 
     156    but.style.width = '11px'; 
    139157    but.style.cursor = 'pointer'; 
    140158    but.onclick = function() { picker.close(); }; 
     
    145163    but.style.cssFloat = 'right'; 
    146164    but.style.styleFloat = 'right'; 
    147     but.style.backgroundColor = '#eee'; 
     165    but.style.padding = '0'; 
     166    but.style.margin = '2px'; 
     167    but.style.backgroundColor = 'transparent'; 
     168    but.style.fontSize= '11px'; 
     169    if ( !Xinha.is_ie) but.style.lineHeight= '9px'; // line-height:9px is better for centering the x, but IE cuts it off at the bottom :( 
     170    but.style.letterSpacing= '0'; 
     171     
     172         
    148173    td.appendChild(but); 
    149174 
     
    157182    this.chosenColor.type = 'text'; 
    158183    this.chosenColor.maxLength = 7; 
    159     this.chosenColor.style.width = '56px'; 
     184    this.chosenColor.style.width = '50px'; 
     185    this.chosenColor.style.fontSize = '11px'; 
     186     
    160187    this.chosenColor.onchange = function() 
    161188      { 
     
    174201 
    175202    this.foreSample = document.createElement('div'); 
    176     this.foreSample.appendChild(document.createTextNode('Sample')); 
     203    this.foreSample.appendChild(document.createTextNode(Xinha._lc('Sample'))); 
    177204    this.foreSample.style.fontWeight = 'bold'; 
    178205    this.foreSample.style.fontFamily = 'small-caption,caption,sans-serif'; 
     
    609636        var div = document.createElement('div'); 
    610637        var label = document.createElement('label'); 
    611         label.appendChild(document.createTextNode('Web Safe: ')); 
     638        label.appendChild(document.createTextNode(Xinha._lc('Web Safe: '))); 
    612639 
    613640        this.constrain_cb.onclick = function() { picker.pick_color(); }; 
     
    624651        label.style.fontFamily = 'small-caption,caption,sans-serif'; 
    625652        label.style.fontSize = 'x-small'; 
    626         label.appendChild(document.createTextNode('Color: ')); 
     653        label.appendChild(document.createTextNode(Xinha._lc('Color: '))); 
    627654        label.appendChild(this.chosenColor); 
    628655        div.appendChild(label); 
    629656        var but = document.createElement('span'); 
    630         but.style.height = '12px'; 
     657        but.className = "buttonColor "; 
     658        but.style.fontSize = '13px'; 
    631659        but.style.width = '24px'; 
    632         but.style.border = '2px outset'; 
    633         but.style.backgroundColor = '#eee'; 
    634         but.style.marginLeft = '6px'; 
     660        but.style.marginLeft = '2px'; 
     661        but.style.padding = '0px 4px'; 
    635662        but.style.cursor = 'pointer'; 
    636663        but.onclick = function() { colorPicker.remember(picker.chosenColor.value, picker.savecolors); picker.callback(picker.chosenColor.value); picker.close(); }; 
     
    751778      @*/ 
    752779    }; 
    753  
    754780  } 
    755781 
     
    794820  } 
    795821}; 
     822 
     823colorPicker._lc = function(string) { 
     824  return Xinha._lc(string); 
     825} 
  • trunk/modules/FullScreen/full-screen.js

    r695 r700  
    4040 
    4141FullScreen.prototype._lc = function(string) { 
    42     return HTMLArea._lc(string, {url : _editor_url + 'modules/FullScreen/lang/'}); 
     42    return HTMLArea._lc(string, {url : _editor_url + 'modules/FullScreen/lang/',context:"FullScreen"}); 
    4343}; 
    4444 
  • trunk/plugins/ExtendedFileManager/assets/manager.css

    r677 r700  
    1 html, body {  background-color: ButtonFace;  color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} 
     1html, body, .dialog {  background-color: ButtonFace;  color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} 
    22body { padding: 5px; } 
    33fieldset { padding: 0;} 
     
    2525th, td { padding-right:3px; text-align:left; font-family:small-caption,helvetica,sans-serif; } 
    2626.dirWidth {width: 59%} 
     27 
     28.buttonColor { 
     29  padding: 1px; 
     30  cursor: default; 
     31  border: 1px solid; 
     32  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; 
     33} 
  • trunk/plugins/ExtendedFileManager/extended-file-manager.js

    r681 r700  
    6161 
    6262    var editor = this;  // for nested functions 
    63     var outparam = null; 
     63    var outparam = {"editor" : this, param : null}; 
     64     
    6465    if (typeof image == "undefined") { 
    6566        image = this.getParentElement(); 
     
    6970 
    7071    if (image) { 
    71         outparam = { 
     72        outparam.param = { 
    7273            f_url    : Xinha.is_ie ? image.src : image.getAttribute("src"), 
    7374            f_alt    : image.alt, 
     
    8586 
    8687        // compress 'top right bottom left' syntax into one value if possible 
    87         outparam.f_border = shortSize(outparam.f_border); 
    88         outparam.f_padding = shortSize(outparam.f_padding); 
    89         outparam.f_margin = shortSize(outparam.f_margin); 
     88        outparam.param.f_border = shortSize(outparam.f_border); 
     89        outparam.param.f_padding = shortSize(outparam.f_padding); 
     90        outparam.param.f_margin = shortSize(outparam.f_margin); 
    9091 
    9192        // convert rgb() calls to rgb hex 
    92         outparam.f_backgroundColor = convertToHex(outparam.f_backgroundColor); 
    93         outparam.f_borderColor = convertToHex(outparam.f_borderColor); 
     93        outparam.param.f_backgroundColor = convertToHex(outparam.f_backgroundColor); 
     94        outparam.param.f_borderColor = convertToHex(outparam.f_borderColor); 
    9495 
    9596    } 
  • trunk/plugins/ExtendedFileManager/manager.php

    r681 r700  
    8181<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/popup.js"></script> 
    8282<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dialog.js"></script> 
    83 <?php if (!empty($IMConfig['use_color_pickers'])) { ?><script type="text/javascript" src="../../popups/color_picker.js"></script><?php } ?> 
     83<?php if (!empty($IMConfig['use_color_pickers'])) { ?><script type="text/javascript" src="../../modules/ColorPicker/ColorPicker.js"></script><?php } ?> 
    8484<script type="text/javascript"> 
    8585/* <![CDATA[ */ 
  • trunk/plugins/FullPage/popups/docprop.html

    r419 r700  
    33<title>Document properties</title> 
    44<script type="text/javascript" src="../../../popups/popup.js"></script> 
    5 <script type="text/javascript" src="../../../popups/color_picker.js"></script> 
     5<script type="text/javascript" src="../../../modules/ColorPicker/ColorPicker.js"></script> 
    66<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" /> 
    77<script type="text/javascript"> 
  • trunk/plugins/ImageManager/assets/manager.css

    r677 r700  
    1 html, body {  background-color: ButtonFace;  color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} 
     1html, body, .dialog {  background-color: ButtonFace;  color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} 
    22body { padding: 5px; } 
    33fieldset { padding: 0;} 
     
    2222table { margin-top:10px; } 
    2323th, td { padding-right:3px; text-align:left; font-family:small-caption,helvetica,sans-serif; } 
     24.buttonColor { 
     25  padding: 1px; 
     26  cursor: default; 
     27  border: 1px solid; 
     28  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; 
     29} 
  • trunk/plugins/ImageManager/manager.php

    r677 r700  
    3030<script type="text/javascript" src="../../popups/popup.js"></script> 
    3131<script type="text/javascript" src="assets/popup.js"></script> 
    32 <script type="text/javascript" src="../../popups/color_picker.js"></script> 
     32<script type="text/javascript" src="../../modules/ColorPicker/ColorPicker.js"></script> 
    3333<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dialog.js"></script> 
    3434<script type="text/javascript"> 
  • trunk/popups/popup.css

    r677 r700  
    1 html, body { 
     1html, body, .dialog { 
    22  background: ButtonFace; 
    33  color: ButtonText; 
     
    2626border-bottom: 1px solid black; letter-spacing: 2px; 
    2727} 
    28  
     28.buttonColor { 
     29  padding: 1px; 
     30  cursor: default; 
     31  border: 1px solid; 
     32  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; 
     33} 
    2934#buttons { 
    3035      margin-top: 1em; border-top: 1px solid #999; 
Note: See TracChangeset for help on using the changeset viewer.