function movealert(){ if( input_changed ){ alert( "入力値が保存されていません。「チェックする」ボタンで確定させてください。" ); return false; } }; $(function(){ var input_changed = false; // ===addclass=== $("tr:even").addClass("even"); $("tr:odd").addClass("odd"); $("form :submit").addClass("button"); // ===jquery4contentslist=== $('.jquery4contentslist h1').after(''); $('.pico_container h2').each(function(){ var txt = $(this).html(); var number = 't'+($('.pico_container h2').index(this)+1); $(this).append(''); $('ul#jquery4contentslist').append('
  • '+txt+'
  • '); }); // ===Mainmenu=== $('#sitemenu li a.mainitem').each(function(){ var menuid = $(this).attr('id'); var alt = $(this).text(); $(this).empty(); if($(this).attr('class')=='on'){ $(''+alt+'').prependTo(this); }else{ $(''+alt+'').prependTo(this); } }); $('#sitemenu li a').hover(function(){ var imgsrc = $(this).find('img').attr('src').replace('_df.gif','_ro.gif'); $(this).find('img').attr('src',imgsrc); },function(){ if($(this).attr('class')=='on'){ }else{ var imgsrc = $(this).find('img').attr('src').replace('_ro.gif','_df.gif'); $(this).find('img').attr('src',imgsrc); } }); //==floatimage margin for FCKeditor== $('#CenterWrapper img').each(function(){ if($(this).attr('align')=='left'){ $(this).css({'margin':'0 10px 10px 0','float':'left'}); $(this).removeAttr('align'); }else if($(this).attr('align')=='right'){ $(this).css({'margin':'0 0 10px 10px','float':'right'}); $(this).removeAttr('align'); }else if($(this).attr('align')=='center'){ $(this).css({'margin':'0 10px 10px 10px'}); } }); //==== rollover4text ==== $('a.rollover4text').each(function() { var alt = $(this).html(); $(this).empty(); var class_arr = $(this).attr('class').split(' '); var filename4rollover = class_arr[1].replace(/__/g,'/'); $(''+alt+'').prependTo(this); }); //==== a.rollover img ==== $('a.rollover img').hover(function(){ var imgsrc = $(this).attr('src').replace('_df.gif','_ro.gif'); $(this).attr('src',imgsrc); },function(){ var imgsrc = $(this).attr('src').replace('_ro.gif','_df.gif'); $(this).attr('src',imgsrc); }); $('a.rollover img').click(function(){ if ( $(this).attr('alt') != "チェックする" ){ return movealert(); } }); //==== a.current img ==== $('a.current img').each(function(){ var imgsrc = $(this).attr('src').replace('_df.gif','_ro.gif'); $(this).attr('src',imgsrc); }); //==== input.rollover ==== $('input.rollover').hover(function(){ var imgsrc = $(this).attr('src').replace('_df.gif','_ro.gif'); $(this).attr('src',imgsrc); },function(){ var imgsrc = $(this).attr('src').replace('_ro.gif','_df.gif'); $(this).attr('src',imgsrc); }); //====add markers==== currenturl = location.href; if (currenturl.search(/system/i) != -1) { $(".cite").prepend(" "); $(".cite_left").prepend(" "); $("#toppage #backtotop").prepend(" "); } else { $(".cite").prepend(" "); $(".cite_left").prepend(" "); $("#toppage #backtotop").prepend(" "); } // ===captionblock=== $('img.fcr').each(function(){ var captxt = $(this).attr('alt').replace('[/url]','').replace(']','">').replace('[url=',''); $(this).wrap('
    '); $(this).attr('alt','').after('
    '+captxt); }); $('img.fcl').each(function(){ var captxt = $(this).attr('alt').replace('[/url]','
    ').replace(']','">').replace('[url=',''); $(this).wrap('
    '); $(this).attr('alt','').after('
    '+captxt); }); $('img.fcc').each(function(){ var captxt = $(this).attr('alt').replace('[/url]','
    ').replace(']','">').replace('[url=',''); $(this).wrap('
    '); $(this).attr('alt','').after('
    '+captxt); }); // ===lightbox=== $('a.lb').each(function(){ var capwidth = $(this).find('img').attr('width'); capwidth=capwidth+10; var altx = $(this).find('img').attr('alt'); var altx = '画像拡大表示' + altx; $(this).find('img').attr('alt',altx); $(this).lightBox(); }); // ===fn.disableDoubleSubmit=== // http://www.alink.co.jp/tech/wiki/index.php?jQuery%2F%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AB%E3%82%B3%E3%83%BC%E3%83%89%2Fsubmit%EF%BC%88%E9%80%81%E4%BF%A1%EF%BC%89%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%AE2%E5%BA%A6%E6%8A%BC%E3%81%97%E3%82%92%E7%A6%81%E6%AD%A2%E3%81%99%E3%82%8B (function() { $.fn.disableDoubleSubmit = function(timeout) { if(!timeout || timeout < 1) { timeout = 3000; // 3sec. } $(this).bind("submit",function() { var submit_buttons = $(":submit",this); submit_buttons.attr("disabled", true); setTimeout(function(){ submit_buttons.attr("disabled", false); },timeout); }); return this; } })(jQuery); $('form').disableDoubleSubmit(); //for all forms });