Skip to content

Instantly share code, notes, and snippets.

@gbakernet
Created October 7, 2010 04:18
Show Gist options
  • Save gbakernet/614545 to your computer and use it in GitHub Desktop.
Save gbakernet/614545 to your computer and use it in GitHub Desktop.
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();
};
})())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment