diff options
Diffstat (limited to 'apps/plugins/puzzles/src/emcclib.js')
-rw-r--r-- | apps/plugins/puzzles/src/emcclib.js | 65 |
1 files changed, 7 insertions, 58 deletions
diff --git a/apps/plugins/puzzles/src/emcclib.js b/apps/plugins/puzzles/src/emcclib.js index cd8876e76d..907dc19995 100644 --- a/apps/plugins/puzzles/src/emcclib.js +++ b/apps/plugins/puzzles/src/emcclib.js | |||
@@ -108,7 +108,6 @@ mergeInto(LibraryManager.library, { | |||
108 | item.appendChild(tick); | 108 | item.appendChild(tick); |
109 | item.appendChild(document.createTextNode(name)); | 109 | item.appendChild(document.createTextNode(name)); |
110 | var submenu = document.createElement("ul"); | 110 | var submenu = document.createElement("ul"); |
111 | submenu.className = "left"; | ||
112 | item.appendChild(submenu); | 111 | item.appendChild(submenu); |
113 | gametypesubmenus[menuid].appendChild(item); | 112 | gametypesubmenus[menuid].appendChild(item); |
114 | var toret = gametypesubmenus.length; | 113 | var toret = gametypesubmenus.length; |
@@ -575,38 +574,7 @@ mergeInto(LibraryManager.library, { | |||
575 | * overlay on top of the rest of the puzzle web page. | 574 | * overlay on top of the rest of the puzzle web page. |
576 | */ | 575 | */ |
577 | js_dialog_init: function(titletext) { | 576 | js_dialog_init: function(titletext) { |
578 | // Create an overlay on the page which darkens everything | 577 | dialog_init(Pointer_stringify(titletext)); |
579 | // beneath it. | ||
580 | dlg_dimmer = document.createElement("div"); | ||
581 | dlg_dimmer.style.width = "100%"; | ||
582 | dlg_dimmer.style.height = "100%"; | ||
583 | dlg_dimmer.style.background = '#000000'; | ||
584 | dlg_dimmer.style.position = 'fixed'; | ||
585 | dlg_dimmer.style.opacity = 0.3; | ||
586 | dlg_dimmer.style.top = dlg_dimmer.style.left = 0; | ||
587 | dlg_dimmer.style["z-index"] = 99; | ||
588 | |||
589 | // Now create a form which sits on top of that in turn. | ||
590 | dlg_form = document.createElement("form"); | ||
591 | dlg_form.style.width = (window.innerWidth * 2 / 3) + "px"; | ||
592 | dlg_form.style.opacity = 1; | ||
593 | dlg_form.style.background = '#ffffff'; | ||
594 | dlg_form.style.color = '#000000'; | ||
595 | dlg_form.style.position = 'absolute'; | ||
596 | dlg_form.style.border = "2px solid black"; | ||
597 | dlg_form.style.padding = "20px"; | ||
598 | dlg_form.style.top = (window.innerHeight / 10) + "px"; | ||
599 | dlg_form.style.left = (window.innerWidth / 6) + "px"; | ||
600 | dlg_form.style["z-index"] = 100; | ||
601 | |||
602 | var title = document.createElement("p"); | ||
603 | title.style.marginTop = "0px"; | ||
604 | title.appendChild(document.createTextNode | ||
605 | (Pointer_stringify(titletext))); | ||
606 | dlg_form.appendChild(title); | ||
607 | |||
608 | dlg_return_funcs = []; | ||
609 | dlg_next_id = 0; | ||
610 | }, | 578 | }, |
611 | 579 | ||
612 | /* | 580 | /* |
@@ -701,29 +669,13 @@ mergeInto(LibraryManager.library, { | |||
701 | * everything else on the page. | 669 | * everything else on the page. |
702 | */ | 670 | */ |
703 | js_dialog_launch: function() { | 671 | js_dialog_launch: function() { |
704 | // Put in the OK and Cancel buttons at the bottom. | 672 | dialog_launch(function(event) { |
705 | var button; | ||
706 | |||
707 | button = document.createElement("input"); | ||
708 | button.type = "button"; | ||
709 | button.value = "OK"; | ||
710 | button.onclick = function(event) { | ||
711 | for (var i in dlg_return_funcs) | 673 | for (var i in dlg_return_funcs) |
712 | dlg_return_funcs[i](); | 674 | dlg_return_funcs[i](); |
713 | command(3); | 675 | command(3); // OK |
714 | } | 676 | }, function(event) { |
715 | dlg_form.appendChild(button); | 677 | command(4); // Cancel |
716 | 678 | }); | |
717 | button = document.createElement("input"); | ||
718 | button.type = "button"; | ||
719 | button.value = "Cancel"; | ||
720 | button.onclick = function(event) { | ||
721 | command(4); | ||
722 | } | ||
723 | dlg_form.appendChild(button); | ||
724 | |||
725 | document.body.appendChild(dlg_dimmer); | ||
726 | document.body.appendChild(dlg_form); | ||
727 | }, | 679 | }, |
728 | 680 | ||
729 | /* | 681 | /* |
@@ -733,10 +685,7 @@ mergeInto(LibraryManager.library, { | |||
733 | * associated with it. | 685 | * associated with it. |
734 | */ | 686 | */ |
735 | js_dialog_cleanup: function() { | 687 | js_dialog_cleanup: function() { |
736 | document.body.removeChild(dlg_dimmer); | 688 | dialog_cleanup(); |
737 | document.body.removeChild(dlg_form); | ||
738 | dlg_dimmer = dlg_form = null; | ||
739 | onscreen_canvas.focus(); | ||
740 | }, | 689 | }, |
741 | 690 | ||
742 | /* | 691 | /* |