Commit c021d53d authored by PkSM3's avatar PkSM3

[UPDATE] asterisk when you do new groups

parent 19046a07
...@@ -211,6 +211,9 @@ function save_groups() { ...@@ -211,6 +211,9 @@ function save_groups() {
FlagsBuffer["group"][ nid ] = [] FlagsBuffer["group"][ nid ] = []
mainform = nid mainform = nid
AjaxRecords[RecDict[nid]].state = 1 AjaxRecords[RecDict[nid]].state = 1
var asterisk = (AjaxRecords[RecDict[nid]].name[0]=="*")?"":"*"
AjaxRecords[RecDict[nid]].name = asterisk+AjaxRecords[RecDict[nid]].name
} else { } else {
AjaxRecords[RecDict[nid]].state = 0; AjaxRecords[RecDict[nid]].state = 0;
} }
...@@ -223,6 +226,7 @@ function save_groups() { ...@@ -223,6 +226,7 @@ function save_groups() {
count++ count++
}); });
$("#group_box").remove() $("#group_box").remove()
$("#group_flag").remove()
GState=0 GState=0
MyTable.data('dynatable').dom.update(); MyTable.data('dynatable').dom.update();
} }
...@@ -235,6 +239,7 @@ function cancel_groups() { ...@@ -235,6 +239,7 @@ function cancel_groups() {
AjaxRecords[RecDict[nid]].state = 0 AjaxRecords[RecDict[nid]].state = 0
}); });
$("#group_box").remove() $("#group_box").remove()
$("#group_flag").remove()
GState=0 GState=0
MyTable.data('dynatable').dom.update(); MyTable.data('dynatable').dom.update();
} }
...@@ -272,11 +277,11 @@ function add2group ( elem ) { ...@@ -272,11 +277,11 @@ function add2group ( elem ) {
var div_name = "#my-ajax-table > thead > tr > th:nth-child(1)" var div_name = "#my-ajax-table > thead > tr > th:nth-child(1)"
var prctg = $(div_name).width()// / $(div_name).parent().width() * 100; var prctg = $(div_name).width()// / $(div_name).parent().width() * 100;
var group_html = ' <span class="group_box" style="max-width:'+prctg+'px;" id="group_box">'+'\n'; var group_html = ' <span class="group_box" style="max-width:'+prctg+'px;" id="group_box">'+'\n';
group_html += ' <span class="group_box header" id="group_box_header"></span>'+'\n';
group_html += ' <span class="group_box content" id="group_box_content"></span>'+'\n'; group_html += ' <span class="group_box content" id="group_box_content"></span>'+'\n';
group_html += ' </span>'+'\n'; group_html += ' </span>'+'\n';
group_html += ' <span id="group_flag"></span>'+'\n';
$(group_html).insertAfter( "#my-ajax-table > thead" ) $(group_html).insertAfter( "#my-ajax-table > thead" )
$("#group_box").append ('<span onclick="save_groups()"> [ Ok</span> - <span onclick="cancel_groups()">No ] </span>') $("#group_flag").append ('<span onclick="save_groups()"> [ Ok</span> - <span onclick="cancel_groups()">No ] </span>')
} }
GState=1 GState=1
...@@ -357,7 +362,6 @@ function overRide(elem) { ...@@ -357,7 +362,6 @@ function overRide(elem) {
// FlagsBuffer[this_newflag][id] = true; // FlagsBuffer[this_newflag][id] = true;
// else // else
// delete FlagsBuffer[ AjaxRecords[id]["flag"] ][id]; // delete FlagsBuffer[ AjaxRecords[id]["flag"] ][id];
AjaxRecords[id]["flag"] = Mark_NGram ( id , AjaxRecords[id]["flag"] , this_newflag );
var sum__selected_elems = 0; var sum__selected_elems = 0;
for(var i in FlagsBuffer) for(var i in FlagsBuffer)
...@@ -376,52 +380,6 @@ function overRide(elem) { ...@@ -376,52 +380,6 @@ function overRide(elem) {
} }
// Here you have to put the weird case of Change from Group-Mode
function DeactivateSelectAll() {
if( $("#multiple_selection").length>0 )
$("#multiple_selection")[0].checked = false;
if( Object.keys(FlagsBuffer["to_group"]).length ){
$("#savemodal").modal("show").css({
'margin-top': function () { //vertical centering
console.log($(".modal-content").height())
return ($(this).height() / 2);
}
});
console.log("OH OH")
console.log("There are some nodes in group array!:")
// $("#to_group").html( Object.keys(FlagsBuffer["to_group"]).join(" , ") );
var labels = []
for (var i in FlagsBuffer["to_group"]){
var fake_id = i
console.log( AjaxRecords[fake_id] )
labels.push(AjaxRecords[fake_id].name)
// $("#to_group").htm
}
$("#to_group").html( '<font color="blue">' + labels.join(" , ") + '</div>' );
}
}
function Mark_NGram( ngram_id , old_flag , new_flag ) {
if(new_flag){
for(var f in FlagsBuffer) {
if( new_flag==f )
FlagsBuffer[f][ngram_id] = true;
else
delete FlagsBuffer[f][ngram_id];
}
} else {
delete FlagsBuffer[ old_flag ][ngram_id];
}
return new_flag;
}
//generic enough //generic enough
function ulWriter(rowIndex, record, columns, cellWriter) { function ulWriter(rowIndex, record, columns, cellWriter) {
var tr = ''; var tr = '';
......
...@@ -72,6 +72,9 @@ tr:hover { ...@@ -72,6 +72,9 @@ tr:hover {
border: 1px solid yellow; border: 1px solid yellow;
} }
#group_flag {
}
.dynatable-record-count { .dynatable-record-count {
font-size: 0.7em; font-size: 0.7em;
} }
......
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