Changes

Jump to: navigation, search

Learning Collaborative Development Lab Fall 2008 Results

1,035 bytes added, 21:10, 11 September 2008
Pastebin command added
}
})
----
[http://matrix.senecac.on.ca/~jwboston/ubiquity/ pastebin]<br />
by [http://jamesboston.ca James Boston]<br />
 
Send highlighted text to pastebin<br />
'''Usage''': pastebin (code)<br />
CmdUtils.CreateCommand({
name: "pastebin",
takes: {"your code": noun_arb_text},
preview: function( pblock, theCode ) {
pblock.innerHTML = "Will paste: " + theCode.text;
},
execute: function( theCode ) {
var baseUrl = "http://pastebin.mozilla.org";
// var params = Utils.paramsToString({code2: theCode.text, parent_pid: ""});
var params = {
format: "text",
poster: "ubiquity",
expiry: "m",
code2: theCode.text,
paste: "Send"
};
jQuery.post( baseUrl, params, function(html) {
var re = /dl=(.+?)"/;
var pid = re.exec(html);
if (pid) {
displayMessage(pid[1]);
Utils.openUrlInBrowser("http://pastebin.mozilla.org/"+pid[1]);
}
else {
displayMessage("Failure!");
}
});
}
})
<br>
noun_type_city = new CmdUtils.NounType( "City",
["Abidjan","Abu Dhabi","Adana","Addis AbabaAddisAbaba","Adelaide *","Aden","Aklavik","Aleutian","Alexandria","Algiers","Amsterdam","Anadyr","Anchorage","Ankara","Antananarivo","Antwerp","Asuncion *","Athens","Atlanta","Auckland *","Aveiro","Baghdad","Bamako","Bandar Seri Begawan","Bangkok","Bangui","Banjul","Barcelona","Barranquilla","Beijing","Beirut","Belgrade","Belize City","Berlin","Blantyre","Bogota","Bologna","Bombay - Mumbai","Brasilia","Bratislava","Brazzaville","Bridgetown","Brisbane","Brussels","Bucharest","Budapest","Buenos Aires","Bujumbura","Cairo","Calcutta","Calgary","Cali","Cape Town","Caracas","Cebu","Chicago","Christchurch","Colombo","Conakry","Copenhagen","Cotonou","Dakar","Dallas","Darwin","Delhi","Detroit","Dhaka","Djibouti","Dover","Dubai","Dublin","Dusseldorf","Edmonton","Fairbanks","Florence","Fort de France","Frankfurt","Freetown","Gaborone","Geneva","Gibraltar","Scotland","GMT","Guatemala City","Guayaquil","Hamilton","Harare","Havana","Helsinki","Hobart","Hong Kong","Honolulu","Indianapolis","Ipswich","Islamabad","Istanbul","Jakarta","Jerusalem","Johannesburg","Kabul","Kaduna","Kahira","Kamchatka","Kano","Karachi","Kathmandu","Kiev","Kigali","Kingston","Kinshasa","Kobe","Kosice","Kuala Lumpur","Kuwait City","Kyoto","La Paz","Lagos","Libreville","Lima","Limon","Lisbon","Lome","London","Los Angeles","Lubumbashi","Luxembourg","Madrid","Manama","Manila","Maracaibo","Maseru","Mayaguez","Mbabane","Medan","Medellin","Melbourne *","Mexico City","Milan","Mogadishu","Mombasa","Monrovia","Monte Carlo","Montevideo","Montreal","Morgantown","Moscow","Mumbai - Bombay","Munich","Murmansk","Muscat","N'Djamena","Nagasaki","Nagoya","Nairobi","Naples","Nassau","New Hebrides","New York City","Newfoundland","Niamey","Nice","Nicosia","Nome","Nottingham","Nouakchott","Nuk","Odessa","Oran","Osaka","Oslo","Ottawa","Ouagadougou","Oulu","Oxford","Palma","Panjim","Paramaribo","Paris","Peking","Perth","Phoenix","Ponce","Port Louis","Port Moresby","Port of Spain","Prague","Praia","Puntarenas","Quebec","Quito","Rangoon","Reykjavik","Riga","Rio de Janeiro","Riyadh","Rome","Saigon","Saint Petersburg - Leningrad","Salt Lake City","Salzburg","San Francisco","San Jose","San Juan","Santa Cruz de Tenerife","Santiago *","Santo Domingo","Sao Paulo","Sapporo","Sarajevo","Seattle","Seoul","Shanghai","Singapore","Sofia","Stockholm","Stuttgart","Surabaya","Suva","Sydney *","Taipei","Tallinn","Tampere","Tashkent","Tegucigalpa","Tehran","Tel Aviv","Tokyo","Toronto","Tripoli","Tunis","Turin","Ulanbatar","Valletta","Vancouver","Vatican","Venice","Victoria Falls","Vienna","Vientiane","Vladimir","Vladivostok","Warsaw","Washington DC","Wellington","Winnipeg","Yalta","Zagreb","Zaragoza","Zurich"]
);

Navigation menu