Dotclear

Changeset 2566:9bf417837888 for admin/js


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
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_category.js

    r0 r2566  
    11$(function() { 
    22     dotclear.hideLockable(); 
    3       
     3 
    44     var tbCategory = new jsToolBar(document.getElementById('cat_desc')); 
    55     tbCategory.draw('xhtml'); 
  • admin/js/_comment.js

    r0 r2566  
    11$(function() { 
    22     if (!document.getElementById) { return; } 
    3       
     3 
    44     var tbComment = new jsToolBar(document.getElementById('comment_content')); 
    55     tbComment.draw('xhtml'); 
    6       
     6 
    77     $('#comment-form input[name="delete"]').click(function() { 
    88          return window.confirm(dotclear.msg.confirm_delete_comment); 
  • admin/js/_comments.js

    r2531 r2566  
    11dotclear.viewCommentContent = function(line,action) { 
    22     var action = action || 'toggle'; 
    3      var commentId = $(line).attr('id').substr(1);      
     3     var commentId = $(line).attr('id').substr(1); 
    44     var tr = document.getElementById('ce'+commentId); 
    55 
     
    1111          td.className = 'expand'; 
    1212          tr.appendChild(td); 
    13            
     13 
    1414          // Get comment content 
    1515          $.get('services.php',{f:'getCommentById',id: commentId},function(data) { 
    1616               var rsp = $(data).children('rsp')[0]; 
    17                 
     17 
    1818               if (rsp.attributes[0].value == 'ok') { 
    1919                    var comment = $(rsp).find('comment_display_content').text(); 
    20                      
     20 
    2121                    if (comment) { 
    2222                         $(td).append(comment); 
     
    2525                         var comment_ip = $(rsp).find('comment_ip').text(); 
    2626                         var comment_spam_disp = $(rsp).find('comment_spam_disp').text(); 
    27                           
     27 
    2828                         $(td).append('<p><strong>' + dotclear.msg.website + 
    2929                         '</strong> ' + comment_site + '<br />' + 
     
    3737               } 
    3838          }); 
    39            
     39 
    4040          $(line).toggleClass('expand'); 
    4141          line.parentNode.insertBefore(tr,line.nextSibling); 
  • admin/js/_posts_list.js

    r2531 r2566  
    33     var postId = $(line).attr('id').substr(1); 
    44     var tr = document.getElementById('pe'+postId); 
    5       
     5 
    66     if ( !tr && ( action == 'toggle' || action == 'open' ) ) { 
    77          tr = document.createElement('tr'); 
     
    1111          td.className = 'expand'; 
    1212          tr.appendChild(td); 
    13            
     13 
    1414          // Get post content 
    1515          $.get('services.php',{f:'getPostById', id: postId, post_type: ''},function(data) { 
    1616               var rsp = $(data).children('rsp')[0]; 
    17                 
     17 
    1818               if (rsp.attributes[0].value == 'ok') { 
    1919                    var post = $(rsp).find('post_display_content').text(); 
    2020                    var post_excerpt = $(rsp).find('post_display_excerpt').text(); 
    2121                    var res = ''; 
    22                      
     22 
    2323                    if (post) { 
    2424                         if (post_excerpt) { 
     
    3232               } 
    3333          }); 
    34            
     34 
    3535          $(line).addClass('expand'); 
    3636          line.parentNode.insertBefore(tr,line.nextSibling); 
  • admin/js/_preferences.js

    r2101 r2566  
    33          return; 
    44     } 
    5       
     5 
    66     var user_email = $('#user_email').val(); 
    7       
     7 
    88     $('#user-form').submit(function() { 
    99          var e = this.elements['cur_pwd']; 
  • admin/js/_users.js

    r860 r2566  
    99          var i; 
    1010          var msg_cannot_delete = false; 
    11            
     11 
    1212          $(this).find('input[name="users[]"]').each(function() { 
    1313               user_ids.push(this); 
     
    1616               nb_posts.push(this.value); 
    1717          }); 
    18            
     18 
    1919          if (action == 'deleteuser') { 
    2020               for (i=0; i<user_ids.length; i++) { 
     
    3030               } 
    3131          } 
    32            
     32 
    3333          var selectfields = 0; 
    3434          for (i=0; i<user_ids.length; i++) { 
    3535               selectfields += user_ids[i].checked; 
    3636          } 
    37            
     37 
    3838          if (selectfields == 0) { 
    3939               return false; 
    4040          } 
    41            
     41 
    4242          if (action == 'deleteuser') { 
    4343               return window.confirm(dotclear.msg.confirm_delete_user.replace('%s',$('input[name="users[]"]:checked').size())); 
    4444          } 
    45            
     45 
    4646          return true; 
    4747     }); 
  • admin/js/_users_actions.js

    r1449 r2566  
    11jQuery.fn.updatePermissionsForm = function() { 
    22     return this.each(function() { 
    3            
     3 
    44          var perms = {}; 
    55          var re = /^perm\[(.+?)\]\[(.+?)\]$/; 
    66          var e,prop; 
    7            
     7 
    88          // Building a nice object of form elements 
    99          for (var i=0; i<this.elements.length; i++) { 
    1010               e = this.elements[i]; 
    11                 
     11 
    1212               if (e.name == undefined) { 
    1313                    continue; 
     
    2222               } 
    2323               perms[prop[1]][prop[2]] = e; 
    24                 
     24 
    2525               // select related permissions for admin 
    2626               if (prop[2] == 'admin') { 
     
    4949               } 
    5050          } 
    51            
     51 
    5252          function admin(E,perms,re) { 
    5353                         P = E.name.match(re); 
    54                           
     54 
    5555                         perms[P[1]]['usage'].checked = E.checked; 
    5656                         perms[P[1]]['publish'].checked = E.checked; 
     
    6868                         perms[P[1]]['media_admin'].disabled = E.checked; 
    6969          } 
    70            
     70 
    7171          function contentadmin(E,perms,re) { 
    7272                         P = E.name.match(re); 
    73                           
     73 
    7474                         perms[P[1]]['usage'].checked = E.checked; 
    7575                         perms[P[1]]['publish'].checked = E.checked; 
     
    7979                         perms[P[1]]['delete'].disabled = E.checked; 
    8080          } 
    81            
     81 
    8282          function mediaadmin(E,perms,re) { 
    8383                         P = E.name.match(re); 
    84                           
     84 
    8585                         perms[P[1]]['media'].checked = E.checked; 
    8686                         perms[P[1]]['media'].disabled = E.checked; 
    8787          } 
    88            
    89            
     88 
     89 
    9090     }); 
    9191}; 
  • admin/js/color-picker.js

    r2335 r2566  
    77          var colbox, f; 
    88          var colbox = $('#jquery-colorpicker')[0]; 
    9            
     9 
    1010          if (colbox == undefined) { 
    1111               colbox = document.createElement('div'); 
    1212               colbox.id = 'jquery-colorpicker'; 
    1313               colbox.linkedto = null; 
    14                 
     14 
    1515               $(colbox).addClass('color-color-picker'); 
    1616               $(colbox).css({display: 'none', position: 'absolute'}); 
     
    1919          f = $.farbtastic(colbox); 
    2020          f.linkTo(this); 
    21            
     21 
    2222          var handler = $(document.createElement('img')); 
    2323          handler.attr('src','images/picker.png'); 
    2424          handler.attr('alt',''); 
    25            
     25 
    2626          var span = $(document.createElement('span')); 
    27            
     27 
    2828          if ($(this).css('position') == 'absolute') { 
    2929               span.css('position','absolute'); 
     
    3535          } 
    3636          span.css('display','inline-block'); 
    37            
     37 
    3838          /*ligne supprimée car elle ne fait pas le calcul 
    3939          du width de l'input et ça fout la merde */ 
     
    4242          $(this).wrap(span); 
    4343          $(this).after(handler); 
    44            
     44 
    4545          var offset = $(this).offset(); 
    4646          handler.css({ 
     
    5151               //right: 0 
    5252          }); 
    53            
     53 
    5454          handler.css({cursor: 'default'}); 
    55            
     55 
    5656          var This = this; 
    5757          handler.click(function() { 
     
    6868                    $(colbox).show(); 
    6969                    colbox.linkedto = this; 
    70                      
     70 
    7171               } else { 
    7272                    $(colbox).hide(); 
  • admin/js/common.js

    r2531 r2566  
    7979          p.hide = p.reverse_cookie; 
    8080     } 
    81       
     81 
    8282     var set_user_pref = p.hide ^ p.reverse_user_pref; 
    8383     if (p.user_pref && p.unfolded_sections !== undefined && (p.user_pref in p.unfolded_sections)) { 
     
    131131               if (p.user_pref && set_user_pref) { 
    132132                    if (p.hide ^ p.reverse_user_pref) { 
    133                          jQuery.post('services.php',  
     133                         jQuery.post('services.php', 
    134134                              {'f':'setSectionFold','section':p.user_pref,'value':1,xd_check: dotclear.nonce}, 
    135135                              function(data) {}); 
    136136                    } else { 
    137                          jQuery.post('services.php',  
     137                         jQuery.post('services.php', 
    138138                              {'f':'setSectionFold','section':p.user_pref,'value':0,xd_check: dotclear.nonce}, 
    139139                              function(data) {}); 
     
    168168          }); 
    169169     } 
    170       
     170 
    171171     var singleExpander = function singleExpander(line) { 
    172172          $('<input type="image" src="'+dotclear.img_plus_src+'" alt="'+dotclear.img_plus_alt+'"/>') 
     
    178178               .prependTo($(line).children().get(0)); // first td 
    179179     }; 
    180       
     180 
    181181     var multipleExpander = function multipleExpander(line,lines) { 
    182182          $('<input type="image" src="'+dotclear.img_plus_src+'" alt="'+dotclear.img_plus_alt+'"/>') 
     
    203203               } 
    204204          } 
    205            
     205 
    206206          if (action=='open') { 
    207207               button.src = dotclear.img_minus_src; 
     
    211211               button.alt = dotclear.img_plus_alt; 
    212212          } 
    213            
     213 
    214214          return action; 
    215215     } 
     
    286286 
    287287     $('#content').append(img); 
    288       
     288 
    289289     // listen for scroll 
    290290     var peInPage = $('#help-button').offset().top; 
     
    428428               return color; 
    429429          } 
    430           var result = /^rgb\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\)$/.exec(color);        
     430          var result = /^rgb\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\)$/.exec(color); 
    431431          if ( result === null) { 
    432432               return ''; 
     
    464464     // remove class no-js from html tag; cf style/default.css for examples 
    465465     $('body').removeClass('no-js').addClass('with-js'); 
    466       
     466 
    467467     $('body').contents().each(function() { 
    468468          if (this.nodeType==8) { 
  • admin/js/confirm-close.js

    r0 r2566  
    11function confirmClose() { 
    2       
     2 
    33     if (arguments.length > 0) { 
    44          for (var i=0; i<arguments.length; i++) { 
     
    1313     forms: new Array(), 
    1414     formSubmit: false, 
    15       
     15 
    1616     getCurrentForms: function() { 
    1717          var formsInPage = this.getForms(); 
     
    2525               } 
    2626               this.forms.push(tmpForm); 
    27                 
     27 
    2828               chainHandler(f,'onsubmit',function() { 
    2929                    This.formSubmit = true; 
     
    3131          } 
    3232     }, 
    33       
     33 
    3434     compareForms: function() { 
    3535          if (this.forms.length == 0) { 
    3636               return true; 
    3737          } 
    38            
     38 
    3939          var formsInPage = this.getForms(); 
    4040          var f; 
     
    4747               } 
    4848          } 
    49            
     49 
    5050          return true; 
    5151     }, 
    52       
     52 
    5353     getForms: function() { 
    5454          if (!document.getElementsByTagName || !document.getElementById) { 
    5555               return new Array(); 
    5656          } 
    57            
     57 
    5858          if (this.forms_id.length > 0) { 
    5959               var res = new Array(); 
     
    6969               return document.getElementsByTagName('form'); 
    7070          } 
    71            
     71 
    7272          return new Array(); 
    7373     }, 
    74       
     74 
    7575     getFormElementValue: function(e) { 
    7676          if (e.type != undefined && e.type == 'radio') { 
     
    8484          } 
    8585     }, 
    86       
     86 
    8787     getFormCheckValue: function(e) { 
    8888          if (e.checked) { 
     
    9191          return null; 
    9292     }, 
    93       
     93 
    9494     getFormRadioValue: function(e) { 
    9595          for (var i=0; i <e.length; i++) { 
     
    114114          event_ = window.event; 
    115115     } 
    116       
     116 
    117117     if (!confirmClosePage.formSubmit && !confirmClosePage.compareForms()) { 
    118118          event_.returnValue = confirmClosePage.prompt; 
  • admin/js/date-picker.js

    r0 r2566  
    22{ 
    33     if (!document.getElementById) { return; } 
    4       
     4 
    55     if (!target || target.nodeName.toLowerCase() != 'input') { 
    66          return; 
    77     } 
    8       
     8 
    99     this.target = target; 
    1010     this.oTable = document.createElement('table'); 
     
    1717     this.oTable.id = 'dc_datepicker_'+target.id; 
    1818     this.oTable.className = 'date-picker'; 
    19       
     19 
    2020     var cur = 1; 
    2121     var oRow, oHeading, oSpan; 
    22       
     22 
    2323     // Set title 
    2424     oRow = document.createElement('tr'); 
    25       
     25 
    2626     // Month block 
    2727     oHeading = document.createElement('th'); 
    2828     oHeading.colSpan = 4; 
    2929     oHeading.className = 'date-picker-month'; 
    30       
     30 
    3131     var nav = document.createElement('span'); 
    3232     nav.appendChild(document.createTextNode(String.fromCharCode(171))); 
     
    3636     nav.className = 'date-picker-control'; 
    3737     oHeading.appendChild(nav); 
    38       
    39      oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
    40       
     38 
     39     oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
     40 
    4141     nav = document.createElement('span'); 
    4242     nav.appendChild(document.createTextNode(String.fromCharCode(187))); 
     
    4646     nav.className = 'date-picker-control'; 
    4747     oHeading.appendChild(nav); 
    48       
    49      oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
    50       
     48 
     49     oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
     50 
    5151     oHeading.appendChild(this.oMonth); 
    52       
     52 
    5353     oRow.appendChild(oHeading); 
    54       
     54 
    5555     // Year block 
    5656     oHeading = document.createElement('th'); 
    5757     oHeading.colSpan = 3; 
    5858     oHeading.className = 'date-picker-year'; 
    59       
     59 
    6060     oHeading.appendChild(this.oYear); 
    61       
    62      oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
    63       
     61 
     62     oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
     63 
    6464     nav = document.createElement('span'); 
    6565     nav.appendChild(document.createTextNode(String.fromCharCode(171))); 
     
    6969     nav.className = 'date-picker-control'; 
    7070     oHeading.appendChild(nav); 
    71       
    72      oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
    73       
     71 
     72     oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
     73 
    7474     nav = document.createElement('span'); 
    7575     nav.appendChild(document.createTextNode(String.fromCharCode(187))); 
     
    7979     nav.className = 'date-picker-control'; 
    8080     oHeading.appendChild(nav); 
    81       
     81 
    8282     oRow.appendChild(oHeading); 
    83       
     83 
    8484     this.oBody.appendChild(oRow); 
    85       
     85 
    8686     // Create legend 
    8787     oRow = document.createElement('tr'); 
     
    9595     } 
    9696     this.oBody.appendChild(oRow); 
    97       
     97 
    9898     // Create 6 rows of 7 cols for days 
    9999     for (var i=0; i<6; i++) { 
    100100          oRow = document.createElement('tr'); 
    101            
     101 
    102102          for (var j=0; j<7; j++) { 
    103103               this.oDates[cur] = document.createElement('td'); 
     
    107107               cur++; 
    108108          } 
    109            
     109 
    110110          this.oBody.appendChild(oRow); 
    111111     } 
    112       
     112 
    113113     // Time controls 
    114114     oRow = document.createElement('tr'); 
    115       
     115 
    116116     oHeading = document.createElement('th'); 
    117117     oHeading.className = 'date-picker-control'; 
     
    121121     oHeading.obj = this; 
    122122     oHeading.onclick = function() { this.fn.call(this.obj); }; 
    123       
     123 
    124124     oRow.appendChild(oHeading); 
    125       
     125 
    126126     oHeading = document.createElement('th'); 
    127127     oHeading.colSpan = 5; 
    128       
     128 
    129129     oSpan = document.createElement('span'); 
    130130     oSpan.className = 'date-picker-control'; 
     
    143143     oHeading.appendChild(oSpan); 
    144144     oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
    145       
     145 
    146146     this.oHour.size = 3; 
    147147     oHeading.appendChild(this.oHour); 
    148       
     148 
    149149     oHeading.appendChild(document.createTextNode(' : ')); 
    150       
     150 
    151151     this.oMinute.size = 3; 
    152152     oHeading.appendChild(this.oMinute); 
    153       
     153 
    154154     oHeading.appendChild(document.createTextNode(String.fromCharCode(160))); 
    155155     oSpan = document.createElement('span'); 
     
    167167     oSpan.obj = this; 
    168168     oSpan.onclick = function() { this.fn.call(this.obj,+1); }; 
    169       
     169 
    170170     oHeading.appendChild(oSpan); 
    171       
     171 
    172172     oRow.appendChild(oHeading); 
    173       
     173 
    174174     // Close control 
    175175     oHeading = document.createElement('th'); 
     
    180180     oHeading.obj = this; 
    181181     oHeading.onclick = function() { this.fn.call(this.obj); }; 
    182       
     182 
    183183     oRow.appendChild(oHeading); 
    184       
     184 
    185185     this.oBody.appendChild(oRow); 
    186186}; 
     
    192192     hour: 0, 
    193193     minute: 0, 
    194       
     194 
    195195     img_src: '', 
    196196     img_top: '0.2em', 
    197197     now_msg: 'now', 
    198198     close_msg: 'close', 
    199       
     199 
    200200     days: new Array('Monday','Tuesday','Wednesday','Thursday','Friday', 
    201201     'Saturday','Sunday'), 
    202       
     202 
    203203     months: new Array('January','February','March','April','May','June', 
    204204     'July','August','September','October','November','December'), 
    205       
    206       
     205 
     206 
    207207     setDate: function() { 
    208208          if (this.numberOfDays() < this.day) { 
    209209               this.day = this.numberOfDays(); 
    210210          } 
    211            
     211 
    212212          while (this.oYear.hasChildNodes()) { 
    213213               this.oYear.removeChild(this.oYear.firstChild) 
    214214          } 
    215215          this.oYear.appendChild(document.createTextNode(this.year)); 
    216            
     216 
    217217          while (this.oMonth.hasChildNodes()) { 
    218218               this.oMonth.removeChild(this.oMonth.firstChild) 
     
    220220          this.oMonth.appendChild(document.createTextNode( 
    221221               this.months[this.month-1])); 
    222            
     222 
    223223          var firstDay = this.firstDay(); 
    224224          var nbDays = this.numberOfDays(); 
    225            
     225 
    226226          // Empty days 
    227227          for (var i=1; i<=42; i++) { 
     
    233233               this.oDates[i].onclick = function() { return; }; 
    234234          } 
    235            
     235 
    236236          // Insert days from the first day to the last 
    237237          for (i=1; i<=nbDays; i++) { 
    238238               var j=firstDay+i-1; 
    239                 
     239 
    240240               while (this.oDates[j].hasChildNodes()) { 
    241241                    this.oDates[j].removeChild(this.oDates[j].firstChild) 
    242242               } 
    243                 
     243 
    244244               this.oDates[j].appendChild(document.createTextNode(i)); 
    245245               this.oDates[j].index = i; 
     
    253253               } 
    254254          } 
    255            
     255 
    256256          // Set time 
    257257          this.setHour(this.hour); 
    258258          this.setMinute(this.minute); 
    259259     }, 
    260       
     260 
    261261     setHour: function(h) { 
    262262          if (h < 0) { h = 23; } 
    263263          if (h > 23) { h = 0; } 
    264264          if (h < 10) { h = '0'+h; } 
    265            
     265 
    266266          this.hour = h*1; 
    267267          this.oHour.value = h; 
    268268     }, 
    269       
     269 
    270270     setMinute: function(m) { 
    271271          if (m < 0) { m = 59; } 
    272272          if (m > 59) { m = 0; } 
    273273          if (m < 10) { m = '0'+m; } 
    274            
     274 
    275275          this.minute = m*1; 
    276276          this.oMinute.value = m; 
    277277     }, 
    278       
     278 
    279279     changeMonth: function(dir) { 
    280280          var y = this.year; 
    281281          var m = this.month; 
    282282          m = m+dir; 
    283            
     283 
    284284          if (m > 12) { this.month = 1; this.year++; } 
    285285          else if ( m < 1) { this.month = 12; this.year--; } 
    286286          else { this.month = m; } 
    287            
     287 
    288288          this.setDate(); 
    289289     }, 
    290       
     290 
    291291     changeYear: function(dir) { 
    292292          this.year = this.year + dir; 
    293293          this.setDate(); 
    294294     }, 
    295       
     295 
    296296     changeHour: function(dir) { 
    297297          this.setHour(this.hour*1+dir); 
    298298     }, 
    299       
     299 
    300300     changeMinute: function(dir) { 
    301301          this.setMinute(this.minute*1+dir); 
    302302     }, 
    303       
     303 
    304304     sendDate: function(d) { 
    305305          var m = this.month; 
    306306          var hour = this.oHour.value*1; 
    307307          var minute = this.oMinute.value*1; 
    308            
     308 
    309309          if (hour < 0 || hour > 23 || isNaN(hour)) { hour = 0; } 
    310310          if (minute < 0 || minute > 59 || isNaN(minute)) { minute = 0; } 
    311            
     311 
    312312          if (m < 10) { m = '0'+m; } 
    313313          if (d < 10) { d = '0'+d; } 
    314314          if (hour < 10) { hour = '0'+hour; } 
    315315          if (minute < 10) { minute = '0'+minute; } 
    316            
     316 
    317317          this.target.value = this.year+'-'+m+'-'+d+' '+hour+':'+minute; 
    318318          this.close(); 
    319319     }, 
    320       
     320 
    321321     sendNow: function() { 
    322322          var dt = new Date(); 
     
    326326          var h = dt.getHours(); 
    327327          var i = dt.getMinutes(); 
    328            
     328 
    329329          if (m < 10) { m = '0'+m; } 
    330330          if (d < 10) { d = '0'+d; } 
    331331          if (h < 10) { h = '0'+h; } 
    332332          if (i < 10) { i = '0'+i; } 
    333            
     333 
    334334          this.target.value = y+'-'+m+'-'+d+' '+h+':'+i; 
    335335          this.close(); 
    336336     }, 
    337       
     337 
    338338     close: function() { 
    339339          document.body.removeChild(this.oTable); 
    340340     }, 
    341       
     341 
    342342     numberOfDays: function() { 
    343343          var res = 31; 
     
    352352               } 
    353353          } 
    354            
     354 
    355355          return res; 
    356356     }, 
    357       
     357 
    358358     firstDay: function() { 
    359359          var dt = new Date(this.year,this.month-1,1); 
    360360          var res = dt.getDay(); 
    361            
     361 
    362362          if (res == 0) { 
    363363               res = 7; 
    364364          } 
    365            
     365 
    366366          return res; 
    367367     }, 
    368       
     368 
    369369     show: function() { 
    370370          // Parsing target value 
     
    385385               this.minute = dt.getMinutes(); 
    386386          } 
    387            
     387 
    388388          this.oTable.appendChild(this.oBody); 
    389389          this.setDate(); 
     
    392392          this.oHour.focus(); 
    393393     }, 
    394       
     394 
    395395     setPosition: function() { 
    396396          var t_x = this.findPosX(this.target); 
     
    398398          var o_h = this.oTable.offsetHeight; 
    399399          var o_w = this.oTable.offsetWidth; 
    400            
     400 
    401401          this.oTable.style.position = 'absolute'; 
    402402          this.oTable.style.zIndex = '100'; 
     
    404404          this.oTable.style.left = t_x+'px'; 
    405405     }, 
    406       
     406 
    407407     findPosX: function(obj) { 
    408408          var curleft = 0; 
     
    420420          return curleft; 
    421421     }, 
    422       
     422 
    423423     findPosY: function(obj) { 
    424424          var curtop = 0; 
     
    436436          return curtop; 
    437437     }, 
    438       
     438 
    439439     draw: function() { 
    440440          var imgE = document.createElement('img'); 
     
    446446          imgE.fn = this.show; 
    447447          imgE.onclick = function() { this.fn.apply(this.obj); }; 
    448            
     448 
    449449          this.target.parentNode.style.position = 'relative'; 
    450450          this.target.parentNode.insertBefore(imgE,this.target.nextSibling); 
  • admin/js/dragsort-tablerows.js

    r0 r2566  
    11ToolMan._dragsortFactory.makeTableSortable = function(table) { 
    22     if (table == null) return; 
    3       
     3 
    44     var helpers = ToolMan.helpers(); 
    55     var coordinates = ToolMan.coordinates(); 
    66     var items = table.getElementsByTagName("tr"); 
    7       
     7 
    88     helpers.map(items, function(item) { 
    99          var dragGroup = dragsort.makeSortable(item); 
  • admin/js/filter-controls.js

    r2128 r2566  
    11$(function() { 
    2       
     2 
    33     $filtersform = $('#filters-form'); 
    44     $filtersform.before('<p><a id="filter-control" class="form-control" href="?" style="display:inline">'+dotclear.msg.filter_posts_list+'</a></p>') 
    5       
     5 
    66     if( dotclear.msg.show_filters == 'false' ) { 
    77          $filtersform.hide(); 
     
    1111               .text(dotclear.msg.cancel_the_filter); 
    1212     } 
    13       
     13 
    1414     $('#filter-control').click(function() { 
    1515          if( $(this).hasClass('open') ) { 
  • 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(); 
  • admin/js/prelude.js

    r2306 r2566  
    77                    $('#wrapper, #help-button, #collapser').addClass('with-prelude'); 
    88               }); 
    9            
     9 
    1010          $('body').on('click', '#prelude a[href="#help"]', function(e) { 
    1111               e.preventDefault(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map