Update TinyMCE to 3.5.3, enable stripping of Word styles on paste
This commit is contained in:
parent
83404c2c80
commit
48790b7525
274 changed files with 25268 additions and 14504 deletions
47
webapp/web/js/tiny_mce/utils/validate.js
vendored
Executable file → Normal file
47
webapp/web/js/tiny_mce/utils/validate.js
vendored
Executable file → Normal file
|
@ -1,10 +1,11 @@
|
|||
/**
|
||||
* $Id: validate.js 758 2008-03-30 13:53:29Z spocke $
|
||||
* validate.js
|
||||
*
|
||||
* Various form validation methods.
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -31,7 +32,7 @@ var Validator = {
|
|||
},
|
||||
|
||||
isSize : function(s) {
|
||||
return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
|
||||
return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
|
||||
},
|
||||
|
||||
isId : function(s) {
|
||||
|
@ -95,8 +96,10 @@ var AutoValidator = {
|
|||
var i, nl, s = this.settings, c = 0;
|
||||
|
||||
nl = this.tags(f, 'label');
|
||||
for (i=0; i<nl.length; i++)
|
||||
for (i=0; i<nl.length; i++) {
|
||||
this.removeClass(nl[i], s.invalid_cls);
|
||||
nl[i].setAttribute('aria-invalid', false);
|
||||
}
|
||||
|
||||
c += this.validateElms(f, 'input');
|
||||
c += this.validateElms(f, 'select');
|
||||
|
@ -108,6 +111,33 @@ var AutoValidator = {
|
|||
invalidate : function(n) {
|
||||
this.mark(n.form, n);
|
||||
},
|
||||
|
||||
getErrorMessages : function(f) {
|
||||
var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;
|
||||
nl = this.tags(f, "label");
|
||||
for (i=0; i<nl.length; i++) {
|
||||
if (this.hasClass(nl[i], s.invalid_cls)) {
|
||||
field = document.getElementById(nl[i].getAttribute("for"));
|
||||
values = { field: nl[i].textContent };
|
||||
if (this.hasClass(field, s.min_cls, true)) {
|
||||
message = ed.getLang('invalid_data_min');
|
||||
values.min = this.getNum(field, s.min_cls);
|
||||
} else if (this.hasClass(field, s.number_cls)) {
|
||||
message = ed.getLang('invalid_data_number');
|
||||
} else if (this.hasClass(field, s.size_cls)) {
|
||||
message = ed.getLang('invalid_data_size');
|
||||
} else {
|
||||
message = ed.getLang('invalid_data');
|
||||
}
|
||||
|
||||
message = message.replace(/{\#([^}]+)\}/g, function(a, b) {
|
||||
return values[b] || '{#' + b + '}';
|
||||
});
|
||||
messages.push(message);
|
||||
}
|
||||
}
|
||||
return messages;
|
||||
},
|
||||
|
||||
reset : function(e) {
|
||||
var t = ['label', 'input', 'select', 'textarea'];
|
||||
|
@ -118,8 +148,10 @@ var AutoValidator = {
|
|||
|
||||
for (i=0; i<t.length; i++) {
|
||||
nl = this.tags(e.form ? e.form : e, t[i]);
|
||||
for (j=0; j<nl.length; j++)
|
||||
for (j=0; j<nl.length; j++) {
|
||||
this.removeClass(nl[j], s.invalid_cls);
|
||||
nl[j].setAttribute('aria-invalid', false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -200,6 +232,7 @@ var AutoValidator = {
|
|||
var s = this.settings;
|
||||
|
||||
this.addClass(n, s.invalid_cls);
|
||||
n.setAttribute('aria-invalid', 'true');
|
||||
this.markLabels(f, n, s.invalid_cls);
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue