Version Description
Download this release
Release Info
Developer | miyauchi |
Plugin | TinyMCE Templates |
Version | 3.0.0 |
Comparing to | |
See all releases |
Code changes from version 2.9.1 to 3.0.0
- mce_plugins/tiny_mce_popup.js +1 -1
- mce_plugins/utils/editable_selects.js +6 -5
- mce_plugins/utils/form_utils.js +19 -8
- mce_plugins/utils/mctabs.js +100 -14
- mce_plugins/utils/validate.js +40 -7
- readme.txt +4 -4
- tinymce-templates.php +1 -1
mce_plugins/tiny_mce_popup.js
CHANGED
@@ -2,4 +2,4 @@
|
|
2 |
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
3 |
// document.domain = 'moxiecode.com';
|
4 |
|
5 |
-
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var
|
2 |
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
3 |
// document.domain = 'moxiecode.com';
|
4 |
|
5 |
+
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
|
mce_plugins/utils/editable_selects.js
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
/**
|
2 |
-
*
|
3 |
*
|
4 |
-
*
|
|
|
5 |
*
|
6 |
-
*
|
7 |
-
*
|
8 |
*/
|
9 |
|
10 |
var TinyMCE_EditableSelects = {
|
@@ -15,7 +16,7 @@ var TinyMCE_EditableSelects = {
|
|
15 |
|
16 |
for (i=0; i<nl.length; i++) {
|
17 |
if (nl[i].className.indexOf('mceEditableSelect') != -1) {
|
18 |
-
o = new Option('
|
19 |
|
20 |
o.className = 'mceAddSelectValue';
|
21 |
|
1 |
/**
|
2 |
+
* editable_selects.js
|
3 |
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
*/
|
10 |
|
11 |
var TinyMCE_EditableSelects = {
|
16 |
|
17 |
for (i=0; i<nl.length; i++) {
|
18 |
if (nl[i].className.indexOf('mceEditableSelect') != -1) {
|
19 |
+
o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');
|
20 |
|
21 |
o.className = 'mceAddSelectValue';
|
22 |
|
mce_plugins/utils/form_utils.js
CHANGED
@@ -1,19 +1,24 @@
|
|
1 |
/**
|
2 |
-
*
|
3 |
*
|
4 |
-
*
|
|
|
5 |
*
|
6 |
-
*
|
7 |
-
*
|
8 |
*/
|
9 |
|
10 |
var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
|
11 |
|
12 |
function getColorPickerHTML(id, target_form_element) {
|
13 |
-
var h = "";
|
14 |
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
17 |
|
18 |
return h;
|
19 |
}
|
@@ -66,6 +71,9 @@ function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
|
|
66 |
if (!form_obj || !form_obj.elements[field_name])
|
67 |
return;
|
68 |
|
|
|
|
|
|
|
69 |
var sel = form_obj.elements[field_name];
|
70 |
|
71 |
var found = false;
|
@@ -170,7 +178,7 @@ function convertHexToRGB(col) {
|
|
170 |
}
|
171 |
|
172 |
function trimSize(size) {
|
173 |
-
return size.replace(/([0-9\.]+)px
|
174 |
}
|
175 |
|
176 |
function getCSSSize(size) {
|
@@ -182,6 +190,9 @@ function getCSSSize(size) {
|
|
182 |
// Add px
|
183 |
if (/^[0-9]+$/.test(size))
|
184 |
size += 'px';
|
|
|
|
|
|
|
185 |
|
186 |
return size;
|
187 |
}
|
1 |
/**
|
2 |
+
* form_utils.js
|
3 |
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
*/
|
10 |
|
11 |
var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
|
12 |
|
13 |
function getColorPickerHTML(id, target_form_element) {
|
14 |
+
var h = "", dom = tinyMCEPopup.dom;
|
15 |
|
16 |
+
if (label = dom.select('label[for=' + target_form_element + ']')[0]) {
|
17 |
+
label.id = label.id || dom.uniqueId();
|
18 |
+
}
|
19 |
+
|
20 |
+
h += '<a role="button" aria-labelledby="' + id + '_label" id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
|
21 |
+
h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"> <span id="' + id + '_label" class="mceVoiceLabel mceIconOnly" style="display:none;">' + tinyMCEPopup.getLang('browse') + '</span></span></a>';
|
22 |
|
23 |
return h;
|
24 |
}
|
71 |
if (!form_obj || !form_obj.elements[field_name])
|
72 |
return;
|
73 |
|
74 |
+
if (!value)
|
75 |
+
value = "";
|
76 |
+
|
77 |
var sel = form_obj.elements[field_name];
|
78 |
|
79 |
var found = false;
|
178 |
}
|
179 |
|
180 |
function trimSize(size) {
|
181 |
+
return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');
|
182 |
}
|
183 |
|
184 |
function getCSSSize(size) {
|
190 |
// Add px
|
191 |
if (/^[0-9]+$/.test(size))
|
192 |
size += 'px';
|
193 |
+
// Sanity check, IE doesn't like broken values
|
194 |
+
else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size)))
|
195 |
+
return "";
|
196 |
|
197 |
return size;
|
198 |
}
|
mce_plugins/utils/mctabs.js
CHANGED
@@ -1,14 +1,16 @@
|
|
1 |
/**
|
2 |
-
*
|
3 |
*
|
4 |
-
* Moxiecode
|
|
|
5 |
*
|
6 |
-
*
|
7 |
-
*
|
8 |
*/
|
9 |
|
10 |
function MCTabs() {
|
11 |
this.settings = [];
|
|
|
12 |
};
|
13 |
|
14 |
MCTabs.prototype.init = function(settings) {
|
@@ -27,26 +29,62 @@ MCTabs.prototype.getParam = function(name, default_value) {
|
|
27 |
return value;
|
28 |
};
|
29 |
|
30 |
-
MCTabs.prototype.
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
panelElm= document.getElementById(panel_id);
|
34 |
panelContainerElm = panelElm ? panelElm.parentNode : null;
|
35 |
-
tabElm = document.getElementById(tab_id);
|
36 |
tabContainerElm = tabElm ? tabElm.parentNode : null;
|
37 |
-
selectionClass =
|
38 |
|
39 |
if (tabElm && tabContainerElm) {
|
40 |
nodes = tabContainerElm.childNodes;
|
41 |
|
42 |
// Hide all other tabs
|
43 |
for (i = 0; i < nodes.length; i++) {
|
44 |
-
if (nodes[i].nodeName == "LI")
|
45 |
-
nodes[i]
|
|
|
46 |
}
|
47 |
|
48 |
// Show selected tab
|
49 |
-
tabElm
|
50 |
}
|
51 |
|
52 |
if (panelElm && panelContainerElm) {
|
@@ -55,11 +93,15 @@ MCTabs.prototype.displayTab = function(tab_id, panel_id) {
|
|
55 |
// Hide all other panels
|
56 |
for (i = 0; i < nodes.length; i++) {
|
57 |
if (nodes[i].nodeName == "DIV")
|
58 |
-
nodes[i]
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
// Show selected panel
|
62 |
-
panelElm
|
63 |
}
|
64 |
};
|
65 |
|
@@ -72,5 +114,49 @@ MCTabs.prototype.getAnchor = function() {
|
|
72 |
return "";
|
73 |
};
|
74 |
|
75 |
-
|
|
|
76 |
var mcTabs = new MCTabs();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/**
|
2 |
+
* mctabs.js
|
3 |
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
*/
|
10 |
|
11 |
function MCTabs() {
|
12 |
this.settings = [];
|
13 |
+
this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');
|
14 |
};
|
15 |
|
16 |
MCTabs.prototype.init = function(settings) {
|
29 |
return value;
|
30 |
};
|
31 |
|
32 |
+
MCTabs.prototype.showTab =function(tab){
|
33 |
+
tab.className = 'current';
|
34 |
+
tab.setAttribute("aria-selected", true);
|
35 |
+
tab.setAttribute("aria-expanded", true);
|
36 |
+
tab.tabIndex = 0;
|
37 |
+
};
|
38 |
+
|
39 |
+
MCTabs.prototype.hideTab =function(tab){
|
40 |
+
var t=this;
|
41 |
+
|
42 |
+
tab.className = '';
|
43 |
+
tab.setAttribute("aria-selected", false);
|
44 |
+
tab.setAttribute("aria-expanded", false);
|
45 |
+
tab.tabIndex = -1;
|
46 |
+
};
|
47 |
+
|
48 |
+
MCTabs.prototype.showPanel = function(panel) {
|
49 |
+
panel.className = 'current';
|
50 |
+
panel.setAttribute("aria-hidden", false);
|
51 |
+
};
|
52 |
+
|
53 |
+
MCTabs.prototype.hidePanel = function(panel) {
|
54 |
+
panel.className = 'panel';
|
55 |
+
panel.setAttribute("aria-hidden", true);
|
56 |
+
};
|
57 |
+
|
58 |
+
MCTabs.prototype.getPanelForTab = function(tabElm) {
|
59 |
+
return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls");
|
60 |
+
};
|
61 |
+
|
62 |
+
MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) {
|
63 |
+
var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;
|
64 |
+
|
65 |
+
tabElm = document.getElementById(tab_id);
|
66 |
+
|
67 |
+
if (panel_id === undefined) {
|
68 |
+
panel_id = t.getPanelForTab(tabElm);
|
69 |
+
}
|
70 |
|
71 |
panelElm= document.getElementById(panel_id);
|
72 |
panelContainerElm = panelElm ? panelElm.parentNode : null;
|
|
|
73 |
tabContainerElm = tabElm ? tabElm.parentNode : null;
|
74 |
+
selectionClass = t.getParam('selection_class', 'current');
|
75 |
|
76 |
if (tabElm && tabContainerElm) {
|
77 |
nodes = tabContainerElm.childNodes;
|
78 |
|
79 |
// Hide all other tabs
|
80 |
for (i = 0; i < nodes.length; i++) {
|
81 |
+
if (nodes[i].nodeName == "LI") {
|
82 |
+
t.hideTab(nodes[i]);
|
83 |
+
}
|
84 |
}
|
85 |
|
86 |
// Show selected tab
|
87 |
+
t.showTab(tabElm);
|
88 |
}
|
89 |
|
90 |
if (panelElm && panelContainerElm) {
|
93 |
// Hide all other panels
|
94 |
for (i = 0; i < nodes.length; i++) {
|
95 |
if (nodes[i].nodeName == "DIV")
|
96 |
+
t.hidePanel(nodes[i]);
|
97 |
+
}
|
98 |
+
|
99 |
+
if (!avoid_focus) {
|
100 |
+
tabElm.focus();
|
101 |
}
|
102 |
|
103 |
// Show selected panel
|
104 |
+
t.showPanel(panelElm);
|
105 |
}
|
106 |
};
|
107 |
|
114 |
return "";
|
115 |
};
|
116 |
|
117 |
+
|
118 |
+
//Global instance
|
119 |
var mcTabs = new MCTabs();
|
120 |
+
|
121 |
+
tinyMCEPopup.onInit.add(function() {
|
122 |
+
var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;
|
123 |
+
|
124 |
+
each(dom.select('div.tabs'), function(tabContainerElm) {
|
125 |
+
var keyNav;
|
126 |
+
|
127 |
+
dom.setAttrib(tabContainerElm, "role", "tablist");
|
128 |
+
|
129 |
+
var items = tinyMCEPopup.dom.select('li', tabContainerElm);
|
130 |
+
var action = function(id) {
|
131 |
+
mcTabs.displayTab(id, mcTabs.getPanelForTab(id));
|
132 |
+
mcTabs.onChange.dispatch(id);
|
133 |
+
};
|
134 |
+
|
135 |
+
each(items, function(item) {
|
136 |
+
dom.setAttrib(item, 'role', 'tab');
|
137 |
+
dom.bind(item, 'click', function(evt) {
|
138 |
+
action(item.id);
|
139 |
+
});
|
140 |
+
});
|
141 |
+
|
142 |
+
dom.bind(dom.getRoot(), 'keydown', function(evt) {
|
143 |
+
if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab
|
144 |
+
keyNav.moveFocus(evt.shiftKey ? -1 : 1);
|
145 |
+
tinymce.dom.Event.cancel(evt);
|
146 |
+
}
|
147 |
+
});
|
148 |
+
|
149 |
+
each(dom.select('a', tabContainerElm), function(a) {
|
150 |
+
dom.setAttrib(a, 'tabindex', '-1');
|
151 |
+
});
|
152 |
+
|
153 |
+
keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
|
154 |
+
root: tabContainerElm,
|
155 |
+
items: items,
|
156 |
+
onAction: action,
|
157 |
+
actOnFocus: true,
|
158 |
+
enableLeftRight: true,
|
159 |
+
enableUpDown: true
|
160 |
+
}, tinyMCEPopup.dom);
|
161 |
+
});
|
162 |
+
});
|
mce_plugins/utils/validate.js
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
/**
|
2 |
-
*
|
3 |
*
|
4 |
-
*
|
|
|
5 |
*
|
6 |
-
*
|
7 |
-
*
|
8 |
*/
|
9 |
|
10 |
/**
|
@@ -31,7 +32,7 @@ var Validator = {
|
|
31 |
},
|
32 |
|
33 |
isSize : function(s) {
|
34 |
-
return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
|
35 |
},
|
36 |
|
37 |
isId : function(s) {
|
@@ -95,8 +96,10 @@ var AutoValidator = {
|
|
95 |
var i, nl, s = this.settings, c = 0;
|
96 |
|
97 |
nl = this.tags(f, 'label');
|
98 |
-
for (i=0; i<nl.length; i++)
|
99 |
this.removeClass(nl[i], s.invalid_cls);
|
|
|
|
|
100 |
|
101 |
c += this.validateElms(f, 'input');
|
102 |
c += this.validateElms(f, 'select');
|
@@ -108,6 +111,33 @@ var AutoValidator = {
|
|
108 |
invalidate : function(n) {
|
109 |
this.mark(n.form, n);
|
110 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
reset : function(e) {
|
113 |
var t = ['label', 'input', 'select', 'textarea'];
|
@@ -118,8 +148,10 @@ var AutoValidator = {
|
|
118 |
|
119 |
for (i=0; i<t.length; i++) {
|
120 |
nl = this.tags(e.form ? e.form : e, t[i]);
|
121 |
-
for (j=0; j<nl.length; j++)
|
122 |
this.removeClass(nl[j], s.invalid_cls);
|
|
|
|
|
123 |
}
|
124 |
},
|
125 |
|
@@ -200,6 +232,7 @@ var AutoValidator = {
|
|
200 |
var s = this.settings;
|
201 |
|
202 |
this.addClass(n, s.invalid_cls);
|
|
|
203 |
this.markLabels(f, n, s.invalid_cls);
|
204 |
|
205 |
return false;
|
1 |
/**
|
2 |
+
* validate.js
|
3 |
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
*/
|
10 |
|
11 |
/**
|
32 |
},
|
33 |
|
34 |
isSize : function(s) {
|
35 |
+
return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
|
36 |
},
|
37 |
|
38 |
isId : function(s) {
|
96 |
var i, nl, s = this.settings, c = 0;
|
97 |
|
98 |
nl = this.tags(f, 'label');
|
99 |
+
for (i=0; i<nl.length; i++) {
|
100 |
this.removeClass(nl[i], s.invalid_cls);
|
101 |
+
nl[i].setAttribute('aria-invalid', false);
|
102 |
+
}
|
103 |
|
104 |
c += this.validateElms(f, 'input');
|
105 |
c += this.validateElms(f, 'select');
|
111 |
invalidate : function(n) {
|
112 |
this.mark(n.form, n);
|
113 |
},
|
114 |
+
|
115 |
+
getErrorMessages : function(f) {
|
116 |
+
var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;
|
117 |
+
nl = this.tags(f, "label");
|
118 |
+
for (i=0; i<nl.length; i++) {
|
119 |
+
if (this.hasClass(nl[i], s.invalid_cls)) {
|
120 |
+
field = document.getElementById(nl[i].getAttribute("for"));
|
121 |
+
values = { field: nl[i].textContent };
|
122 |
+
if (this.hasClass(field, s.min_cls, true)) {
|
123 |
+
message = ed.getLang('invalid_data_min');
|
124 |
+
values.min = this.getNum(field, s.min_cls);
|
125 |
+
} else if (this.hasClass(field, s.number_cls)) {
|
126 |
+
message = ed.getLang('invalid_data_number');
|
127 |
+
} else if (this.hasClass(field, s.size_cls)) {
|
128 |
+
message = ed.getLang('invalid_data_size');
|
129 |
+
} else {
|
130 |
+
message = ed.getLang('invalid_data');
|
131 |
+
}
|
132 |
+
|
133 |
+
message = message.replace(/{\#([^}]+)\}/g, function(a, b) {
|
134 |
+
return values[b] || '{#' + b + '}';
|
135 |
+
});
|
136 |
+
messages.push(message);
|
137 |
+
}
|
138 |
+
}
|
139 |
+
return messages;
|
140 |
+
},
|
141 |
|
142 |
reset : function(e) {
|
143 |
var t = ['label', 'input', 'select', 'textarea'];
|
148 |
|
149 |
for (i=0; i<t.length; i++) {
|
150 |
nl = this.tags(e.form ? e.form : e, t[i]);
|
151 |
+
for (j=0; j<nl.length; j++) {
|
152 |
this.removeClass(nl[j], s.invalid_cls);
|
153 |
+
nl[j].setAttribute('aria-invalid', false);
|
154 |
+
}
|
155 |
}
|
156 |
},
|
157 |
|
232 |
var s = this.settings;
|
233 |
|
234 |
this.addClass(n, s.invalid_cls);
|
235 |
+
n.setAttribute('aria-invalid', 'true');
|
236 |
this.markLabels(f, n, s.invalid_cls);
|
237 |
|
238 |
return false;
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: miyauchi
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CTUKCMFHF79K2
|
4 |
Tags: tinymce, Visual Editor, template
|
5 |
-
Requires at least: 3.
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag:
|
8 |
|
9 |
TinyMCE Template plugin will enable to use HTML template on WordPress Visual Editor.
|
10 |
You can edit and share this template with WordPress users.
|
@@ -57,7 +57,7 @@ You can send your own language pack to me.
|
|
57 |
4. Copy to new template from Admin Bar.
|
58 |
|
59 |
== Changelog ==
|
60 |
-
|
61 |
* [2.9.0](http://wpist.me/2012/06/14/tinymce-templates-2-9-0/)
|
62 |
* [2.8.0](http://wpist.me/2012/05/24/tinymce-templates-2-8-0/)
|
63 |
* [2.7.0](http://wpist.me/2012/05/19/tinymce-templates-2-7-0/)
|
2 |
Contributors: miyauchi
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CTUKCMFHF79K2
|
4 |
Tags: tinymce, Visual Editor, template
|
5 |
+
Requires at least: 3.5
|
6 |
+
Tested up to: 3.5
|
7 |
+
Stable tag: 3.0.0
|
8 |
|
9 |
TinyMCE Template plugin will enable to use HTML template on WordPress Visual Editor.
|
10 |
You can edit and share this template with WordPress users.
|
57 |
4. Copy to new template from Admin Bar.
|
58 |
|
59 |
== Changelog ==
|
60 |
+
* 3.0.0 - WordPress 3.5 fix
|
61 |
* [2.9.0](http://wpist.me/2012/06/14/tinymce-templates-2-9-0/)
|
62 |
* [2.8.0](http://wpist.me/2012/05/24/tinymce-templates-2-8-0/)
|
63 |
* [2.7.0](http://wpist.me/2012/05/19/tinymce-templates-2-7-0/)
|
tinymce-templates.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: TinyMCE Templates
|
|
4 |
Plugin URI: http://wpist.me/wp/tinymce-templates/
|
5 |
Description: TinyMCE Templates plugin will enable to use HTML template on WordPress Visual Editor.
|
6 |
Author: Takayuki Miyauchi
|
7 |
-
Version:
|
8 |
Author URI: http://wpist.me/
|
9 |
Domain Path: /languages
|
10 |
Text Domain: tinymce_templates
|
4 |
Plugin URI: http://wpist.me/wp/tinymce-templates/
|
5 |
Description: TinyMCE Templates plugin will enable to use HTML template on WordPress Visual Editor.
|
6 |
Author: Takayuki Miyauchi
|
7 |
+
Version: 3.0.0
|
8 |
Author URI: http://wpist.me/
|
9 |
Domain Path: /languages
|
10 |
Text Domain: tinymce_templates
|