Dotclear

Changeset 1815:07b857f03655


Ignore:
Timestamp:
09/04/13 14:29:21 (11 years ago)
Author:
kevin@…
Branch:
Ticket #1539
Parents:
1814:53cc8fc5cad5 (diff), 1717:9df047961e9c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Fusion avec default

Location:
admin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_post.js

    r1717 r1815  
    9090                    $(this).val(last_post_format); 
    9191               } 
     92                
     93               $('.format_control > *').addClass('hide'); 
     94               if( $(this).val() == 'xhtml' ) { 
     95                    $('.control_xhtml > *').removeClass('hide'); 
     96               } else if ( $(this).val() == 'wiki' ) { 
     97                    $('.control_wiki > *').removeClass('hide'); 
     98               } 
    9299          }); 
    93100 
     
    117124               return window.confirm(dotclear.msg.confirm_delete_post); 
    118125          }); 
     126 
     127          // Markup validator 
     128          var v = $('<div class="format_control control_xhtml"><p><a id="a-validator"></a></p><div/>').get(0); 
     129          $('.control_wiki').before(v); 
     130          var a = $('#a-validator').get(0); 
     131          a.href = '#'; 
     132          a.className = 'button '; 
     133          $(a).click(function() { 
     134                
     135               excerpt_content = $('#post_excerpt').css('display') != 'none' ? $('#post_excerpt').val() : $('#excerpt-area iframe').contents().find('body').html(); 
     136               post_content    = $('#post_content').css('display') != 'none' ? $('#post_content').val() : $('#content-area iframe').contents().find('body').html(); 
     137                
     138               var params = { 
     139                    xd_check: dotclear.nonce, 
     140                    f: 'validatePostMarkup', 
     141                    excerpt: excerpt_content, 
     142                    content: post_content, 
     143                    format: $('#post_format').get(0).value, 
     144                    lang: $('#post_lang').get(0).value 
     145               }; 
     146 
     147               $.post('services.php',params,function(data) { 
     148                    if ($(data).find('rsp').attr('status') != 'ok') { 
     149                         alert($(data).find('rsp message').text()); 
     150                         return false; 
     151                    } 
     152 
     153                    if ($(data).find('valid').text() == 1) { 
     154                         var p = document.createElement('p'); 
     155                         p.id = 'markup-validator'; 
     156 
     157                         if ($('#markup-validator').length > 0) { 
     158                              $('#markup-validator').remove(); 
     159                         } 
     160 
     161                         $(p).addClass('message'); 
     162                         $(p).text(dotclear.msg.xhtml_valid); 
     163                         $('#entry-content h3').after(p); 
     164                         $(p).backgroundFade({sColor:'#666666',eColor:'#ffcc00',steps:50},function() { 
     165                                   $(this).backgroundFade({sColor:'#ffcc00',eColor:'#666666'}); 
     166                         }); 
     167                    } else { 
     168                         var div = document.createElement('div'); 
     169                         div.id = 'markup-validator'; 
     170 
     171                         if ($('#markup-validator').length > 0) { 
     172                              $('#markup-validator').remove(); 
     173                         } 
     174 
     175                         $(div).addClass('error'); 
     176                         $(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text()); 
     177                         $('#entry-content h3').after(div); 
     178                         $(div).backgroundFade({sColor:'#ffffff',eColor:'#FFBABA',steps:50},function() { 
     179                                   $(this).backgroundFade({sColor:'#ffbaba',eColor:'#ffffff'}); 
     180                         }); 
     181                    } 
     182 
     183                    return false; 
     184               }); 
     185 
     186               return false; 
     187          }); 
     188 
     189          a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator)); 
     190           
     191          $('.format_control > *').addClass('hide'); 
     192          if ( last_post_format == 'xhtml' ) { 
     193               $('.control_xhtml > *').removeClass('hide'); 
     194          } else if ( last_post_format == 'wiki' ) { 
     195               $('.control_wiki > *').removeClass('hide'); 
     196          } 
    119197 
    120198          // Hide some fields 
     
    184262          }); 
    185263 
    186           // Markup validator 
    187           var h = document.createElement('h4'); 
    188           var a = document.createElement('a'); 
    189           a.href = '#'; 
    190           a.className = 'button'; 
    191           $(a).click(function() { 
    192                var params = { 
    193                     xd_check: dotclear.nonce, 
    194                     f: 'validatePostMarkup', 
    195                     excerpt: $('#post_excerpt').text(), 
    196                     content: $('#post_content').text(), 
    197                     format: $('#post_format').get(0).value, 
    198                     lang: $('#post_lang').get(0).value 
    199                }; 
    200  
    201                $.post('services.php',params,function(data) { 
    202                     if ($(data).find('rsp').attr('status') != 'ok') { 
    203                          alert($(data).find('rsp message').text()); 
    204                          return false; 
    205                     } 
    206  
    207                     if ($(data).find('valid').text() == 1) { 
    208                          var p = document.createElement('p'); 
    209                          p.id = 'markup-validator'; 
    210  
    211                          if ($('#markup-validator').length > 0) { 
    212                               $('#markup-validator').remove(); 
    213                          } 
    214  
    215                          $(p).addClass('message'); 
    216                          $(p).text(dotclear.msg.xhtml_valid); 
    217                          $(p).insertAfter(h); 
    218                          $(p).backgroundFade({sColor:'#666666',eColor:'#ffcc00',steps:50},function() { 
    219                                    $(this).backgroundFade({sColor:'#ffcc00',eColor:'#666666'}); 
    220                          }); 
    221                     } else { 
    222                          var div = document.createElement('div'); 
    223                          div.id = 'markup-validator'; 
    224  
    225                          if ($('#markup-validator').length > 0) { 
    226                               $('#markup-validator').remove(); 
    227                          } 
    228  
    229                          $(div).addClass('error'); 
    230                          $(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text()); 
    231                          $(div).insertAfter(h); 
    232                          $(div).backgroundFade({sColor:'#ffffff',eColor:'#FFBABA',steps:50},function() { 
    233                                    $(this).backgroundFade({sColor:'#ffbaba',eColor:'#ffffff'}); 
    234                          }); 
    235                     } 
    236  
    237                     return false; 
    238                }); 
    239  
    240                return false; 
    241           }); 
    242  
    243           a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator)); 
    244           h.appendChild(a); 
    245           $(h).appendTo('#entry-content'); 
    246  
    247264          // Check unsaved changes before XHTML conversion 
    248265          var excerpt = $('#post_excerpt').val(); 
  • admin/js/_post.js

    r1813 r1815  
    198198          // Hide some fields 
    199199          $('#notes-area label').toggleWithLegend($('#notes-area').children().not('label'),{ 
    200                cookie: 'dcx_post_notes', 
     200               user_pref: 'dcx_post_notes', 
    201201               legend_click:true, 
    202202               hide: $('#post_notes').val() == '' 
     
    207207          }); 
    208208          $('#post_lang').parent().children('label').toggleWithLegend($('#post_lang'),{ 
    209                cookie: 'dcx_post_lang', 
     209               user_pref: 'dcx_post_lang', 
    210210               legend_click: true 
    211211          }); 
    212212          $('#post_password').parent().children('label').toggleWithLegend($('#post_password'),{ 
    213                cookie: 'dcx_post_password', 
     213               user_pref: 'dcx_post_password', 
    214214               legend_click: true, 
    215215               hide: $('#post_password').val() == '' 
    216216          }); 
    217217          $('#post_status').parent().children('label').toggleWithLegend($('#post_status'),{ 
    218                cookie: 'dcx_post_status', 
     218               user_pref: 'dcx_post_status', 
    219219               legend_click: true 
    220220          }); 
    221221          $('#post_dt').parent().children('label').toggleWithLegend($('#post_dt').parent().children().not('label'),{ 
    222                cookie: 'dcx_post_dt', 
     222               user_pref: 'dcx_post_dt', 
    223223               legend_click: true 
    224224          }); 
    225225          $('#label_format').toggleWithLegend($('#label_format').parent().children().not('#label_format'),{ 
    226                cookie: 'dcx_post_format', 
     226               user_pref: 'dcx_post_format', 
    227227               legend_click: true 
    228228          }); 
    229229          $('#cat_id').parent().children('label').toggleWithLegend($('#cat_id'),{ 
    230                cookie: 'cat_id', 
     230               user_pref: 'cat_id', 
     231               legend_click: true 
     232          }); 
     233          $('#label_comment_tb').toggleWithLegend($('#label_comment_tb').parent().children().not('#label_comment_tb'),{ 
     234               user_pref: 'dcx_comment_tb', 
    231235               legend_click: true 
    232236          }); 
    233237          $('#post_url').parent().children('label').toggleWithLegend($('#post_url').parent().children().not('label'),{ 
    234                cookie: 'post_url', 
     238               user_pref: 'post_url', 
    235239               legend_click: true 
    236240          }); 
    237241          // We load toolbar on excerpt only when it's ready 
    238242          $('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'),{ 
    239                cookie: 'dcx_post_excerpt', 
     243               user_pref: 'dcx_post_excerpt', 
    240244               legend_click: true, 
    241245               hide: $('#post_excerpt').val() == '' 
  • admin/post.php

    r1714 r1815  
    445445                         '<p>'.form::combo('post_format',$formaters_combo,$post_format,'maximal'). 
    446446                         '</p>'. 
    447                          '<p>'.($post_id && $post_format != 'xhtml' ?  
    448                          '<a id="convert-xhtml" class="button maximal" href="post.php?id='.$post_id.'&amp;xconv=1">'. 
    449                          __('Convert to XHTML').'</a>' : '').'</p></div>')), 
     447                         '<p class="format_control control_wiki">'. 
     448                         '<a id="convert-xhtml" class="button maximal '.($post_id && $post_format != 'wiki' ? 'hide' : '').'" href="post.php?id='.$post_id.'&amp;xconv=1">'. 
     449                         __('Convert to XHTML').'</a></p></div>')), 
    450450          'metas-box' => array( 
    451451               'title' => __('Ordering'), 
     
    523523           
    524524          "post_content" => 
    525                '<p class="area"><label class="required" '. 
     525               '<p class="area" id="content-area"><label class="required" '. 
    526526               'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 
    527527               form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)). 
  • admin/post.php

    r1813 r1815  
    472472               'title' => __('Options'), 
    473473               'items' => array( 
    474                     'post_open_comment' => 
     474                    'post_open_comment_tb' => 
     475                         '<div>'. 
     476                         '<h5 id="label_comment_tb">'.__('Commentaires et rétroliens').'</h5>'. 
    475477                         '<p><label for="post_open_comment" class="classic">'. 
    476478                         form::checkbox('post_open_comment',1,$post_open_comment).' '. 
     
    482484                                   __('Warning: Comments are not more accepted for this entry.').'</p>') :  
    483485                              '<p class="form-note warn">'. 
    484                               __('Comments are not accepted on this blog so far.').'</p>'), 
    485                     'post_open_tb' => 
     486                              __('Comments are not accepted on this blog so far.').'</p>'). 
    486487                         '<p><label for="post_open_tb" class="classic">'. 
    487488                         form::checkbox('post_open_tb',1,$post_open_tb).' '. 
     
    492493                                   '<p class="form-note warn">'. 
    493494                                   __('Warning: Trackbacks are not more accepted for this entry.').'</p>') :  
    494                               '<p class="form-note warn">'.__('Trackbacks are not accepted on this blog so far.').'</p>'), 
     495                              '<p class="form-note warn">'.__('Trackbacks are not accepted on this blog so far.').'</p>'). 
     496                         '</div>', 
    495497                    'post_password' => 
    496498                         '<p><label for="post_password" class="ib">'.__('Password').'</label>'. 
     
    516518          "post_excerpt" => 
    517519               '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'<span class="form-note">'. 
    518                __('Add an introduction to the post.').'</span></label> '. 
     520               __('Introduction to the post.').'</span></label> '. 
    519521               form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)). 
    520522               '</p>', 
     
    528530          "post_notes" => 
    529531               '<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').'<span class="form-note">'. 
    530                __('Add unpublished notes.').'</span></label>'. 
     532               __('Unpublished notes.').'</span></label>'. 
    531533               form::textarea('post_notes',50,5,html::escapeHTML($post_notes)). 
    532534               '</p>' 
  • admin/style/default.css

    r1698 r1815  
    3434a:hover, a:active, a:focus { 
    3535     text-decoration: underline; 
     36} 
     37a.hide, a.button.hide, a.submit.hide { 
     38     display: none; 
    3639} 
    3740a img, a:link img, a:visited img { 
  • admin/style/default.css

    r1814 r1815  
    800800     border: none; 
    801801} 
    802 .media-item { 
     802.media-item, .media-action-box { 
    803803     position: relative; 
    804804     border: 1px solid #ccc; 
     
    806806     padding: 1em; 
    807807     width: 300px; 
    808      height: 120px; 
    809808     display: inline-block; 
    810809     vertical-align: top; 
    811 } 
    812 div.media-list .media-item { 
     810     min-height: 120px 
    813811} 
    814812a.media-icon { 
     
    908906     margin-left: 0; 
    909907} 
     908/* in blog_pref */ 
     909.user-perm { 
     910     margin: 2em 0px; 
     911     background: transparent url(user.png) no-repeat left top; 
     912     width: 320px; 
     913     display: inline-block; 
     914     vertical-align: top; 
     915} 
     916.user-perm h4, .user-perm h5, .user-perm p, .user-perm ul, .user-perm li { 
     917     margin: .5em 0 .33em; 
     918     padding: 0; 
     919} 
     920.user-perm h4 { 
     921     padding-left: 28px; 
     922} 
     923.user-perm ul { 
     924     list-style-type: inside; 
     925} 
     926.user-perm li { 
     927     margin-left: 1em; 
     928     padding-left: 0; 
     929} 
     930.user-perm h5 { 
     931     margin:   1em 0 0 0; 
     932} 
     933li.user_super, li.user_admin { 
     934     margin-left: 0; 
     935     padding-left: 1em; 
     936     list-style: none; 
     937     background: transparent url(../images/superadmin.png) no-repeat -2px 2px; 
     938} 
     939li.user_admin { 
     940     background-image: url(../images/admin.png); 
     941} 
     942 
    910943/* -------------------------------------------------------------------- Themes */ 
    911944#themes { 
     
    11651198.success a { 
    11661199     color: #666; 
     1200} 
     1201.dc-update { 
     1202     padding: 1em 48px 0.5em 48px; 
     1203     margin-bottom: 1em; 
     1204     border-radius: 8px; 
     1205     background: #A2CBE9 url(msg-success.png) no-repeat .7em .7em; 
     1206} 
     1207.dc-update a { 
     1208     color: #000; 
     1209     border-color: #000; 
     1210     margin-right: 1em; 
     1211} 
     1212a.info { 
     1213     margin-left: 2em; 
     1214     font-weight: bold; 
    11671215} 
    11681216/* ------------------------------------------------------------------ navigation */ 
Note: See TracChangeset for help on using the changeset viewer.

Sites map