Changeset 791 for branches


Ignore:
Timestamp:
03/19/07 16:27:42 (12 years ago)
Author:
ray
Message:

updated branch

Location:
branches/ray
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/ray/XinhaCore.js

    r786 r791  
    57425742  document.body.appendChild(loading_message); 
    57435743   
     5744  Xinha.freeLater(loading_message); 
     5745  Xinha.freeLater(loading_main); 
     5746  Xinha.freeLater(loading_sub); 
     5747   
    57445748  return loading_sub; 
    57455749}; 
  • branches/ray/XinhaLoader.js

    r782 r791  
    2222  Xinha.createLoadingMessages(xinha_editors); 
    2323  var loadingMessages = Xinha.loadingMessages; 
    24   Xinha._loadback(_editor_url + "XinhaCore.js",function () {  
     24  Xinha._loadback(_editor_url + "XinhaCore.js",function () { 
    2525    Xinha.removeLoadingMessages(xinha_editors);   
    2626    Xinha.createLoadingMessages(xinha_editors);   
  • branches/ray/examples/testbed.html

    r786 r791  
    6363       [ 
    6464         'CharacterMap',  
    65         'Linker', 
    66         'Stylist', 
    67         'SmartReplace' 
     65        // 'Linker', 
     66        // 'Stylist', 
     67        // 'SmartReplace' 
    6868       ]; 
    6969             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :) 
     
    8787       //  xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); 
    8888          
    89       xinha_config.CharacterMap.mode = 'panel'; 
    90 xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); 
     89      //xinha_config.CharacterMap.mode = 'panel'; 
     90//xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); 
    9191 
    9292/* 
  • branches/ray/modules/ColorPicker/ColorPicker.js

    r786 r791  
    892892          colPicker.open("",chooser, input.value );  
    893893  } 
     894  Xinha.freeLater(this,"chooser"); 
    894895} 
    895896Xinha.colorPicker.InputBinding.prototype.setColor = function (color) 
  • branches/ray/modules/Dialogs/XinhaDialog.js

    r786 r791  
    3737  this.editor   = editor; 
    3838  this.document = document; 
     39  this.size = size; 
    3940  this.modal = (options && options.modal === false) ? false : true; 
    4041  this.closable = (options && options.closable === false) ? false : true; 
    4142  this.layer = (options && options.layer) ? options.layer : 0; 
    4243   
    43   if ( !this.background ) 
    44   { 
    45         this.background = []; 
    46          
    47     if (Xinha.is_ie) 
    48     { // IE6 needs the iframe to hide select boxes 
    49       var backG = document.createElement("iframe"); 
    50       backG.src = "about:blank"; 
    51     } 
    52     else  
    53     { // Mozilla (<FF3) can't have the iframe, because it hides the caret in text fields  
    54       // see https://bugzilla.mozilla.org/show_bug.cgi?id=226933 
    55       // unfortunately https://bugzilla.mozilla.org/show_bug.cgi?id=230701 indicates that this is an issue with pos fixed div, too 
    56       var backG = document.createElement("div"); 
    57     } 
    58     backG.className = "xinha_dialog_background"; 
    59     with (backG.style) 
    60     { 
    61       position = "absolute";//(Xinha.is_ie) ? "absolute" : "fixed";  
    62       top = 0; 
    63       left = 0; 
    64       border = 'none'; 
    65       overflow = "hidden"; 
    66       display = "none"; 
    67       zIndex = (this.modal ? 1025 : 1001 ) + this.layer; 
    68     } 
    69     document.body.appendChild(backG); 
    70     this.background.push(backG); 
    71      
    72     backG = document.createElement("div"); 
    73     with (backG.style) 
    74     { 
    75       position =  "absolute"; 
    76       top = 0; 
    77       left = 0; 
    78       overflow = "hidden"; 
    79       display = "none"; 
    80       zIndex = (this.modal ? 1026 : 1002 ) + this.layer; 
    81     }  
    82     document.body.appendChild(backG); 
    83     this.background.push(backG); 
    84     backG = null; 
    85     Xinha.freeLater(this.background); 
    86   } 
     44   
     45  if (Xinha.is_ie) 
     46  { // IE6 needs the iframe to hide select boxes 
     47    var backG = document.createElement("iframe"); 
     48    backG.src = "about:blank"; 
     49    backG.onreadystatechange = function ()  
     50    { 
     51      var doc = window.event.srcElement.contentWindow.document; 
     52      if (doc && doc.body) 
     53      { 
     54        doc.body.style.backgroundColor = "#666666"; 
     55      } 
     56    } 
     57  } 
     58  else 
     59  { // Mozilla (<FF3) can't have the iframe, because it hides the caret in text fields 
     60    // see https://bugzilla.mozilla.org/show_bug.cgi?id=226933 
     61    var backG = document.createElement("div"); 
     62  } 
     63  backG.className = "xinha_dialog_background"; 
     64  with (backG.style) 
     65  { 
     66    position = "absolute"; 
     67    top = 0; 
     68    left = 0; 
     69    border = 'none'; 
     70    overflow = "hidden"; 
     71    display = "none"; 
     72    zIndex = (this.modal ? 1025 : 1001 ) + this.layer; 
     73  } 
     74  document.body.appendChild(backG); 
     75  this.background = backG; 
     76 
     77  backG = null; 
     78  Xinha.freeLater(this, "background"); 
     79 
    8780  var rootElem = document.createElement('div'); 
    8881  //I've got the feeling dragging is much slower in IE7 w/ pos:fixed, besides the strange fact that it only works in Strict mode  
     
    10699 
    107100  rootElem.style.paddingBottom = "10px"; 
    108   rootElem.style.width = size.width + 'px'; 
    109  
    110    
    111   this.size = size; 
     101  rootElem.style.width = size.width  ? size.width + 'px' : ''; 
     102 
    112103  if (size.height) 
    113104  { 
     
    122113  } 
    123114 
    124   if(typeof localizer == 'function') 
    125   { 
    126     this._lc = localizer; 
    127   } 
    128   else if(localizer) 
    129   { 
    130     this._lc = function(string) 
    131     { 
    132       return Xinha._lc(string,localizer); 
    133     }; 
    134   } 
    135   else 
    136   { 
    137     this._lc = function(string) 
    138     { 
    139       return string; 
    140     }; 
    141   } 
    142  
    143   html = this.translateHtml(html) 
     115  html = this.translateHtml(html,localizer) 
    144116 
    145117  var main = document.createElement('div'); 
     
    154126  captionBar.style.MozUserSelect = "none"; 
    155127   
    156   var closer = null; 
     128  this.buttons = document.createElement('div'); 
     129  with (this.buttons.style) 
     130  { 
     131    position = "absolute"; 
     132    top = "0"; 
     133    right = "2px"; 
     134  } 
     135  rootElem.appendChild(this.buttons); 
     136   
     137  this.closer = null; 
    157138  if ( this.closable ) 
    158139  { 
    159     var closer = document.createElement('div'); 
    160     closer.className= 'closeButton';  
    161      
    162     closer.onmousedown = function(ev) { this.className = "closeButton buttonClick"; Xinha._stopEvent((ev) ? ev : window.event); return false;}; 
    163     closer.onmouseout = function(ev) { this.className = "closeButton"; Xinha._stopEvent((ev) ? ev : window.event); return false;}; 
    164     closer.onmouseup = function() { this.className = "closeButton"; dialog.hide(); return false;}; 
    165     captionBar.appendChild(closer); 
     140    this.closer = document.createElement('div'); 
     141    this.closer.className= 'closeButton';  
     142       
     143    this.closer.onmousedown = function(ev) { this.className = "closeButton buttonClick"; Xinha._stopEvent((ev) ? ev : window.event); return false;}; 
     144    this.closer.onmouseout = function(ev) { this.className = "closeButton"; Xinha._stopEvent((ev) ? ev : window.event); return false;}; 
     145    this.closer.onmouseup = function() { this.className = "closeButton"; dialog.hide(); return false;}; 
     146   
     147    this.buttons.appendChild(this.closer); 
    166148   
    167149    var butX = document.createElement('span'); 
     
    170152    butX.style.top = '-3px'; 
    171153   
    172     butX.appendChild(document.createTextNode('\u00D7')); 
    173     closer.appendChild(butX); 
     154    butX.appendChild(document.createTextNode('\u00D7')); // cross 
     155    //butX.appendChild(document.createTextNode('\u25AC')); //bar 
     156    //butX.appendChild(document.createTextNode('\u25BA')); //triangle right 
     157    //butX.appendChild(document.createTextNode('\u25B2')); //triangle up 
     158    //butX.appendChild(document.createTextNode('\u25BC')); //triangle down 
     159    this.closer.appendChild(butX); 
    174160    butX = null; 
    175161  } 
    176162   
    177   var icon = document.createElement('img'); 
    178   icon.className = 'icon'; 
    179   icon.src = _editor_url + 'images/xinha-small-icon.gif'; 
    180   icon.style.position = 'absolute'; 
    181   icon.style.top = '3px'; 
    182   icon.style.left = '2px'; 
     163  this.icon = document.createElement('img'); 
     164  with (this.icon) 
     165  { 
     166    className = 'icon'; 
     167    src = _editor_url + 'images/xinha-small-icon.gif'; 
     168    style.position = 'absolute'; 
     169    style.top = '3px'; 
     170    style.left = '2px'; 
     171  } 
    183172  captionBar.style.paddingLeft = '22px'; 
    184   captionBar.appendChild(icon); 
    185    
     173  rootElem.appendChild(this.icon); 
    186174   
    187175  var all = rootElem.getElementsByTagName("*"); 
     
    201189  } 
    202190 
    203   var resizeHandle = document.createElement('div'); 
    204   resizeHandle.className = "resizeHandle"; 
    205   with (resizeHandle.style) 
     191  this.resizer = document.createElement('div'); 
     192  this.resizer.className = "resizeHandle"; 
     193  with (this.resizer.style) 
    206194  { 
    207195    position = "absolute"; 
     
    209197    right= "0px"; 
    210198  } 
    211   resizeHandle.onmousedown = function(ev) { dialog._resizeStart(ev); }; 
    212   rootElem.appendChild(resizeHandle); 
     199  this.resizer.onmousedown = function(ev) { dialog._resizeStart(ev); }; 
     200  rootElem.appendChild(this.resizer); 
    213201   
    214202  this.rootElem = rootElem; 
    215203  this.captionBar = captionBar; 
    216204  this.main = main; 
    217   this.closer = closer; 
    218   this.icon = icon; 
    219   this.resizer = resizeHandle; 
    220    
    221   captionBar =  
    222   rootElem =  
    223   rootElem = 
    224   main =  
    225   closer =  
    226   icon =  
     205   
     206  captionBar = null; 
     207  rootElem = null; 
     208  main = null; 
    227209  resizeHandle = null; 
    228210   
    229   Xinha.freeLater(this,'rootElem'); 
     211  Xinha.freeLater(this,"rootElem"); 
     212  Xinha.freeLater(this,"captionBar"); 
     213  Xinha.freeLater(this,"main"); 
     214  Xinha.freeLater(this, "buttons"); 
     215  Xinha.freeLater(this, "closer"); 
     216  Xinha.freeLater(this, "icon"); 
     217  Xinha.freeLater(this, "resizer"); 
     218  Xinha.freeLater(this, "document"); 
    230219   
    231220  // for caching size & position after dragging & resizing 
     
    233222 
    234223}; 
    235  
    236 Xinha.Dialog.activateModeless = function(dialog) 
    237 { 
    238   var zIndex; 
    239   if (Xinha.Dialog.activeModeless == dialog || dialog.attached )  
    240   { 
    241     return; 
    242   } 
    243    
    244   if (Xinha.Dialog.activeModeless ) 
    245   { 
    246     Xinha.Dialog.activeModeless.rootElem.style.zIndex = parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex) -10; 
    247   } 
    248   Xinha.Dialog.activeModeless = dialog; 
    249  
    250   Xinha.Dialog.activeModeless.rootElem.style.zIndex = parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex) + 10; 
    251 } 
    252  
    253 Xinha.Dialog.prototype.sizeBackground = function() 
    254 { 
    255   var pageSize = Xinha.pageSize(); 
    256  
    257   if ( this.modal ) 
    258   { 
    259     this.resizeBackground({width: pageSize.x + 'px', height: pageSize.y + 'px'}); 
    260   } 
    261   //window.scroll(this.scrollPos.x, this.scrollPos.y); 
    262 } 
    263224 
    264225Xinha.Dialog.prototype.onresize = function() 
     
    291252  { 
    292253    dialog.saveSelection = function() { dialog._lastRange = dialog.editor.saveSelection();}; 
    293     Xinha._addEvent(this.editor._doc.body,'mouseup', dialog.saveSelection); 
     254    Xinha._addEvent(this.editor._doc,'mouseup', dialog.saveSelection); 
    294255  } 
    295256 
     
    304265  } 
    305266   
    306   if ( !this.attached) 
     267  if ( !this.attached ) 
    307268  { 
    308269    this.showBackground(); 
    309270    var viewport = Xinha.viewportSize(); 
    310     this.sizeBackground(); 
     271    if ( modal ) 
     272    { 
     273      var pageSize = Xinha.pageSize(); 
     274      this.resizeBackground({width:pageSize.x + "px",height:pageSize.y + "px"}); 
     275    } 
    311276    var viewportHeight = viewport.y; 
    312277    var viewportWidth = viewport.x; 
     
    382347  if (!modal) 
    383348  { 
    384     this.sizeBackground({width: dialogWidth + 'px', height: dialogHeight + 'px' }); 
     349    this.resizeBackground({width: dialogWidth + 'px', height: dialogHeight + 'px' }); 
    385350    this.posBackground({top:  rootElemStyle.top, left: rootElemStyle.left}); 
    386351  } 
     
    419384    if (Xinha.is_ie && !this.modal) 
    420385    { 
    421       Xinha._removeEvent(this.editor._doc.body,'mouseup', dialog.saveSelection); 
     386      Xinha._removeEvent(this.editor._doc,'mouseup', dialog.saveSelection); 
    422387    } 
    423388 
     
    688653Xinha.Dialog.prototype.hideBackground = function() 
    689654{ 
    690   this.background[0].style.display = 'none'; 
    691   this.background[1].style.display = 'none'; 
     655  this.background.style.display = 'none'; 
    692656} 
    693657Xinha.Dialog.prototype.showBackground = function() 
    694658{ 
    695   this.background[0].style.display = ''; 
    696   this.background[1].style.display = ''; 
     659  this.background.style.display = ''; 
    697660} 
    698661Xinha.Dialog.prototype.posBackground = function(pos) 
    699662{ 
    700   this.background[0].style.top  = pos.top; 
    701   this.background[0].style.left = pos.left; 
    702   this.background[1].style.top  = pos.top; 
    703   this.background[1].style.left = pos.left; 
     663  this.background.style.top  = pos.top; 
     664  this.background.style.left = pos.left; 
    704665} 
    705666Xinha.Dialog.prototype.resizeBackground = function(size) 
    706667{ 
    707   this.background[0].style.width  = size.width; 
    708   this.background[0].style.height = size.height; 
    709   this.background[1].style.width  = size.width; 
    710   this.background[1].style.height = size.height; 
     668  this.background.style.width  = size.width; 
     669  this.background.style.height = size.height; 
    711670} 
    712671Xinha.Dialog.prototype.posDialog = function(pos) 
     
    916875}; 
    917876 
    918 Xinha.Dialog.prototype.translateHtml = function(html) 
    919 { 
    920   var dialog = this; 
     877Xinha.Dialog.prototype.translateHtml = function(html,localizer) 
     878{ 
     879  var dialog = this; 
     880  if(typeof localizer == 'function') 
     881  { 
     882    dialog._lc = localizer; 
     883  } 
     884  else if(localizer) 
     885  { 
     886    this._lc = function(string) 
     887    { 
     888      return Xinha._lc(string,localizer); 
     889    }; 
     890  } 
     891  else 
     892  { 
     893    this._lc = function(string) 
     894    { 
     895      return string; 
     896    }; 
     897  } 
     898   
    921899  html = html.replace(/\[([a-z0-9_]+)\]/ig, 
    922900    function(fullString, id) 
     
    943921} 
    944922 
     923 
     924Xinha.Dialog.activateModeless = function(dialog) 
     925{ 
     926  var zIndex; 
     927  if (Xinha.Dialog.activeModeless == dialog || dialog.attached )  
     928  { 
     929    return; 
     930  } 
     931   
     932  if (Xinha.Dialog.activeModeless ) 
     933  { 
     934    Xinha.Dialog.activeModeless.rootElem.style.zIndex = parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex) -10; 
     935  } 
     936  Xinha.Dialog.activeModeless = dialog; 
     937 
     938  Xinha.Dialog.activeModeless.rootElem.style.zIndex = parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex) + 10; 
     939} 
  • branches/ray/modules/InsertImage/InsertImage.js

    r762 r791  
    101101        this.dialog.onresize = function () 
    102102        { 
    103                 this.getElementById("ipreview").style.height =  
     103                 
     104                 
     105                var newHeightForPreview =  
    104106                parseInt(this.height,10)  
    105107                - this.getElementById('h1').offsetHeight  
    106108                - this.getElementById('buttons').offsetHeight 
    107109                - this.getElementById('inputs').offsetHeight  
    108                 - parseInt(this.rootElem.style.paddingBottom,10) // we have a padding at the bottom, gotta take this into acount 
    109                 + 'px'; // don't forget this ;) 
     110                - parseInt(this.rootElem.style.paddingBottom,10); // we have a padding at the bottom, gotta take this into acount 
    110111                 
    111                 this.getElementById("ipreview").style.width =(this.width - 2) + 'px'; // and the width 
     112                 
     113                this.getElementById("ipreview").style.height = ((newHeightForPreview > 0) ? newHeightForPreview : 0) + "px"; // no-go beyond 0 
     114                 
     115                this.getElementById("ipreview").style.width = this.width - 2   + 'px'; // and the width 
    112116 
    113117        } 
  • branches/ray/plugins/CharacterMap/character-map.js

    r786 r791  
    5959    return false; 
    6060  }; 
    61   this.dialog.rootElem.appendChild( a ); 
     61  this.dialog.main.appendChild( a ); 
    6262  a = null; 
    6363}; 
  • branches/ray/plugins/ExtendedFileManager/images.php

    r761 r791  
    2727 
    2828//process paste 
    29 if (isset($_GET['paste'])) 
    30         $pasteStatus = $manager->processPaste(); 
    31  
    32 if ($manager->deleteFiles()) 
    33     $refreshFile = true; 
     29$pasteStatus = (isset($_GET['paste'])) ?        $manager->processPaste() : false; 
     30 
     31$refreshFile = ($manager->deleteFiles()) ? true : false; 
    3432 
    3533$refreshDir = false; 
     
    5149} 
    5250 
    53  
    54 $afruViewType=""; 
    55 if(isset($_REQUEST['viewtype'])) 
    56 { 
    57         $afruViewType=$_REQUEST['viewtype']; 
    58 } 
     51$afruViewType = (isset($_REQUEST['viewtype'])) ? $afruViewType=$_REQUEST['viewtype'] : ''; 
     52 
    5953if($afruViewType!="thumbview" && $afruViewType!="listview") 
    60  
    61 $afruViewType=$IMConfig['view_type']; 
    62  
     54{ 
     55  $afruViewType=$IMConfig['view_type']; 
     56} 
    6357//get the list of files and directories 
    6458$list = $manager->getFiles($relative); 
     
    139133                    <a href="#" title="Cut" onclick="copyFile('<?php echo rawurlencode($entry);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> 
    140134                     <a href="#" title="Copy" onclick="copyFile('<?php echo rawurlencode($entry);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> 
    141                     <?php $thisFileNameLength -= 6; }  ?> 
     135                    <?php }  ?> 
    142136                  </td> 
    143137                </tr> 
  • branches/ray/plugins/Stylist/stylist.js

    r786 r791  
    782782  this.dialog = new Xinha.Dialog(editor, html, 'Stylist',{width:200},{modal:false,closable:false}); 
    783783        Xinha._addClass( this.dialog.rootElem, 'Stylist' ); 
    784         this.dialog.attachToPanel('right'); 
     784        //this.dialog.attachToPanel('right'); 
    785785  this.dialog.show(); 
    786786   
Note: See TracChangeset for help on using the changeset viewer.