TOC html

From Redazione
Jump to navigation Jump to search
Line 55: Line 55:
 
$ci(function() {
 
$ci(function() {
  
// https://stackoverflow.com/questions/25003217/using-encodeuri-vs-escape-for-utf-8-strings-in-javascript
 
var utf8_to_latin1 = function (s) {
 
    return unescape(encodeURIComponent(s));
 
};
 
var latin1_to_utf8 = function (s) {
 
    return decodeURIComponent(escape(s));
 
};
 
  
 
var wiki_list = []
 
var wiki_list = []
Line 101: Line 94:
 
var contents = $ci('#TOC_contents').val();
 
var contents = $ci('#TOC_contents').val();
  
contents = latin1_to_utf8(window.atob(contents));
+
contents = TOC_functions.base64_to_utf8(index_obj_saved);
  
 
if(contents) {
 
if(contents) {
contents = JSON.parse(contents)
+
contents = JSON.parse(contents);
  
Frontend_Index.translate_index_rec(contents,'from');
+
TOC_functions.translate_TOC_rec(contents,'from');
  
  
Line 117: Line 110:
 
return data.node.isFolder() ? false : true;
 
return data.node.isFolder() ? false : true;
 
},
 
},
   dnd5: Frontend_Index.fancytree_dnd5_conf
+
   dnd5: TOC_functions.fancytree_dnd5_conf
 
});
 
});
 
}
 
}
Line 130: Line 123:
 
index_obj_saved = tree.toDict(true).children;
 
index_obj_saved = tree.toDict(true).children;
  
Frontend_Index.translate_index_rec(index_obj_saved,'to');
+
TOC_functions.translate_TOC_rec(index_obj_saved,'to');
  
 
walk_through_TOC(index_obj_saved,null,0);
 
walk_through_TOC(index_obj_saved,null,0);
  
index_obj_saved = utf8_to_latin1(JSON.stringify(index_obj_saved));
+
index_obj_saved = TOC_functions.utf8_to_base64(JSON.stringify(index_obj_saved));
  
 
$ci('#TOC_contents').val(btoa(index_obj_saved))
 
$ci('#TOC_contents').val(btoa(index_obj_saved))
  
  
$ci('#pf_free_text').val(`
+
$ci('#pf_free_text').val(`<!--  
<!--  
 
 
The content of this page is created automatically.
 
The content of this page is created automatically.
 
Don't edit it without the form, since any additional content  
 
Don't edit it without the form, since any additional content  

Revision as of 16:37, 17 July 2020

tree placeholder