var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); $k.fn.blockcode = function (config) { var obj = function (selector, config) { this.selector = selector; this.config = $.extendEx({}, this.defConfig, config); } obj.prototype.defConfig = { }; obj.prototype.blockcode = function () { var _obj = this; _obj.selector.addClass('kui-block-code'); var rows = _obj.selector.find('pre').html().split('\n'); var code = ''; $.each(rows, function (i, o) { code += '
  • ' + o.replace(/\t/g, '    ').replace(/ /g, ' ') + '
  • '; }) _obj.selector.find('pre')[0].outerHTML = '
      ' + code + '
    '; } var _obj = new obj($(this.jo), config || {}); _obj.blockcode(); return _obj; } //自动调用 $(function () { $.each($('.kui-block-code'), function (i, o) { $k(o).blockcode(); }); }); }