Latest Neocron News and Information

  • New test server patch #563 has been released to Vedeena

Difference between revisions of "Metadata:Mapping/Map.js"

From Neocron Wiki
Jump to: navigation, search
(Updates for autoplay)
(Brammers changed the content model of the page Metadata:Mapping/Map.js from "wikitext" to "JavaScript")
Tag: content model change
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* NC-Wiki Jquery File - Do not delete! */
+
/* NC-Wiki Jquery File - Do not delete! (c) 2017 - Tech Haven Network */
  
$kjq(document).ready(function($)
+
$(document).ready(function($)
 
{
 
{
 
// Add functions and stuff here
 
// Add functions and stuff here
Line 51: Line 51:
 
// 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
 
 
});
 
});
 
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;
 
}
 

Latest revision as of 23:35, 27 August 2017

Sorry you do not have permissions to view this page.