aboutsummaryrefslogtreecommitdiffstats
path: root/vimiumFrontend.js
diff options
context:
space:
mode:
authorPhil Crosby2011-01-30 02:11:58 -0800
committerPhil Crosby2011-01-30 02:11:58 -0800
commitae73ad02e936f66bb894fca5da13a631bcd14d31 (patch)
treef6f629d489731661ccb1c482386089fd815486c6 /vimiumFrontend.js
parent1315254f6b75e6dfc4169b73b51537967416e580 (diff)
downloadvimium-ae73ad02e936f66bb894fca5da13a631bcd14d31.tar.bz2
Split the help dialog into common commands and advanced commands. This closes #284
Diffstat (limited to 'vimiumFrontend.js')
-rw-r--r--vimiumFrontend.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index 8c5f94db..7c90aec5 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -635,12 +635,18 @@ function showHelpDialog(html, fid) {
isShowingHelpDialog = true;
var container = document.createElement("div");
container.id = "vimiumHelpDialogContainer";
+
+ document.body.appendChild(container);
+
container.innerHTML = html;
+ // This is necessary because innerHTML does not evaluate javascript embedded in <script> tags.
+ var scripts = Array.prototype.slice.call(container.getElementsByTagName("script"));
+ scripts.forEach(function(script) { eval(script.text); });
+
container.getElementsByClassName("closeButton")[0].addEventListener("click", hideHelpDialog, false);
container.getElementsByClassName("optionsPage")[0].addEventListener("click",
function() { chrome.extension.sendRequest({ handler: "openOptionsPageInNewTab" }); }, false);
- document.body.appendChild(container);
var dialog = document.getElementById("vimiumHelpDialog");
dialog.style.zIndex = "99999998";
var zoomFactor = currentZoomLevel / 100.0;