Grab the latest version of prototype.js!

Today I wandered around the prototype svn brower and found some updates committed about a week ago. I ultra compared it with my 2-week-old version.

Prototype is starting to play with XPath. getElementByClassName() has been optimized by first trying the XPath approach and using classical iteration instead of Ruby-like Enumerable methods.

Sadly, the file size is almost 64KB now. JQuery and mootools are much smaller!

I’ve written up a short python script to grab the latest version of prototype.js. If you are not a Ruby on Rails fan and don’t have its build system, my getPrototype.py is the right thing for you!

 

# -*- coding: utf-8 -*-
# getPrototype.py
# Written by Arrix
import urllib2
import re
def download(partName):
    if partName != 'Rakefile':
        url = 'http://dev.rubyonrails.org/browser/spinoffs/prototype/src/%s?format=raw' % partName
    else:
        url = 'http://dev.rubyonrails.org/browser/spinoffs/prototype/Rakefile?format=raw'
    print 'downloading %s from %s' % (partName, url)
    f = urllib2.urlopen(url)
    txt = f.read()
    f.close()
    print 'ok'
    return txt
    
def setupProxy():    #the proxy server
    proxy = urllib2.ProxyHandler({'http': 'http://proxyserver:port'})
    opener = urllib2.build_opener(proxy)
    urllib2.install_opener(opener)
if __name__ == '__main__':
    setupProxy() #comment this out if no proxy is needed
    txt = download('prototype.js')
    
    def include(m):
        fileList = m.group(1).split(',')
        ret = ''
        for f in fileList:
            ret += download(f.strip(" '"))
            ret += '\n'
        return ret
    
    txt = re.sub(r"<%=\s+include\s+(.*?)\s+%>", include, txt)
    
    rake = download('Rakefile');
    version = re.search(r"PROTOTYPE_VERSION\s*=\s*'(.*?)'", rake).group(1)
    prototype = txt.replace('<%= PROTOTYPE_VERSION %>', version)
    file = open('prototype.js', 'w');
    file.write(prototype)
    file.close();
    print 'done! File written to prototype.js'
Advertisements
This entry was posted in Web. Bookmark the permalink.

5 Responses to Grab the latest version of prototype.js!

  1. Unknown says:

    wow gold!All wow gold US Server 24.99$/1000G on sell! Cheap wow gold,wow gold,wow gold,Buy Cheapest/Safe/Fast WoW US EU wow gold Power leveling wow gold from the time you wWorld of Warcraft gold ordered!

    wow power leveling wow power leveling power leveling wow power leveling wow powerleveling wow power levelingcheap wow power leveling wow power leveling buy wow power leveling wow power leveling buy power leveling wow power leveling cheap power leveling wow power leveling wow power leveling wow power leveling wow powerleveling wow power leveling power leveling wow power leveling wow powerleveling wow power leveling buy rolex cheap rolex wow gold wow gold wow gold wow gold -210089755161147

  2. Unknown says:


    信是個富有挑戰的工作,忙碌、刺激、激情。最后的結局總是有人哭,有人笑。在徵信社工作的幾年時間里,我感悟到很多生活的無奈與殘酷。閑暇時我去中古车市
    场,感覺工作太緊張,放松一下而已,不是純粹的為了淘二手车。私家偵探也就是徵信工作人員似乎是個很酷的詞,但是如果誰需要私家偵探來幫忙的話,他(她)
    的婚姻也許已經亮起了紅燈。每天陪著星際客戶喝著咖啡,似乎是一件很爽的事,可是她們的眼淚比咖啡要苦的多。常常聽他們說嘈雜的燈光音響麻痹著他們的神
    經,讓他們過著醉生夢死的生活。其實,誰不渴望幸福美滿的愛情。沒有團體制服不了那些玩弄生活、玩弄感情的人,于是,徵信社應運而生。這不知道是人們的福
    音還是不幸,希望天下的每一個人都歡樂著、幸福著。坐月子是女人一生的大事,女人可以为了襁褓中的婴儿放弃一直引用的红酒而吃月子餐,这时候的女人是幸福
    而伟大的。有人歡喜有人優,有人狂笑有人大哭,我不想看到女人太多的眼淚,辭職后,我做了一位安靜、平和的室內設計師。虽然上下班没有了车接车送,但我租
    车怡然自得。偶爾和Fake
    Rolex Watch, Breitling
    Replica Watch, Best
    replica watches, Omega
    Replica Watches ecosway的朋友小聚,很愜意

  3. hggg says:

    Many World of Warcraft players try to play the game on their own before making the decision to buy wow gold.wow power leveling,wow power leveling,wow power leveling,wow power leveling,World of warcraft Power Leveling,World of warcraft Power Leveling,ffxi gil,ffxi gil,ffxi gil,ffxi gil,final fantasy xi gil,welcome to the cheapfinal fantasy xi gil,final fantasy xi gil,final fantasy xi gil,guildwars gold,guildwars gold,guild wars gold,guild wars gold,FFXI Gil,final fantasy gil,everquest plat,eq2 plat,eq2 gold,everquest platinum,rs gold,silkroad gold,Chinese Tea,Green Tea,Childrens Clothes,Childrens clothing,Baby Clothing,Baby Clothes,newborn clothes,infant clothes,boys clothes,boys clothing,girls clothing,girls clothes,baby boy clothes,jewelry store,flashlight,promotional products,promotional items,Dog Collar,Dog carrier,Dog Clothes,WOW goldis earned through doing things like killing enemies c3v6g7or

  4. Unknown says:

    Hi,Do you have used LCDs, used flat screens and secondhand LCDs? Please go here:www.sstar-hk.com(Southern Stars).We are constantly buying re-usable LCD panels and working for LCD recycling.The re-usable panels go through strictly designed process of categorizing, checking, testing, repairing and refurbishing before they are re-used to make remanufactured LCD displays and TV sets.Due to our recent breakthrough in testing and repairing technology of LCD, we can improve the value for your LCD panels.
    Contact Us
    E-mail:sstar@netvigator.com
    website:www.sstar-hk.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s