Dotclear


Ignore:
Timestamp:
11/17/13 20:25:53 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.6
Children:
2567:6c11245cbf04, 2568:61c67a7d17fa
Message:

Add some people in CREDITS, remove trailing spaces and tabs.

Location:
admin/js/jsToolBar
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • admin/js/jsToolBar/jsToolBar.dotclear.js

    r1753 r2566  
    88     window.the_toolbar = this; 
    99     args = args || ''; 
    10       
     10 
    1111     this.elements.link.data = {}; 
    1212     var url = this.elements.link.open_url+args; 
    13       
     13 
    1414     var p_win = window.open(url,'dc_popup', 
    1515     'alwaysRaised=yes,dependent=yes,toolbar=yes,height=420,width=520,'+ 
     
    2222jsToolBar.prototype.elements.link.fncall.wiki = function() { 
    2323     var data = this.elements.link.data; 
    24       
     24 
    2525     if (data.href == '') { return; } 
    26       
     26 
    2727     var etag = '|'+data.href; 
    2828     if (data.hreflang) { etag += '|'+data.hreflang; } 
    29       
     29 
    3030     if (data.title) { 
    3131          if (!data.hreflang) { etag += '|'; } 
    3232          etag += '|'+data.title; 
    3333     } 
    34       
     34 
    3535     if (data.content) { 
    3636          this.encloseSelection('['+data.content,etag+']'); 
     
    4545jsToolBar.prototype.elements.link.fncall.xhtml = function() { 
    4646     var data = this.elements.link.data; 
    47       
     47 
    4848     if (data.href == '') { return; } 
    49       
     49 
    5050     var stag = '<a href="'+data.href+'"'; 
    51       
     51 
    5252     if (data.hreflang) { stag += ' hreflang="'+data.hreflang+'"'; } 
    5353     if (data.title) { stag += ' title="'+data.title+'"'; } 
    5454     stag += '>'; 
    5555     var etag = '</a>'; 
    56       
     56 
    5757     if (data.content) { 
    5858          this.encloseSelection('','',function() { 
     
    6868     href = title = hreflang = ''; 
    6969     hreflang = this.elements.link.default_hreflang; 
    70       
     70 
    7171     var a = this.getAncestor(); 
    72       
     72 
    7373     if (a.tagName == 'a') { 
    7474          href= a.tag.href || ''; 
     
    7676          hreflang = a.tag.hreflang || ''; 
    7777     } 
    78       
     78 
    7979     this.elements.link.popup.call(this,'?href='+href+'&hreflang='+hreflang+'&title='+title); 
    8080}; 
    8181jsToolBar.prototype.elements.link.fncall.wysiwyg = function() { 
    8282     var data = this.elements.link.data; 
    83       
     83 
    8484     var a = this.getAncestor(); 
    85       
     85 
    8686     if (a.tagName == 'a') { 
    8787          if (data.href == '') { 
     
    106106          } 
    107107     } 
    108       
     108 
    109109     // Create link 
    110110     if (data.content) { 
     
    123123     var res = {}; 
    124124     var range, commonAncestorContainer; 
    125       
     125 
    126126     if (this.iwin.getSelection) { //gecko 
    127127          var selection = this.iwin.getSelection(); 
     
    135135          commonAncestorContainer = range.parentElement(); 
    136136     } 
    137       
     137 
    138138     var ancestorTagName = commonAncestorContainer.tagName.toLowerCase(); 
    139139     while (ancestorTagName!='a' && ancestorTagName!='body') { 
     
    141141          ancestorTagName = commonAncestorContainer.tagName.toLowerCase(); 
    142142     } 
    143       
     143 
    144144     res.tag = commonAncestorContainer; 
    145145     res.tagName = ancestorTagName; 
    146       
     146 
    147147     return res; 
    148148}; 
     
    160160          window.the_toolbar = this; 
    161161          this.elements.img_select.data = {}; 
    162            
     162 
    163163          var p_win = window.open(this.elements.img_select.open_url,'dc_popup', 
    164164          'alwaysRaised=yes,dependent=yes,toolbar=yes,height=500,width=760,'+ 
     
    172172     var d = this.elements.img_select.data; 
    173173     if (d.src == undefined) { return; } 
    174       
     174 
    175175     this.encloseSelection('','',function(str) { 
    176176          var alt = (str) ? str : d.title; 
    177177          var res = '(('+d.src+'|'+alt; 
    178            
     178 
    179179          if (d.alignment == 'left') { 
    180180               res += '|L'; 
     
    186186               res += '|'; 
    187187          } 
    188            
     188 
    189189          if (d.description) { 
    190190               res += '|'+d.description; 
    191191          } 
    192            
     192 
    193193          res += '))'; 
    194            
     194 
    195195          if (d.link) { 
    196196               var ltitle = (alt) ? '||'+alt : ''; 
    197197               res = '['+res+'|'+d.url+ltitle+']'; 
    198198          } 
    199            
     199 
    200200          return res; 
    201201     }); 
     
    207207     var d = this.elements.img_select.data; 
    208208     if (d.src == undefined) { return; } 
    209       
     209 
    210210     this.encloseSelection('','',function(str) { 
    211211          var alt = (str) ? str : d.title; 
    212212          var res = '<img src="'+d.src+'" alt="'+alt.replace('&','&amp;').replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')+'"'; 
    213            
     213 
    214214          if (d.alignment == 'left') { 
    215215               res += ' style="float: left; margin: 0 1em 1em 0;"'; 
     
    219219               res += ' style="margin: 0 auto; display: block;"'; 
    220220          } 
    221            
     221 
    222222          if (d.description) { 
    223223               res += ' title="'+d.description.replace('&','&amp;').replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')+'"'; 
    224224          } 
    225            
     225 
    226226          res += ' />'; 
    227            
     227 
    228228          if (d.link) { 
    229229               var ltitle = (alt) ? ' title="'+alt.replace('&','&amp;').replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')+'"' : ''; 
    230230               res = '<a href="'+d.url+'"'+ltitle+'>'+res+'</a>'; 
    231231          } 
    232            
     232 
    233233          return res; 
    234234     }); 
     
    238238     var src = this.elements.img.prompt.call(this); 
    239239     if (!src) { return; } 
    240       
     240 
    241241     var img = this.iwin.document.createElement('img'); 
    242242     img.src = src; 
    243243     img.setAttribute('alt',this.getSelectedText()); 
    244       
     244 
    245245     this.insertNode(img); 
    246246}; 
     
    253253     var alt = (this.getSelectedText()) ? this.getSelectedText() : d.title; 
    254254     if (d.src == undefined) { return; } 
    255       
     255 
    256256     var img = this.iwin.document.createElement('img'); 
    257257     img.src = d.src; 
    258258     img.setAttribute('alt',alt); 
    259       
    260       
     259 
     260 
    261261     if (d.alignment == 'left') { 
    262262          if (img.style.styleFloat != undefined) { 
     
    286286          img.style.display = 'block'; 
    287287     } 
    288       
     288 
    289289     if (d.description) { 
    290290          img.setAttribute('title',d.description); 
    291291     } 
    292       
     292 
    293293     if (d.link) { 
    294294          var a = this.iwin.document.createElement('a'); 
     
    309309     var d = this.elements.mp3_insert.data; 
    310310     if (d.player == undefined) { return; } 
    311       
     311 
    312312     this.encloseSelection('','',function(str) { 
    313313          return '\n///html\n' + d.player + '///\n'; 
     
    317317     var d = this.elements.mp3_insert.data; 
    318318     if (d.player == undefined) { return; } 
    319       
     319 
    320320     this.encloseSelection('','',function(str) { 
    321321          return '\n' + d.player + '\n'; 
     
    331331     var d = this.elements.flv_insert.data; 
    332332     if (d.player == undefined) { return; } 
    333       
     333 
    334334     this.encloseSelection('','',function(str) { 
    335335          return '\n///html\n' + d.player + '///\n'; 
     
    339339     var d = this.elements.flv_insert.data; 
    340340     if (d.player == undefined) { return; } 
    341       
     341 
    342342     this.encloseSelection('','',function(str) { 
    343343          return '\n' + d.player + '\n'; 
     
    360360          window.the_toolbar = this; 
    361361          this.elements.img_select.data = {}; 
    362            
     362 
    363363          var p_win = window.open(this.elements.post_link.open_url,'dc_popup', 
    364364          'alwaysRaised=yes,dependent=yes,toolbar=yes,height=500,width=760,'+ 
     
    378378// Last space element 
    379379jsToolBar.prototype.elements.space3 = { 
    380      type:'space',  
     380     type:'space', 
    381381     format:{ 
    382382          wysiwyg:true, 
  • admin/js/jsToolBar/jsToolBar.js

    r1759 r2566  
    88 * the Free Software Foundation; either version 2 of the License, or 
    99 * (at your option) any later version. 
    10  *  
     10 * 
    1111 * DotClear is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1313 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    15  *  
     15 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with DotClear; if not, write to the Free Software 
     
    2323function jsToolBar(textarea) { 
    2424     if (!document.createElement) { return; } 
    25       
     25 
    2626     if (!textarea) { return; } 
    27       
     27 
    2828     if ((typeof(document["selection"]) == "undefined") 
    2929     && (typeof(textarea["setSelectionRange"]) == "undefined")) { 
    3030          return; 
    3131     } 
    32       
     32 
    3333     this.textarea = textarea; 
    34       
     34 
    3535     this.editor = document.createElement('div'); 
    3636     this.editor.className = 'jstEditor'; 
    37       
     37 
    3838     this.textarea.parentNode.insertBefore(this.editor,this.textarea); 
    3939     this.editor.appendChild(this.textarea); 
    40       
     40 
    4141     this.toolbar = document.createElement("div"); 
    4242     this.toolbar.className = 'jstElements'; 
    4343     this.editor.parentNode.insertBefore(this.toolbar,this.editor); 
    44       
     44 
    4545     // Dragable resizing (only for gecko) 
    4646     if (navigator.appName == 'Microsoft Internet Explorer') 
    4747     { 
    4848          if (this.editor.addEventListener) 
    49           {          
     49          { 
    5050               this.handle = document.createElement('div'); 
    5151               this.handle.className = 'jstHandle'; 
     
    5656          } 
    5757     } 
    58       
     58 
    5959     this.context = null; 
    60      this.toolNodes = {}; // lorsque la toolbar est dessinée , cet objet est garni  
     60     this.toolNodes = {}; // lorsque la toolbar est dessinée , cet objet est garni 
    6161                         // de raccourcis vers les éléments DOM correspondants aux outils. 
    6262}; 
     
    7070jsButton.prototype.draw = function() { 
    7171     if (!this.scope) return null; 
    72       
     72 
    7373     var button = document.createElement('button'); 
    7474     button.setAttribute('type','button'); 
     
    7878     span.appendChild(document.createTextNode(this.title)); 
    7979     button.appendChild(span); 
    80       
     80 
    8181     if (this.icon != undefined) { 
    8282          button.style.backgroundImage = 'url('+this.icon+')'; 
     
    9999     span.className = 'jstSpacer'; 
    100100     if (this.width) span.style.marginRight = this.width+'px'; 
    101       
     101 
    102102     return span; 
    103103}; 
     
    112112jsCombo.prototype.draw = function() { 
    113113     if (!this.scope || !this.options) return null; 
    114       
     114 
    115115     var select = document.createElement('select'); 
    116116     if (this.className) select.className = className; 
    117117     select.title = this.title; 
    118       
     118 
    119119     for (var o in this.options) { 
    120120          //var opt = this.options[o]; 
     
    124124          select.appendChild(option); 
    125125     } 
    126       
     126 
    127127     var This = this; 
    128128     select.onchange = function() { 
    129           try {  
     129          try { 
    130130               This.fn.call(This.scope, this.value); 
    131131          } catch (e) { alert(e); } 
    132            
     132 
    133133          return false; 
    134134     }; 
    135       
     135 
    136136     return select; 
    137137}; 
     
    142142     mode: 'xhtml', 
    143143     elements: {}, 
    144       
     144 
    145145     getMode: function() { 
    146146          return this.mode; 
    147147     }, 
    148       
     148 
    149149     setMode: function(mode) { 
    150150          this.mode = mode || 'xhtml'; 
    151151     }, 
    152       
     152 
    153153     switchMode: function(mode) { 
    154154          mode = mode || 'xhtml'; 
    155155          this.draw(mode); 
    156156     }, 
    157       
     157 
    158158     button: function(toolName) { 
    159159          var tool = this.elements[toolName]; 
     
    175175     combo: function(toolName) { 
    176176          var tool = this.elements[toolName]; 
    177            
     177 
    178178          if( tool[this.mode] != undefined) { 
    179                 
     179 
    180180               var length = tool[this.mode].list.length; 
    181                 
     181 
    182182               if (typeof tool[this.mode].fn != 'function' || length == 0) { 
    183183                    return null; 
     
    190190                    return new jsCombo(tool.title, options, this, tool[this.mode].fn); 
    191191               } 
    192                 
    193           } 
    194            
     192 
     193          } 
     194 
    195195     }, 
    196196     draw: function(mode) { 
    197197          this.setMode(mode); 
    198            
     198 
    199199          // Empty toolbar 
    200200          while (this.toolbar.hasChildNodes()) { 
     
    202202          } 
    203203          this.toolNodes = {}; // vide les raccourcis DOM/**/ 
    204            
     204 
    205205          // Draw toolbar elements 
    206206          var b, tool, newTool; 
    207            
     207 
    208208          for (var i in this.elements) { 
    209209               b = this.elements[i]; 
    210                 
     210 
    211211               var disabled = 
    212212               b.type == undefined || b.type == '' 
    213213               || (b.disabled != undefined && b.disabled) 
    214214               || (b.context != undefined && b.context != null && b.context != this.context); 
    215                 
     215 
    216216               if (!disabled && typeof this[b.type] == 'function') { 
    217217                    tool = this[b.type](i); 
     
    224224          } 
    225225     }, 
    226       
     226 
    227227     singleTag: function(stag,etag) { 
    228228          stag = stag || null; 
    229229          etag = etag || stag; 
    230            
     230 
    231231          if (!stag || !etag) { return; } 
    232            
     232 
    233233          this.encloseSelection(stag,etag); 
    234234     }, 
    235       
     235 
    236236     encloseSelection: function(prefix, suffix, fn) { 
    237237          this.textarea.focus(); 
    238            
     238 
    239239          prefix = prefix || ''; 
    240240          suffix = suffix || ''; 
    241            
     241 
    242242          var start, end, sel, scrollPos, subst, res; 
    243            
     243 
    244244          if (typeof(document["selection"]) != "undefined") { 
    245245               sel = document.selection.createRange().text; 
     
    250250               sel = this.textarea.value.substring(start, end); 
    251251          } 
    252            
     252 
    253253          if (sel.match(/ $/)) { // exclude ending space char, if any 
    254254               sel = sel.substring(0, sel.length - 1); 
    255255               suffix = suffix + " "; 
    256256          } 
    257            
     257 
    258258          if (typeof(fn) == 'function') { 
    259259               res = (sel) ? fn.call(this,sel) : fn(''); 
     
    261261               res = (sel) ? sel : ''; 
    262262          } 
    263            
     263 
    264264          subst = prefix + res + suffix; 
    265            
     265 
    266266          if (typeof(document["selection"]) != "undefined") { 
    267267               var range = document.selection.createRange().text = subst; 
     
    278278          } 
    279279     }, 
    280       
     280 
    281281     stripBaseURL: function(url) { 
    282282          if (this.base_url != '') { 
     
    286286               } 
    287287          } 
    288            
     288 
    289289          return url; 
    290290     } 
     
    355355// spacer 
    356356jsToolBar.prototype.elements.space0 = { 
    357      type:'space',  
     357     type:'space', 
    358358     format:{ 
    359359          wysiwyg:true, 
     
    425425// spacer 
    426426jsToolBar.prototype.elements.space1 = { 
    427      type:'space',  
     427     type:'space', 
    428428     format:{ 
    429429          wysiwyg:true, 
     
    445445// spacer 
    446446jsToolBar.prototype.elements.space2 = { 
    447      type:'space',  
     447     type:'space', 
    448448     format:{ 
    449449          wysiwyg:true, 
     
    523523// spacer 
    524524jsToolBar.prototype.elements.space3 = { 
    525      type:'space',  
     525     type:'space', 
    526526     format:{ 
    527527          wysiwyg:true, 
     
    542542          href = href || ''; 
    543543          hreflang = hreflang || this.elements.link.default_hreflang; 
    544            
     544 
    545545          href = window.prompt(this.elements.link.href_prompt,href); 
    546546          if (!href) { return false; } 
    547            
     547 
    548548          hreflang = window.prompt(this.elements.link.hreflang_prompt, 
    549549          hreflang); 
    550            
     550 
    551551          return { href: this.stripBaseURL(href), hreflang: hreflang }; 
    552552     } 
     
    560560          stag = stag+'>'; 
    561561          var etag = '</a>'; 
    562            
     562 
    563563          this.encloseSelection(stag,etag); 
    564564     } 
     
    571571          if (link.hreflang) { etag = etag+'|'+link.hreflang; } 
    572572          etag = etag+']'; 
    573            
     573 
    574574          this.encloseSelection(stag,etag); 
    575575     } 
  • admin/js/jsToolBar/jsToolBar.wysiwyg.js

    r2155 r2566  
    88 * the Free Software Foundation; either version 2 of the License, or 
    99 * (at your option) any later version. 
    10  *  
     10 * 
    1111 * DotClear is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1313 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    15  *  
     15 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with DotClear; if not, write to the Free Software 
     
    3232jsToolBar.prototype.draw = function(mode) { 
    3333     mode = mode || 'xhtml'; 
    34       
     34 
    3535     if (this.can_wwg) { 
    3636          this.mode = 'wysiwyg'; 
     
    4444jsToolBar.prototype.switchMode = function(mode) { 
    4545     mode = mode || 'xhtml'; 
    46       
     46 
    4747     if (mode == 'xhtml') { 
    4848          this.wwg_mode = true; 
     
    7070          this.textarea.value = html; 
    7171     } 
    72       
     72 
    7373     function initContent() { 
    7474          if (!This.iframe.contentWindow.document || !This.iframe.contentWindow.document.body) { 
     
    7777          } 
    7878          This.ibody = This.iframe.contentWindow.document.body; 
    79            
     79 
    8080          if (This.textarea.value != '' && This.textarea.value != '<p></p>') { 
    8181               This.ibody.innerHTML = This.applyWysiwygFilters(This.textarea.value); 
     
    139139jsToolBar.prototype.initWindow = function() { 
    140140     var This = this; 
    141       
     141 
    142142     this.iframe = document.createElement('iframe'); 
    143143     this.textarea.parentNode.insertBefore(this.iframe,this.textarea.nextSibling); 
    144       
     144 
    145145     this.switcher = document.createElement('ul'); 
    146146     this.switcher.className = 'jstSwitcher'; 
    147147     this.editor.appendChild(this.switcher); 
    148       
     148 
    149149     this.iframe.height = this.textarea.offsetHeight + 0; 
    150150     this.iframe.width = this.textarea.offsetWidth + 0; 
    151       
     151 
    152152     if (this.textarea.tabIndex != undefined) { 
    153153          this.iframe.tabIndex = this.textarea.tabIndex; 
    154154     } 
    155       
     155 
    156156     function initIframe() { 
    157157          var doc = This.iframe.contentWindow.document; 
     
    160160               return false; 
    161161          } 
    162            
     162 
    163163          doc.open(); 
    164164          var html = 
     
    171171          '</body>\n'+ 
    172172          '</html>'; 
    173            
     173 
    174174          doc.write(html); 
    175175          doc.close(); 
     
    178178               // warning : doc is now inaccessible for IE6 sp1 
    179179          } 
    180            
     180 
    181181          This.iwin = This.iframe.contentWindow; 
    182            
     182 
    183183          This.syncContents('textarea'); 
    184            
     184 
    185185          if (This.wwg_mode == undefined) { 
    186186               This.wwg_mode = true; 
    187187          } 
    188            
     188 
    189189          if (This.wwg_mode) { 
    190190               This.textarea.style.display = 'none'; 
     
    192192               This.iframe.style.display = 'none'; 
    193193          } 
    194            
     194 
    195195          // update textarea on submit 
    196196          if (This.textarea.form) { 
     
    201201               }); 
    202202          } 
    203            
     203 
    204204          for (var evt in This.iwinEvents) { 
    205205               var event = This.iwinEvents[evt]; 
    206206               This.addIwinEvent(This.iframe.contentWindow.document, event.type, event.fn, This); 
    207207          } 
    208            
     208 
    209209          This.setSwitcher(); 
    210210          try { This.iwin.document.designMode = 'on'; } catch (e) {}; // Firefox needs this 
    211            
     211 
    212212          return true; 
    213213     } 
     
    241241          this.switcher.removeChild(this.switcher.firstChild); 
    242242     } 
    243       
     243 
    244244     var This = this; 
    245245     function setLink(title,link) { 
     
    255255               a = document.createTextNode(title); 
    256256          } 
    257            
     257 
    258258          li.appendChild(a); 
    259259          This.switcher.appendChild(li); 
    260260     } 
    261       
     261 
    262262     setLink(this.switcher_visual_title,!this.wwg_mode); 
    263263     setLink(this.switcher_source_title,this.wwg_mode); 
     
    271271          this.iframe = null; 
    272272     } 
    273       
     273 
    274274     if (this.switcher != undefined && this.switcher.parentNode != undefined) { 
    275275          this.switcher.parentNode.removeChild(this.switcher); 
     
    312312jsToolBar.prototype.insertNode = function(node) { 
    313313     var range; 
    314       
     314 
    315315     if (this.iwin.getSelection) { // Gecko 
    316316          var sel = this.iwin.getSelection(); 
    317317          range = sel.getRangeAt(0); 
    318            
     318 
    319319          // deselect all ranges 
    320320          sel.removeAllRanges(); 
    321            
     321 
    322322          // empty range 
    323323          range.deleteContents(); 
    324            
     324 
    325325          // Insert node 
    326326          range.insertNode(node); 
    327            
     327 
    328328          range.selectNodeContents(node); 
    329329          range.setEndAfter(node); 
     
    335335          } 
    336336          sel.addRange(range); 
    337            
     337 
    338338          sel.collapseToEnd(); 
    339339     } else { // IE 
     
    391391jsToolBar.prototype.getBlockLevel = function() { 
    392392     var blockElts = ['p','h1','h2','h3','h4','h5','h6']; 
    393       
     393 
    394394     var range, commonAncestorContainer; 
    395395     if (this.iwin.getSelection) { //gecko 
     
    404404          commonAncestorContainer = range.parentElement(); 
    405405     } 
    406       
     406 
    407407     var ancestorTagName = commonAncestorContainer.tagName.toLowerCase(); 
    408408     while (arrayIndexOf(blockElts, ancestorTagName)==-1 && ancestorTagName!='body') { 
     
    430430     [/<style[\w\W]*?>[\w\W]*?<\/style>/gim, ''], 
    431431     [/<\/?font[\w\W]*?>/gim, ''], 
    432       
    433       
     432 
     433 
    434434     /* Replacements */ 
    435435     [/<(\/?)(B|b|STRONG)([\s>\/])/g, "<$1strong$3"], 
     
    498498          html = html.replace(/(<[^\/!]>|<[^\/!][^>]*[^\/]>)\s*<\/[^>]*[^-]>/g, ""); 
    499499     } 
    500       
     500 
    501501     /* tous les tags en minuscule */ 
    502502     html = html.replace(/<(\/?)([A-Z0-9]+)/g, 
     
    504504                    return "<" + match1 + match2.toLowerCase(); 
    505505               }); 
    506       
     506 
    507507     /* IE laisse souvent des attributs sans guillemets */ 
    508508     var myRegexp = /<[^>]+((\s+\w+\s*=\s*)([^"'][\w~@+$,%\/:.#?=&;!*()-]*))[^>]*?>/; 
     
    516516          ) 
    517517     } 
    518       
     518 
    519519     /* les navigateurs rajoutent une unite aux longueurs css nulles */ 
    520520     /* note: a ameliorer ! */ 
     
    522522          html = html.replace(/(<[^>]+style=(["'])[^>]+[\s:]+)0(pt|px)(\2|\s|;)/gi, "$1"+"0$4"); 
    523523     } 
    524       
     524 
    525525     /* correction des fins de lignes : le textarea edite contient des \n 
    526526     * le wysiwyg des \r\n , et le textarea mis a jour SANS etre affiche des \r\n ! */ 
    527527     html = html.replace(/\r\n/g,"\n"); 
    528       
     528 
    529529     /* Trim */ 
    530530     html = html.replace(/^\s+/gm,''); 
    531531     html = html.replace(/\s+$/gm,''); 
    532       
     532 
    533533     return html; 
    534534}; 
     
    538538     var BQs = this.iwin.document.getElementsByTagName('blockquote'); 
    539539     var bqChilds; 
    540       
     540 
    541541     for (var bq = 0; bq < BQs.length; bq++) { 
    542542          bqChilds = BQs[bq].childNodes; 
     
    572572     [/(<[a-z][^>]*)margin-right\s*:[^;]*;/mg, "$1"], 
    573573     [/(<[a-z][^>]*)margin-top\s*:[^;]*;/mg, "$1"], 
    574       
     574 
    575575     [/(<[a-z][^>]*)padding\s*:[^;]*;/mg, "$1"], 
    576576     [/(<[a-z][^>]*)padding-bottom\s*:[^;]*;/mg, "$1"], 
     
    578578     [/(<[a-z][^>]*)padding-right\s*:[^;]*;/mg, "$1"], 
    579579     [/(<[a-z][^>]*)padding-top\s*:[^;]*;/mg, "$1"], 
    580       
     580 
    581581     [/(<[a-z][^>]*)font\s*:[^;]*;/mg, "$1"], 
    582582     [/(<[a-z][^>]*)font-family\s*:[^;]*;/mg, "$1"], 
     
    585585     [/(<[a-z][^>]*)font-variant\s*:[^;]*;/mg, "$1"], 
    586586     [/(<[a-z][^>]*)font-weight\s*:[^;]*;/mg, "$1"], 
    587       
     587 
    588588     [/(<[a-z][^>]*)color\s*:[^;]*;/mg, "$1"] 
    589589); 
     
    593593          html = html.replace(this.removeFormatRegexp[reg][0], this.removeFormatRegexp[reg][1]); 
    594594     } 
    595       
     595 
    596596     html = this.tagsoup2xhtml(html); 
    597597     html = html.replace(/style="\s*?"/mgi,''); 
     
    693693          commonAncestorContainer = range.parentElement(); 
    694694     } 
    695       
     695 
    696696     var ancestorTagName = commonAncestorContainer.tagName.toLowerCase(); 
    697697     while (ancestorTagName!='a' && ancestorTagName!='body') { 
     
    699699          ancestorTagName = commonAncestorContainer.tagName.toLowerCase(); 
    700700     } 
    701       
     701 
    702702     // Update or remove link? 
    703703     if (ancestorTagName == 'a') { 
     
    705705          hreflang = commonAncestorContainer.hreflang || ''; 
    706706     } 
    707       
     707 
    708708     href = window.prompt(this.elements.link.href_prompt,href); 
    709       
     709 
    710710     // Remove link 
    711711     if (ancestorTagName == 'a' && href=='') { 
     
    713713     } 
    714714     if (!href) return; // user cancel 
    715       
     715 
    716716     hreflang = window.prompt(this.elements.link.hreflang_prompt, hreflang); 
    717       
     717 
    718718     // Update link 
    719719     if (ancestorTagName == 'a' && href) { 
     
    726726          return; 
    727727     } 
    728       
     728 
    729729     // Create link 
    730730     var n = this.getSelectedNode(); 
  • admin/js/jsToolBar/popup_link.js

    r0 r2566  
    33          window.close(); 
    44     }); 
    5       
     5 
    66     $('#link-insert-ok').click(function() { 
    77          sendClose(); 
    88          window.close(); 
    99     }); 
    10       
     10 
    1111     function sendClose() { 
    1212          var insert_form = $('#link-insert-form').get(0); 
    1313          if (insert_form == undefined) { return; } 
    14            
     14 
    1515          var tb = window.opener.the_toolbar; 
    1616          var data = tb.elements.link.data; 
    17            
     17 
    1818          data.href = tb.stripBaseURL(insert_form.elements.href.value); 
    1919          data.title = insert_form.elements.title.value; 
  • admin/js/jsToolBar/popup_media.js

    r0 r2566  
    11$(function() { 
    22     var toolBar = window.opener.the_toolbar.textarea; 
    3       
     3 
    44     $('#media-insert').onetabload(function() { 
    55          $('#media-insert-cancel').click(function() { 
    66               window.close(); 
    77          }); 
    8            
     8 
    99          $('#media-insert-ok').click(function() { 
    1010               sendClose(); 
     
    1212          }); 
    1313     }); 
    14       
     14 
    1515     function sendClose() { 
    1616          var insert_form = $('#media-insert-form').get(0); 
    1717          if (insert_form == undefined) { return; } 
    18            
     18 
    1919          var tb = window.opener.the_toolbar; 
    2020          var type = insert_form.elements.type.value; 
    21            
     21 
    2222          var media_align_grid = { 
    2323               left: 'float: left; margin: 0 1em 1em 0;', 
     
    2525               center: 'text-align: center;' 
    2626          }; 
    27            
     27 
    2828          if (type == 'image') 
    2929          { 
     
    3131               tb.elements.img_select.data.alignment = $('input[name="alignment"]:checked',insert_form).val(); 
    3232               tb.elements.img_select.data.link = $('input[name="insertion"]:checked',insert_form).val() == 'link'; 
    33                 
     33 
    3434               tb.elements.img_select.data.title = insert_form.elements.title.value; 
    3535               tb.elements.img_select.data.description = $('input[name="description"]',insert_form).val(); 
     
    4141               var player = $('#public_player').val(); 
    4242               var align = $('input[name="alignment"]:checked',insert_form).val(); 
    43                 
     43 
    4444               if (align != undefined && align != 'none') { 
    4545                    player = '<div style="' + media_align_grid[align] + '">' + player + '</div>'; 
    4646               } 
    47                 
     47 
    4848               tb.elements.mp3_insert.data.player = player.replace(/>/g,'>\n'); 
    4949               tb.elements.mp3_insert.fncall[tb.mode].call(tb); 
     
    5353               var oplayer = $('<div>'+$('#public_player').val()+'</div>'); 
    5454               var flashvars = $("[name=FlashVars]",oplayer).val(); 
    55                 
     55 
    5656               var align = $('input[name="alignment"]:checked',insert_form).val(); 
    5757               var title = insert_form.elements.title.value; 
    58                 
     58 
    5959               if (title) { 
    6060                    flashvars = 'title='+encodeURI(title)+'&amp;'+flashvars; 
     
    6464               flashvars = flashvars.replace(/(width=\d*)/,'width='+$('#video_w').val()); 
    6565               flashvars = flashvars.replace(/(height=\d*)/,'height='+$('#video_h').val()); 
    66                 
     66 
    6767               $("[name=FlashVars]",oplayer).val(flashvars); 
    68                var player = oplayer.html();   
    69                 
     68               var player = oplayer.html(); 
     69 
    7070               if (align != undefined && align != 'none') { 
    7171                    player = '<div style="' + media_align_grid[align] + '">' + player + '</div>'; 
    7272               } 
    73                 
     73 
    7474               tb.elements.flv_insert.data.player = player.replace(/>/g,'>\n'); 
    7575               tb.elements.flv_insert.fncall[tb.mode].call(tb); 
     
    8282          } 
    8383     }; 
    84       
     84 
    8585     function playerFormat(s) { 
    8686          s = s.replace(/&lt;/g,'<'); 
    8787          s = s.replace(/&gt;/g,'>\n'); 
    8888          s = s.replace(/&amp;/g,'&'); 
    89            
     89 
    9090          return s; 
    9191     }; 
  • admin/js/jsToolBar/popup_posts.js

    r0 r2566  
    33          window.close(); 
    44     }); 
    5       
     5 
    66     $('#form-entries tr>td.maximal>a').click(function() { 
    77          // Get post_id 
    88          var tb = window.opener.the_toolbar; 
    99          var data = tb.elements.link.data; 
    10            
     10 
    1111          data.href = tb.stripBaseURL($(this).attr('title')); 
    12            
     12 
    1313          tb.elements.link.fncall[tb.mode].call(tb); 
    1414          window.close(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map