பயனர்:Pitchaimuthu2050/js/mpmbookhiphen.js
குறிப்பு - சேமித்த பின்னர், நீங்கள் செய்த மாற்றங்களைக் காண்பதற்கு உங்கள் உலவியின் இடைமாற்று அகற்றப்பட வேண்டும்.
- மொஸில்லா பயர்பாக்ஸ் / சபாரி: Shift+Reload, அல்லது Ctrl-F5 அல்லது Ctrl-R (⌘-R Mac ல்)
- கூகிள் குரோம் Ctrl-Shift-R அழுத்தவும். (⌘-Shift-R Mac ல்) ;
- இண்டர்நெட் எக்ஸ்ப்ளோரர்: Ctrl-Refresh அல்லது Ctrl-F5 ஐ அழுத்தவும்.
- ஒபேரா: Tools → Preferences இல் இடைமாற்றை அகற்றவும்;
$(document).ready(function(){
$hp = $('<img src="https:////upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Eo_circle_deep-orange_white_letter-h.svg/55px-Eo_circle_deep-orange_white_letter-h.svg.png" decoding="async" width="21" height="21">')
$heading = $(".firstHeading").html()
$heading_sp = $heading.split('/')
$hp .click(function(){
$("#hwsMessage").html("Please wait, trying to add hwsPages")
//alert($heading)
//$(this).attr("disabled",true)
//$(this).prop("disabled",true)
//replaceContent("All is")
readContent_mpm($heading)
})
$heading_pnum = $heading_sp[($heading_sp.length-1)]
//alert ($heading_pnum)
if(isNaN($heading_pnum) === false){
$($hp).insertAfter(".firstHeading");
$("<span id=hwsMessage></span").insertAfter($hp)
}
var apihp = new mw.Api();
function readContent_mpm(heading) {
apihp.get({
//title: "பயனர்:Info-farmer/hwsPages",
//summary: 'Replacing through CustomEditTools',
origin: "*",
action: "parse",
//prop: "extracts",
page: "பயனர்:Info-farmer/hwsPages",
format: "json",
}).done(function (result, jqXHR) {
mw.log("Saved successfully");
//location.reload();
$html_loc = $.parseHTML( result.parse.text["*"] )
$content_loc = ""
if($html_loc[0].children.length > 0)
{
$content_loc = $html_loc[0].children[0].innerHTML
}
replaceContent_mpm(heading,$content_loc+heading)
$("#hwsMessage").html(heading+" is added to hwsPages")
$($hp).off("click");
});
}
function replaceContent_mpm(heading,content) {
apihp.postWithToken("edit", {
action: "edit",
title: "பயனர்:Info-farmer/hwsPages",
summary: heading+": hwsPages",
text: content
}).done(function (result, jqXHR) {
mw.log("Saved successfully");
//location.reload();
});
}
})