Changeset 6358

Show
Ignore:
Timestamp:
02/08/08 03:46:06 (10 months ago)
Author:
noriaki
Message:

websites/coderepos.org/trac/share/js/TracUtils.js:

  • /share/browser/lang/javascript/userscripts/*.user.js: 各ソースコードページにそのスクリプトのインストールURLを追加.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • websites/coderepos.org/trac/share/js/TracUtils.js

    r6356 r6358  
    123123                TracUtils.addRecentChangesForProject(); 
    124124                TracUtils.avoidGreasemonkeyInstallation(); 
     125        TracUtils.addGreasemonkeyInstallLink(); 
    125126                TracUtils.AuthorIcons.showAuthorIcons(); 
    126127        } 
     
    258259                } 
    259260        } 
     261 
     262    /* 
     263     * user.js のページにインストールURLを追加する. 
     264     * 
     265     */ 
     266    , addGreasemonkeyInstallLink : function () { 
     267        if (($.browser.mozilla || $.browser.safari) && (new RegExp("^/share/browser/lang/javascript/userscripts/.*\\.user\\.js")).test(location.pathname)) { 
     268            var uri = location.protocol + '//svn.coderepos.org' + location.pathname.replace('browser/', '').replace('user.js?', 'user.js'); 
     269            $('<a></a>') 
     270            .attr({ 
     271                href :   uri 
     272                ,title : uri.split('/').slice(-1) + ' をインストールする' 
     273            }) 
     274            .text('インストール - ' + uri) 
     275            .insertAfter($('h1:first')); 
     276        } 
     277    } 
    260278 
    261279        /*