Changeset 3016:37646518675d
- Timestamp:
- 06/19/15 08:18:58 (10 years ago)
- Branch:
- default
- Location:
- plugins/dcLegacyEditor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcLegacyEditor/_define.php
r2894 r3016 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 3Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2015 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 16 16 /* Description*/ "dotclear legacy editor", 17 17 /* Author */ "dotclear Team", 18 /* Version */ '0.1. 2',18 /* Version */ '0.1.3', 19 19 array( 20 20 'permissions' => 'usage,contentadmin', -
plugins/dcLegacyEditor/js/_post_editor.js
r2856 r3016 46 46 47 47 $('#edit-entry').onetabload(function() { 48 // Markup validator49 var v = $('<div class="format_control"><p><a id="a-validator"></a></p><div/>').get(0);50 $('.format_control').before(v);51 var a = $('#a-validator').get(0);52 a.href = '#';53 a.className = 'button ';54 $(a).click(function() {55 56 excerpt_content = $('#post_excerpt').css('display') != 'none' ? $('#post_excerpt').val() : $('#excerpt-area iframe').contents().find('body').html();57 post_content = $('#post_content').css('display') != 'none' ? $('#post_content').val() : $('#content-area iframe').contents().find('body').html();58 59 var params = {60 xd_check: dotclear.nonce,61 f: 'validatePostMarkup',62 excerpt: excerpt_content,63 content: post_content,64 format: $('#post_format').get(0).value,65 lang: $('#post_lang').get(0).value66 };67 68 $.post('services.php',params,function(data) {69 if ($(data).find('rsp').attr('status') != 'ok') {70 alert($(data).find('rsp message').text());71 return false;72 }73 74 $('.message, .success, .error, .warning-msg').remove();75 76 if ($(data).find('valid').text() == 1) {77 var p = document.createElement('p');78 p.id = 'markup-validator';79 80 $(p).addClass('success');81 $(p).text(dotclear.msg.xhtml_valid);82 $('#entry-content h3').after(p);83 $(p).backgroundFade({sColor: dotclear.fadeColor.beginValidatorMsg, eColor: dotclear.fadeColor.endValidatorMsg, steps: 50},function() {84 $(this).backgroundFade({sColor: dotclear.fadeColor.endValidatorMsg, eColor: dotclear.fadeColor.beginValidatorMsg});85 });86 } else {87 var div = document.createElement('div');88 div.id = 'markup-validator';89 90 $(div).addClass('error');91 $(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text());92 $('#entry-content h3').after(div);93 $(div).backgroundFade({sColor: dotclear.fadeColor.beginValidatorErr,eColor: dotclear.fadeColor.endValidatorErr, steps: 50},function() {94 $(this).backgroundFade({sColor: dotclear.fadeColor.endValidatorErr, eColor: dotclear.fadeColor.beginValidatorErr});95 });96 }97 98 if ( $('#post_excerpt').text() != excerpt_content || $('#post_content').text() != post_content ) {99 var pn = document.createElement('p');100 $(pn).addClass('warning-msg');101 $(pn).text(dotclear.msg.warning_validate_no_save_content);102 $('#entry-content h3').after(pn);103 }104 105 return false;106 });107 108 return false;109 });110 111 a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator));112 48 113 49 // Load toolbars
Note: See TracChangeset
for help on using the changeset viewer.