Merged changes to skin folders
commit
6843acc9fc
@ -1,4 +1,4 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteRule !^js|.*\.[gt]if$ - [F]
|
||||
RewriteRule !^js|resources$ - [F]
|
||||
</IfModule>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 56 B |
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
|
||||
(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
|
@ -1,181 +1,184 @@
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2011, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.AutolinkPlugin', {
|
||||
/**
|
||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
||||
* of the editor instance to intercept that event.
|
||||
*
|
||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
|
||||
init : function(ed, url) {
|
||||
var t = this;
|
||||
|
||||
// Add a key down handler
|
||||
ed.onKeyDown.addToTop(function(ed, e) {
|
||||
if (e.keyCode == 13)
|
||||
return t.handleEnter(ed);
|
||||
});
|
||||
|
||||
// Internet Explorer has built-in automatic linking for most cases
|
||||
if (tinyMCE.isIE)
|
||||
return;
|
||||
|
||||
ed.onKeyPress.add(function(ed, e) {
|
||||
if (e.which == 41)
|
||||
return t.handleEclipse(ed);
|
||||
});
|
||||
|
||||
// Add a key up handler
|
||||
ed.onKeyUp.add(function(ed, e) {
|
||||
if (e.keyCode == 32)
|
||||
return t.handleSpacebar(ed);
|
||||
});
|
||||
},
|
||||
|
||||
handleEclipse : function(ed) {
|
||||
this.parseCurrentLine(ed, -1, '(', true);
|
||||
},
|
||||
|
||||
handleSpacebar : function(ed) {
|
||||
this.parseCurrentLine(ed, 0, '', true);
|
||||
},
|
||||
|
||||
handleEnter : function(ed) {
|
||||
this.parseCurrentLine(ed, -1, '', false);
|
||||
},
|
||||
|
||||
parseCurrentLine : function(ed, end_offset, delimiter, goback) {
|
||||
var r, end, start, endContainer, bookmark, text, matches, prev, len;
|
||||
|
||||
// We need at least five characters to form a URL,
|
||||
// hence, at minimum, five characters from the beginning of the line.
|
||||
r = ed.selection.getRng(true).cloneRange();
|
||||
if (r.startOffset < 5) {
|
||||
// During testing, the caret is placed inbetween two text nodes.
|
||||
// The previous text node contains the URL.
|
||||
prev = r.endContainer.previousSibling;
|
||||
if (prev == null) {
|
||||
if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
|
||||
return;
|
||||
|
||||
prev = r.endContainer.firstChild.nextSibling;
|
||||
}
|
||||
len = prev.length;
|
||||
r.setStart(prev, len);
|
||||
r.setEnd(prev, len);
|
||||
|
||||
if (r.endOffset < 5)
|
||||
return;
|
||||
|
||||
end = r.endOffset;
|
||||
endContainer = prev;
|
||||
} else {
|
||||
endContainer = r.endContainer;
|
||||
|
||||
// Get a text node
|
||||
if (endContainer.nodeType != 3 && endContainer.firstChild) {
|
||||
while (endContainer.nodeType != 3 && endContainer.firstChild)
|
||||
endContainer = endContainer.firstChild;
|
||||
|
||||
r.setStart(endContainer, 0);
|
||||
r.setEnd(endContainer, endContainer.nodeValue.length);
|
||||
}
|
||||
|
||||
if (r.endOffset == 1)
|
||||
end = 2;
|
||||
else
|
||||
end = r.endOffset - 1 - end_offset;
|
||||
}
|
||||
|
||||
start = end;
|
||||
|
||||
do
|
||||
{
|
||||
// Move the selection one character backwards.
|
||||
r.setStart(endContainer, end - 2);
|
||||
r.setEnd(endContainer, end - 1);
|
||||
end -= 1;
|
||||
|
||||
// Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
|
||||
} while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
|
||||
|
||||
if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
|
||||
r.setStart(endContainer, end);
|
||||
r.setEnd(endContainer, start);
|
||||
end += 1;
|
||||
} else if (r.startOffset == 0) {
|
||||
r.setStart(endContainer, 0);
|
||||
r.setEnd(endContainer, start);
|
||||
}
|
||||
else {
|
||||
r.setStart(endContainer, end);
|
||||
r.setEnd(endContainer, start);
|
||||
}
|
||||
|
||||
// Exclude last . from word like "www.site.com."
|
||||
var text = r.toString();
|
||||
if (text.charAt(text.length - 1) == '.') {
|
||||
r.setEnd(endContainer, start - 1);
|
||||
}
|
||||
|
||||
text = r.toString();
|
||||
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
|
||||
|
||||
if (matches) {
|
||||
if (matches[1] == 'www.') {
|
||||
matches[1] = 'http://www.';
|
||||
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
|
||||
matches[1] = 'mailto:' + matches[1];
|
||||
}
|
||||
|
||||
bookmark = ed.selection.getBookmark();
|
||||
|
||||
ed.selection.setRng(r);
|
||||
tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
|
||||
ed.selection.moveToBookmark(bookmark);
|
||||
ed.nodeChanged();
|
||||
|
||||
// TODO: Determine if this is still needed.
|
||||
if (tinyMCE.isWebKit) {
|
||||
// move the caret to its original position
|
||||
ed.selection.collapse(false);
|
||||
var max = Math.min(endContainer.length, start + 1);
|
||||
r.setStart(endContainer, max);
|
||||
r.setEnd(endContainer, max);
|
||||
ed.selection.setRng(r);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns information about the plugin as a name/value array.
|
||||
* The current keys are longname, author, authorurl, infourl and version.
|
||||
*
|
||||
* @return {Object} Name/value array containing information about the plugin.
|
||||
*/
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Autolink',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
|
||||
})();
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2011, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.AutolinkPlugin', {
|
||||
/**
|
||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
||||
* of the editor instance to intercept that event.
|
||||
*
|
||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
|
||||
init : function(ed, url) {
|
||||
var t = this;
|
||||
|
||||
// Add a key down handler
|
||||
ed.onKeyDown.addToTop(function(ed, e) {
|
||||
if (e.keyCode == 13)
|
||||
return t.handleEnter(ed);
|
||||
});
|
||||
|
||||
// Internet Explorer has built-in automatic linking for most cases
|
||||
if (tinyMCE.isIE)
|
||||
return;
|
||||
|
||||
ed.onKeyPress.add(function(ed, e) {
|
||||
if (e.which == 41)
|
||||
return t.handleEclipse(ed);
|
||||
});
|
||||
|
||||
// Add a key up handler
|
||||
ed.onKeyUp.add(function(ed, e) {
|
||||
if (e.keyCode == 32)
|
||||
return t.handleSpacebar(ed);
|
||||
});
|
||||
},
|
||||
|
||||
handleEclipse : function(ed) {
|
||||
this.parseCurrentLine(ed, -1, '(', true);
|
||||
},
|
||||
|
||||
handleSpacebar : function(ed) {
|
||||
this.parseCurrentLine(ed, 0, '', true);
|
||||
},
|
||||
|
||||
handleEnter : function(ed) {
|
||||
this.parseCurrentLine(ed, -1, '', false);
|
||||
},
|
||||
|
||||
parseCurrentLine : function(ed, end_offset, delimiter, goback) {
|
||||
var r, end, start, endContainer, bookmark, text, matches, prev, len;
|
||||
|
||||
// We need at least five characters to form a URL,
|
||||
// hence, at minimum, five characters from the beginning of the line.
|
||||
r = ed.selection.getRng(true).cloneRange();
|
||||
if (r.startOffset < 5) {
|
||||
// During testing, the caret is placed inbetween two text nodes.
|
||||
// The previous text node contains the URL.
|
||||
prev = r.endContainer.previousSibling;
|
||||
if (prev == null) {
|
||||
if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
|
||||
return;
|
||||
|
||||
prev = r.endContainer.firstChild.nextSibling;
|
||||
}
|
||||
len = prev.length;
|
||||
r.setStart(prev, len);
|
||||
r.setEnd(prev, len);
|
||||
|
||||
if (r.endOffset < 5)
|
||||
return;
|
||||
|
||||
end = r.endOffset;
|
||||
endContainer = prev;
|
||||
} else {
|
||||
endContainer = r.endContainer;
|
||||
|
||||
// Get a text node
|
||||
if (endContainer.nodeType != 3 && endContainer.firstChild) {
|
||||
while (endContainer.nodeType != 3 && endContainer.firstChild)
|
||||
endContainer = endContainer.firstChild;
|
||||
|
||||
// Move range to text node
|
||||
if (endContainer.nodeType == 3) {
|
||||
r.setStart(endContainer, 0);
|
||||
r.setEnd(endContainer, endContainer.nodeValue.length);
|
||||
}
|
||||
}
|
||||
|
||||
if (r.endOffset == 1)
|
||||
end = 2;
|
||||
else
|
||||
end = r.endOffset - 1 - end_offset;
|
||||
}
|
||||
|
||||
start = end;
|
||||
|
||||
do
|
||||
{
|
||||
// Move the selection one character backwards.
|
||||
r.setStart(endContainer, end - 2);
|
||||
r.setEnd(endContainer, end - 1);
|
||||
end -= 1;
|
||||
|
||||
// Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
|
||||
} while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
|
||||
|
||||
if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
|
||||
r.setStart(endContainer, end);
|
||||
r.setEnd(endContainer, start);
|
||||
end += 1;
|
||||
} else if (r.startOffset == 0) {
|
||||
r.setStart(endContainer, 0);
|
||||
r.setEnd(endContainer, start);
|
||||
}
|
||||
else {
|
||||
r.setStart(endContainer, end);
|
||||
r.setEnd(endContainer, start);
|
||||
}
|
||||
|
||||
// Exclude last . from word like "www.site.com."
|
||||
var text = r.toString();
|
||||
if (text.charAt(text.length - 1) == '.') {
|
||||
r.setEnd(endContainer, start - 1);
|
||||
}
|
||||
|
||||
text = r.toString();
|
||||
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
|
||||
|
||||
if (matches) {
|
||||
if (matches[1] == 'www.') {
|
||||
matches[1] = 'http://www.';
|
||||
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
|
||||
matches[1] = 'mailto:' + matches[1];
|
||||
}
|
||||
|
||||
bookmark = ed.selection.getBookmark();
|
||||
|
||||
ed.selection.setRng(r);
|
||||
tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
|
||||
ed.selection.moveToBookmark(bookmark);
|
||||
ed.nodeChanged();
|
||||
|
||||
// TODO: Determine if this is still needed.
|
||||
if (tinyMCE.isWebKit) {
|
||||
// move the caret to its original position
|
||||
ed.selection.collapse(false);
|
||||
var max = Math.min(endContainer.length, start + 1);
|
||||
r.setStart(endContainer, max);
|
||||
r.setEnd(endContainer, max);
|
||||
ed.selection.setRng(r);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns information about the plugin as a name/value array.
|
||||
* The current keys are longname, author, authorurl, infourl and version.
|
||||
*
|
||||
* @return {Object} Name/value array containing information about the plugin.
|
||||
*/
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Autolink',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
|
||||
})();
|
||||
|
@ -1,119 +1,119 @@
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
/**
|
||||
* Auto Resize
|
||||
*
|
||||
* This plugin automatically resizes the content area to fit its content height.
|
||||
* It will retain a minimum height, which is the height of the content area when
|
||||
* it's initialized.
|
||||
*/
|
||||
tinymce.create('tinymce.plugins.AutoResizePlugin', {
|
||||
/**
|
||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
||||
* of the editor instance to intercept that event.
|
||||
*
|
||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
init : function(ed, url) {
|
||||
var t = this, oldSize = 0;
|
||||
|
||||
if (ed.getParam('fullscreen_is_enabled'))
|
||||
return;
|
||||
|
||||
/**
|
||||
* This method gets executed each time the editor needs to resize.
|
||||
*/
|
||||
function resize() {
|
||||
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
|
||||
|
||||
// Get height differently depending on the browser used
|
||||
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
|
||||
|
||||
// Don't make it smaller than the minimum height
|
||||
if (myHeight > t.autoresize_min_height)
|
||||
resizeHeight = myHeight;
|
||||
|
||||
// If a maximum height has been defined don't exceed this height
|
||||
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
|
||||
resizeHeight = t.autoresize_max_height;
|
||||
body.style.overflowY = "auto";
|
||||
de.style.overflowY = "auto"; // Old IE
|
||||
} else {
|
||||
body.style.overflowY = "hidden";
|
||||
de.style.overflowY = "hidden"; // Old IE
|
||||
body.scrollTop = 0;
|
||||
}
|
||||
|
||||
// Resize content element
|
||||
if (resizeHeight !== oldSize) {
|
||||
deltaSize = resizeHeight - oldSize;
|
||||
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
|
||||
oldSize = resizeHeight;
|
||||
|
||||
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
||||
// So we need to continue to resize the iframe down until the size gets fixed
|
||||
if (tinymce.isWebKit && deltaSize < 0)
|
||||
resize();
|
||||
}
|
||||
};
|
||||
|
||||
t.editor = ed;
|
||||
|
||||
// Define minimum height
|
||||
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
|
||||
|
||||
// Define maximum height
|
||||
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
|
||||
|
||||
// Add padding at the bottom for better UX
|
||||
ed.onInit.add(function(ed){
|
||||
ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
|
||||
});
|
||||
|
||||
// Add appropriate listeners for resizing content area
|
||||
ed.onChange.add(resize);
|
||||
ed.onSetContent.add(resize);
|
||||
ed.onPaste.add(resize);
|
||||
ed.onKeyUp.add(resize);
|
||||
ed.onPostRender.add(resize);
|
||||
|
||||
if (ed.getParam('autoresize_on_init', true)) {
|
||||
ed.onLoad.add(resize);
|
||||
ed.onLoadContent.add(resize);
|
||||
}
|
||||
|
||||
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
||||
ed.addCommand('mceAutoResize', resize);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns information about the plugin as a name/value array.
|
||||
* The current keys are longname, author, authorurl, infourl and version.
|
||||
*
|
||||
* @return {Object} Name/value array containing information about the plugin.
|
||||
*/
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Auto Resize',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
|
||||
})();
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
/**
|
||||
* Auto Resize
|
||||
*
|
||||
* This plugin automatically resizes the content area to fit its content height.
|
||||
* It will retain a minimum height, which is the height of the content area when
|
||||
* it's initialized.
|
||||
*/
|
||||
tinymce.create('tinymce.plugins.AutoResizePlugin', {
|
||||
/**
|
||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
||||
* of the editor instance to intercept that event.
|
||||
*
|
||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
init : function(ed, url) {
|
||||
var t = this, oldSize = 0;
|
||||
|
||||
if (ed.getParam('fullscreen_is_enabled'))
|
||||
return;
|
||||
|
||||
/**
|
||||
* This method gets executed each time the editor needs to resize.
|
||||
*/
|
||||
function resize() {
|
||||
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
|
||||
|
||||
// Get height differently depending on the browser used
|
||||
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
|
||||
|
||||
// Don't make it smaller than the minimum height
|
||||
if (myHeight > t.autoresize_min_height)
|
||||
resizeHeight = myHeight;
|
||||
|
||||
// If a maximum height has been defined don't exceed this height
|
||||
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
|
||||
resizeHeight = t.autoresize_max_height;
|
||||
body.style.overflowY = "auto";
|
||||
de.style.overflowY = "auto"; // Old IE
|
||||
} else {
|
||||
body.style.overflowY = "hidden";
|
||||
de.style.overflowY = "hidden"; // Old IE
|
||||
body.scrollTop = 0;
|
||||
}
|
||||
|
||||
// Resize content element
|
||||
if (resizeHeight !== oldSize) {
|
||||
deltaSize = resizeHeight - oldSize;
|
||||
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
|
||||
oldSize = resizeHeight;
|
||||
|
||||
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
||||
// So we need to continue to resize the iframe down until the size gets fixed
|
||||
if (tinymce.isWebKit && deltaSize < 0)
|
||||
resize();
|
||||
}
|
||||
};
|
||||
|
||||
t.editor = ed;
|
||||
|
||||
// Define minimum height
|
||||
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
|
||||
|
||||
// Define maximum height
|
||||
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
|
||||
|
||||
// Add padding at the bottom for better UX
|
||||
ed.onInit.add(function(ed){
|
||||
ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
|
||||
});
|
||||
|
||||
// Add appropriate listeners for resizing content area
|
||||
ed.onChange.add(resize);
|
||||
ed.onSetContent.add(resize);
|
||||
ed.onPaste.add(resize);
|
||||
ed.onKeyUp.add(resize);
|
||||
ed.onPostRender.add(resize);
|
||||
|
||||
if (ed.getParam('autoresize_on_init', true)) {
|
||||
ed.onLoad.add(resize);
|
||||
ed.onLoadContent.add(resize);
|
||||
}
|
||||
|
||||
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
||||
ed.addCommand('mceAutoResize', resize);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns information about the plugin as a name/value array.
|
||||
* The current keys are longname, author, authorurl, infourl and version.
|
||||
*
|
||||
* @return {Object} Name/value array containing information about the plugin.
|
||||
*/
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Auto Resize',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
|
||||
})();
|
||||
|
@ -1 +1 @@
|
||||
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
|
||||
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
|
@ -1,50 +1,50 @@
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
|
||||
/**
|
||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
||||
* of the editor instance to intercept that event.
|
||||
*
|
||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
init : function(ed, url) {
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Returns information about the plugin as a name/value array.
|
||||
* The current keys are longname, author, authorurl, infourl and version.
|
||||
*
|
||||
* @return {Object} Name/value array containing information about the plugin.
|
||||
*/
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Example Dependency plugin',
|
||||
author : 'Some author',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
|
||||
version : "1.0"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
|
||||
* plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
|
||||
* plugins in a depends list should typically be specified using the short name). If neccesary this can be done
|
||||
* with an object which has the url to the plugin and the shortname.
|
||||
*/
|
||||
tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
|
||||
})();
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
|
||||
/**
|
||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
||||
* of the editor instance to intercept that event.
|
||||
*
|
||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
init : function(ed, url) {
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Returns information about the plugin as a name/value array.
|
||||
* The current keys are longname, author, authorurl, infourl and version.
|
||||
*
|
||||
* @return {Object} Name/value array containing information about the plugin.
|
||||
*/
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Example Dependency plugin',
|
||||
author : 'Some author',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
|
||||
version : "1.0"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
|
||||
* plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
|
||||
* plugins in a depends list should typically be specified using the short name). If neccesary this can be done
|
||||
* with an object which has the url to the plugin and the shortname.
|
||||
*/
|
||||
tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
|
||||
})();
|
||||
|
@ -1 +1 @@
|
||||
tinyMCE.addI18n('he.fullpage_dlg',{title:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05de\u05e1\u05de\u05da","meta_tab":"\u05db\u05dc\u05dc\u05d9","appearance_tab":"\u05de\u05e8\u05d0\u05d4","advanced_tab":"\u05de\u05ea\u05e7\u05d3\u05dd","meta_props":"\u05ea\u05d2\u05d9 \u05de\u05d8\u05d4",langprops:"\u05e9\u05e4\u05d4 \u05d5\u05e7\u05d9\u05d3\u05d5\u05d3","meta_title":"\u05db\u05d5\u05ea\u05e8\u05ea","meta_keywords":"\u05de\u05d9\u05dc\u05d5\u05ea \u05de\u05e4\u05ea\u05d7","meta_description":"\u05ea\u05d9\u05d0\u05d5\u05e8","meta_robots":"\u05e8\u05d5\u05d1\u05d5\u05d8\u05d9\u05dd",doctypes:"Doctype",langcode:"\u05e7\u05d5\u05d3 \u05d4\u05e9\u05e4\u05d4",langdir:"\u05db\u05d9\u05d5\u05d5\u05df \u05d4\u05e9\u05e4\u05d4",ltr:"\u05de\u05e9\u05de\u05d0\u05dc \u05dc\u05d9\u05de\u05d9\u05df",rtl:"\u05de\u05d9\u05de\u05d9\u05df \u05dc\u05e9\u05de\u05d0\u05dc","xml_pi":"XML declaration",encoding:"\u05e7\u05d9\u05d3\u05d5\u05d3 \u05ea\u05d5\u05d5\u05d9\u05dd","appearance_bgprops":"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05e8\u05e7\u05e2","appearance_marginprops":"Body margins","appearance_linkprops":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd","appearance_textprops":"Text properties",bgcolor:"\u05e6\u05d1\u05e2 \u05e8\u05e7\u05e2",bgimage:"\u05ea\u05de\u05d5\u05e0\u05ea \u05e8\u05e7\u05e2","left_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05e9\u05de\u05d0\u05dc\u05d9\u05d9\u05dd","right_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05d9\u05de\u05e0\u05d9\u05d9\u05dd","top_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05e2\u05dc\u05d9\u05d5\u05e0\u05d9\u05dd","bottom_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05ea\u05d7\u05ea\u05d9\u05d9\u05dd","text_color":"\u05e6\u05d1\u05e2 \u05d8\u05e7\u05e1\u05d8","font_size":"\u05d2\u05d5\u05d3\u05dc \u05d2\u05d5\u05e4\u05df","font_face":"\u05e1\u05d5\u05d2 \u05d2\u05d5\u05e4\u05df","link_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8","hover_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05de\u05e2\u05d1\u05e8 \u05e2\u05db\u05d1\u05e8","visited_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05e9\u05e0\u05e6\u05e4\u05d4","active_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05e4\u05e2\u05d9\u05dc",textcolor:"\u05e6\u05d1\u05e2",fontsize:"\u05d2\u05d5\u05d3\u05dc \u05d2\u05d5\u05e4\u05df",fontface:"\u05d2\u05d5\u05e4\u05df","meta_index_follow":"Index and follow the links","meta_index_nofollow":"Index and don\'t follow the links","meta_noindex_follow":"Do not index but follow the links","meta_noindex_nofollow":"Do not index and don\\\'t follow the links","appearance_style":"Stylesheet and style properties",stylesheet:"\u05e1\u05d2\u05e0\u05d5\u05df \u05e2\u05d9\u05e6\u05d5\u05d1",style:"\u05e2\u05d9\u05e6\u05d5\u05d1",author:"\u05db\u05d5\u05ea\u05d1",copyright:"\u05d6\u05db\u05d5\u05d9\u05d5\u05ea \u05d9\u05d5\u05e6\u05e8\u05d9\u05dd",add:"Add new element",remove:"Remove selected element",moveup:"Move selected element up",movedown:"Move selected element down","head_elements":"Head elements",info:"\u05de\u05d9\u05d3\u05e2","add_title":"Title element","add_meta":"Meta element","add_script":"Script element","add_style":"Style element","add_link":"Link element","add_base":"Base element","add_comment":"Comment node","title_element":"Title element","script_element":"Script element","style_element":"Style element","base_element":"Base element","link_element":"Link element","meta_element":"Meta element","comment_element":"\u05ea\u05d2\u05d5\u05d1\u05d4",src:"\u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05e7\u05d5\u05e8",language:"\u05e9\u05e4\u05d4",href:"Href",target:"\u05d9\u05e2\u05d3",type:"\u05e1\u05d5\u05d2",charset:"\u05e7\u05d9\u05d3\u05d5\u05d3",defer:"Defer",media:"\u05de\u05d3\u05d9\u05d4",properties:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9\u05dd",name:"\u05e9\u05dd",value:"\u05e2\u05e8\u05da",content:"\u05ea\u05d5\u05db\u05df",rel:"Rel",rev:"Rev",hreflang:"Href lang","general_props":"\u05db\u05dc\u05dc\u05d9","advanced_props":"\u05de\u05ea\u05e7\u05d3\u05dd"});
|
||||
tinyMCE.addI18n('he.fullpage_dlg',{title:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05de\u05e1\u05de\u05da","meta_tab":"\u05db\u05dc\u05dc\u05d9","appearance_tab":"\u05de\u05e8\u05d0\u05d4","advanced_tab":"\u05de\u05ea\u05e7\u05d3\u05dd","meta_props":"\u05ea\u05d2\u05d9 \u05de\u05d8\u05d4",langprops:"\u05e9\u05e4\u05d4 \u05d5\u05e7\u05d9\u05d3\u05d5\u05d3","meta_title":"\u05db\u05d5\u05ea\u05e8\u05ea","meta_keywords":"\u05de\u05d9\u05dc\u05d5\u05ea \u05de\u05e4\u05ea\u05d7","meta_description":"\u05ea\u05d9\u05d0\u05d5\u05e8","meta_robots":"\u05e8\u05d5\u05d1\u05d5\u05d8\u05d9\u05dd",doctypes:"Doctype",langcode:"\u05e7\u05d5\u05d3 \u05d4\u05e9\u05e4\u05d4",langdir:"\u05db\u05d9\u05d5\u05d5\u05df \u05d4\u05e9\u05e4\u05d4",ltr:"\u05de\u05e9\u05de\u05d0\u05dc \u05dc\u05d9\u05de\u05d9\u05df",rtl:"\u05de\u05d9\u05de\u05d9\u05df \u05dc\u05e9\u05de\u05d0\u05dc","xml_pi":"XML declaration",encoding:"\u05e7\u05d9\u05d3\u05d5\u05d3 \u05ea\u05d5\u05d5\u05d9\u05dd","appearance_bgprops":"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05e8\u05e7\u05e2","appearance_marginprops":"Body margins","appearance_linkprops":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd","appearance_textprops":"Text properties",bgcolor:"\u05e6\u05d1\u05e2 \u05e8\u05e7\u05e2",bgimage:"\u05ea\u05de\u05d5\u05e0\u05ea \u05e8\u05e7\u05e2","left_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05e9\u05de\u05d0\u05dc\u05d9\u05d9\u05dd","right_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05d9\u05de\u05e0\u05d9\u05d9\u05dd","top_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05e2\u05dc\u05d9\u05d5\u05e0\u05d9\u05dd","bottom_margin":"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd \u05ea\u05d7\u05ea\u05d9\u05d9\u05dd","text_color":"\u05e6\u05d1\u05e2 \u05d8\u05e7\u05e1\u05d8","font_size":"\u05d2\u05d5\u05d3\u05dc \u05d2\u05d5\u05e4\u05df","font_face":"\u05e1\u05d5\u05d2 \u05d2\u05d5\u05e4\u05df","link_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8","hover_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05de\u05e2\u05d1\u05e8 \u05e2\u05db\u05d1\u05e8","visited_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05e9\u05e0\u05e6\u05e4\u05d4","active_color":"\u05e6\u05d1\u05e2 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05e4\u05e2\u05d9\u05dc",textcolor:"\u05e6\u05d1\u05e2",fontsize:"\u05d2\u05d5\u05d3\u05dc \u05d2\u05d5\u05e4\u05df",fontface:"\u05d2\u05d5\u05e4\u05df","meta_index_follow":"Index and follow the links","meta_index_nofollow":"Index and don\'t follow the links","meta_noindex_follow":"Do not index but follow the links","meta_noindex_nofollow":"Do not index and don\\\'t follow the links","appearance_style":"Stylesheet and style properties",stylesheet:"\u05e1\u05d2\u05e0\u05d5\u05df \u05e2\u05d9\u05e6\u05d5\u05d1",style:"\u05e2\u05d9\u05e6\u05d5\u05d1",author:"\u05db\u05d5\u05ea\u05d1",copyright:"\u05d6\u05db\u05d5\u05d9\u05d5\u05ea \u05d9\u05d5\u05e6\u05e8\u05d9\u05dd",add:"\u05d4\u05d5\u05e1\u05e3 \u05d0\u05dc\u05de\u05e0\u05d8 \u05d7\u05d3\u05e9",remove:"Remove selected element",moveup:"Move selected element up",movedown:"Move selected element down","head_elements":"Head elements",info:"\u05de\u05d9\u05d3\u05e2","add_title":"Title element","add_meta":"Meta element","add_script":"Script element","add_style":"Style element","add_link":"Link element","add_base":"Base element","add_comment":"Comment node","title_element":"Title element","script_element":"Script element","style_element":"\u05d0\u05dc\u05de\u05e0\u05d8 \u05e2\u05d9\u05e6\u05d5\u05d1","base_element":"\u05d0\u05dc\u05de\u05e0\u05d8 \u05d1\u05e1\u05d9\u05e1","link_element":"\u05d0\u05dc\u05de\u05e0\u05d8 \u05e7\u05d9\u05e9\u05d5\u05e8","meta_element":"Meta element","comment_element":"\u05ea\u05d2\u05d5\u05d1\u05d4",src:"\u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05e7\u05d5\u05e8",language:"\u05e9\u05e4\u05d4",href:"HREF",target:"\u05d9\u05e2\u05d3",type:"\u05e1\u05d5\u05d2",charset:"\u05e7\u05d9\u05d3\u05d5\u05d3",defer:"Defer",media:"\u05de\u05d3\u05d9\u05d4",properties:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9\u05dd",name:"\u05e9\u05dd",value:"\u05e2\u05e8\u05da",content:"\u05ea\u05d5\u05db\u05df",rel:"Rel",rev:"Rev",hreflang:"Href lang","general_props":"\u05db\u05dc\u05dc\u05d9","advanced_props":"\u05de\u05ea\u05e7\u05d3\u05dd"});
|
@ -1 +1 @@
|
||||
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
|
||||
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().getElementsByTagName("table")[0]);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
tinyMCE.addI18n('es.style_dlg',{"text_lineheight":"Ancho de la fila","text_variant":"Variante","text_style":"Estilo","text_weight":"Peso","text_size":"Tama\u00f1o","text_font":"Fuente","text_props":"Texto","positioning_tab":"Posici\u00f3n","list_tab":"Lista","border_tab":"Borde","box_tab":"Caja","block_tab":"Bloque","background_tab":"Fondo","text_tab":"Texto",apply:"Aplicar",title:"Editar Estilo CSS",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibilidad","positioning_type":"Tipo",position:"Posici\u00f3n","bullet_image":"Imagen de la vi\u00f1eta","list_type":"Tipo",color:"Color",height:"Alto",width:"Ancho",style:"Estilo",margin:"Margen",left:"Izquierda",bottom:"Debajo",right:"Derecha",top:"Arriba",same:"Lo mismo en todos",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Alto","box_width":"Ancho","block_display":"Display","block_whitespace":"Espacio en blanco","block_text_indent":"Sangr\u00eda","block_text_align":"Alineaci\u00f3n del texto","block_vertical_alignment":"Alineaci\u00f3n vertical","block_letterspacing":"Espacio entre letra","block_wordspacing":"Espacio entre palabra","background_vpos":"Posici\u00f3n vertical","background_hpos":"Posici\u00f3n horizontal","background_attachment":"Adjunto","background_repeat":"Repetici\u00f3n","background_image":"Imagen de fondo","background_color":"Color de fondo","text_none":"Ninguno","text_blink":"Parpadeo","text_case":"Min\u00fas./May\u00fas.","text_striketrough":"Tachado","text_underline":"Subrayado","text_overline":"Subrayado superior","text_decoration":"Decorativos","text_color":"Color",text:"Texto",background:"Fondo",block:"Bloque",box:"Caja",border:"Borde",list:"Lista"});
|
||||
tinyMCE.addI18n('es.style_dlg',{"text_lineheight":"Ancho de la fila","text_variant":"Variante","text_style":"Estilo","text_weight":"Peso","text_size":"Tama\u00f1o","text_font":"Fuente","text_props":"Texto","positioning_tab":"Posicionamiento","list_tab":"Lista","border_tab":"Borde","box_tab":"Caja","block_tab":"Bloque","background_tab":"Fondo","text_tab":"Texto",apply:"Aplicar",title:"Editar Estilo CSS",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibilidad","positioning_type":"Tipo",position:"Posici\u00f3n","bullet_image":"Imagen de la vi\u00f1eta","list_type":"Tipo",color:"Color",height:"Alto",width:"Ancho",style:"Estilo",margin:"Margen",left:"Izquierda",bottom:"Inferior",right:"Derecha",top:"Superior",same:"Lo mismo en todos",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Alto","box_width":"Ancho","block_display":"Display","block_whitespace":"Espacio en blanco","block_text_indent":"Sangr\u00eda","block_text_align":"Alineaci\u00f3n del texto","block_vertical_alignment":"Alineaci\u00f3n vertical","block_letterspacing":"Espacio entre letra","block_wordspacing":"Espacio entre palabra","background_vpos":"Posici\u00f3n vertical","background_hpos":"Posici\u00f3n horizontal","background_attachment":"Adjunto","background_repeat":"Repetici\u00f3n","background_image":"Imagen de fondo","background_color":"Color de fondo","text_none":"Ninguno","text_blink":"Parpadeo","text_case":"Min\u00fas./May\u00fas.","text_striketrough":"Tachado","text_underline":"Subrayado","text_overline":"Subrayado superior","text_decoration":"Decorativos","text_color":"Color",text:"Texto",background:"Fondo",block:"Bloque",box:"Caja",border:"Borde",list:"Lista"});
|
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,19 @@
|
||||
Edit CSS Style plug-in notes
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Unlike WYSIWYG editor functionality that operates only on the selected text,
|
||||
typically by inserting new HTML elements with the specified styles.
|
||||
This plug-in operates on the HTML blocks surrounding the selected text.
|
||||
No new HTML elements are created.
|
||||
|
||||
This plug-in only operates on the surrounding blocks and not the nearest
|
||||
parent node. This means that if a block encapsulates a node,
|
||||
e.g <p><span>text</span></p>, then only the styles in the block are
|
||||
recognized, not those in the span.
|
||||
|
||||
When selecting text that includes multiple blocks at the same level (peers),
|
||||
this plug-in accumulates the specified styles in all of the surrounding blocks
|
||||
and populates the dialogue checkboxes accordingly. There is no differentiation
|
||||
between styles set in all the blocks versus styles set in some of the blocks.
|
||||
|
||||
When the [Update] or [Apply] buttons are pressed, the styles selected in the
|
||||
checkboxes are applied to all blocks that surround the selected text.
|
||||
Edit CSS Style plug-in notes
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Unlike WYSIWYG editor functionality that operates only on the selected text,
|
||||
typically by inserting new HTML elements with the specified styles.
|
||||
This plug-in operates on the HTML blocks surrounding the selected text.
|
||||
No new HTML elements are created.
|
||||
|
||||
This plug-in only operates on the surrounding blocks and not the nearest
|
||||
parent node. This means that if a block encapsulates a node,
|
||||
e.g <p><span>text</span></p>, then only the styles in the block are
|
||||
recognized, not those in the span.
|
||||
|
||||
When selecting text that includes multiple blocks at the same level (peers),
|
||||
this plug-in accumulates the specified styles in all of the surrounding blocks
|
||||
and populates the dialogue checkboxes accordingly. There is no differentiation
|
||||
between styles set in all the blocks versus styles set in some of the blocks.
|
||||
|
||||
When the [Update] or [Apply] buttons are pressed, the styles selected in the
|
||||
checkboxes are applied to all blocks that surround the selected text.
|
||||
|
@ -1,122 +1,122 @@
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
|
||||
|
||||
tinymce.create('tinymce.plugins.TabFocusPlugin', {
|
||||
init : function(ed, url) {
|
||||
function tabCancel(ed, e) {
|
||||
if (e.keyCode === 9)
|
||||
return Event.cancel(e);
|
||||
}
|
||||
|
||||
function tabHandler(ed, e) {
|
||||
var x, i, f, el, v;
|
||||
|
||||
function find(d) {
|
||||
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
|
||||
|
||||
function canSelectRecursive(e) {
|
||||
return e.nodeName==="BODY" || (e.type != 'hidden' &&
|
||||
!(e.style.display == "none") &&
|
||||
!(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
|
||||
}
|
||||
function canSelectInOldIe(el) {
|
||||
return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
|
||||
}
|
||||
function isOldIe() {
|
||||
return tinymce.isIE6 || tinymce.isIE7;
|
||||
}
|
||||
function canSelect(el) {
|
||||
return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
|
||||
}
|
||||
|
||||
each(el, function(e, i) {
|
||||
if (e.id == ed.id) {
|
||||
x = i;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (d > 0) {
|
||||
for (i = x + 1; i < el.length; i++) {
|
||||
if (canSelect(el[i]))
|
||||
return el[i];
|
||||
}
|
||||
} else {
|
||||
for (i = x - 1; i >= 0; i--) {
|
||||
if (canSelect(el[i]))
|
||||
return el[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (e.keyCode === 9) {
|
||||
v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
|
||||
|
||||
if (v.length == 1) {
|
||||
v[1] = v[0];
|
||||
v[0] = ':prev';
|
||||
}
|
||||
|
||||
// Find element to focus
|
||||
if (e.shiftKey) {
|
||||
if (v[0] == ':prev')
|
||||
el = find(-1);
|
||||
else
|
||||
el = DOM.get(v[0]);
|
||||
} else {
|
||||
if (v[1] == ':next')
|
||||
el = find(1);
|
||||
else
|
||||
el = DOM.get(v[1]);
|
||||
}
|
||||
|
||||
if (el) {
|
||||
if (el.id && (ed = tinymce.get(el.id || el.name)))
|
||||
ed.focus();
|
||||
else
|
||||
window.setTimeout(function() {
|
||||
if (!tinymce.isWebKit)
|
||||
window.focus();
|
||||
el.focus();
|
||||
}, 10);
|
||||
|
||||
return Event.cancel(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ed.onKeyUp.add(tabCancel);
|
||||
|
||||
if (tinymce.isGecko) {
|
||||
ed.onKeyPress.add(tabHandler);
|
||||
ed.onKeyDown.add(tabCancel);
|
||||
} else
|
||||
ed.onKeyDown.add(tabHandler);
|
||||
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Tabfocus',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
|
||||
})();
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
|
||||
|
||||
tinymce.create('tinymce.plugins.TabFocusPlugin', {
|
||||
init : function(ed, url) {
|
||||
function tabCancel(ed, e) {
|
||||
if (e.keyCode === 9)
|
||||
return Event.cancel(e);
|
||||
}
|
||||
|
||||
function tabHandler(ed, e) {
|
||||
var x, i, f, el, v;
|
||||
|
||||
function find(d) {
|
||||
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
|
||||
|
||||
function canSelectRecursive(e) {
|
||||
return e.nodeName==="BODY" || (e.type != 'hidden' &&
|
||||
!(e.style.display == "none") &&
|
||||
!(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
|
||||
}
|
||||
function canSelectInOldIe(el) {
|
||||
return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
|
||||
}
|
||||
function isOldIe() {
|
||||
return tinymce.isIE6 || tinymce.isIE7;
|
||||
}
|
||||
function canSelect(el) {
|
||||
return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
|
||||
}
|
||||
|
||||
each(el, function(e, i) {
|
||||
if (e.id == ed.id) {
|
||||
x = i;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (d > 0) {
|
||||
for (i = x + 1; i < el.length; i++) {
|
||||
if (canSelect(el[i]))
|
||||
return el[i];
|
||||
}
|
||||
} else {
|
||||
for (i = x - 1; i >= 0; i--) {
|
||||
if (canSelect(el[i]))
|
||||
return el[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (e.keyCode === 9) {
|
||||
v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
|
||||
|
||||
if (v.length == 1) {
|
||||
v[1] = v[0];
|
||||
v[0] = ':prev';
|
||||
}
|
||||
|
||||
// Find element to focus
|
||||
if (e.shiftKey) {
|
||||
if (v[0] == ':prev')
|
||||
el = find(-1);
|
||||
else
|
||||
el = DOM.get(v[0]);
|
||||
} else {
|
||||
if (v[1] == ':next')
|
||||
el = find(1);
|
||||
else
|
||||
el = DOM.get(v[1]);
|
||||
}
|
||||
|
||||
if (el) {
|
||||
if (el.id && (ed = tinymce.get(el.id || el.name)))
|
||||
ed.focus();
|
||||
else
|
||||
window.setTimeout(function() {
|
||||
if (!tinymce.isWebKit)
|
||||
window.focus();
|
||||
el.focus();
|
||||
}, 10);
|
||||
|
||||
return Event.cancel(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ed.onKeyUp.add(tabCancel);
|
||||
|
||||
if (tinymce.isGecko) {
|
||||
ed.onKeyPress.add(tabHandler);
|
||||
ed.onKeyDown.add(tabCancel);
|
||||
} else
|
||||
ed.onKeyDown.add(tabHandler);
|
||||
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Tabfocus',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
|
||||
})();
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,345 +1,345 @@
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
|
||||
|
||||
var colors = [
|
||||
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
|
||||
"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
|
||||
"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
|
||||
"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
|
||||
"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
|
||||
"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
|
||||
"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
|
||||
"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
|
||||
"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
|
||||
"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
|
||||
"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
|
||||
"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
|
||||
"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
|
||||
"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
|
||||
"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
|
||||
"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
|
||||
"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
|
||||
"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
|
||||
"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
|
||||
"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
|
||||
"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
|
||||
"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
|
||||
"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
|
||||
"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
|
||||
"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
|
||||
"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
|
||||
"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
|
||||
];
|
||||
|
||||
var named = {
|
||||
'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
|
||||
'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
|
||||
'#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
|
||||
'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
|
||||
'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
|
||||
'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
|
||||
'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
|
||||
'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
|
||||
'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
|
||||
'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
|
||||
'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
|
||||
'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
|
||||
'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
|
||||
'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
|
||||
'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
|
||||
'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
|
||||
'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
|
||||
'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
|
||||
'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
|
||||
'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
|
||||
'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
|
||||
'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
|
||||
'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
|
||||
};
|
||||
|
||||
var namedLookup = {};
|
||||
|
||||
function init() {
|
||||
var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
|
||||
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
generatePicker();
|
||||
generateWebColors();
|
||||
generateNamedColors();
|
||||
|
||||
if (inputColor) {
|
||||
changeFinalColor(inputColor);
|
||||
|
||||
col = convertHexToRGB(inputColor);
|
||||
|
||||
if (col)
|
||||
updateLight(col.r, col.g, col.b);
|
||||
}
|
||||
|
||||
for (key in named) {
|
||||
value = named[key];
|
||||
namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
function toHexColor(color) {
|
||||
var matches, red, green, blue, toInt = parseInt;
|
||||
|
||||
function hex(value) {
|
||||
value = parseInt(value).toString(16);
|
||||
|
||||
return value.length > 1 ? value : '0' + value; // Padd with leading zero
|
||||
};
|
||||
|
||||
color = tinymce.trim(color);
|
||||
color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
|
||||
color = namedLookup[color] || color;
|
||||
|
||||
matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
|
||||
|
||||
if (matches) {
|
||||
red = toInt(matches[1]);
|
||||
green = toInt(matches[2]);
|
||||
blue = toInt(matches[3]);
|
||||
} else {
|
||||
matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
|
||||
|
||||
if (matches) {
|
||||
red = toInt(matches[1], 16);
|
||||
green = toInt(matches[2], 16);
|
||||
blue = toInt(matches[3], 16);
|
||||
} else {
|
||||
matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
|
||||
|
||||
if (matches) {
|
||||
red = toInt(matches[1] + matches[1], 16);
|
||||
green = toInt(matches[2] + matches[2], 16);
|
||||
blue = toInt(matches[3] + matches[3], 16);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '#' + hex(red) + hex(green) + hex(blue);
|
||||
}
|
||||
|
||||
function insertAction() {
|
||||
var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
|
||||
|
||||
var hexColor = toHexColor(color);
|
||||
|
||||
if (hexColor === '') {
|
||||
var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
|
||||
tinyMCEPopup.alert(text + ': ' + color);
|
||||
}
|
||||
else {
|
||||
tinyMCEPopup.restoreSelection();
|
||||
|
||||
if (f)
|
||||
f(hexColor);
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
}
|
||||
|
||||
function showColor(color, name) {
|
||||
if (name)
|
||||
document.getElementById("colorname").innerHTML = name;
|
||||
|
||||
document.getElementById("preview").style.backgroundColor = color;
|
||||
document.getElementById("color").value = color.toUpperCase();
|
||||
}
|
||||
|
||||
function convertRGBToHex(col) {
|
||||
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
|
||||
|
||||
if (!col)
|
||||
return col;
|
||||
|
||||
var rgb = col.replace(re, "$1,$2,$3").split(',');
|
||||
if (rgb.length == 3) {
|
||||
r = parseInt(rgb[0]).toString(16);
|
||||
g = parseInt(rgb[1]).toString(16);
|
||||
b = parseInt(rgb[2]).toString(16);
|
||||
|
||||
r = r.length == 1 ? '0' + r : r;
|
||||
g = g.length == 1 ? '0' + g : g;
|
||||
b = b.length == 1 ? '0' + b : b;
|
||||
|
||||
return "#" + r + g + b;
|
||||
}
|
||||
|
||||
return col;
|
||||
}
|
||||
|
||||
function convertHexToRGB(col) {
|
||||
if (col.indexOf('#') != -1) {
|
||||
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
|
||||
|
||||
r = parseInt(col.substring(0, 2), 16);
|
||||
g = parseInt(col.substring(2, 4), 16);
|
||||
b = parseInt(col.substring(4, 6), 16);
|
||||
|
||||
return {r : r, g : g, b : b};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function generatePicker() {
|
||||
var el = document.getElementById('light'), h = '', i;
|
||||
|
||||
for (i = 0; i < detail; i++){
|
||||
h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
|
||||
+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
|
||||
+ ' onmousedown="isMouseDown = true; return false;"'
|
||||
+ ' onmouseup="isMouseDown = false;"'
|
||||
+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
|
||||
+ ' onmouseover="isMouseOver = true;"'
|
||||
+ ' onmouseout="isMouseOver = false;"'
|
||||
+ '></div>';
|
||||
}
|
||||
|
||||
el.innerHTML = h;
|
||||
}
|
||||
|
||||
function generateWebColors() {
|
||||
var el = document.getElementById('webcolors'), h = '', i;
|
||||
|
||||
if (el.className == 'generated')
|
||||
return;
|
||||
|
||||
// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
|
||||
h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
|
||||
+ '<tr>';
|
||||
|
||||
for (i=0; i<colors.length; i++) {
|
||||
h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
|
||||
+ '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
|
||||
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
||||
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
||||
}
|
||||
h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
|
||||
h += '</a></td>';
|
||||
if ((i+1) % 18 == 0)
|
||||
h += '</tr><tr>';
|
||||
}
|
||||
|
||||
h += '</table></div>';
|
||||
|
||||
el.innerHTML = h;
|
||||
el.className = 'generated';
|
||||
|
||||
paintCanvas(el);
|
||||
enableKeyboardNavigation(el.firstChild);
|
||||
}
|
||||
|
||||
function paintCanvas(el) {
|
||||
tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
|
||||
var context;
|
||||
if (canvas.getContext && (context = canvas.getContext("2d"))) {
|
||||
context.fillStyle = canvas.getAttribute('data-color');
|
||||
context.fillRect(0, 0, 10, 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
function generateNamedColors() {
|
||||
var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
|
||||
|
||||
if (el.className == 'generated')
|
||||
return;
|
||||
|
||||
for (n in named) {
|
||||
v = named[n];
|
||||
h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
|
||||
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
||||
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
||||
}
|
||||
h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
|
||||
h += '</a>';
|
||||
i++;
|
||||
}
|
||||
|
||||
el.innerHTML = h;
|
||||
el.className = 'generated';
|
||||
|
||||
paintCanvas(el);
|
||||
enableKeyboardNavigation(el);
|
||||
}
|
||||
|
||||
function enableKeyboardNavigation(el) {
|
||||
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
|
||||
root: el,
|
||||
items: tinyMCEPopup.dom.select('a', el)
|
||||
}, tinyMCEPopup.dom);
|
||||
}
|
||||
|
||||
function dechex(n) {
|
||||
return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
|
||||
}
|
||||
|
||||
function computeColor(e) {
|
||||
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
|
||||
|
||||
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
|
||||
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
|
||||
|
||||
partWidth = document.getElementById('colors').width / 6;
|
||||
partDetail = detail / 2;
|
||||
imHeight = document.getElementById('colors').height;
|
||||
|
||||
r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
|
||||
g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
|
||||
b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
|
||||
|
||||
coef = (imHeight - y) / imHeight;
|
||||
r = 128 + (r - 128) * coef;
|
||||
g = 128 + (g - 128) * coef;
|
||||
b = 128 + (b - 128) * coef;
|
||||
|
||||
changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
|
||||
updateLight(r, g, b);
|
||||
}
|
||||
|
||||
function updateLight(r, g, b) {
|
||||
var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
|
||||
|
||||
for (i=0; i<detail; i++) {
|
||||
if ((i>=0) && (i<partDetail)) {
|
||||
finalCoef = i / partDetail;
|
||||
finalR = dechex(255 - (255 - r) * finalCoef);
|
||||
finalG = dechex(255 - (255 - g) * finalCoef);
|
||||
finalB = dechex(255 - (255 - b) * finalCoef);
|
||||
} else {
|
||||
finalCoef = 2 - i / partDetail;
|
||||
finalR = dechex(r * finalCoef);
|
||||
finalG = dechex(g * finalCoef);
|
||||
finalB = dechex(b * finalCoef);
|
||||
}
|
||||
|
||||
color = finalR + finalG + finalB;
|
||||
|
||||
setCol('gs' + i, '#'+color);
|
||||
}
|
||||
}
|
||||
|
||||
function changeFinalColor(color) {
|
||||
if (color.indexOf('#') == -1)
|
||||
color = convertRGBToHex(color);
|
||||
|
||||
setCol('preview', color);
|
||||
document.getElementById('color').value = color;
|
||||
}
|
||||
|
||||
function setCol(e, c) {
|
||||
try {
|
||||
document.getElementById(e).style.backgroundColor = c;
|
||||
} catch (ex) {
|
||||
// Ignore IE warning
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.onInit.add(init);
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
|
||||
|
||||
var colors = [
|
||||
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
|
||||
"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
|
||||
"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
|
||||
"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
|
||||
"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
|
||||
"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
|
||||
"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
|
||||
"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
|
||||
"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
|
||||
"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
|
||||
"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
|
||||
"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
|
||||
"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
|
||||
"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
|
||||
"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
|
||||
"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
|
||||
"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
|
||||
"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
|
||||
"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
|
||||
"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
|
||||
"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
|
||||
"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
|
||||
"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
|
||||
"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
|
||||
"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
|
||||
"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
|
||||
"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
|
||||
];
|
||||
|
||||
var named = {
|
||||
'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
|
||||
'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
|
||||
'#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
|
||||
'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
|
||||
'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
|
||||
'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
|
||||
'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
|
||||
'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
|
||||
'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
|
||||
'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
|
||||
'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
|
||||
'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
|
||||
'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
|
||||
'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
|
||||
'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
|
||||
'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
|
||||
'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
|
||||
'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
|
||||
'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
|
||||
'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
|
||||
'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
|
||||
'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
|
||||
'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
|
||||
};
|
||||
|
||||
var namedLookup = {};
|
||||
|
||||
function init() {
|
||||
var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
|
||||
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
generatePicker();
|
||||
generateWebColors();
|
||||
generateNamedColors();
|
||||
|
||||
if (inputColor) {
|
||||
changeFinalColor(inputColor);
|
||||
|
||||
col = convertHexToRGB(inputColor);
|
||||
|
||||
if (col)
|
||||
updateLight(col.r, col.g, col.b);
|
||||
}
|
||||
|
||||
for (key in named) {
|
||||
value = named[key];
|
||||
namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
function toHexColor(color) {
|
||||
var matches, red, green, blue, toInt = parseInt;
|
||||
|
||||
function hex(value) {
|
||||
value = parseInt(value).toString(16);
|
||||
|
||||
return value.length > 1 ? value : '0' + value; // Padd with leading zero
|
||||
};
|
||||
|
||||
color = tinymce.trim(color);
|
||||
color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
|
||||
color = namedLookup[color] || color;
|
||||
|
||||
matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
|
||||
|
||||
if (matches) {
|
||||
red = toInt(matches[1]);
|
||||
green = toInt(matches[2]);
|
||||
blue = toInt(matches[3]);
|
||||
} else {
|
||||
matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
|
||||
|
||||
if (matches) {
|
||||
red = toInt(matches[1], 16);
|
||||
green = toInt(matches[2], 16);
|
||||
blue = toInt(matches[3], 16);
|
||||
} else {
|
||||
matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
|
||||
|
||||
if (matches) {
|
||||
red = toInt(matches[1] + matches[1], 16);
|
||||
green = toInt(matches[2] + matches[2], 16);
|
||||
blue = toInt(matches[3] + matches[3], 16);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '#' + hex(red) + hex(green) + hex(blue);
|
||||
}
|
||||
|
||||
function insertAction() {
|
||||
var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
|
||||
|
||||
var hexColor = toHexColor(color);
|
||||
|
||||
if (hexColor === '') {
|
||||
var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
|
||||
tinyMCEPopup.alert(text + ': ' + color);
|
||||
}
|
||||
else {
|
||||
tinyMCEPopup.restoreSelection();
|
||||
|
||||
if (f)
|
||||
f(hexColor);
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
}
|
||||
|
||||
function showColor(color, name) {
|
||||
if (name)
|
||||
document.getElementById("colorname").innerHTML = name;
|
||||
|
||||
document.getElementById("preview").style.backgroundColor = color;
|
||||
document.getElementById("color").value = color.toUpperCase();
|
||||
}
|
||||
|
||||
function convertRGBToHex(col) {
|
||||
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
|
||||
|
||||
if (!col)
|
||||
return col;
|
||||
|
||||
var rgb = col.replace(re, "$1,$2,$3").split(',');
|
||||
if (rgb.length == 3) {
|
||||
r = parseInt(rgb[0]).toString(16);
|
||||
g = parseInt(rgb[1]).toString(16);
|
||||
b = parseInt(rgb[2]).toString(16);
|
||||
|
||||
r = r.length == 1 ? '0' + r : r;
|
||||
g = g.length == 1 ? '0' + g : g;
|
||||
b = b.length == 1 ? '0' + b : b;
|
||||
|
||||
return "#" + r + g + b;
|
||||
}
|
||||
|
||||
return col;
|
||||
}
|
||||
|
||||
function convertHexToRGB(col) {
|
||||
if (col.indexOf('#') != -1) {
|
||||
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
|
||||
|
||||
r = parseInt(col.substring(0, 2), 16);
|
||||
g = parseInt(col.substring(2, 4), 16);
|
||||
b = parseInt(col.substring(4, 6), 16);
|
||||
|
||||
return {r : r, g : g, b : b};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function generatePicker() {
|
||||
var el = document.getElementById('light'), h = '', i;
|
||||
|
||||
for (i = 0; i < detail; i++){
|
||||
h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
|
||||
+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
|
||||
+ ' onmousedown="isMouseDown = true; return false;"'
|
||||
+ ' onmouseup="isMouseDown = false;"'
|
||||
+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
|
||||
+ ' onmouseover="isMouseOver = true;"'
|
||||
+ ' onmouseout="isMouseOver = false;"'
|
||||
+ '></div>';
|
||||
}
|
||||
|
||||
el.innerHTML = h;
|
||||
}
|
||||
|
||||
function generateWebColors() {
|
||||
var el = document.getElementById('webcolors'), h = '', i;
|
||||
|
||||
if (el.className == 'generated')
|
||||
return;
|
||||
|
||||
// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
|
||||
h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
|
||||
+ '<tr>';
|
||||
|
||||
for (i=0; i<colors.length; i++) {
|
||||
h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
|
||||
+ '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
|
||||
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
||||
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
||||
}
|
||||
h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
|
||||
h += '</a></td>';
|
||||
if ((i+1) % 18 == 0)
|
||||
h += '</tr><tr>';
|
||||
}
|
||||
|
||||
h += '</table></div>';
|
||||
|
||||
el.innerHTML = h;
|
||||
el.className = 'generated';
|
||||
|
||||
paintCanvas(el);
|
||||
enableKeyboardNavigation(el.firstChild);
|
||||
}
|
||||
|
||||
function paintCanvas(el) {
|
||||
tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
|
||||
var context;
|
||||
if (canvas.getContext && (context = canvas.getContext("2d"))) {
|
||||
context.fillStyle = canvas.getAttribute('data-color');
|
||||
context.fillRect(0, 0, 10, 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
function generateNamedColors() {
|
||||
var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
|
||||
|
||||
if (el.className == 'generated')
|
||||
return;
|
||||
|
||||
for (n in named) {
|
||||
v = named[n];
|
||||
h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
|
||||
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
||||
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
||||
}
|
||||
h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
|
||||
h += '</a>';
|
||||
i++;
|
||||
}
|
||||
|
||||
el.innerHTML = h;
|
||||
el.className = 'generated';
|
||||
|
||||
paintCanvas(el);
|
||||
enableKeyboardNavigation(el);
|
||||
}
|
||||
|
||||
function enableKeyboardNavigation(el) {
|
||||
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
|
||||
root: el,
|
||||
items: tinyMCEPopup.dom.select('a', el)
|
||||
}, tinyMCEPopup.dom);
|
||||
}
|
||||
|
||||
function dechex(n) {
|
||||
return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
|
||||
}
|
||||
|
||||
function computeColor(e) {
|
||||
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
|
||||
|
||||
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
|
||||
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
|
||||
|
||||
partWidth = document.getElementById('colors').width / 6;
|
||||
partDetail = detail / 2;
|
||||
imHeight = document.getElementById('colors').height;
|
||||
|
||||
r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
|
||||
g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
|
||||
b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
|
||||
|
||||
coef = (imHeight - y) / imHeight;
|
||||
r = 128 + (r - 128) * coef;
|
||||
g = 128 + (g - 128) * coef;
|
||||
b = 128 + (b - 128) * coef;
|
||||
|
||||
changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
|
||||
updateLight(r, g, b);
|
||||
}
|
||||
|
||||
function updateLight(r, g, b) {
|
||||
var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
|
||||
|
||||
for (i=0; i<detail; i++) {
|
||||
if ((i>=0) && (i<partDetail)) {
|
||||
finalCoef = i / partDetail;
|
||||
finalR = dechex(255 - (255 - r) * finalCoef);
|
||||
finalG = dechex(255 - (255 - g) * finalCoef);
|
||||
finalB = dechex(255 - (255 - b) * finalCoef);
|
||||
} else {
|
||||
finalCoef = 2 - i / partDetail;
|
||||
finalR = dechex(r * finalCoef);
|
||||
finalG = dechex(g * finalCoef);
|
||||
finalB = dechex(b * finalCoef);
|
||||
}
|
||||
|
||||
color = finalR + finalG + finalB;
|
||||
|
||||
setCol('gs' + i, '#'+color);
|
||||
}
|
||||
}
|
||||
|
||||
function changeFinalColor(color) {
|
||||
if (color.indexOf('#') == -1)
|
||||
color = convertRGBToHex(color);
|
||||
|
||||
setCol('preview', color);
|
||||
document.getElementById('color').value = color;
|
||||
}
|
||||
|
||||
function setCol(e, c) {
|
||||
try {
|
||||
document.getElementById(e).style.backgroundColor = c;
|
||||
} catch (ex) {
|
||||
// Ignore IE warning
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.onInit.add(init);
|
||||
|
@ -1 +1 @@
|
||||
tinyMCE.addI18n('he.advanced_dlg',{"link_list":"\u05e8\u05e9\u05d9\u05de\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd","link_is_external":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d7\u05d9\u05e6\u05d5\u05e0\u05d9 \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea http:// \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?","link_is_email":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05d9\u05d9\u05dc \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea MAILTO \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?","link_titlefield":"\u05db\u05d5\u05ea\u05e8\u05ea","link_target_blank":"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d7\u05dc\u05d5\u05df \u05d7\u05d3\u05e9","link_target_same":"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d0\u05d5\u05ea\u05d5 \u05d7\u05dc\u05d5\u05df","link_target":"\u05d9\u05e2\u05d3","link_url":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4\u05e7\u05d9\u05e9\u05d5\u05e8","link_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8","image_align_right":"\u05d9\u05de\u05d9\u05df","image_align_left":"\u05e9\u05de\u05d0\u05dc","image_align_textbottom":"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8","image_align_texttop":"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8","image_align_bottom":"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df","image_align_middle":"\u05d0\u05de\u05e6\u05e2","image_align_top":"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df","image_align_baseline":"\u05e7\u05d5 \u05d4\u05d4\u05ea\u05d7\u05dc\u05d4","image_align":"\u05d9\u05d9\u05e9\u05d5\u05e8","image_hspace":"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05d5\u05e4\u05e7\u05d9","image_vspace":"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05e0\u05db\u05d9","image_dimensions":"\u05d2\u05d5\u05d3\u05dc","image_alt":"\u05ea\u05d9\u05d0\u05d5\u05e8","image_list":"\u05e8\u05e9\u05d9\u05de\u05d4","image_border":"\u05d2\u05d1\u05d5\u05dc","image_src":"\u05db\u05ea\u05d5\u05d1\u05ea:","image_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05ea\u05de\u05d5\u05e0\u05d4","charmap_title":"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e1\u05d9\u05de\u05df","colorpicker_name":"\u05e9\u05dd:","colorpicker_color":"\u05e6\u05d1\u05e2:","colorpicker_named_title":"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea","colorpicker_named_tab":"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea","colorpicker_palette_title":"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_palette_tab":"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_picker_title":"\u05d1\u05d5\u05e8\u05e8 \u05d4\u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_picker_tab":"\u05d1\u05d5\u05e8\u05e8","colorpicker_title":"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e6\u05d1\u05e2","code_wordwrap":"\u05d2\u05dc\u05d9\u05e9\u05ea \u05d8\u05e7\u05e1\u05d8","code_title":"\u05e2\u05d5\u05e8\u05da \u05d4-HTML","anchor_name":"\u05e9\u05dd \u05d4\u05e1\u05d9\u05de\u05e0\u05d9\u05d4","anchor_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e1\u05d9\u05de\u05e0\u05d9\u05d4","about_loaded":"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d5\u05ea","about_version":"\u05d2\u05d9\u05e8\u05e1\u05d4","about_author":"\u05d9\u05d5\u05e6\u05e8","about_plugin":"\u05ea\u05d5\u05e1\u05e4\u05ea","about_plugins":"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea","about_license":"\u05e8\u05e9\u05d9\u05d5\u05df","about_help":"\u05e2\u05d6\u05e8\u05d4","about_general":"\u05d0\u05d5\u05d3\u05d5\u05ea","about_title":"\u05d0\u05d5\u05d3\u05d5\u05ea TinyMCE","charmap_usage":"\u05d4\u05e9\u05ea\u05de\u05e9/\u05d9 \u05d1\u05d7\u05d9\u05e6\u05d9\u05dd \u05dc\u05e0\u05d9\u05d5\u05d5\u05d8 \u05d9\u05de\u05d9\u05e0\u05d4 \u05d5\u05e9\u05de\u05d0\u05dc\u05d4","anchor_invalid":"\u05e0\u05d0 \u05dc\u05e6\u05d9\u05d9\u05df \u05e9\u05dd \u05d7\u05d5\u05e7\u05d9","accessibility_help":"\u05e2\u05d6\u05e8\u05d4 \u05d1\u05e0\u05d2\u05d9\u05e9\u05d5\u05ea","accessibility_usage_title":"\u05e9\u05d9\u05de\u05d5\u05e9 \u05db\u05dc\u05dc\u05d9"});
|
||||
tinyMCE.addI18n('he.advanced_dlg',{"link_list":"\u05e8\u05e9\u05d9\u05de\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd","link_is_external":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d7\u05d9\u05e6\u05d5\u05e0\u05d9 \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea http:// \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?","link_is_email":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05d9\u05d9\u05dc \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea MAILTO \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?","link_titlefield":"\u05db\u05d5\u05ea\u05e8\u05ea","link_target_blank":"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d7\u05dc\u05d5\u05df \u05d7\u05d3\u05e9","link_target_same":"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d0\u05d5\u05ea\u05d5 \u05d7\u05dc\u05d5\u05df","link_target":"\u05d9\u05e2\u05d3","link_url":"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4\u05e7\u05d9\u05e9\u05d5\u05e8","link_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8","image_align_right":"\u05d9\u05de\u05d9\u05df","image_align_left":"\u05e9\u05de\u05d0\u05dc","image_align_textbottom":"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8","image_align_texttop":"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8","image_align_bottom":"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df","image_align_middle":"\u05d0\u05de\u05e6\u05e2","image_align_top":"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df","image_align_baseline":"\u05e7\u05d5 \u05d4\u05d4\u05ea\u05d7\u05dc\u05d4","image_align":"\u05d9\u05d9\u05e9\u05d5\u05e8","image_hspace":"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05d5\u05e4\u05e7\u05d9","image_vspace":"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05e0\u05db\u05d9","image_dimensions":"\u05d2\u05d5\u05d3\u05dc","image_alt":"\u05ea\u05d9\u05d0\u05d5\u05e8","image_list":"\u05e8\u05e9\u05d9\u05de\u05d4","image_border":"\u05d2\u05d1\u05d5\u05dc","image_src":"\u05db\u05ea\u05d5\u05d1\u05ea:","image_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05ea\u05de\u05d5\u05e0\u05d4","charmap_title":"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e1\u05d9\u05de\u05df","colorpicker_name":"\u05e9\u05dd:","colorpicker_color":"\u05e6\u05d1\u05e2:","colorpicker_named_title":"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea","colorpicker_named_tab":"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea","colorpicker_palette_title":"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_palette_tab":"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_picker_title":"\u05d1\u05d5\u05e8\u05e8 \u05d4\u05e6\u05d1\u05e2\u05d9\u05dd","colorpicker_picker_tab":"\u05d1\u05d5\u05e8\u05e8","colorpicker_title":"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e6\u05d1\u05e2","code_wordwrap":"\u05d2\u05dc\u05d9\u05e9\u05ea \u05d8\u05e7\u05e1\u05d8","code_title":"\u05e2\u05d5\u05e8\u05da \u05d4-HTML","anchor_name":"\u05e9\u05dd \u05d4\u05e1\u05d9\u05de\u05e0\u05d9\u05d4","anchor_title":"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e1\u05d9\u05de\u05e0\u05d9\u05d4","about_loaded":"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d5\u05ea","about_version":"\u05d2\u05d9\u05e8\u05e1\u05d4","about_author":"\u05d9\u05d5\u05e6\u05e8","about_plugin":"\u05ea\u05d5\u05e1\u05e4\u05ea","about_plugins":"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea","about_license":"\u05e8\u05e9\u05d9\u05d5\u05df","about_help":"\u05e2\u05d6\u05e8\u05d4","about_general":"\u05d0\u05d5\u05d3\u05d5\u05ea","about_title":"\u05d0\u05d5\u05d3\u05d5\u05ea TinyMCE","charmap_usage":"\u05d4\u05e9\u05ea\u05de\u05e9/\u05d9 \u05d1\u05d7\u05d9\u05e6\u05d9\u05dd \u05dc\u05e0\u05d9\u05d5\u05d5\u05d8 \u05d9\u05de\u05d9\u05e0\u05d4 \u05d5\u05e9\u05de\u05d0\u05dc\u05d4","anchor_invalid":"\u05e0\u05d0 \u05dc\u05e6\u05d9\u05d9\u05df \u05e9\u05dd \u05d7\u05d5\u05e7\u05d9","accessibility_help":"\u05e2\u05d6\u05e8\u05d4 \u05d1\u05e0\u05d2\u05d9\u05e9\u05d5\u05ea","accessibility_usage_title":"\u05e9\u05d9\u05de\u05d5\u05e9 \u05db\u05dc\u05dc\u05d9","invalid_color_value":"\u05e2\u05e8\u05da \u05d4\u05e6\u05d1\u05e2 \u05dc\u05d0 \u05ea\u05e7\u05d9\u05df"});
|
@ -1 +1 @@
|
||||
tinyMCE.addI18n('nb.advanced_dlg',{"link_list":"Lenkeliste","link_is_external":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en ekstern nettadresse. \u00d8nsker du \u00e5 legge til det p\u00e5krevde http://-prefikset?","link_is_email":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en e-postadresse. \u00d8nsker du \u00e5 legge til det p\u00e5krevde mailto:-prefikset?","link_titlefield":"Tittel","link_target_blank":"\u00c5pne i nytt vindu","link_target_same":"\u00c5pne i dette vinduet","link_target":"M\u00e5lside","link_url":"Lenkens URL","link_title":"Sett inn /endre lenke","image_align_right":"H\u00f8yre","image_align_left":"Venstre","image_align_textbottom":"Tekstbunn","image_align_texttop":"Teksttopp","image_align_bottom":"Bunn","image_align_middle":"Midtstilt","image_align_top":"Topp","image_align_baseline":"Bunnlinje","image_align":"Justering","image_hspace":"Horisontal avstand","image_vspace":"Vertikal avstand","image_dimensions":"Dimensjoner","image_alt":"Bildebeskrivelse","image_list":"Bildeliste","image_border":"Ramme","image_src":"Bildets URL","image_title":"Sett inn / endre bilde","charmap_title":"Velg spesialtegn","colorpicker_name":"Navn:","colorpicker_color":"Farge:","colorpicker_named_title":"Fargenavn","colorpicker_named_tab":"Navnevalg","colorpicker_palette_title":"Palettfarger","colorpicker_palette_tab":"Palett","colorpicker_picker_title":"Fargevalg","colorpicker_picker_tab":"Velg farge","colorpicker_title":"Velg en farge","code_wordwrap":"Tekstbryting","code_title":"HTML-editor","anchor_name":"Ankernavn","anchor_title":"Sett inn / endre anker","about_loaded":"Lastede programtillegg","about_version":"Versjon","about_author":"Utvikler","about_plugin":"Programtillegg","about_plugins":"Programtillegg","about_license":"Lisens","about_help":"Hjelp","about_general":"Om","about_title":"Om TinyMCE","charmap_usage":"Bruk venstre og h\u00f8yre piltast for \u00e5 navigere.","anchor_invalid":"Du m\u00e5 angi et gyldig ankernavn.","accessibility_help":"Tilhjengelighetshjelp","accessibility_usage_title":"Generell bruk"});
|
||||
tinyMCE.addI18n('nb.advanced_dlg',{"link_list":"Lenkeliste","link_is_external":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en ekstern nettadresse. \u00d8nsker du \u00e5 legge til det p\u00e5krevde http://-prefikset?","link_is_email":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en e-postadresse. \u00d8nsker du \u00e5 legge til det p\u00e5krevde mailto:-prefikset?","link_titlefield":"Tittel","link_target_blank":"\u00c5pne i nytt vindu","link_target_same":"\u00c5pne i dette vinduet","link_target":"M\u00e5lside","link_url":"Lenkens URL","link_title":"Sett inn /endre lenke","image_align_right":"H\u00f8yre","image_align_left":"Venstre","image_align_textbottom":"Tekstbunn","image_align_texttop":"Teksttopp","image_align_bottom":"Bunn","image_align_middle":"Midtstilt","image_align_top":"Topp","image_align_baseline":"Bunnlinje","image_align":"Justering","image_hspace":"Horisontal avstand","image_vspace":"Vertikal avstand","image_dimensions":"Dimensjoner","image_alt":"Bildebeskrivelse","image_list":"Bildeliste","image_border":"Ramme","image_src":"Bildets URL","image_title":"Sett inn / endre bilde","charmap_title":"Velg spesialtegn","colorpicker_name":"Navn:","colorpicker_color":"Farge:","colorpicker_named_title":"Fargenavn","colorpicker_named_tab":"Navnevalg","colorpicker_palette_title":"Palettfarger","colorpicker_palette_tab":"Palett","colorpicker_picker_title":"Fargevalg","colorpicker_picker_tab":"Velg farge","colorpicker_title":"Velg en farge","code_wordwrap":"Tekstbryting","code_title":"HTML-editor","anchor_name":"Ankernavn","anchor_title":"Sett inn / endre anker","about_loaded":"Lastede programtillegg","about_version":"Versjon","about_author":"Utvikler","about_plugin":"Programtillegg","about_plugins":"Programtillegg","about_license":"Lisens","about_help":"Hjelp","about_general":"Om","about_title":"Om TinyMCE","charmap_usage":"Bruk venstre og h\u00f8yre piltast for \u00e5 navigere.","anchor_invalid":"Du m\u00e5 angi et gyldig ankernavn.","accessibility_help":"Tilhjengelighetshjelp","accessibility_usage_title":"Generell bruk","invalid_color_value":"Ugyldig fargeverdi"});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,306 @@
|
||||
<?php
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2011 Jehan |
|
||||
// | All rights reserved. |
|
||||
// | |
|
||||
// | Redistribution and use in source and binary forms, with or without |
|
||||
// | modification, are permitted provided that the following conditions |
|
||||
// | are met: |
|
||||
// | |
|
||||
// | o Redistributions of source code must retain the above copyright |
|
||||
// | notice, this list of conditions and the following disclaimer. |
|
||||
// | o Redistributions in binary form must reproduce the above copyright |
|
||||
// | notice, this list of conditions and the following disclaimer in the |
|
||||
// | documentation and/or other materials provided with the distribution.|
|
||||
// | o The names of the authors may not be used to endorse or promote |
|
||||
// | products derived from this software without specific prior written |
|
||||
// | permission. |
|
||||
// | |
|
||||
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
||||
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
||||
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
||||
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
||||
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
||||
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
||||
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
||||
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
||||
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
||||
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
||||
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
||||
// | |
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Author: Jehan <jehan.marmottard@gmail.com |
|
||||
// +-----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id$
|
||||
|
||||
/**
|
||||
* Implementation of SCRAM-* SASL mechanisms.
|
||||
* SCRAM mechanisms have 3 main steps (initial response, response to the server challenge, then server signature
|
||||
* verification) which keep state-awareness. Therefore a single class instanciation must be done and reused for the whole
|
||||
* authentication process.
|
||||
*
|
||||
* @author Jehan <jehan.marmottard@gmail.com>
|
||||
* @access public
|
||||
* @version 1.0
|
||||
* @package Auth_SASL
|
||||
*/
|
||||
|
||||
require_once('Auth/SASL/Common.php');
|
||||
|
||||
class Auth_SASL_SCRAM extends Auth_SASL_Common
|
||||
{
|
||||
/**
|
||||
* Construct a SCRAM-H client where 'H' is a cryptographic hash function.
|
||||
*
|
||||
* @param string $hash The name cryptographic hash function 'H' as registered by IANA in the "Hash Function Textual
|
||||
* Names" registry.
|
||||
* @link http://www.iana.org/assignments/hash-function-text-names/hash-function-text-names.xml "Hash Function Textual
|
||||
* Names"
|
||||
* format of core PHP hash function.
|
||||
* @access public
|
||||
*/
|
||||
function __construct($hash)
|
||||
{
|
||||
// Though I could be strict, I will actually also accept the naming used in the PHP core hash framework.
|
||||
// For instance "sha1" is accepted, while the registered hash name should be "SHA-1".
|
||||
$hash = strtolower($hash);
|
||||
$hashes = array('md2' => 'md2',
|
||||
'md5' => 'md5',
|
||||
'sha-1' => 'sha1',
|
||||
'sha1' => 'sha1',
|
||||
'sha-224' > 'sha224',
|
||||
'sha224' > 'sha224',
|
||||
'sha-256' => 'sha256',
|
||||
'sha256' => 'sha256',
|
||||
'sha-384' => 'sha384',
|
||||
'sha384' => 'sha384',
|
||||
'sha-512' => 'sha512',
|
||||
'sha512' => 'sha512');
|
||||
if (function_exists('hash_hmac') && isset($hashes[$hash]))
|
||||
{
|
||||
$this->hash = create_function('$data', 'return hash("' . $hashes[$hash] . '", $data, TRUE);');
|
||||
$this->hmac = create_function('$key,$str,$raw', 'return hash_hmac("' . $hashes[$hash] . '", $str, $key, $raw);');
|
||||
}
|
||||
elseif ($hash == 'md5')
|
||||
{
|
||||
$this->hash = create_function('$data', 'return md5($data, true);');
|
||||
$this->hmac = array($this, '_HMAC_MD5');
|
||||
}
|
||||
elseif (in_array($hash, array('sha1', 'sha-1')))
|
||||
{
|
||||
$this->hash = create_function('$data', 'return sha1($data, true);');
|
||||
$this->hmac = array($this, '_HMAC_SHA1');
|
||||
}
|
||||
else
|
||||
return PEAR::raiseError('Invalid SASL mechanism type');
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the (main) client response for SCRAM-H.
|
||||
*
|
||||
* @param string $authcid Authentication id (username)
|
||||
* @param string $pass Password
|
||||
* @param string $challenge The challenge sent by the server.
|
||||
* If the challenge is NULL or an empty string, the result will be the "initial response".
|
||||
* @param string $authzid Authorization id (username to proxy as)
|
||||
* @return string|false The response (binary, NOT base64 encoded)
|
||||
* @access public
|
||||
*/
|
||||
public function getResponse($authcid, $pass, $challenge = NULL, $authzid = NULL)
|
||||
{
|
||||
$authcid = $this->_formatName($authcid);
|
||||
if (empty($authcid))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!empty($authzid))
|
||||
{
|
||||
$authzid = $this->_formatName($authzid);
|
||||
if (empty($authzid))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($challenge))
|
||||
{
|
||||
return $this->_generateInitialResponse($authcid, $authzid);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_generateResponse($challenge, $pass);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare a name for inclusion in a SCRAM response.
|
||||
*
|
||||
* @param string $username a name to be prepared.
|
||||
* @return string the reformated name.
|
||||
* @access private
|
||||
*/
|
||||
private function _formatName($username)
|
||||
{
|
||||
// TODO: prepare through the SASLprep profile of the stringprep algorithm.
|
||||
// See RFC-4013.
|
||||
|
||||
$username = str_replace('=', '=3D', $username);
|
||||
$username = str_replace(',', '=2C', $username);
|
||||
return $username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the initial response which can be either sent directly in the first message or as a response to an empty
|
||||
* server challenge.
|
||||
*
|
||||
* @param string $authcid Prepared authentication identity.
|
||||
* @param string $authzid Prepared authorization identity.
|
||||
* @return string The SCRAM response to send.
|
||||
* @access private
|
||||
*/
|
||||
private function _generateInitialResponse($authcid, $authzid)
|
||||
{
|
||||
$init_rep = '';
|
||||
$gs2_cbind_flag = 'n,'; // TODO: support channel binding.
|
||||
$this->gs2_header = $gs2_cbind_flag . (!empty($authzid)? 'a=' . $authzid : '') . ',';
|
||||
|
||||
// I must generate a client nonce and "save" it for later comparison on second response.
|
||||
$this->cnonce = $this->_getCnonce();
|
||||
// XXX: in the future, when mandatory and/or optional extensions are defined in any updated RFC,
|
||||
// this message can be updated.
|
||||
$this->first_message_bare = 'n=' . $authcid . ',r=' . $this->cnonce;
|
||||
return $this->gs2_header . $this->first_message_bare;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses and verifies a non-empty SCRAM challenge.
|
||||
*
|
||||
* @param string $challenge The SCRAM challenge
|
||||
* @return string|false The response to send; false in case of wrong challenge or if an initial response has not
|
||||
* been generated first.
|
||||
* @access private
|
||||
*/
|
||||
private function _generateResponse($challenge, $password)
|
||||
{
|
||||
// XXX: as I don't support mandatory extension, I would fail on them.
|
||||
// And I simply ignore any optional extension.
|
||||
$server_message_regexp = "#^r=([\x21-\x2B\x2D-\x7E]+),s=((?:[A-Za-z0-9/+]{4})*(?:[A-Za-z0-9]{3}=|[A-Xa-z0-9]{2}==)?),i=([0-9]*)(,[A-Za-z]=[^,])*$#";
|
||||
if (!isset($this->cnonce, $this->gs2_header)
|
||||
|| !preg_match($server_message_regexp, $challenge, $matches))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$nonce = $matches[1];
|
||||
$salt = base64_decode($matches[2]);
|
||||
if (!$salt)
|
||||
{
|
||||
// Invalid Base64.
|
||||
return false;
|
||||
}
|
||||
$i = intval($matches[3]);
|
||||
|
||||
$cnonce = substr($nonce, 0, strlen($this->cnonce));
|
||||
if ($cnonce <> $this->cnonce)
|
||||
{
|
||||
// Invalid challenge! Are we under attack?
|
||||
return false;
|
||||
}
|
||||
|
||||
$channel_binding = 'c=' . base64_encode($this->gs2_header); // TODO: support channel binding.
|
||||
$final_message = $channel_binding . ',r=' . $nonce; // XXX: no extension.
|
||||
|
||||
// TODO: $password = $this->normalize($password); // SASLprep profile of stringprep.
|
||||
$saltedPassword = $this->hi($password, $salt, $i);
|
||||
$this->saltedPassword = $saltedPassword;
|
||||
$clientKey = call_user_func($this->hmac, $saltedPassword, "Client Key", TRUE);
|
||||
$storedKey = call_user_func($this->hash, $clientKey, TRUE);
|
||||
$authMessage = $this->first_message_bare . ',' . $challenge . ',' . $final_message;
|
||||
$this->authMessage = $authMessage;
|
||||
$clientSignature = call_user_func($this->hmac, $storedKey, $authMessage, TRUE);
|
||||
$clientProof = $clientKey ^ $clientSignature;
|
||||
$proof = ',p=' . base64_encode($clientProof);
|
||||
|
||||
return $final_message . $proof;
|
||||
}
|
||||
|
||||
/**
|
||||
* SCRAM has also a server verification step. On a successful outcome, it will send additional data which must
|
||||
* absolutely be checked against this function. If this fails, the entity which we are communicating with is probably
|
||||
* not the server as it has not access to your ServerKey.
|
||||
*
|
||||
* @param string $data The additional data sent along a successful outcome.
|
||||
* @return bool Whether the server has been authenticated.
|
||||
* If false, the client must close the connection and consider to be under a MITM attack.
|
||||
* @access public
|
||||
*/
|
||||
public function processOutcome($data)
|
||||
{
|
||||
$verifier_regexp = '#^v=((?:[A-Za-z0-9/+]{4})*(?:[A-Za-z0-9]{3}=|[A-Xa-z0-9]{2}==)?)$#';
|
||||
if (!isset($this->saltedPassword, $this->authMessage)
|
||||
|| !preg_match($verifier_regexp, $data, $matches))
|
||||
{
|
||||
// This cannot be an outcome, you never sent the challenge's response.
|
||||
return false;
|
||||
}
|
||||
|
||||
$verifier = $matches[1];
|
||||
$proposed_serverSignature = base64_decode($verifier);
|
||||
$serverKey = call_user_func($this->hmac, $this->saltedPassword, "Server Key", true);
|
||||
$serverSignature = call_user_func($this->hmac, $serverKey, $this->authMessage, TRUE);
|
||||
return ($proposed_serverSignature === $serverSignature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hi() call, which is essentially PBKDF2 (RFC-2898) with HMAC-H() as the pseudorandom function.
|
||||
*
|
||||
* @param string $str The string to hash.
|
||||
* @param string $hash The hash value.
|
||||
* @param int $i The iteration count.
|
||||
* @access private
|
||||
*/
|
||||
private function hi($str, $salt, $i)
|
||||
{
|
||||
$int1 = "\0\0\0\1";
|
||||
$ui = call_user_func($this->hmac, $str, $salt . $int1, true);
|
||||
$result = $ui;
|
||||
for ($k = 1; $k < $i; $k++)
|
||||
{
|
||||
$ui = call_user_func($this->hmac, $str, $ui, true);
|
||||
$result = $result ^ $ui;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates the client nonce for the response
|
||||
*
|
||||
* @return string The cnonce value
|
||||
* @access private
|
||||
* @author Richard Heyes <richard@php.net>
|
||||
*/
|
||||
private function _getCnonce()
|
||||
{
|
||||
// TODO: I reused the nonce function from the DigestMD5 class.
|
||||
// I should probably make this a protected function in Common.
|
||||
if (@file_exists('/dev/urandom') && $fd = @fopen('/dev/urandom', 'r')) {
|
||||
return base64_encode(fread($fd, 32));
|
||||
|
||||
} elseif (@file_exists('/dev/random') && $fd = @fopen('/dev/random', 'r')) {
|
||||
return base64_encode(fread($fd, 32));
|
||||
|
||||
} else {
|
||||
$str = '';
|
||||
for ($i=0; $i<32; $i++) {
|
||||
$str .= chr(mt_rand(0, 255));
|
||||
}
|
||||
|
||||
return base64_encode($str);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Before Width: | Height: | Size: 54 B After Width: | Height: | Size: 54 B |
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 118 B |
Loading…
Reference in New Issue