From 38e2cea77f0cd3e99baa2bfb7105b70efd3a09e0 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Wed, 18 Jun 2014 19:02:37 -0700 Subject: [PATCH] fix shell incompatibility with datatables; add dotted border around input box --- planetstack/core/static/shell/opencloud_shell.css | 3 ++- planetstack/core/static/shell/opencloud_shell.js | 2 +- planetstack/core/static/shell/utils.js | 13 ++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/planetstack/core/static/shell/opencloud_shell.css b/planetstack/core/static/shell/opencloud_shell.css index 108004b..f535cd0 100644 --- a/planetstack/core/static/shell/opencloud_shell.css +++ b/planetstack/core/static/shell/opencloud_shell.css @@ -15,7 +15,8 @@ #terminal input { width: 875px; margin: 1px 0 1px 10px; - border: none; + border: 1px dotted; + border-color:#808080; display: inline; padding: 2px; background: black; diff --git a/planetstack/core/static/shell/opencloud_shell.js b/planetstack/core/static/shell/opencloud_shell.js index 8d850be..1715fdd 100644 --- a/planetstack/core/static/shell/opencloud_shell.js +++ b/planetstack/core/static/shell/opencloud_shell.js @@ -303,7 +303,7 @@ MongoHandler.prototype = { }, _getCommand: function(tokens) { - if(tokens[0] && MongoKeywords.include((tokens[0].value + '').toLowerCase())) { + if(tokens[0] && ArrayInclude(MongoKeywords,(tokens[0].value + '').toLowerCase())) { switch(tokens[0].value.toLowerCase()) { case 'help': return this._help; diff --git a/planetstack/core/static/shell/utils.js b/planetstack/core/static/shell/utils.js index 93aff08..1ded27e 100644 --- a/planetstack/core/static/shell/utils.js +++ b/planetstack/core/static/shell/utils.js @@ -4,7 +4,9 @@ // Licensed under the MIT licence. // http://www.opensource.org/licenses/mit-license.php -Array.prototype.include = function(value) { +// extending array like this is breaking datatables + +/*Array.prototype.include = function(value) { for(var i=0; i < this.length; i++) { if(this[i] == value) { return this[i]; @@ -15,6 +17,15 @@ Array.prototype.include = function(value) { Array.prototype.empty = function() { return (this.length == 0); +};*/ + +function ArrayInclude(arr,value) { + for(var i=0; i < arr.length; i++) { + if(arr[i] == value) { + return arr[i]; + } + } + return false; }; Function.prototype.bind = function() { -- 2.43.0