summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-06-13 18:41:25 +0530
committerGitHub2016-06-13 18:41:25 +0530
commit9f1eaed0028ff4c7efe51c38dab194bc9360b6df (patch)
tree1b3837174d83f5211b3a71f264ac3dff66e6dacb /index.html
parent107bdfc62b534132117e28d4d5af2a81951f5dc0 (diff)
parent6236dbd8f106b2da57dd219bcaa0aedf577da49d (diff)
downloadxcos-on-web-9f1eaed0028ff4c7efe51c38dab194bc9360b6df.tar.gz
xcos-on-web-9f1eaed0028ff4c7efe51c38dab194bc9360b6df.tar.bz2
xcos-on-web-9f1eaed0028ff4c7efe51c38dab194bc9360b6df.zip
Merge pull request #29 from jiteshjha/set-context-dialog
Added set context dialog box with on-click button function
Diffstat (limited to 'index.html')
-rw-r--r--index.html58
1 files changed, 57 insertions, 1 deletions
diff --git a/index.html b/index.html
index 1d8353f..0ae6031 100644
--- a/index.html
+++ b/index.html
@@ -220,7 +220,7 @@
editor.execute('selectAll');
});
menu.addItem('Set Context', null, function() {
- // @ToDo: Pooja: Functionality to be put.
+ setContext(graph, cell);
});
menu.addItem('Setup', 'images/setup.png', function() {
// @ToDo: Pooja: Functionality to be put.
@@ -935,6 +935,62 @@
}
};
+ /*
+ @jiteshjha, @pooja
+ setContext dialog box
+ Includes a set context instruction text and input text area.
+ */
+ function setContext(graph, cell) {
+
+ // Create basic structure for the form
+ var content = document.createElement('div');
+ content.setAttribute("id", "setContext");
+
+ // Add Form
+ var myform = document.createElement("form");
+ myform.method = "";
+ myform.setAttribute("id", "formProperties");
+
+ // Add set context string
+ var descriptionSetContext = document.createElement("div");
+ descriptionSetContext.innerHTML = "You may enter here scilab instructions to define symbolic parameters used in block definitions using Scilab instructions. These instructions are evaluated once confirmed(i.e. you click on OK and every time the diagram is loaded)";
+ descriptionSetContext.setAttribute("id", "descriptionSetContext");
+ myform.appendChild(descriptionSetContext);
+
+ // Line break
+ var linebreak = document.createElement('br');
+ myform.appendChild(linebreak);
+
+ // input text area
+ var textareaSetContext = document.createElement("textarea");
+ textareaSetContext.setAttribute("id", "textareaSetContext");
+
+ myform.appendChild(textareaSetContext);
+
+ // Line break
+ var linebreak = document.createElement('br');
+ myform.appendChild(linebreak);
+
+ // Line break
+ var linebreak = document.createElement('br');
+ myform.appendChild(linebreak);
+
+ // Button - Submit
+ var btn = document.createElement("button");
+ btn.innerHTML = 'Ok';
+ btn.type = "button";
+ btn.name = "submit";
+ btn.setAttribute("id", "buttonSetContext");
+
+ // Executes when button 'btn' is clicked
+ btn.onclick = function() {
+ console.log('Input: '+document.getElementById('textareaSetContext').value);
+ };
+
+ myform.appendChild(btn);
+ content.appendChild(myform);
+ showModalWindow(graph, 'Set Context', content, 450, 350);
+ };
function showPropertiesWindow(graph, cell) {