|
|
Line 50: |
Line 50: |
| | | |
| // End of mapkey functions | | // End of mapkey functions |
− |
| |
− | // Start of Flowplayer code
| |
− |
| |
− | $('div.flowplayer').each(function ()
| |
− | {
| |
− | playist_obj=eval('{['+urldecode($(this).attr('playlist').split(","))+']}');
| |
− |
| |
− | $(this).flowplayer('/extensions/WikiMediaPlayer/flowplayer/flowplayer-3.0.1.swf',
| |
− | {
| |
− | playlist: playist_obj
| |
− | }
| |
− | );
| |
− | });
| |
− |
| |
− | // End of Flowplayer code
| |
− |
| |
| | | |
| // End of functions | | // End of functions |
| }); | | }); |
− |
| |
− | function urldecode( str ) {
| |
− | // http://kevin.vanzonneveld.net
| |
− | // + original by: Philip Peterson
| |
− |
| |
− | var histogram = {};
| |
− | var ret = str.toString();
| |
− |
| |
− | var replacer = function(search, replace, str) {
| |
− | var tmp_arr = [];
| |
− | tmp_arr = str.split(search);
| |
− | return tmp_arr.join(replace);
| |
− | };
| |
− |
| |
− | // The histogram is identical to the one in urlencode.
| |
− | histogram["'"] = '%27';
| |
− | histogram['('] = '%28';
| |
− | histogram[')'] = '%29';
| |
− | histogram['*'] = '%2A';
| |
− | histogram['~'] = '%7E';
| |
− | histogram['!'] = '%21';
| |
− | histogram['%20'] = '+';
| |
− |
| |
− | for (replace in histogram) {
| |
− | search = histogram[replace]; // Switch order when decoding
| |
− | ret = replacer(search, replace, ret) // Custom replace. No regexing
| |
− | }
| |
− |
| |
− | // End with decodeURIComponent, which most resembles PHP's encoding functions
| |
− | ret = decodeURIComponent(ret);
| |
− |
| |
− | return ret;
| |
− | }
| |
Revision as of 20:52, 27 January 2009
Sorry you do not have permissions to view this page.