Site Notice

hello, world

Difference between revisions of "MediaWiki:Js-InPageEdit-v2.js"

From Project-EPB Commons
([InPageEdit] 没有编辑摘要)
 
(402 intermediate revisions by the same user not shown)
Line 1: Line 1:
/**
+
mw.loader.load('https://cdn.jsdelivr.net/gh/dragon-fish/inpageedit-v2@master/script.min.js');
*『Wjghj Project Static』
+
$(window).load(function(){
* This _JavaScript_ code is from https://common.wjghj.cn
+
   ssi_modal.notify('confirm',{
* CC BY-NC-SA
+
     title: 'Update your Source',
**/
+
     content: 'Thank you for using InPageEdit-v2. You are using static source host by Wjghj Proj. server. Our server is under attack by web bot. You should modify the resource call address to the following address:<div style="clear:both"></div><textarea readonly>mw.loader.load(\'https://cdn.jsdelivr.net/gh/dragon-fish/inpageedit-v2@master/script.min.js\');</textarea><div style="clear:both"></div>Future updates will also use the new address above.<br/>Dragon Fish | Apr. 15, 2020'
// Modal plugin
 
mw.loader.load('https://common.wjghj.cn/js/SsiModal');
 
 
 
// Main
 
function InPageEdit(option) {
 
 
 
  // Variables
 
  var editPage,
 
      editSection,
 
      editReversion,
 
      editSummary,
 
      jsonPreview,
 
      jsonPost;
 
  if (option.page === undefined || option.page === '') {editPage = wgPageName} else {editPage = option.page}
 
     
 
  // Show modal
 
   ssi_modal.show({
 
    className: 'ipe',
 
     title: '<span style="font-style:normal;">123',
 
     content: '<textarea id="editArea" style="max-width:100%;min-width:100%;min-height:350px"></textarea><label>摘要:<input id="editSummary"/></label><br/><label><input id="editMinor" type="checkbox" style="margin-left:0;margin-right:4px"/>小编辑</label>',
 
    keepContent: false,
 
    beforeClose: function(modal) {
 
      ssi_modal.confirm({
 
        position: 'top center',
 
        content: '确定要关闭窗口吗',
 
        okBtn: {
 
          className: 'btn btn-primary',
 
          label: '确定'
 
        },
 
        cancelBtn: {
 
          className: 'btn btn-danger',
 
          label: '取消'
 
        }
 
      },
 
      function(result) {
 
        if (result === true) {
 
          modal.options.keepContent = false;
 
          modal.options.beforeClose = '';
 
          modal.close();
 
          ssi_modal.notify('error', {
 
            position: 'right top',
 
            content: "编辑被取消。"
 
          })
 
        }
 
      });
 
      return false;
 
    },
 
    buttons: [{
 
      label: '预览',
 
      method: requestPreview
 
    },
 
    {
 
      label: '发布',
 
      method: function(modal) {
 
        ssi_modal.confirm({
 
          content: '是否发布',
 
          okButton: {
 
            label: '确定'
 
          },
 
          cancelButton: {
 
            label: '取消'
 
          },
 
        },
 
        function(result) {
 
          if (result) {
 
            postArticle();
 
          }
 
        })
 
      }
 
    }]
 
 
   });
 
   });
 
+
});
  function requestPreview(){
 
    ssi_modal.show({content:'preview'})
 
  }
 
}
 

Latest revision as of 10:50, 15 April 2020

mw.loader.load('https://cdn.jsdelivr.net/gh/dragon-fish/inpageedit-v2@master/script.min.js');
$(window).load(function(){
  ssi_modal.notify('confirm',{
    title: 'Update your Source',
    content: 'Thank you for using InPageEdit-v2. You are using static source host by Wjghj Proj. server. Our server is under attack by web bot. You should modify the resource call address to the following address:<div style="clear:both"></div><textarea readonly>mw.loader.load(\'https://cdn.jsdelivr.net/gh/dragon-fish/inpageedit-v2@master/script.min.js\');</textarea><div style="clear:both"></div>Future updates will also use the new address above.<br/>Dragon Fish | Apr. 15, 2020'
  });
});