Team:OUC-China/js/jquery.oucext.js

// This file adds external functions to jQuery 2.1.4. // All codes are licensed to WinUP Software and you have no permission to use it only if for acedemic researches. // Make sure that you imported this file after markdown.js if you want to use $.createElement. (function ($) {

   $.getUrlParam = function (name) {
       var r = window.location.search.substr(1).match(new RegExp("(^|&)" + name + "=([^&]*)(&|$)"));
       if (r != null) return unescape(r[2]);
       return null;
   }

})(jQuery);

(function ($) {

   $.createElement = function (content) {
       var converter = new Markdown.Converter();
       var parts = content.split('exec::split');
       for (var i = 0; i < parts.length; i++) {
           var html = converter.makeHtml(parts[i]);
           parts[i] = html;
if (i % 2 == 0) parts[i] = '
' + parts[i] + '
'; else parts[i] = '
' + parts[i] + '
';
       }
       return parts.join();
   }

})(jQuery);