summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/emcclib.js
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-09-30 17:47:13 -0400
committerFranklin Wei <git@fwei.tk>2017-09-30 20:06:50 -0400
commitb9386109e8f0cf346037b72464577fe19bba2d43 (patch)
treef0c15f6c80043376ec94d23cb1b681324eb3df3d /apps/plugins/puzzles/src/emcclib.js
parentea679de8371e4e74fe4e78fb8df8e5df19efffdc (diff)
downloadrockbox-b9386109e8f0cf346037b72464577fe19bba2d43.zip
rockbox-b9386109e8f0cf346037b72464577fe19bba2d43.tar.gz
rockbox-b9386109e8f0cf346037b72464577fe19bba2d43.tar.bz2
rockbox-b9386109e8f0cf346037b72464577fe19bba2d43.tar.xz
puzzles: resync with upstream
This brings puzzles to upstream commit 84d3fd2. Change-Id: I808a197f868032d771fc101a15666c5ec4b9f94b
Diffstat (limited to 'apps/plugins/puzzles/src/emcclib.js')
-rw-r--r--apps/plugins/puzzles/src/emcclib.js65
1 files changed, 7 insertions, 58 deletions
diff --git a/apps/plugins/puzzles/src/emcclib.js b/apps/plugins/puzzles/src/emcclib.js
index cd8876e..907dc19 100644
--- a/apps/plugins/puzzles/src/emcclib.js
+++ b/apps/plugins/puzzles/src/emcclib.js
@@ -108,7 +108,6 @@ mergeInto(LibraryManager.library, {
item.appendChild(tick);
item.appendChild(document.createTextNode(name));
var submenu = document.createElement("ul");
- submenu.className = "left";
item.appendChild(submenu);
gametypesubmenus[menuid].appendChild(item);
var toret = gametypesubmenus.length;
@@ -575,38 +574,7 @@ mergeInto(LibraryManager.library, {
* overlay on top of the rest of the puzzle web page.
*/
js_dialog_init: function(titletext) {
- // Create an overlay on the page which darkens everything
- // beneath it.
- dlg_dimmer = document.createElement("div");
- dlg_dimmer.style.width = "100%";
- dlg_dimmer.style.height = "100%";
- dlg_dimmer.style.background = '#000000';
- dlg_dimmer.style.position = 'fixed';
- dlg_dimmer.style.opacity = 0.3;
- dlg_dimmer.style.top = dlg_dimmer.style.left = 0;
- dlg_dimmer.style["z-index"] = 99;
-
- // Now create a form which sits on top of that in turn.
- dlg_form = document.createElement("form");
- dlg_form.style.width = (window.innerWidth * 2 / 3) + "px";
- dlg_form.style.opacity = 1;
- dlg_form.style.background = '#ffffff';
- dlg_form.style.color = '#000000';
- dlg_form.style.position = 'absolute';
- dlg_form.style.border = "2px solid black";
- dlg_form.style.padding = "20px";
- dlg_form.style.top = (window.innerHeight / 10) + "px";
- dlg_form.style.left = (window.innerWidth / 6) + "px";
- dlg_form.style["z-index"] = 100;
-
- var title = document.createElement("p");
- title.style.marginTop = "0px";
- title.appendChild(document.createTextNode
- (Pointer_stringify(titletext)));
- dlg_form.appendChild(title);
-
- dlg_return_funcs = [];
- dlg_next_id = 0;
+ dialog_init(Pointer_stringify(titletext));
},
/*
@@ -701,29 +669,13 @@ mergeInto(LibraryManager.library, {
* everything else on the page.
*/
js_dialog_launch: function() {
- // Put in the OK and Cancel buttons at the bottom.
- var button;
-
- button = document.createElement("input");
- button.type = "button";
- button.value = "OK";
- button.onclick = function(event) {
+ dialog_launch(function(event) {
for (var i in dlg_return_funcs)
dlg_return_funcs[i]();
- command(3);
- }
- dlg_form.appendChild(button);
-
- button = document.createElement("input");
- button.type = "button";
- button.value = "Cancel";
- button.onclick = function(event) {
- command(4);
- }
- dlg_form.appendChild(button);
-
- document.body.appendChild(dlg_dimmer);
- document.body.appendChild(dlg_form);
+ command(3); // OK
+ }, function(event) {
+ command(4); // Cancel
+ });
},
/*
@@ -733,10 +685,7 @@ mergeInto(LibraryManager.library, {
* associated with it.
*/
js_dialog_cleanup: function() {
- document.body.removeChild(dlg_dimmer);
- document.body.removeChild(dlg_form);
- dlg_dimmer = dlg_form = null;
- onscreen_canvas.focus();
+ dialog_cleanup();
},
/*