From 4dbcdd652b3e414042b344f3e65de73bbd8d4294 Mon Sep 17 00:00:00 2001 From: Kevin Nadro Date: Mon, 4 Jul 2016 12:38:56 -0700 Subject: [PATCH] new window overlay for generating MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - removed the sandbox tab its not an algorithm now - the overlay can be opened by pressing “generate” button at the top menu bar - creates overlayed divs that have the functionality to generate a tracer and the code - (x) button to close and return to the algorithm --- css/stylesheet.css | 12 ++++++-- index.html | 33 +++++----------------- js/create/index.js | 51 ++++++++++++++++++++++++++++++++++ js/dom/setup/setup_top_menu.js | 6 ++++ js/dom/show_algorithm.js | 8 ------ js/index.js | 3 -- 6 files changed, 74 insertions(+), 39 deletions(-) diff --git a/css/stylesheet.css b/css/stylesheet.css index 6a4c34f..9cafd47 100644 --- a/css/stylesheet.css +++ b/css/stylesheet.css @@ -252,6 +252,7 @@ section { .sandbox_container{ left: 50%; + z-index: 100; } .editor_container { @@ -341,6 +342,7 @@ section { border-bottom: none; } +.close_bar, .files_bar { height: 30px; border-bottom: 1px solid #505050; @@ -385,6 +387,11 @@ section { box-shadow: inset 16px 0 16px -16px rgba(0, 0, 0, .6), inset -16px 0 16px -16px rgba(0, 0, 0, .6); } +.close_bar { + width: 100%; + background-color: #3f3f3f; +} + .explanation_container { border: none; top: 30px; @@ -689,8 +696,8 @@ input[type=number]::-webkit-outer-spin-button { } .auto-gen{ - height: 33%; - border: 1px solid #515151; + height: 34%; + /*border: 1px solid #515151;*/ text-align: center; background-color: #262626; display: flex; @@ -698,6 +705,7 @@ input[type=number]::-webkit-outer-spin-button { } .auto-gen-tracers{ + top: 30px; bottom: 66%; } diff --git a/index.html b/index.html index eacfae5..e9e1387 100644 --- a/index.html +++ b/index.html @@ -30,6 +30,13 @@
+
+
+ + Generate +
+
+
Share @@ -127,32 +134,6 @@
-
- -
- - -
- -
-
- # of Rows: -
- -
- # of Columns: -
- -
- Tracer Name: -
-
- -
- -
- -
diff --git a/js/create/index.js b/js/create/index.js index 100d160..3240f69 100644 --- a/js/create/index.js +++ b/js/create/index.js @@ -2,10 +2,61 @@ const modules = require('../module'); const array2d = require('./array2d'); +const util = require('./util'); +const closeCreate = (modules) => { + const $btnClose = $('#btn_close'); + + $btnClose.click(() => { + $('.sandbox_container').remove(); + util.clearModules(); + restoreModules(modules); + }); +}; + +const restoreModules = (modules) => { + for (var i = 0; i < modules.length; i++) { + $('.module_container').append(modules[i]); + } +}; + +const saveModules = () => { + return $('.module_wrapper') +}; const init = () => { + var moduleWrappers = saveModules(); + + util.clearModules(); + $('.workspace').append("
\ +
\ +
\ +
\ + \ +
\ +
\ +
\ +
\ + \ +
\ +
\ +
\ + # of Rows: \ +
\ +
\ + # of Columns: \ +
\ +
\ + Tracer Name: \ +
\ +
\ +
\ + \ +
\ +
"); array2d.setup(); + + closeCreate(moduleWrappers); }; module.exports = { diff --git a/js/dom/setup/setup_top_menu.js b/js/dom/setup/setup_top_menu.js index d0ee6f4..e6888a8 100644 --- a/js/dom/setup/setup_top_menu.js +++ b/js/dom/setup/setup_top_menu.js @@ -4,6 +4,7 @@ const app = require('../../app'); const Server = require('../../server'); const Toast = require('../toast'); const TopMenu = require('../top_menu'); +const create = require('../../create'); module.exports = () => { @@ -32,6 +33,7 @@ module.exports = () => { const $btnPause = $('#btn_pause'); const $btnPrev = $('#btn_prev'); const $btnNext = $('#btn_next'); + const $btnGenerate = $('#btn_generate'); // initially, control buttons are disabled TopMenu.disableFlowControl(); @@ -73,4 +75,8 @@ module.exports = () => { app.getTracerManager().nextStep(); }); + $btnGenerate.click(() => { + create.init(); + }); + }; diff --git a/js/dom/show_algorithm.js b/js/dom/show_algorithm.js index 9272e65..61783e1 100644 --- a/js/dom/show_algorithm.js +++ b/js/dom/show_algorithm.js @@ -25,14 +25,6 @@ module.exports = (category, algorithm, data, requestedFile) => { algorithm_name = categoryObj.list[algorithm]; } - if(category_name === 'Sandbox'){ - $('.editor_container').addClass('hide'); - $('.sandbox_container').removeClass('hide'); - }else{ - $('.editor_container').removeClass('hide'); - $('.sandbox_container').addClass('hide'); - } - $('.sidemenu button').removeClass('active'); $menu.addClass('active'); diff --git a/js/index.js b/js/index.js index 390b1e4..746302c 100644 --- a/js/index.js +++ b/js/index.js @@ -5,7 +5,6 @@ const app = require('./app'); const AppConstructor = require('./app/constructor'); const DOM = require('./dom'); const Server = require('./server'); -const Sandbox= require('./create'); const modules = require('./module'); const { @@ -73,8 +72,6 @@ $(() => { DOM.showFirstAlgorithm(); } - Sandbox.init(); - }); Server.loadWikiList().then((data) => { -- GitLab