Changeset 37396

Show
Ignore:
Timestamp:
05/06/10 20:35:42 (3 years ago)
Author:
anekos
Message:

Vimperator 依存を解消

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/stella.js

    r37395 r37396  
    299299      s.replace(/^[a-z]/, String.toUpperCase).replace(/-[a-z]/, function (s) s.slice(1).toUpperCase()), 
    300300 
    301     currentURL: function () 
    302       content.document.location.href, 
     301    get currentURL() content.document.location.href, 
    303302 
    304303    download: function (url, filepath, ext, title, postData) { 
     
    696695    get title () undefined, 
    697696 
    698     get isValid () /^http:\/\/(tw|es|de|www)\.nicovideo\.jp\/watch\//.test(buffer.URL), 
     697    get isValid () /^http:\/\/(tw|es|de|www)\.nicovideo\.jp\/watch\//.test(U.currentURL), 
    699698 
    700699    get volume () undefined, 
     
    992991    get totalTime () parseInt(this.player.getDuration()), 
    993992 
    994     get isValid () buffer.URL.match(/^http:\/\/(?:[^.]+\.)?youtube\.com\/watch/), 
     993    get isValid () U.currentURL.match(/^http:\/\/(?:[^.]+\.)?youtube\.com\/watch/), 
    995994 
    996995    get volume () parseInt(this.player.getVolume()), 
     
    10011000 
    10021001      U.httpRequest( 
    1003         buffer.URL, 
     1002        U.currentURL, 
    10041003        null, 
    10051004        function (xhr) { 
    10061005          let [, t] = xhr.responseText.match(/swfHTML.*&t=([^&]+)/); 
    1007           let id = YouTubePlayer.getIDfromURL(buffer.URL); 
     1006          let id = YouTubePlayer.getIDfromURL(U.currentURL); 
    10081007          let url = "http://youtube.com/get_video?video_id=" + id + "&t=" + decodeURIComponent(t); 
    10091008          U.download(url, filepath, '.flv', self.title); 
     
    10841083 
    10851084    get cachedInfo () { 
    1086       let url = U.currentURL(); 
     1085      let url = U.currentURL; 
    10871086      if (this.__info_cache.url != url) 
    10881087        this.__info_cache = {url: url}; 
     
    11091108 
    11101109    get id () 
    1111       let (m = U.currentURL().match(/\/watch\/([a-z\d]+)/)) 
     1110      let (m = U.currentURL.match(/\/watch\/([a-z\d]+)/)) 
    11121111        (m && m[1]), 
    11131112 
     
    11481147 
    11491148      function IDsFromAPI () { 
    1150         if (self.__rid_last_url == U.currentURL()) 
     1149        if (self.__rid_last_url == U.currentURL) 
    11511150          return self.__rid_cache || []; 
    11521151 
     
    11741173          } 
    11751174 
    1176           self.__rid_last_url = U.currentURL(); 
     1175          self.__rid_last_url = U.currentURL; 
    11771176          self.__rid_cache = videos; 
    11781177        } catch (e) { 
     
    12581257      let self = this; 
    12591258 
    1260       let watchURL = buffer.URL; 
     1259      let watchURL = U.currentURL; 
    12611260      let [,id] = watchURL.match(/watch\/(.+)$/); 
    12621261      let apiURL = 'http://www.nicovideo.jp/api/getflv?v=' + id; 
     
    14671466      U.xpathGet('//div[@class="title"]').textContent, 
    14681467 
    1469     get isValid () buffer.URL.match(/^http:\/\/(www\.)?vimeo\.com\/(channels\/(hd)?#)?\d+$/), 
     1468    get isValid () U.currentURL.match(/^http:\/\/(www\.)?vimeo\.com\/(channels\/(hd)?#)?\d+$/), 
    14701469 
    14711470    // XXX setVolume は実際には存在しない?