Changeset 124

Show
Ignore:
Timestamp:
11/13/06 16:14:03 (2 years ago)
Author:
akiyan
Message:

bug fix http://www.akiyan.com/cgi-bin/trac.fcgi/public/ticket/2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • checkpad-bookmarklet-box/trunk/checkpadBookmarkletBox.js

    r123 r124  
    1111    // Bookmarklet 
    1212    var elm_rightside = document.getElementById('rightside'); 
    13     var addForm = document.getElementById('add_form_ms').getElementsByTagName('form')[0]; 
    1413 
    15     var action = addForm.action; 
    16     action = 'http://www.checkpad.jp' + action.replace('http://www.checkpad.jp', ''); 
     14    var idRegexp = new RegExp("&id=([0-9]+)"); 
     15    location.href.match(idRegexp); 
     16    var id = RegExp.$1; 
     17    var action = 'http://www.checkpad.jp/?mode=ms&act=add&pjt_id=' + id; 
    1718 
    1819    var addBlank = "javascript:(function(){var formObj=document.createElement('form');var ttl=document.createElement('input');document.body.appendChild(formObj);formObj.appendChild(ttl);ttl.name='ttl';ttl.value=document.title+' '+location.href;formObj.action='" + action + "';formObj.acceptCharset='euc-jp';formObj.method='post';formObj.target='_blank';formObj.submit();})();"; 
    1920    var addSelf = "javascript:(function(){var formObj=document.createElement('form');var ttl=document.createElement('input');document.body.appendChild(formObj);formObj.appendChild(ttl);ttl.name='ttl';ttl.value=document.title+' '+location.href;formObj.action='" + action + "';formObj.acceptCharset='euc-jp';formObj.method='post';formObj.target='_self';formObj.submit();})();"; 
    2021     
    21     var cpTitleRegexp = new RegExp(" - (.+)$"); 
    22     document.title.match(cpTitleRegexp); 
    23     var cpTitle = RegExp.$1 + unescape('%u3078%u8FFD%u52A0'); 
     22    var cpTitle = document.title + unescape('%u3078%u8FFD%u52A0'); 
    2423 
    2524    var menuBoxHtml = '<div><p class="title">' + unescape('%u30D6%u30C3%u30AF%u30DE%u30FC%u30AF%u30EC%u30C3%u30C8') + '</p><ul><li><a href="' + addBlank + '">' + cpTitle + '</a> (blank)</li><li><a href="' + addSelf + '">' + cpTitle + '</a> (self)</li></ul></div>';