Latest Neocron News and Information
- New test server patch #774 has been released to Vedeena
Difference between revisions of "Metadata:Mapping/Map.js"
From Neocron Wiki
(Undo revision 11576 by - needs to be done via the playlist) |
(Updates for autoplay) |
||
| Line 55: | Line 55: | ||
$('div.flowplayer').each(function () | $('div.flowplayer').each(function () | ||
{ | { | ||
| − | + | playist_obj=eval('{['+urldecode($(this).attr('playlist').split(","))+']}'); | |
$(this).flowplayer('/extensions/WikiMediaPlayer/flowplayer/flowplayer-3.0.1.swf', | $(this).flowplayer('/extensions/WikiMediaPlayer/flowplayer/flowplayer-3.0.1.swf', | ||
{ | { | ||
| − | playlist: | + | playlist: playist_obj |
} | } | ||
); | ); | ||
| Line 69: | Line 69: | ||
// 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; | ||
| + | } | ||