Site Notice

hello, world

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

From Project-EPB Commons
([InPageEdit] 没有编辑摘要)
m ([InPageEdit] 没有编辑摘要)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
ssi_modal.show({
+
(function () {
  title: '关于InPageEdit',
+
  ssi_modal.show({
  className: 'in-page-edit-about in-page-edit',
+
    title: '关于InPageEdit',
  fitScreen: true,
+
    className: 'in-page-edit-about in-page-edit',
  fixedHeight: true,
+
    fitScreen: true,
  content: '<div id="placeholder" class="ipe-progress" style="margin: calc(30% - 1em) auto;"><div class="ipe-progress-bar"></div></div><section style="display:none"></section>'
+
    fixedHeight: true,
});
+
    content: '<div id="placeholder" class="ipe-progress" style="margin: calc(30% - 1em) auto;"><div class="ipe-progress-bar"></div></div><section style="display:none"></section>',
$.ajax({
+
    buttons: [{ label: '', className: 'hideBtn' }],
  url: 'https://common.wjghj.cn/api.php',
+
    onShow: function () {
  dataType: 'jsonp',
+
      $('.in-page-edit-about .hideBtn').remove();
  type: 'post',
+
      $.ajax({
  data: {
+
        url: 'https://common.wjghj.cn/api.php',
    page: 'InPageEdit-v2',
+
        dataType: 'jsonp',
    action: 'parse',
+
        type: 'post',
    prop: 'text',
+
        data: {
    format: 'json'
+
          page: 'InPageEdit-v2',
  },
+
          action: 'parse',
  success: function (data) {
+
          prop: 'text',
    var info = data.parse.text['*'];
+
          format: 'json'
    $('.in-page-edit-about #placeholder').addClass('done').fadeOut(800);
+
        },
    $('.in-page-edit-about section').html(info).delay(800).fadeIn(400);
+
        success: function (data) {
    $('.in-page-edit-about section a[href^="/"]').each(function () {
+
          var info = data.parse.text['*'];
      $(this).attr('href', 'https://common.wjghj.cn' + $(this).attr('href'));
+
          $('.in-page-edit-about #placeholder').addClass('done').fadeOut(800);
    });
+
          $('.in-page-edit-about section').html(info).delay(800).fadeIn(400);
    $('.in-page-edit-about section img[src^="/"]').each(function () {
+
          $('.in-page-edit-about section a[href^="/"]').each(function () {
      var $this = $(this),
+
            $(this).attr('href', 'https://common.wjghj.cn' + $(this).attr('href'));
        src = 'https://common.wjghj.cn' + $this.attr('src') + '?_random=' + Math.random();
+
          });
      $this.attr({
+
          $('.in-page-edit-about section img[src^="/"]').each(function () {
        src: src,
+
            var $this = $(this),
        srcset: ''
+
              src = 'https://common.wjghj.cn' + $this.attr('src') + '?_random=' + Math.random();
 +
            $this.attr({
 +
              src: src,
 +
              srcset: ''
 +
            });
 +
          });
 +
        }
 
       });
 
       });
     });
+
     }
   }
+
   });
});
+
})();

Latest revision as of 02:30, 21 March 2020

(function () {
  ssi_modal.show({
    title: '关于InPageEdit',
    className: 'in-page-edit-about in-page-edit',
    fitScreen: true,
    fixedHeight: true,
    content: '<div id="placeholder" class="ipe-progress" style="margin: calc(30% - 1em) auto;"><div class="ipe-progress-bar"></div></div><section style="display:none"></section>',
    buttons: [{ label: '', className: 'hideBtn' }],
    onShow: function () {
      $('.in-page-edit-about .hideBtn').remove();
      $.ajax({
        url: 'https://common.wjghj.cn/api.php',
        dataType: 'jsonp',
        type: 'post',
        data: {
          page: 'InPageEdit-v2',
          action: 'parse',
          prop: 'text',
          format: 'json'
        },
        success: function (data) {
          var info = data.parse.text['*'];
          $('.in-page-edit-about #placeholder').addClass('done').fadeOut(800);
          $('.in-page-edit-about section').html(info).delay(800).fadeIn(400);
          $('.in-page-edit-about section a[href^="/"]').each(function () {
            $(this).attr('href', 'https://common.wjghj.cn' + $(this).attr('href'));
          });
          $('.in-page-edit-about section img[src^="/"]').each(function () {
            var $this = $(this),
              src = 'https://common.wjghj.cn' + $this.attr('src') + '?_random=' + Math.random();
            $this.attr({
              src: src,
              srcset: ''
            });
          });
        }
      });
    }
  });
})();