Index: branches/testa/js/menux.js
===================================================================
--- branches/testa/js/menux.js	(revision 29)
+++ 	(revision )
@@ -1,198 +1,0 @@
-function make_ul_for_menu( part, sel ) {
-    let content = `<ul id="${Globalx[part].menu_id}"></ul>`
-    let v = $(sel).append( content )
-}
-
-function set_globalx_item_name( part, item_name ) {
-    Globalx[part].item_name = item_name
-    let dl = $( '#download' )
-    dl.attr('download' , Globalx[part].item_name)
-    dl.removeAttr('href')
-}
-
-function menu_action( part, item_name , up_flag = false ) {
-    if( Globalx[part].key != '/' ){
-	
-    }
-
-    let realData = get_filelist( Globalx.num )
-    Globalx[part].key_indicate_file = false;
-    if( up_flag ){
-	set_globalx_item_name(part, "")
-	Globalx[part].editor.getSession().setValue( "" );
-	$( Globalx[part].textarea_sel ).val( "" );
-	if( Globalx[part].key != '/' ){
-	    let array = Globalx[part].key.split("/")
-	    array.pop()
-	    if( array.length > 1 ){
-		Globalx[part].key_type = false;
-		set_globalx_item_name( part, array[array.length - 1] )
-
-		Globalx[part].key = array.join('/')
-		$( Globalx[part].menu_sel ).empty()
-	    }
-	    else {
-		Globalx[part].key = '/'
-		set_globalx_item_name( part, "" )
-	    }
-	}
-    }
-    else{
-	if( Globalx[part].key == '/' ){
-	    Globalx[part].key = Globalx[part].key + item_name
-	}
-	else{
-	    Globalx[part].key = Globalx[part].key + '/' + item_name
-	}
-    }
-    set_globalx_item_name(part, item_name)
-
-    const bookmark_cb = $( Globalx[part].bookmark_op_sel )
-    if( Globalx[part].bookmarks.indexOf( Globalx[part].key ) >= 0 ){
-	bookmark_cb.prop('checked', true)
-    }
-    else{
-	bookmark_cb.prop('checked', false)
-    }
-
-    $( Globalx[part].key_sel ).val( Globalx[part].key )
-    $( Globalx[part].menu_sel ).empty()
-
-    make_menu_item_list(part, realData)
-
-    if( realData[Globalx[part].key].length == 0 ){
-	Globalx[part].key_indicate_file = true;
-	get_content( Globalx[part].key , function(content) {
-	    Globalx[part].editor.getSession().setValue( content );
-	    $( Globalx[part].textarea_sel ).val( content );
-	});
-    }
-} 
-
-function make_menu_item_list( part, realData ) {
-    let content = null
-    let ary = realData[ Globalx[part].key ]
-
-    let name = '..(Up)'
-    content = `<li class="ui-menu-item"><div class="ui-menu-item-wrapper hasmenu" onclick="menu_action( '${part}', '${name}', true)">${name}</div></li>`;
-    $( Globalx[part].menu_sel ).append(content);
-
-    ary.map( function( item_name ){
-	content = `<li class="ui-menu-item"><div class="ui-menu-item-wrapper hasmenu" onclick="menu_action( '${part}', '${item_name}' , false)">${item_name}</div></li>`;
-	$( Globalx[part].menu_sel ).append(content);
-    })
-}
-
-async function get_filelist_async( num )
-{
-     let realData = get_filelist( Globalx.num )
-     if( realData === undefined ){
-	await get_filelist_from_remote()
-	realData = get_filelist( Globalx.num )
-    }
-
-    return realData
-}
-
-function menux( part ) {
-    get_filelist_async( Globalx.num ).then( (data) => {
-	make_menu_item_list( part, data )
-	$( Globalx[part].menu_sel ).menu({
-	    classes: {
-		"ui-menu": "highlight"
-	    }
-	})
-    })
-}
-
-function contextmenux0( menu_sel ) {
-    $( menu_sel ).contextmenu({
-	delegate: ".hasmenu",
-	menu: [
-	    {title: "Copy", cmd: "copy", uiIcon: "ui-icon-copy"},
-	    {title: "----"},
-	    {title: "More", childern: [
-		{title: "Sub 1", cmd: "sub1"},
-		{title: "Sub 2", cmd: "sub1"}
-	    ]}
-	],
-	select: function(event, ui) {
-	    alert("select " + ui.cmd + " on " + ui.target.text());
-	}
-    });
-}
-
-function bookmark_op(part) {
-    if( $( Globalx[part].bookmark_op_sel ).is(':checked') == true ){
-	add_bookmark(part)
-    }
-    else{
-	remove_bookmark(part)
-    }
-}
-
-function add_bookmark( part ) {
-    $( '#bookmark_displayname' ).val( Globalx[part].bookmark_mgr.get_restricted_display_name( Globalx[part].key ) )
-    $( '#bookmark_path' ).val( Globalx[part].key )
-    $('#bookmarkDlg').dialog("open")
-}
-
-function register_bookmark_( part , path, displayname ) {
-    Globalx[part].bookmark_mgr.add( path , displayname )
-    rebuild_bookmark_menu( part )
-}
-
-function remove_bookmark(part) {
-    Globalx[part].bookmark_mgr.remove( Globalx[part].key )
-    rebuild_bookmark_menu(part)
-}
-
-function rebuild_bookmark_menu(part) {
-    $( Globalx[part].bookmark_sel ).empty()
-
-    const mgr = Globalx[part].bookmark_mgr
-    const array = mgr.get_paths()
-
-    array.map( function( path ){
-	const display_name = mgr.display_name( path )
-	content = `<li><a href="#" onclick="bookmark_action( '${part}' , '${path}' )">${display_name}</a></li>`;
-	$( Globalx[part].bookmark_sel ).append(content);
-    })
-}
-
-function bookmark_action( part, key ) {
-    if( key === null || key === "" ){
-	alert("illeagal key=" + key )
-	return
-    }
-    if(key === Globalx[part].key){
-	return
-    }
-
-    let realData = get_filelist( Globalx.num )
-    Globalx[part].key = key
-    Globalx[part].key_indicate_file = false;
-
-    set_globalx_item_name( part, key )
-    $( Globalx[part].key_sel ).val( key )
-
-    if( realData[Globalx[part].key].length == 0 ){
-	Globalx[part].key_indicate_file = true;
-	get_content( Globalx[part].key , function(content) {
-	    Globalx[part].editor.getSession().setValue( content );
-	    $( Globalx[part].textarea_sel ).val( content );
-	});
-    }
-    else{
-	Globalx[part].key_indicate_file = false
-	Globalx[part].editor.getSession().setValue( "" );
-	$( Globalx[part].textarea_sel ).val( "" );
-    }
-    const bookmark_cb = $( Globalx[part].bookmark_op_sel )
-    bookmark_cb.prop('checked', true)
-
-    $( Globalx[part].menu_sel ).empty()
-
-    make_menu_item_list(part, realData)
-}
-
Index: branches/testa/js/remote.js
===================================================================
--- branches/testa/js/remote.js	(revision 29)
+++ 	(revision )
@@ -1,120 +1,0 @@
-function upload_to_host(part) {
-    if( Globalx[part].key_indicate_file === true ){
-	let textarea = $( Globalx[part].textarea_sel )
-	upload_content(textarea.val(), Globalx[part].key, Globalx.num)
-    }
-}
-
-function upload_content(content, path, num) {
-    let form = document.createElement('form');
-    let req_content = document.createElement('input');
-    let req_path = document.createElement('input');
-    let req_cmd = document.createElement('input');
-    let req_num = document.createElement('input');
-
-    document.body.appendChild(form);
-    req_content.type = 'hidden';
-    req_content.name = 'mytext';
-    req_content.value = content;
-    
-    req_path.type = 'hidden';
-    req_path.name = 'path';
-    req_path.value = path;
-    
-    req_cmd.type = 'hidden';
-    req_cmd.name = 'cmd';
-    req_cmd.value = 'upload_content';
-    
-    req_num.type = 'hidden';
-    req_num.name = 'num';
-    req_num.value = num + '';
-    
-    form.appendChild(req_content);
-    form.appendChild(req_path);
-    form.appendChild(req_cmd);
-    form.appendChild(req_num);
-    
-    // FormDataオブジェクトを作成する
-    var form_data = new FormData(form);
-
-    fetch('php/content.php', {
-	method: 'POST',
-	mode: 'same-origin', /* 'no-cors' 'cors' 'same-origin' */
-	body: form_data
-    })
-    .then((response) => response.text())
-    .then((data) => console.log(data))
-    .catch((error) => console.log(error));
-}
-
-function make_url_params( arrayx ){
-      let params = new URLSearchParams();
-      arrayx.reduce(function(acc, element, index, array) {
-	  acc.append(element[0], element[1]);
-	  return acc;
-      }, params)
-      return params;
-}
-
-function get_filelist_from_remote() {
-    let param_array = [['cmd', 'get_filelist'], ['num', Globalx.num ]];
-    let params = make_url_params( param_array );
-    let filename = "php/content.php"
-    fetch(`${filename}?${params}`)
-    .then((response) => response.text())
-    .then((str) => save_filelist_to_local_storage(str, num))
-    .catch((error) => console.log(error));
-}
-
-function update_filelist() {
-    let param_array = [['cmd', 'update_filelist'], ['num', Globalx.num ]];
-    let params = make_url_params( param_array );
-    let filename = "php/content.php"
-    fetch(`${filename}?${params}`)
-    .then((response) => response.text())
-    .then((text) => save_filelist_to_local_storage(text, num))
-    .catch((error) => console.log(error));
-}
-
-function get_content(path , func) {
-    let param_array = [['cmd', 'get_content'], ['num', Globalx.num ], ['path', path]];
-    let params = make_url_params( param_array );
-    let filename = "php/content.php"
-    fetch(`${filename}?${params}`)
-    .then((response) => response.text())
-    .then((text) => {func(text)})
-    .catch((error) => console.log(error));
-}
-
-function handleDownload(e) {
-    let dl = document.getElementById("down-download")
-    if( Globalx[ e.data.part ].key_indicate_file === true ){
-
-	get_content( Globalx[ e.data.part ].key , function(content) {
-	    let blob = new Blob([ content ], { "type" : "text/plain" });
-
-	    if (window.navigator.msSaveBlob) { 
-		window.navigator.msSaveBlob(blob, Globalx[ e.data.part ].item_name); 
-		
-		// msSaveOrOpenBlobの場合はファイルを保存せずに開ける
-		window.navigator.msSaveOrOpenBlob(blob, Globalx[ e.data.part ].item_name); 
-	    } else {
-		dl.download = Globalx[ e.data.part ].item_name
-		dl.href = window.URL.createObjectURL(blob);
-	    }
-	})
-    }
-    else{
-	e.preventDefault()
-	dl.href = ""
-	dl.download = ""
-    }
-}
-
-function download_cmd(part) {
-    if( Globalx[part].key_indicate_file === true ){
-	let dl = $( Globalx[part].download_sel )
-	dl.trigger('click')
-    }
-}
-
Index: branches/testa/js/storage.js
===================================================================
--- branches/testa/js/storage.js	(revision 29)
+++ 	(revision )
@@ -1,173 +1,0 @@
-let _globalStorage = {}
-
-const _items = ["num", "index", "parts"]
-
-function storage_test(){
-    console.log(_items);
-}
-
-function save_info_from_globalx(){
-    save_info_from_globalx_with_items(_items)
-}
-
-function convert_to_array_from_bookmark_mgr(mgr){
-	return {
-	    paths: mgr.get_paths(),
-	    items: mgr_to_array(mgr),
-	    max_display_name_length: mgr.max_display_name_length()
-	}
-}
-
-function save_info_from_globalx_with_items(items){
-    let info = {}
-
-    copy_object( info, Globalx, items )
-    /*	
-	info.num = Globalx.num
-	info.index = Globalx.index
-	info.parts = Globalx.parts
-    */
-    Globalx.parts.map( function (part) {
-	save_info_from_globalx_part(info , part)
-    } )
-
-    save_info_to_local_storage(info)
-}
-function convert_to_plain_object_from_bookmark_mgr(mgr){
-//    console.log( "mgr=" + mgr )
-//    console.log( "mgr.items()=" + mgr.items )
-    const paths = mgr.get_paths()
-    const new_bk_items = paths.map( function( path ){
-	let ret = {
-	    path: "",
-	    display_name: ""
-	}
-	item = mgr.get(path)
-	if( item != null ){
-	    ret.path = path
-	    ret.display_name = item.display_name
-	}
-	return ret
-    } )
-
-    return {
-	max_display_name_length: mgr.max_display_name_length,
-	items: new_bk_items
-    }
-}
-
-function save_info_from_globalx_part(info, part){
-    info[part] = {}
-    copy_obj_with_part(info, Globalx, part)
-
-    info[part].bookmark_mgr = convert_to_plain_object_from_bookmark_mgr(Globalx[part].bookmark_mgr)
-}
-
-function copy_obj_with_part(to_obj, from_obj, part){
-/*    const items = ["editor_id", "editor", "textarea_sel" , "menu_id", "bookmark_id", "bookmark_op_id", "item_name", "bookmarks", "bookmark_displayname_max_length", "key_indicate_file", "key", "key_sel", "download_sel", "menu_sel", "bookmark_sel", "bookmark_op_sel", "bookmark_mgr" ]*/
-    const items = ["editor_id", "textarea_sel" , "menu_id", "bookmark_id", "bookmark_op_id", "item_name", "bookmarks", "bookmark_displayname_max_length", "key_sel", "download_sel", "menu_sel", "bookmark_sel", "bookmark_op_sel", "bookmark_mgr" ]
-    const init_value_items = ["editor", "key_indicate_file", "key"]
-
-    if( to_obj[part] === undefined ){
-	to_obj[part] = {}
-    }
-    copy_object( to_obj[part], from_obj[part], items )
-    copy_object( to_obj[part], GlobalxInitValue, init_value_items )
-}
-
-function copy_object( to_obj, from_obj, items ){
-    let x = null
-    items.map( function(item) {
-	x = from_obj[item]
-	to_obj[item] = x
-    } )
-}
-
-function restore_info_to_globalx(){
-    const info = restore_info()
-    if( info === undefined ){
-	console.log("call init_globalx()")
-	init_globalx()
-    }
-    else {
-	console.log("call restore_info_to_globalx_with_items")
-	restore_info_to_globalx_with_items(info, _items)
-    }
-}
-
-function convert_to_bookmark_mgr_from_plain_object(mgr) {
-    let new_mgr = new BookmarkMgr( mgr.max_display_name_length )
-    
-    const bk_items = mgr.items
-    bk_items.map( function(bk_item) {
-	return new_mgr.add( bk_item.path , bk_item.display_name)
-    })
-    return new_mgr
-}
-
-function restore_info_to_globalx_with_items(info, items){
-    
-    copy_object( Globalx, info, items )
-
-    info.parts.map( function (part) {
-	restore_info_to_globalx_part(info , part)
-    } )
-}
-
-function restore_info_to_globalx_part(info , part){
-    info[part].bookmark_mgr = convert_to_bookmark_mgr_from_plain_object(info[part].bookmark_mgr)
-    copy_obj_with_part(Globalx, info, part)
-}
-
-function save_info_to_local_storage(info){
-    _globalStorage["info"] = info
-    save_to_local_storage(JSON.stringify(info), "info")
-}
-
-function save_filelist_to_local_storage(text , num){
-    let num_s = num + ''
-    save_to_local_storage(text, key)
-}
-
-function save_to_local_storage(str, key) {
-    _globalStorage[key] = str
-    localStorage.setItem(key , str)
-}
-
-function get_filelist(num) {
-    let num_s = num + ''
-    return restore_from_localstorage(num_s)
-}
-
-
-function restore_info(){
-    const item_name = "info"
-    return restore_from_localstorage(item_name)
-}
-
-function restore_from_localstorage(item_name){
-   if( _globalStorage[item_name] === undefined ){
-	oldData = localStorage.getItem(item_name)
-	if( oldData ){
-	    _globalStorage[item_name] = JSON.parse(oldData)
-	}
-    }
-    return _globalStorage[item_name]
-}
-
-function reset_info(){
-    let item_name = 'info'
-    reset_localstorage(item_name)
-}
-
-function reset_localstorage(item_name){
-    delete _globalStorage[item_name]
-    localStorage.removeItem(item_name)
-}
-
-function clear_localstorage(){
-    let keys = Object.keys(_globalStorage)
-    keys.map( (v) => { delete _globalStorage[v] } )
-
-    localStorage.clear()
-}
