public
Created

  • Download Gist
yui-editor-bookmarklet.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
javascript:void((function(){
var script=document.createElement('script');
script.src='http://yui.yahooapis.com/2.8.0r4/build/yuiloader/yuiloader-min.js';
script.setAttribute('type', 'text/javascript');
document.getElementsByTagName('HEAD')[0].appendChild(script);
 
var loaderCheck = setInterval(function(){
if(window['YAHOO']) {
clearInterval(loaderCheck);
doit();
}
},50);
 
var doit = function(){
var loader = new YAHOO.util.YUILoader({
base: '',
require: ['containercore','dom','element','selector','event','simpleeditor'],
loadOptional: false,
combine: true,
filter: 'MIN',
allowRollup: true,
onSuccess: function() {
 
YAHOO.namespace('injector');
YAHOO.injector.TextArea = function(){
 
var body = new YAHOO.util.Element(YAHOO.util.Selector.query('body')[0]);
body.addClass('yui-skin-sam');
var textareas = YAHOO.util.Selector.query('textarea');
for(var i = 0; i < textareas.length; i++) {
 
var yuiTextArea = new YAHOO.util.Element(textareas[i]);
var myConfig = {
height: yuiTextArea.getStyle('height'),
width: yuiTextArea.getStyle('width'),
dompath: true,
focusAtStart: true
};
 
(function(){
var myEditor = new YAHOO.widget.SimpleEditor(textareas[i], myConfig);
myEditor.render();
setInterval(function(){
myEditor.saveHTML();
},500);
})();
}
};
var myTextAreas = new YAHOO.injector.TextArea();
 
}
});
loader.insert();
};
 
 
})())

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.