Site Notice

hello, world

MediaWiki:Gadget-WikiForum/theme.default.js

From Project-EPB Commons
< MediaWiki:Gadget-WikiForum
Revision as of 20:56, 28 December 2020 by 机智的小鱼君 (talk | contribs) ([InPageEdit] 没有编辑摘要)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Invoke this: https://common.wjghj.cn/

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/**
 * @name WikiForum.theme.default
 * @author 机智的小鱼君 <[email protected]>
 * @description Provide a front-end structured discussion page with JavaScript.
 *              Similar to Community Feed and support wikitext.
 *
 * @license MIT
 * @url https://github.com/Wjghj-Project/Gadget-WikiForum
 */

/******/ (function() { // webpackBootstrap
/*!**********************************!*\
  !*** ./theme/default/default.js ***!
  \**********************************/
/**
 * @function theme 主题函数
 * @param {Object} ctx
 * @param {Function} next
 */
mw.hook('WikiForum.theme').add(function (next) {
  var forumContainer = function forumContainer(ctx) {
    return $('<div>', {
      "class": 'wiki-forum'
    });
  };

  var firstThread = function firstThread(ctx) {
    return $('<div>', {
      "class": 'forum-thread forum-first'
    }).append($('<div>', {
      "class": 'forum-before'
    }).append($('<h3>', {
      "class": 'forum-title',
      text: ctx.title
    }), $('<div>', {
      "class": 'forum-user'
    }).append($('<span>', {
      "class": 'forum-user-link'
    }).append($('<a>', {
      text: ctx.meta.userAuthor,
      href: mw.util.getUrl('User:' + ctx.meta.userAuthor)
    })))), $('<div>', {
      "class": 'forum-content',
      html: ctx.content
    }), $('<div>', {
      "class": 'forum-after'
    }).append($('<i>', {
      "class": 'post-date',
      text: new Date(ctx.meta.timePublish).toLocaleString()
    })), ctx.fn.newThreadArea);
  };

  var normalThread = function normalThread(ctx) {
    return $('<div>', {
      "class": 'forum-thread'
    }).append($('<div>', {
      "class": 'forum-before'
    }).append($('<div>', {
      "class": 'forum-user'
    }).append($('<span>', {
      "class": 'forum-user-link'
    }).append($('<a>', {
      text: ctx.meta.userAuthor,
      href: mw.util.getUrl('User:' + ctx.meta.userAuthor)
    })))), $('<div>', {
      "class": 'forum-content',
      html: ctx.content
    }), $('<div>', {
      "class": 'forum-after'
    }).append($('<i>', {
      "class": 'post-date',
      text: new Date(ctx.meta.timePublish).toLocaleString()
    }), ctx.fn.newReplyArea));
  };

  next && next({
    forumContainer: forumContainer,
    firstThread: firstThread,
    normalThread: normalThread
  });
});
/******/ })()
;
//# sourceMappingURL=WikiForum.theme.default.js.map