aboutsummaryrefslogtreecommitdiffstats
path: root/completionDialog.js
diff options
context:
space:
mode:
authorPeter Parks2012-01-14 22:17:56 -0800
committerPeter Parks2012-01-15 12:08:06 -0800
commitd2118277a39ddb89e95dbcc2c339b15923caea74 (patch)
treedfd7e6330be8185637ae3aa8fb4e6bc2eb2dc10b /completionDialog.js
parent44c36c6ab1c6111f25e535fabfd3b5c75fb4120e (diff)
downloadvimium-d2118277a39ddb89e95dbcc2c339b15923caea74.tar.bz2
Harden and move CSS declarations out of the code.
Remove CSS from background_page.html and change getLinkHintCss to only return the user's overrides. Add vimiumReset class to html generated by completionDialog, helpDialog, linkHints and vimiumFrontEnd Add vimium.css to the manifest and link to it in the tests_harnesses/automated.html and options.html. Add an id, vimiumLinkHintsContainer, to linkhints div to allow user overrides to have a higher specificity. Change the default for the user CSS override.
Diffstat (limited to 'completionDialog.js')
-rw-r--r--completionDialog.js57
1 files changed, 8 insertions, 49 deletions
diff --git a/completionDialog.js b/completionDialog.js
index 7a01a10d..eec089a0 100644
--- a/completionDialog.js
+++ b/completionDialog.js
@@ -14,6 +14,7 @@
handlerStack.push({ keydown: this.onKeydown });
render.call(this);
clearInterval(this._tweenId);
+ this.container.style.display = "block";
this._tweenId = Tween.fade(this.container, 1.0, 150);
}
},
@@ -41,7 +42,6 @@
var initialize = function() {
var self = this;
- addCssToPage(completionCSS);
self.currentSelection = 0;
@@ -94,27 +94,27 @@
container.style.display = "";
if (searchString === undefined) {
- this.container.className = "vimium-dialog";
+ this.container.className = "vimiumReset vimium-dialog";
createDivInside(container).innerHTML = this.options.initialSearchText || "Begin typing";
}
else {
- this.container.className = "vimium-dialog vimium-completions";
+ this.container.className = "vimiumReset vimium-dialog vimium-completions";
var searchBar = createDivInside(container);
searchBar.innerHTML=searchString;
- searchBar.className="vimium-searchBar";
+ searchBar.className="vimiumReset vimium-searchBar";
searchResults = createDivInside(container);
- searchResults.className="vimium-searchResults";
+ searchResults.className="vimiumReset vimium-searchResults";
if (completions.length<=0) {
var resultDiv = createDivInside(searchResults);
- resultDiv.className="vimium-noResults";
+ resultDiv.className="vimiumReset vimium-noResults";
resultDiv.innerHTML="No results found";
}
else {
for (var i = 0; i < completions.length; i++) {
var resultDiv = createDivInside(searchResults);
if (i === this.currentSelection) {
- resultDiv.className="vimium-selected";
+ resultDiv.className="vimiumReset vimium-selected";
}
resultDiv.innerHTML=this.options.renderOption(searchString, completions[i]);
}
@@ -127,6 +127,7 @@
};
var createDivInside = function(parent) {
var element = document.createElement("div");
+ element.className = "vimiumReset";
parent.appendChild(element);
return element;
}
@@ -139,48 +140,6 @@
}
}
- var completionCSS = ".vimium-dialog {"+
- "position:fixed;"+
- "background-color: #ebebeb;" +
- "z-index: 99999998;" +
- "border: 1px solid #b3b3b3;" +
- "font-size: 12px;" +
- "text-align:left;"+
- "color: black;" +
- "padding:10px;"+
- "border-radius: 4px;" +
- "}"+
-
- ".vimium-completions {"+
- "width:400px;"+
- "}"+
-
- ".vimium-completions .vimium-searchBar {"+
- "height: 15px;"+
- "border-bottom: 1px solid #b3b3b3;"+
- "}"+
-
- ".vimium-completions .vimium-searchResults {"+
- "}"+
-
- ".vimium-completions .vimium-searchResults .vimium-selected{"+
- "background-color:#aaa;"+
- "border-radius: 4px;" +
- "}"+
-
- ".vimium-completions div{"+
- "padding:4px;"+
- "}"+
-
- ".vimium-completions div strong{"+
- "color: black;" +
- "font-weight:bold;"+
- "}"+
-
- ".vimium-completions .vimium-noResults{"+
- "color:#555;"+
- "}";
-
window.CompletionDialog = CompletionDialog;
}(window, document))