generators/wysihat/templates/javascripts/wysihat.js in wysihat-engine-0.1.6 vs generators/wysihat/templates/javascripts/wysihat.js in wysihat-engine-0.1.7
- old
+ new
@@ -445,11 +445,11 @@
function getDocument() {
return this.contentDocument || this.contentWindow.document;
}
function getWindow() {
- if (this.contentDocument)
+ if (this.contentDocument && this.contentDocument.defaultView)
return this.contentDocument.defaultView;
else if (this.contentWindow.document)
return this.contentWindow;
else
return null;
@@ -552,35 +552,10 @@
}
return this;
},
-
- linkStyleSheet: function(href) {
- this.whenReady(function(editor){
- var document = editor.getDocument();
- if(document.createStyleSheet) { // IE
- document.createStyleSheet(css);
- } else {
- var head = document.documentElement.getElementsByTagName('head')[0];
- if (!head) {
- head=document.createElement('head');
- document.documentElement.insertBefore(head,document.getElementsByTagName('body')[0]);
- }
- var link='<link href="'+href+'" media="screen" rel="stylesheet" type="text/css"/>';
- head=$(head);
- if (head.insert) { // Safari
- $(head).insert(link);
- } else { // everyone else
- head.innerHTML=head.innerHTML+link;
- }
- }
- });
- },
-
-
-
/**
* WysiHat.iFrame.Methods#getStyle(style) -> string
* - style specificication (i.e. backgroundColor)
*
* Returns the style from the element based on the given style
@@ -2015,10 +1990,10 @@
var handler = this.buttonStateHandler(name, options);
this.observeStateChanges(button, name, handler)
}
function createButtonElement(toolbar, options) {
- var button = Element('a', {
+ var button = new Element('a', {
'class': 'button', 'href': '#'
});
button.update('<span>' + options.get('label') + '</span>');
button.addClassName(options.get('name'));