User CSS context menu settings fix
* Fixed initialization of user CSS settings from cookie. Now we the correct values are being read. This could be possible fix for issue #138. * Changed generation of CSS link elements to get rid of JS deprecated warnings.
This commit is contained in:
parent
cb2c39c502
commit
e341a3e97c
1 changed files with 5 additions and 13 deletions
|
@ -329,7 +329,7 @@ VT100.prototype.getUserSettings = function() {
|
||||||
this.disableAlt = settings.charAt(5) != '0';
|
this.disableAlt = settings.charAt(5) != '0';
|
||||||
if (typeof userCSSList != 'undefined') {
|
if (typeof userCSSList != 'undefined') {
|
||||||
for (var i = 0; i < userCSSList.length; ++i) {
|
for (var i = 0; i < userCSSList.length; ++i) {
|
||||||
userCSSList[i][2] = settings.charAt(i + 5) != '0';
|
userCSSList[i][2] = settings.charAt(i + 6) != '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,18 +370,10 @@ VT100.prototype.initializeUserCSSStyles = function() {
|
||||||
|
|
||||||
// Add user style sheet to document
|
// Add user style sheet to document
|
||||||
var style = document.createElement('link');
|
var style = document.createElement('link');
|
||||||
var id = document.createAttribute('id');
|
style.setAttribute('id', 'usercss-' + i);
|
||||||
id.nodeValue = 'usercss-' + i;
|
style.setAttribute('href', 'usercss-' + i + '.css');
|
||||||
style.setAttributeNode(id);
|
style.setAttribute('rel', 'stylesheet');
|
||||||
var rel = document.createAttribute('rel');
|
style.setAttribute('type', 'text/css');
|
||||||
rel.nodeValue = 'stylesheet';
|
|
||||||
style.setAttributeNode(rel);
|
|
||||||
var href = document.createAttribute('href');
|
|
||||||
href.nodeValue = 'usercss-' + i + '.css';
|
|
||||||
style.setAttributeNode(href);
|
|
||||||
var type = document.createAttribute('type');
|
|
||||||
type.nodeValue = 'text/css';
|
|
||||||
style.setAttributeNode(type);
|
|
||||||
document.getElementsByTagName('head')[0].appendChild(style);
|
document.getElementsByTagName('head')[0].appendChild(style);
|
||||||
style.disabled = !enabled;
|
style.disabled = !enabled;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue