diff --git a/lib/ace/lib/dom.js b/lib/ace/lib/dom.js index 19e88899..22c5bf18 100644 --- a/lib/ace/lib/dom.js +++ b/lib/ace/lib/dom.js @@ -177,7 +177,7 @@ exports.importCssString = function importCssString(cssText, id, doc) { exports.importCssStylsheet = function(uri, doc) { if (doc.createStyleSheet) { - var sheet = doc.createStyleSheet(uri); + doc.createStyleSheet(uri); } else { var link = exports.createElement('link'); link.rel = 'stylesheet'; @@ -189,13 +189,19 @@ exports.importCssStylsheet = function(uri, doc) { }; exports.getInnerWidth = function(element) { - return (parseInt(exports.computedStyle(element, "paddingLeft")) - + parseInt(exports.computedStyle(element, "paddingRight")) + element.clientWidth); + return ( + parseInt(exports.computedStyle(element, "paddingLeft"), 10) + + parseInt(exports.computedStyle(element, "paddingRight"), 10) + + element.clientWidth + ); }; exports.getInnerHeight = function(element) { - return (parseInt(exports.computedStyle(element, "paddingTop")) - + parseInt(exports.computedStyle(element, "paddingBottom")) + element.clientHeight); + return ( + parseInt(exports.computedStyle(element, "paddingTop"), 10) + + parseInt(exports.computedStyle(element, "paddingBottom"), 10) + + element.clientHeight + ); }; if (window.pageYOffset !== undefined) { @@ -221,13 +227,13 @@ if (window.getComputedStyle) exports.computedStyle = function(element, style) { if (style) return (window.getComputedStyle(element, "") || {})[style] || ""; - return window.getComputedStyle(element, "") || {} + return window.getComputedStyle(element, "") || {}; }; else exports.computedStyle = function(element, style) { if (style) return element.currentStyle[style]; - return element.currentStyle + return element.currentStyle; }; exports.scrollbarWidth = function(document) { @@ -300,36 +306,4 @@ exports.getParentWindow = function(document) { return document.defaultView || document.parentWindow; }; -exports.getSelectionStart = function(textarea) { - // TODO IE - var start; - try { - start = textarea.selectionStart || 0; - } catch (e) { - start = 0; - } - return start; -}; - -exports.setSelectionStart = function(textarea, start) { - // TODO IE - return textarea.selectionStart = start; -}; - -exports.getSelectionEnd = function(textarea) { - // TODO IE - var end; - try { - end = textarea.selectionEnd || 0; - } catch (e) { - end = 0; - } - return end; -}; - -exports.setSelectionEnd = function(textarea, end) { - // TODO IE - return textarea.selectionEnd = end; -}; - }); diff --git a/lib/ace/lib/lang.js b/lib/ace/lib/lang.js index fb8d8802..d023df8a 100644 --- a/lib/ace/lib/lang.js +++ b/lib/ace/lib/lang.js @@ -49,7 +49,7 @@ var trimBeginRegexp = /^\s\s*/; var trimEndRegexp = /\s\s*$/; exports.stringTrimLeft = function (string) { - return string.replace(trimBeginRegexp, '') + return string.replace(trimBeginRegexp, ''); }; exports.stringTrimRight = function (string) { @@ -66,11 +66,11 @@ exports.copyObject = function(obj) { exports.copyArray = function(array){ var copy = []; - for (i=0, l=array.length; i