/*----------------------------------------*/ /* breadCrumb.js ( 2012/11/16 ) /* http://tshinobu.com/lab/breadCrumbJs/ /* readcrumb (topicpath) generator by javascript /*----------------------------------------*/ breadCrumbJsData = function(){ /*----------------------------------------*/ /* index.html をパンくずリスト生成に含めるかどうか定義します。 /* false … index.html を無視する /* true … index.html を無視しない /*----------------------------------------*/ this.indexMatch = false; /*----------------------------------------*/ /* パンくずリストから除外するパスを定義してください。 /* 最後に「/」を付けないようにしてください。 /* 除外しない場合 … '' /* 除外する場合 … '/lab/breadCrumbJs' /*----------------------------------------*/ this.ignorePath = '/third'; /*----------------------------------------*/ /* パンくずリストに表示する名前を定義してください。 /* (書式) "ディレクトリ名" : "表示名" /*----------------------------------------*/ this.contentName = { "home" : "ホーム", // この行は残してください。 "/~kitagata/":"トップ", "/~kitagata/living/":"くらしの情報", "/~kitagata/living/copy_of_the_certificate_of_residence.html":"戸籍・住民票など", //"/templateSiteHP/index.html" : "index", "" : "" //この行は残してください。 }; } var breadCrumbJsData = new breadCrumbJsData(); function breadCrumbJs(){ /*----------------------------------------*/ /* 以下条件分岐 / 表示処理部分 /*----------------------------------------*/ var URL = window.location.pathname.replace(breadCrumbJsData.ignorePath, ''); var thisURL = URL.match(/(.*?)\//g); var fileName = window.location.pathname.match(/([^¥/]+?)$/); if ( fileName && (!( fileName[0].match("index") && !breadCrumbJsData.indexMatch )) ){ thisURL.push( fileName[0] ); } var drw = document.getElementById("breadCrumb"); var rootingPath = ""; if ( drw.tagName == "P" | drw.tagName == "DIV" ){ for( i=0; i' + funcIndexSearch('home') + ''; } else if ( i == thisURL.length - 1 ){ drw.innerHTML += ' > ' + funcIndexSearch(rootingPath) + ''; } else { drw.innerHTML += ' > ' + funcIndexSearch(rootingPath) + ''; } } } if ( drw.tagName == "UL" | drw.tagName == "OL" ){ for( i=0; i' + funcIndexSearch('home') + ''; } else if ( i == thisURL.length - 1 ){ drw.innerHTML += '
  • ' + funcIndexSearch(rootingPath) + '
  • '; } else { drw.innerHTML += '
  • ' + funcIndexSearch(rootingPath) + '
  • '; } } } } function funcIndexSearch(){ /*----------------------------------------*/ /* パンくずリスト生成検索処理 /*----------------------------------------*/ keyword = breadCrumbJsData.contentName[arguments[0]]; if(keyword == undefined){ return arguments[0].match(/(.*?)\//g).pop().replace("/",""); } else{ return keyword; } } if(window.addEventListener) { window.addEventListener("load", breadCrumbJs, false); } else if(window.attachEvent) { window.attachEvent("onload", breadCrumbJs); }