Index: branches/testa-single-bookmark/index.html
===================================================================
--- branches/testa-single-bookmark/index.html	(revision 66)
+++ branches/testa-single-bookmark/index.html	(revision 67)
@@ -8,21 +8,21 @@
     <link rel="stylesheet" href="./css/style.css" />
     <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
-    <link rel="stylesheet" href="css/style-3.css?146">
-    <link rel="stylesheet" href="css/tab.css?146">
-    <link rel="stylesheet" href="css/menu.css?146">
+    <link rel="stylesheet" href="css/style-3.css?170">
+    <link rel="stylesheet" href="css/tab.css?170">
+    <link rel="stylesheet" href="css/menu.css?170">
     <link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" />
     <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.5/ace.js"></script>
-    <script src="js/storagex.js?146>"></script>
-    <script src="js/sidemenu.js?146>"></script>
-    <script src="js/bookmark.js?146>"></script>
-    <script src="js/bookmarkmgr.js?146"></script>
-    <script src="js/bookmarkmenu.js?146"></script>
-    <script src="js/tab.js?146"></script>
-    <script src="js/topmenu.js?146"></script>
-    <script src="js/remotex.js?146"></script>
-    <script src="js/build.js?146"></script>
-    <script src="js/main.js?146"></script>
+    <script src="js/storagex.js?170>"></script>
+    <script src="js/sidemenu.js?170>"></script>
+    <script src="js/bookmark.js?170>"></script>
+    <script src="js/bookmarkmgr.js?170"></script>
+    <script src="js/bookmarkmenu.js?170"></script>
+    <script src="js/tab.js?170"></script>
+    <script src="js/topmenu.js?170"></script>
+    <script src="js/remotex.js?170"></script>
+    <script src="js/build.js?170"></script>
+    <script src="js/main.js?170"></script>
 
 <!-- AREA-END -->
@@ -238,7 +238,2 @@
     </script>
   </body>
-</html>
-
-
-
-
Index: branches/testa-single-bookmark/js/build.js
===================================================================
--- branches/testa-single-bookmark/js/build.js	(revision 66)
+++ branches/testa-single-bookmark/js/build.js	(revision 67)
@@ -1,12 +1,4 @@
 class Build {
     constructor(){
-    }
-
-    set_anchor_url( part, item_name, href, text , kind){
-	if( href === undefined ){
-	    href = ""
-	}
-	Globalx.output_url_listx[text] = href
-	Globalx[part].sidemenu.set_anchor_down_url( item_name, href, text , kind)
     }
 
@@ -18,6 +10,8 @@
 	    const content = textarea.val()
 
-	    this.set_anchor_url( part, Globalx[part].item_name, "", "" , "full")
-	    this.set_anchor_url( part, Globalx[part].item_name, "", "" , "partial")
+	    let words = Globalx[part].item_name.split('.')
+	    let base = words[0]
+	    Globalx[part].sidemenu.set_anchor_url( part, base, "", "" , "full")
+	    Globalx[part].sidemenu.set_anchor_url( part, base, "", "" , "partial")
 
 	    Globalx.remotex.upload_file( cmd, Globalx.num, part, Globalx[part].key, content , (data) => {
@@ -27,6 +21,6 @@
 		    console.log("partial_download_url=" + obj["partial_download_url"])
 
-		    this.set_anchor_url( part, Globalx[part].item_name, obj["full_download_url"],    Globalx[part].item_name, "full")
-		    this.set_anchor_url( part, Globalx[part].item_name, obj["partial_download_url"], Globalx[part].item_name, "partial")
+		    Globalx[part].sidemenu.set_anchor_url( part, base, obj["full_download_url"],    Globalx[part].item_name, "full")
+		    Globalx[part].sidemenu.set_anchor_url( part, base, obj["partial_download_url"], Globalx[part].item_name, "partial")
 		}
 		else{
Index: branches/testa-single-bookmark/js/main.js
===================================================================
--- branches/testa-single-bookmark/js/main.js	(revision 66)
+++ branches/testa-single-bookmark/js/main.js	(revision 67)
@@ -45,12 +45,25 @@
 }
 
+function set_output_url_listx(text){
+    if( text.match( /{.*}/ ) !== null ){
+	const obj = JSON.parse( text )
+	//console.log("update_all_info_on_host text=" + text )
+	Globalx.output_url_listx = {}
+	obj["htmlfname"].forEach( (item) => {
+	    let words = item.full.split('.')
+	    let base = words[0]
+	    Globalx.output_url_listx[ base ] = {}
+	    Globalx.output_url_listx[ base ].full = `${obj["output_url"]}/${item.full}`
+	    Globalx.output_url_listx[ base ].partial = `${obj["output_url"]}/${item.partial}`
+	    console.log(`${words[0].full}=${ Globalx.output_url_listx[ base ].full }`)
+	    console.log(`${words[0].partial}=${ Globalx.output_url_listx[ base ].partial }`)
+	} )
+	Globalx.storagex.save_as_info_from_globalx()
+    }
+}
+
 async function update_all_info_on_host_async( ) {
-    await Globalx.remotex.get_output_url_listx( Globalx.num , (text) => {
-	if( text.match( /{.*}/ ) !== null ){
-	    const obj = JSON.parse( text )
-//console.log("update_all_info_on_host text=" + text )
-	    Globalx.output_url_listx = obj
-	    Globalx.storagex.save_as_info_from_globalx()
-	}
+    await Globalx.remotex.update_output_url_listx( Globalx.num , (text) => {
+	set_output_url_listx(text)
     } )
 
@@ -86,15 +99,11 @@
 async function get_output_url_listx_async( num ) {
     await Globalx.remotex.get_output_url_listx( num , (text) => {
-	if( text.match( /{.*}/ ) !== null ){
-	    const obj = JSON.parse( text )
-//console.log("update_all_info_on_host text=" + text )
-	    Globalx.output_url_listx = obj
-	    Globalx.storagex.save_as_info_from_globalx()
-	}
+	set_output_url_listx(text)
     } )
 }
+
 async function setup(){
     await get_output_url_listx_async( Globalx.num )
-    await get_output_url( Globalx.num )
+//    await get_output_url( Globalx.num )
 }
 
Index: branches/testa-single-bookmark/js/remotex.js
===================================================================
--- branches/testa-single-bookmark/js/remotex.js	(revision 66)
+++ branches/testa-single-bookmark/js/remotex.js	(revision 67)
@@ -38,4 +38,9 @@
     async get_output_url_listx( num, func) {
 	let param_array = [['cmd', 'get_output_url_listx'] , ['num', num]]
+	await this.fetchx( this.filename , param_array, 2, func )
+    }
+
+    async update_output_url_listx( num, func) {
+	let param_array = [['cmd', 'update_output_url_listx'] , ['num', num]]
 	await this.fetchx( this.filename , param_array, 2, func )
     }
Index: branches/testa-single-bookmark/js/sidemenu.js
===================================================================
--- branches/testa-single-bookmark/js/sidemenu.js	(revision 66)
+++ branches/testa-single-bookmark/js/sidemenu.js	(revision 67)
@@ -83,7 +83,9 @@
 	    Globalx[part].editor.getSession().setValue( "" );
 
+	    let words = Globalx[part].item_name.split('.')
+	    let base = words[0]
 	    $( this.textarea_sel ).val( "" );
-	    this.set_anchor_url( part, Globalx[part].item_name, "", "" , "full")
-	    this.set_anchor_url( part, Globalx[part].item_name, "", "" , "partial")
+	    this.set_anchor_url( part, base, "", "" , "full")
+	    this.set_anchor_url( part, base, "", "" , "partial")
 
 	    if( Globalx[part].key != '/' ){
@@ -128,8 +130,13 @@
 
 	if( jsondata !== undefined && jsondata[Globalx[part].key] !== undefined ){
+	    let words = item_name.split('.')
+	    let base = words[0]
 	    if( jsondata[Globalx[part].key].length == 0 ){
 		Globalx[part].key_indicate_file = true;
 console.log("Globalx[" + part + "].key_indicate_file = " + Globalx[part].key_indicate_file)
-		let url = ""
+		let url = Globalx.output_url_listx[base].full
+console.log( "item_name="+item_name )
+console.log( "base="+base )
+console.log( "url="+url )
 		$( Globalx[part].download_url_sel ).val( Globalx[part].key )
 		$( Globalx[part].download_url_sel ).attr('href' , url )
@@ -142,10 +149,10 @@
 		});
 
-		this.set_anchor_down_url( item_name, Globalx.output_url_listx[item_name], item_name , "full" )
-		this.set_anchor_down_url( item_name, Globalx.output_url_listx[item_name], item_name , "partial" )
+		this.set_anchor_down_url( base, Globalx.output_url_listx[base].full, item_name , "full" )
+		this.set_anchor_down_url( base, Globalx.output_url_listx[base].partial, item_name , "partial" )
 	    }
 	    else{
-		this.set_anchor_url( part, Globalx[part].item_name, "", "" , "full")
-		this.set_anchor_url( part, Globalx[part].item_name, "", "" , "partial")
+		this.set_anchor_url( part, base, "", "" , "full")
+		this.set_anchor_url( part, base, "", "" , "partial")
 	    }
 	}
@@ -184,11 +191,36 @@
     }
 
-    set_anchor_down_url( item_name, href, text , kind ){
+    set_anchor_url( part, base, href, text , kind){
+	if( href === undefined ){
+	    href = ""
+	}
+	if( text === "" ){
+	    Globalx[part].sidemenu.set_anchor_down_url( base, href, text , kind)
+	}
+	else{
+	    let words = text.split('.')
+	    let base = words[0]
+	    if( Globalx.output_url_listx[base] !==  undefined ){
+		Globalx[part].sidemenu.set_anchor_down_url( base, href, text , kind)
+	    }
+	}
+    }
+
+    set_anchor_down_url( base, href, text , kind ){
 	let sel = null
 	if( href === undefined ){
 	    href = ""
 	}
-	Globalx.output_url_listx[item_name] = href
-
+	if( href === "" ){
+	    text = ""
+	}
+	if( text !== "" ){
+	    if( kind == "full" ){
+		Globalx.output_url_listx[base].full = href
+	    }
+	    else{
+		Globalx.output_url_listx[base].partial = href
+	    }
+	}
 	if( kind === "full" ){
 	    sel = this.full_download_url_sel
Index: branches/testa-single-bookmark/php/content3.php
===================================================================
--- branches/testa-single-bookmark/php/content3.php	(revision 66)
+++ branches/testa-single-bookmark/php/content3.php	(revision 67)
@@ -15,5 +15,7 @@
 require_once( dirname(__FILE__) . "/spyc-0.5/spyc.php"); // ★の部分にはspyc.phpを置いたパスを入れます
 
-$exec_path = dirname(__FILE__) . "/..";
+$Top_path = dirname(__FILE__) . "/..";
+$Url_data = null;
+$Url_data_array = null;
 
 function get_url_data_array()
@@ -25,15 +27,7 @@
 }
 
-function get_url_data_array0()
-{
-	$array = array(
-        array('url' => 'https://toppers.jp', 'path' =>	'/var/www/vhosts/devconf.northern-cross.info/httpdocs/a/tmp/devconf-guest-4/tmp/md2site-x/_xtest/wtjx/t12/src') );
-
-	return $array;
-}
-
 function get_url_data( $num ){
-    $array = get_url_data_array();
-    return $array[$num];
+    global $Url_data_array;
+    return $Url_data_array[$num];
 }
 
@@ -43,13 +37,15 @@
 
 function get_path_from_url_data( $num , $part){
+    global $Url_data_array;
+
     switch($part){
     case 'data':
-        $ret = get_url_data( $num )['path'];
+        $ret = $Url_data_array[$num]['path'];
         break;
     case 'conf':
-        $ret = get_url_data( $num )['conf_path'];
+        $ret = $Url_data_array[$num]['conf_path'];
         break;
     case 'output':
-        $ret = get_url_data( $num )['output_path'];
+        $ret = $Url_data_array[$num]['output_path'];
         break;
     default:
@@ -123,5 +119,4 @@
 }
 
-
 function get_path_info( $num , $part){
     $path_info = get_path_list_by_url( $num , $part);
@@ -138,5 +133,7 @@
 function ensure_storage_dir( $storage_dir , $num, $filename ) {
     $dir = implode( "/" , array( $storage_dir , $num) );
-    mkdir($dir);
+    if( !file_exists( $dir ) ){
+        mkdir($dir);
+    }
     $path = implode( "/" , array( $dir , $filename) );
     ensure_dir( $dir );
@@ -152,5 +149,5 @@
 }
 
-function build_one_html( $exec_path, $num , $md_path , $part) {
+function build_one_html( $top_path, $num , $md_path , $part) {
     $pathinfo = pathinfo( $md_path );
     $md_fname = $pathinfo['basename'];
@@ -169,5 +166,5 @@
     $output_url = $url_data["output_url"];
 
-    $cmd_line_items = array( $exec_path . "/bin/build.sh" , $bundle_path , $t, $s, $conf_path);
+    $cmd_line_items = array( $top_path . "/bin/build.sh" , $bundle_path , $t, $s, $conf_path);
 
     $cmd_line = implode(" " , $cmd_line_items);
@@ -191,7 +188,12 @@
 
 function cmdx(){
-    global $exec_path;
+    global $Top_path;
+    global $Url_data;
+    global $Url_data_array;
+
+    $Url_data_array = get_url_data_array();
 
     $filelist_filename = array("data"=> "filelist.json", "conf"=> "conf-filelist.json", "output" => "output-filelist.json");
+    $output_url_filename = "output_url.json";
     #    $storage_dir = dirname(__FILE__) . '/../storage';
     $storage_dir = dirname(__FILE__) . '/../storage-devconf';
@@ -202,4 +204,7 @@
         if (isset($_GET['num'])) {
             $num = $_GET['num'];
+
+            $Url_data = get_url_data($num);
+
             if (isset($_GET['part'])) {
                 $part = $_GET['part'];
@@ -237,5 +242,17 @@
                     $content = json_encode($info);
                     break;
+                case 'update_output_url_listx':
+                    $content = update_output_url_list( $num );
+                case 'get_output_url_listx':
+                    $path = ensure_storage_dir( $storage_dir , $num , $output_url_filename );
+                    if( file_exists($path) ){
+                        $content = input_file( $path );
+                    }
+                    else {
+                        $content = update_output_url_list( $num );
+                    }
+                    break;
                 default:
+                    $content = "bad cmd=" . $cmd;
                     break;
                 }
@@ -248,4 +265,7 @@
         if (isset($_POST['num'])) {
             $num = $_POST['num'];
+
+            $Url_data = get_url_data($num);
+
             if (isset($_POST['part'])) {
                 $part = $_POST['part'];
@@ -259,5 +279,5 @@
                         $top_path = get_path_from_url_data( $num , $part);
                         $filename_abs_path = $top_path . DIRECTORY_SEPARATOR . $path;
-                        $ret = build_one_html( $exec_path , $num, $path, $part );
+                        $ret = build_one_html( $Top_path , $num, $path, $part );
                     }
                     else{
@@ -304,5 +324,5 @@
     }
     else{
-        echo($content);
+        echo("no content");
     }
 }
@@ -331,11 +351,20 @@
 
 function get_full_path($num, $key, $fname){
-    $array = get_url_data_array();
-    return $array[$num][$key] . "/" . $fname;
-}
-
-function get_restrict_from_settings_yml() {
-    $settings = get_url_data_array();
-    $array = $settings[0]['restrict'];
+    global $Url_data_array;
+    return $Url_data_array[$num][$key] . "/" . $fname;
+}
+
+function get_restrict_from_settings_yml( $num ) {
+    global $Url_data_array;
+
+    /*    $settings = get_url_data_array();*/
+    $settings = $Url_data_array;
+    if( !isset($settings[$num]) ){
+        return array();
+    }
+    $array = $settings[$num]['restrict'];
+    if( !isset( $array ) ){
+        return array();
+    }
 
     $r_keys = array_keys( $array );
@@ -361,5 +390,5 @@
     $list = get_site_tsv($num );
 
-    $restrict_array = get_restrict_from_settings_yml();
+    $restrict_array = get_restrict_from_settings_yml( $num );
 
     foreach( $list as $k => $v ){
@@ -399,55 +428,58 @@
 }
 
+function update_output_url_list( $num ){
+    $json_data = get_output_url_list( $num );
+    $content = json_encode($json_data);
+    output_file( $path , $content );
+
+    return $content;
+}
+
+function get_output_url_list( $num ){
+    $output_url = get_output_url($num);
+    $data = array( "output_url" => get_output_url($num),
+           "htmlfname" => array()
+    );
+
+    $list = get_site_tsv( $num );
+    $restrict_htmlnames = get_restrict_basenames( $num );
+
+    $output_path = get_path_from_url_data( $num, 'output' );
+    foreach( $list as $k => $v ){
+        $htmlfname = $v["output_html"];
+        if( $htmlfname !== null ){
+            $array = array( "full" => "", "partial" => "" );
+            if( !isset( $restrict_htmlnames[$htmlfname] ) ){
+                $fpath =  $output_path . '/' . $htmlfname;
+                if( file_exist($fpath) ){
+                    $array["full"] = $htmlfname;
+                }
+                $fpath_tmp =  $fpath . '.tmp';
+                if( file_exist($fpath_tmp) ){
+                    $array["partial"] = $htmlfname_tmp;
+                }
+                array_push( $data["htmlfname"] , $array);
+            }
+        }
+    }
+
+    return $data;
+}
+
 function get_output_url($num){
-    $settings = get_url_data_array();
-    return $settings[$num]['output_url'];
+    return $Url_data['output_url'];
 }
 
 function get_restrict($num){
-    $settings = get_url_data_array();
-    return $settings[$num]['restrict'];
-}
-
-function get_item($num, $name){
-    $settings = get_url_data_array();
-    return $settings[$num][$name];
-}
-
-function get_settings_file( $name ){
-    $dir = get_item( 0 , "conf_path" );
-    $path = implode( "/" , [$dir, $name] );
-
-    return $path;
-}
-
-function do_exec(){
-    $cmd = "ls -l /z";
-
-    exec($cmd, $opt, $ret);
-
-#    print_r($opt);
-#    echo "ret=" . $ret . "\n";
+    /*    $settings = get_url_data_array();*/
+    global $Url_data_array;
+    return $Url_data_array[$num]['restrict'];
 }
 
 cmdx();
-/*
-do_exec();
-*/
-/*
-$num = 0;
-$path = "/attempt/devconf2018/data/devconf2018.md";
-$part = "data";
-$lines = build_one_html( $exec_path, $num , $path , $part );
-
-var_dump( $lines );
-
-foreach( $lines as $k => $v ){
-    if( is_array( $v )){
-        echo implode( "\n" , $v );
-    }
-    else{
-        echo $v . "\n";
-    }
-}
-*/
+
+#echo json_encode( get_output_url_list(0) );
+# var_dump( get_output_url_list(0) );
+#var_dump( get_output_url_list(0) );
+#echo json_encode( get_output_url_list(0) );
 ?>
Index: branches/testa-single-bookmark/tmp/tmp.txt
===================================================================
--- branches/testa-single-bookmark/tmp/tmp.txt	(revision 66)
+++ branches/testa-single-bookmark/tmp/tmp.txt	(revision 67)
@@ -8,21 +8,21 @@
     <link rel="stylesheet" href="./css/style.css" />
     <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
-    <link rel="stylesheet" href="css/style-3.css?146">
-    <link rel="stylesheet" href="css/tab.css?146">
-    <link rel="stylesheet" href="css/menu.css?146">
+    <link rel="stylesheet" href="css/style-3.css?170">
+    <link rel="stylesheet" href="css/tab.css?170">
+    <link rel="stylesheet" href="css/menu.css?170">
     <link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" />
     <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.5/ace.js"></script>
-    <script src="js/storagex.js?146>"></script>
-    <script src="js/sidemenu.js?146>"></script>
-    <script src="js/bookmark.js?146>"></script>
-    <script src="js/bookmarkmgr.js?146"></script>
-    <script src="js/bookmarkmenu.js?146"></script>
-    <script src="js/tab.js?146"></script>
-    <script src="js/topmenu.js?146"></script>
-    <script src="js/remotex.js?146"></script>
-    <script src="js/build.js?146"></script>
-    <script src="js/main.js?146"></script>
+    <script src="js/storagex.js?170>"></script>
+    <script src="js/sidemenu.js?170>"></script>
+    <script src="js/bookmark.js?170>"></script>
+    <script src="js/bookmarkmgr.js?170"></script>
+    <script src="js/bookmarkmenu.js?170"></script>
+    <script src="js/tab.js?170"></script>
+    <script src="js/topmenu.js?170"></script>
+    <script src="js/remotex.js?170"></script>
+    <script src="js/build.js?170"></script>
+    <script src="js/main.js?170"></script>
 
 <!-- AREA-END -->
@@ -72,5 +72,4 @@
 	      <ul>
 		<li><a id="data-host-update-all" onclick="update_all_info_on_host_async()">Update all on host</a></li>
-<!--		<li><a id="data-host-update" onclick="Globalx.remotex.update('data')">Update on host</a></li> -->
 		<li><a href="#" onclick="Globalx.storagex.save_info_from_globalx()">Save info</a></li>
 		<li><a href="#" onclick="Globalx.storagex.reset_info()">Reset Info</a></li>
@@ -171,5 +170,4 @@
 	    <ul>
 	      <li><a id="conf-file-upload" onclick="upload_to_host('conf')">Save on host</a></li>
-<!--	      <li><a id="conf-file-download" onclick="download_cmd('data')">Download</a></li> -->
 	      <li><a id="conf-file-rename" class="disabled" >-Rename</a></li>
 	      <li><a id="conf-file-move" class="disabled" >-Move</a></li>
@@ -181,5 +179,5 @@
 	    <ul>
 	      <li><a id="conf-dir-create" class="disabled" href="#">-Create</a></li>
-	      <li><a id="conf-dir-rename" class="disabled" href="#">-Rename</a></li>
+p	      <li><a id="conf-dir-rename" class="disabled" href="#">-Rename</a></li>
 	      <li><a id="conf-dir-move" class="disabled" href="#">-Move</a></li>
 	      <li><a id="conf-dir-delete" class="disabled" href="#">-Delete</a></li>
