Commit f60a943e authored by HERBERT Ryan's avatar HERBERT Ryan Committed by Vidjil Team

database.js builder.js Added an info save button

  In order to achieve a functionnal save_info button, it was necessary
  to add a reference to the Database object
parent 2259ef88
function Builder(model) {
function Builder(model, database) {
if (typeof model != "undefined"){
this.m = model; //Model utilisé
this.m.view.push(this); //synchronisation au Model
}
this.db = database;
this.colorMethod = "";
this.width_left_container = $("#left-container")
.css("width")
......@@ -555,6 +556,16 @@ Builder.prototype = {
text_area.innerHTML = this.m.getInfoTime(this.m.t)
div_sequence_info.appendChild(text_area)
var save_info = document.createElement("span")
save_info.onclick = function() {
self.db.save_sample_info(self.m.t, "foobar");
}
save_info.innerHTML = "save"
save_info.className = "save_info button_right"
div_sequence_info.appendChild(save_info)
parent.appendChild(div_sequence_info)
this.initTag();
},
......
......@@ -53,13 +53,6 @@ var sp = new ScatterPlot("visu", m); // Scatterplot (both grid and b
var segment = new Segment("bot-container", m); // Segmenter
/* [WIP] Builder
* The builder completes some informations in the menu and provide some tools
* TODO replace with a menu and info view
*/
var builder = new Builder(m);
/* Similarity
* retrieve and compute everything related to the similarity matrix
*/
......@@ -84,6 +77,13 @@ var report = new Report(m)
var db = new Database(m);
/* [WIP] Builder
* The builder completes some informations in the menu and provide some tools
* TODO replace with a menu and info view
*/
var builder = new Builder(m, db);
/* [WIP] Shortcut (optional)
* This provides keyboard shortcuts to interact with the browser.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment