Skip to content

Commit 7e6b6fa

Browse files
author
Gaurav SinghaRoy
committed
getting variable and value pairs for variable dictionary
1 parent b0ffd10 commit 7e6b6fa

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

app/assets/javascripts/resources/querybuilder.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,15 @@ QueryBuilder = {
629629
configured_convert.head = QueryBuilder.convert.configured.get_block_string_from_blocks(blocks,"head");
630630
configured_convert.body = QueryBuilder.convert.configured.get_block_string_from_blocks(blocks,"body");
631631
configured_convert.footer = QueryBuilder.convert.configured.get_block_string_from_blocks(blocks,"footer");
632+
str_variable_dictionary = QueryBuilder.convert.configured.get_block_string_from_blocks(blocks,"variable_dictionary");
633+
arr_variable_dictionary = str_variable_dictionary.split("\n");
634+
configured_convert.variable_dictionary = [];
635+
for(i=0;i<arr_variable_dictionary.length;i++){
636+
arr_var = arr_variable_dictionary[i].split("=");
637+
if(arr_var.length == 2){
638+
configured_convert.variable_dictionary.push({variable : arr_var[0].trim(), value: arr_var[1].trim()});
639+
}
640+
}
632641
};
633642
reader.readAsText(f);
634643
}

app/assets/javascripts/resources/variables.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This file will contain any common global variables for javascript
55
*/
66

77
var configured_convert = {
8-
variable_dictionary : "",
8+
variable_dictionary : [],
99
head : "",
1010
body : "",
1111
footer : ""

0 commit comments

Comments
 (0)