//// // function getunicode(str){ var moji; var uni = ''; for( var i=0;i=48 && moji <=57){ //半角数字 //そのまま表示 uni = uni + str.charAt(i); } else if(moji >=65 && moji <=90){ //アルファベット大文字 //そのまま表示 uni = uni + str.charAt(i); } else if(moji >=97 && moji <=122){ //アルファベット小文字 //そのまま表示 uni = uni + str.charAt(i); } else { //「<」「>」「&」などは変換 uni = uni + '%' + moji.toString(16); } } else { //16進数に変換 uni = uni + '%u' + moji.toString(16); } } return uni; } function event_handler_material(){ } function searchText(){ var mat = new Material('map_tsearch'); mat.textSearch(); } function makeLinkForm( num, title ){ var link; link = ''+title+''; if( typeof(_main_markers[num]) != 'undefined' ){ link += ''; } return link; } function makeLinkFormInComp( num, title, comp ){ var link; link = ''+title+''; if( typeof(comp) != 'undefined' ){link += '
'+comp+'
';} if( typeof(_main_markers[num]) != 'undefined' ){ link += ''; } return link; } function makeLinkForm_Main( num, title ){ var link; link = ''+title+''; if( typeof(_main_markers[num]) != 'undefined' ){ link += ''; } return link; } function makeLinkFormInComp_Main( num, title, comp ){ var link; link = ''+title+''; if( typeof(comp) != 'undefined' ){link += '
'+comp+'
';} if( typeof(_main_markers[num]) != 'undefined' ){ link += ''; } return link; } function readMaterial(id){ var mat = new Material(); mat.readMaterial(id); } function readMaterial2MapMarker(opt, marker_color){ var mat = new Material(); putMapMarkerNonNumber(mat.readMaterialAsync(opt), marker_color); } function readMaterialAsync(opt, marker_num){ var mat = new Material(); var xml = mat.readMaterialAsync(opt); var tree = parseXML4Material(xml); if( typeof(tree.material) != 'undefined' ){ return mat.compSmallMaterial(tree.material, marker_num) } else { return ''; } } function readMaterialAdminAsync(opt, marker_num){ var mat = new MaterialAdmin(); var xml = mat.readMaterialAsync(opt); var tree = parseXML4Material(xml); if( typeof(tree.material) != 'undefined' ){ return mat.compSmallMaterial(tree.material, marker_num) } else { return ''; } } function readMaterialMainAsync(opt, marker_num){ var mat = new MaterialAdmin(); var xml = mat.readMaterialAsync(opt); var tree = parseXML4Material(xml); if( typeof(tree.material) != 'undefined' ){ return mat.compBigMaterial(tree.material, marker_num) } else { return ''; } } function putMaterial(html){ var mat = new MaterialAdmin(); return mat.compHtml(html) } /*--------------------------------------------------------------------------*/ var Material = Class.create(); Material.prototype = { initialize : function(id){ this.jax_script = 'http://ingnet.jp/modules/map/gmapjax.php'; this.form_id = 'tmat_form_input'; if( typeof(id) != 'undefined' ){this.form_id = id;} }, // // Save Material // writeMaterial : function(){ setLngLat(); jQuery.ajax({ url: this.jax_script, type: 'post', data: jQuery('#'+this.form_id).serialize(), dataType: 'xml', cache: false, async: true, success: function(req){ }, error: function(req){ }, complete: function(){ //jQuery('#tmessage').html(mess.getMessage('entryerr')); } }); }, // // Get Material(none sync) // readMaterial : function(id){ jQuery.ajax({ url: this.jax_script, type: 'post', data: 'tmat_form_tm=read&tmat_form_edit=1&tid='+id, dataType: 'xml', cache: false, async: false, success: function(req){ putMaterial2Map(req.responseText); }, error: function(req){ }, complete: function(){ jQuery('#tmessage').html('is err'); } }); }, // // Get Material(sync) // readMaterialAsync : function(opt){ var result; jQuery.ajax({ url: this.jax_script, type: 'post', data: 'mm=read'+opt, dataType: 'xml', cache: false, async: false, success: function(req){ result = req; }, error: function(req){ }, complete: function(){ } }); return result; }, // // Search of Soround // // startSearch : function(opt, fnc){ var mapobj = _map.getMapObj(); jQuery.ajax({ url: this.jax_script, type: 'post', data: 'mm=soround'+opt, dataType: 'xml', cache: false, async: true, success: function(req){ if( typeof(req) != 'undefined' ){ _map.clearMarker(); putMapMarker4Xml(req); if( typeof(fnc) != 'undefined' ){ fnc(); } _kid = 0; } }, error: function(req){ jQuery('#tmessage').html('is err'); }, complete: function(){ } }); }, // // Search of Strings // textSearch : function(){ var mapobj = _map.getMapObj(); opt = jQuery('#keyword').val(); jQuery.ajax({ url: this.jax_script, type: 'post', data: 'mm=tsearch&modname='+_modname+'&keyword='+opt, dataType: 'xml', cache: false, async: true, success: function(req){ _map.clearMarker(); if( typeof(req) != 'undefined' ){ putMapMarker4Xml(req); } }, error: function(req){ }, complete: function(){ } }); }, // // Search of Kategorie // kategorieSearch : function(opt, fnc){ var mapobj = _map.getMapObj(); if( opt == '' ){ opt = _kid; opt += 'modname='+_modname+'&kid='+_kid; } jQuery.ajax({ url: this.jax_script, type: 'post', data: 'mm=ksearch&'+opt, dataType: 'xml', cache: false, async: true, success: function(req){ _map.clearMarker(); if( typeof(req) != 'undefined' ){ putMapMarker4Xml(req); if( typeof(fnc) != 'undefined' ){ fnc(); } } }, error: function(req){ }, complete: function(){ } }); }, // Clear of Form // clearMaterial : function(){ //jQuery('#tmat_form_name').val(''); //clearMaterialInfo(); //jQuery('#tmat_form_parking2').checked = true; //Element.hide('tmat_form_cars_box'); //jQuery('#tmat_form_submit_material').val(mess.getMessage('newentry')); //Element.setStyle('tabBoxIndex1', {backgroundColor:'#f5deb3'}); //var style = ''; //jQuery('#tdummy').html(style); }, // // Composition Material(Practice) // compSmallMaterial : function(material, marker_num){ var html = ''; var title; var comment; var lng = material.lng; var lat = material.lat; var width = 200; var height = 250; tid = material.tid; if( typeof(material.title) != 'undefined' ){title = material.title;} else {title = '';} if( typeof(material.comment) != 'undefined' ){comment = material.comment;} else {comment = '';} html += '
'; html += ''; html += ''; html += '
'; html += '
'+title+'
'; html += '
'+comment+'
'; html += '
'; html += '
'; return html; }, // // Composition Html(Practice) // compHtml : function(source){ var html = ''; source = source.replace(/</g, '<'); source = source.replace(/>/g, '>'); source = source.replace(/"/g, '"'); source = source.replace(/'/g, '\''); html = source return html; } } /*--------------------------------------------------------------------------*/ var MaterialAdmin = Class.create(Material, { // // Composition Material practice // compSmallMaterial : function(material, marker_num){ var html = ''; var title; var url; var comment; var img_url = ''; var lng = material.lng; var lat = material.lat; var width = 400; var height = 250; tid = material.tid; if( typeof(material.title) != 'undefined' ){title = material.title;} else {title = '';} if( typeof(material.url) != 'undefined' ){url = material.url;} else {title = '';} if( typeof(material.comment) != 'undefined' ){comment = material.comment;} else {comment = '';} if( typeof(material.img_url) != 'undefined' ){ img_url = material.img_url; } else if( typeof(material.thumb_url) != 'undefined' ){ img_url = material.thumb_url; } comment = comment.replace('<', '<'); comment = comment.replace('>', '>'); comment = comment.replace('"', '"'); comment = comment.replace('\'', '\''); html += '
'; html += ''; html += ''; html += '
'; html += '
'; if( ! _linkoff ){html += '';} html += title; if( ! _linkoff ){html += '';} html += ''; if( img_url != '' ){ html += '
'; } if( _viewmode == 'ex' ){ html += ''; html += '[*]'; html += ''; } html += '
'; html += '
'+comment+'
'; if( _viewmode == 'routeset' ){ opt = '&modname='+_modname+'&id='+material.id; html += '

'; html += '目的地へ追加 / '; html += '目的地から削除'; } html += '
'; html += '
'; return html; }, // // Composition Material practice // compBigMaterial : function(material, marker_num){ var html = ''; var title; var url; var comment; var lng = material.lng; var lat = material.lat; var width = 400; var height = 250; tid = material.tid; if( typeof(material.title) != 'undefined' ){title = material.title;} else {title = '';} if( typeof(material.url) != 'undefined' ){url = material.url;} else {title = '';} if( typeof(material.comment) != 'undefined' ){comment = material.comment;} else {comment = '';} comment = comment.replace('<', '<'); comment = comment.replace('>', '>'); comment = comment.replace('"', '"'); comment = comment.replace('\'', '\''); html += '
'; html += ''; html += ''; html += '
'; html += '
'; if( ! _linkoff ){html += '';} html += title; if( ! _linkoff ){html += '';} html += ''; if( _viewmode == 'ex' ){ html += ''; html += '[*]'; html += ''; } html += '
'; html += '
'+comment+'
'; html += '
'; html += '
'; return html; } });