Line 3:
Line 3:
|Description = Script for preview links on hover
|Description = Script for preview links on hover
|Author = [[user:fngplg|fngplg]]
|Author = [[user:fngplg|fngplg]]
−
|Updated = {{#dpl:suppresserrors=1|namespace=MediaWiki|titlematch={{#titleparts:{{PAGENAME}}|1|0}}/%|ordermethod=lastedit|addeditdate=1|userdateformat=Y.m.d|mode=userformat|replaceintitle=(.*?/),|format=,%DATE% (%TITLE%),<br>}}<!--{{Updated}}-->
+
|Updated = {{#dpl:suppresserrors=1|namespace=MediaWiki|titleregexp =^ {{#titleparts:{{PAGENAME}}|1|0}}( /+{{!}}\.) |ordermethod=lastedit|addeditdate=1|userdateformat=Y.m.d|mode=userformat|replaceintitle=(.*?/),|format=,%DATE% (%TITLE%),<br>}}<!--{{Updated}}-->
−
|Code = {{#dpl:suppresserrors=1|namespace=MediaWiki|titlematch={{#titleparts:{{PAGENAME}}|1|0}}/%|ordermethod=titlewithoutnamespace,lastedit|addeditdate=1|userdateformat=Y.m.d|mode=userformat|replaceintitle=(.*?/),|format=,[[%PAGE%¦%TITLE%]] (%DATE%),<br>}}<!--[[MediaWiki:{{BASEPAGENAME}}/code.js|code.js]]<br>[[MediaWiki:{{BASEPAGENAME}}/code.css|code.css]]<br>[[MediaWiki:{{BASEPAGENAME}}/newpages.js|newpages.js]]-->
+
|Code = {{#dpl:suppresserrors=1|namespace=MediaWiki|titleregexp =^ {{#titleparts:{{PAGENAME}}|1|0}}( /+{{!}}\.) |ordermethod=titlewithoutnamespace,lastedit|addeditdate=1|userdateformat=Y.m.d|mode=userformat|replaceintitle=(.*?/),|format=,[[%PAGE%¦%TITLE%]] (%DATE%),<br>}}<!--[[MediaWiki:{{BASEPAGENAME}}/code.js|code.js]]<br>[[MediaWiki:{{BASEPAGENAME}}/code.css|code.css]]<br>[[MediaWiki:{{BASEPAGENAME}}/newpages.js|newpages.js]]-->
|Skins = omb
|Skins = omb
|Languages = {{l|en|ru}}
|Languages = {{l|en|ru}}
Revision as of 15:18, 24 March 2018
LinkPreview
Description
Script for preview links on hover
Updated
2012.02.26 (Right-codeeditor) 2016.01.12 (code.js) 2016.01.29 (code.min.js) 2016.01.29 (code.js) 2016.01.29 (module.custom.js) 2016.01.29 (module.stopblocked.js) 2016.01.29 (module.nonuser.js) 2016.01.29 (module.userfilter.js) 2016.01.29 (module.isblocked.js) 2016.01.29 (module.implode.js) 2016.01.29 (module.inactive.js) 2016.01.29 (module.metafilter.js) 2016.07.04 (Hlist.css) 2016.09.01 (TZclock.css) 2016.10.10 (style-dark.css) 2016.10.10 (style-light.css) 2017.04.16 (DisableAccessKeys.js) 2017.04.21 (SakuraStorm.css) 2017.06.16 (code.js) 2017.06.16 (code.js) 2017.06.19 (code.js) 2017.08.03 (Custom-abusefilter-warning-i18nedit) 2017.08.09 (Tag-non-script-i18n-edit) 2017.08.09 (Tag-non-script-i18n-edit-description) 2017.09.17 (code.js) 2017.09.17 (PurgeBlogs.js) 2017.09.22 (code.2.js) 2017.10.20 (Custom-FandomSidebar.json) 2017.11.01 (beta.js) 2017.11.14 (en) 2017.11.14 (de) 2017.11.14 (be) 2017.11.14 (ja) 2017.11.14 (uk) 2017.11.14 (ru) 2017.11.14 (es) 2017.11.14 (fr) 2017.11.14 (pt-br) 2017.11.14 (pl) 2017.11.17 (Lang) 2017.11.17 (szl) 2017.11.18 (zh) 2017.11.20 (Custom-documentation-visibility) 2017.11.20 (Custom-documentation-heading) 2017.11.20 (pl) 2017.11.20 (pl) 2017.11.20 (vi) 2017.11.20 (vi) 2017.11.20 (vi) 2017.11.21 (it) 2017.11.21 (pt) 2017.11.21 (ace) 2017.11.21 (kbd-cyrl) 2017.11.21 (kbd) 2017.11.21 (af) 2017.11.21 (ak) 2017.11.21 (gsw) 2017.11.21 (ar) 2017.11.21 (am) 2017.11.21 (anp) 2017.11.21 (ab) 2017.11.21 (arc) 2017.11.21 (roa-rup) 2017.11.21 (frp) 2017.11.21 (rup) 2017.11.21 (ast) 2017.11.21 (gn) 2017.11.21 (av) 2017.11.21 (ay) 2017.11.21 (az) 2017.11.21 (sma) 2017.11.21 (ang) 2017.11.21 (bqi) 2017.11.21 (bcc) 2017.11.21 (bn) 2017.11.21 (bm) 2017.11.21 (bjn) 2017.11.21 (map-bms) 2017.11.21 (ba) 2017.11.21 (bg) 2017.11.21 (nan) 2017.11.21 (be-tarask) 2017.11.21 (be-x-old) 2017.11.21 (bho) 2017.11.21 (bcl) 2017.11.21 (bh) 2017.11.21 (bi) 2017.11.21 (bpy) 2017.11.21 (bs) 2017.11.21 (bo) 2017.11.21 (brh) 2017.11.21 (br) 2017.11.21 (bxr) 2017.11.21 (cps) 2017.11.21 (ca) 2017.11.21 (ceb) 2017.11.21 (cbk-zam) 2017.11.21 (ch) 2017.11.21 (ny) 2017.11.21 (cho) 2017.11.21 (sei) 2017.11.21 (co) 2017.11.21 (cy) 2017.11.21 (cv) 2017.11.21 (cs) 2017.11.21 (da) 2017.11.21 (nv) 2017.11.21 (dv) 2017.11.21 (dsb) 2017.11.21 (dtp) 2017.11.21 (mh) 2017.11.21 (et) 2017.11.21 (el) 2017.11.21 (eml) 2017.11.21 (grc) 2017.11.21 (myv) 2017.11.21 (eo) 2017.11.21 (ext) 2017.11.21 (eu) 2017.11.21 (ee) 2017.11.21 (fa) 2017.11.21 (fy) 2017.11.21 (fo) 2017.11.21 (ff) 2017.11.21 (fur) 2017.11.21 (gv) 2017.11.21 (ga) 2017.11.21 (gag) 2017.11.21 (gl) 2017.11.21 (gd) 2017.11.21 (aln) 2017.11.21 (glk) 2017.11.21 (ki) 2017.11.21 (gan) 2017.11.21 (gan-hans) 2017.11.21 (gan-hant) 2017.11.21 (gu) 2017.11.21 (got) 2017.11.21 (inh) 2017.11.21 (hak) 2017.11.21 (ko) 2017.11.21 (ko-kp) 2017.11.21 (ha) 2017.11.21 (haw) 2017.11.21 (hy) 2017.11.21 (hif) 2017.11.21 (hif-latn) 2017.11.21 (hi) 2017.11.21 (ho) 2017.11.21 (hsb) 2017.11.21 (io) 2017.11.21 (hr) 2017.11.21 (ig) 2017.11.21 (ilo) 2017.11.21 (hil) 2017.11.21 (id) 2017.11.21 (ia) 2017.11.21 (iu) 2017.11.21 (ike-cans) 2017.11.21 (ike-latn) 2017.11.21 (ik) 2017.11.21 (he) 2017.11.21 (os) 2017.11.21 (is) 2017.11.21 (dz) 2017.11.21 (jv) 2017.11.21 (jut) 2017.11.21 (kl) 2017.11.21 (kn) 2017.11.21 (kr) 2017.11.21 (pam) 2017.11.21 (ka) 2017.11.21 (csb) 2017.11.21 (ks-deva) 2017.11.21 (ks) 2017.11.21 (ks-arab) 2017.11.21 (kw) 2017.11.21 (khw) 2017.11.21 (krj) 2017.11.21 (rw) 2017.11.21 (rn) 2017.11.21 (kiu) 2017.11.21 (sw) 2017.11.21 (kv) 2017.11.21 (koi) 2017.11.21 (avk) 2017.11.21 (kg) 2017.11.21 (ht) 2017.11.21 (kri) 2017.11.21 (ku) 2017.11.21 (ku-latn) 2017.11.21 (ku-arab) 2017.11.21 (kj) 2017.11.21 (ckb) 2017.11.21 (ky) 2017.11.21 (lad) 2017.11.21 (lbe) 2017.11.21 (ltg) 2017.11.21 (lo) 2017.11.21 (la) 2017.11.21 (lv) 2017.11.21 (lzz) 2017.11.21 (lez) 2017.11.21 (lb) 2017.11.21 (lt) 2017.11.21 (lij) 2017.11.21 (li) 2017.11.21 (ln) 2017.11.21 (lfn) 2017.11.21 (liv) 2017.11.21 (jbo) 2017.11.21 (lg) 2017.11.21 (lmo) 2017.11.21 (hu) 2017.11.21 (ary) 2017.11.21 (vmf) 2017.11.21 (mai) 2017.11.21 (mk) 2017.11.21 (mg) 2017.11.21 (ml) 2017.11.21 (mt) 2017.11.21 (arn) 2017.11.21 (mr) 2017.11.21 (mhr) 2017.11.21 (xmf) 2017.11.21 (mrj) 2017.11.21 (mzn) 2017.11.21 (ty) 2017.11.21 (mi) 2017.11.21 (ms) 2017.11.21 (min) 2017.11.21 (arz) 2017.11.21 (cdo) 2017.11.21 (mdf) 2017.11.21 (mn) 2017.11.21 (mo) 2017.11.21 (my) 2017.11.21 (mus) 2017.11.21 (na) 2017.11.21 (nah) 2017.11.21 (nl) 2017.11.21 (nl-informal) 2017.11.21 (nds-nl) 2017.11.21 (ne) 2017.11.21 (new) 2017.11.21 (cr) 2017.11.21 (niu) 2017.11.21 (frr) 2017.11.21 (nap) 2017.11.21 (no) 2017.11.21 (nn) 2017.11.21 (nrm) 2017.11.21 (nov) 2017.11.21 (ce) 2017.11.21 (ii) 2017.11.21 (oc) 2017.11.21 (uz) 2017.11.21 (or) 2017.11.21 (ng) 2017.11.21 (om) 2017.11.21 (hz) 2017.11.21 (as) 2017.11.21 (pag) 2017.11.21 (pa) 2017.11.21 (pnb) 2017.11.21 (pap) 2017.11.21 (jam) 2017.11.21 (pi) 2017.11.21 (ps) 2017.11.21 (pcd) 2017.11.21 (pms) 2017.11.21 (pih) 2017.11.21 (nds) 2017.11.21 (pnt) 2017.11.21 (prg) 2017.11.21 (krc) 2017.11.21 (aa) 2017.11.21 (kaa) 2017.11.21 (kk-kz) 2017.11.21 (kk) 2017.11.21 (kk-cyrl) 2017.11.21 (kk-arab) 2017.11.21 (kk-latn) 2017.11.21 (kk-tr) 2017.11.21 (kk-cn) 2017.11.21 (crh) 2017.11.21 (crh-latn) 2017.11.21 (crh-cyrl) 2017.11.21 (rmy) 2017.11.21 (ksh) 2017.11.21 (ro) 2017.11.21 (rm) 2017.11.21 (rgn) 2017.11.21 (qu) 2017.11.21 (qug) 2017.11.21 (sm) 2017.11.21 (rue) 2017.11.21 (sa) 2017.11.21 (sc) 2017.11.21 (sah) 2017.11.21 (sdc) 2017.11.21 (se) 2017.11.21 (sg) 2017.11.21 (sco) 2017.11.21 (sli) 2017.11.21 (stq) 2017.11.21 (st) 2017.11.21 (nso) 2017.11.21 (tn) 2017.11.21 (sn) 2017.11.21 (scn) 2017.11.21 (sq) 2017.11.21 (si) 2017.11.21 (sd) 2017.11.21 (sk) 2017.11.21 (sl) 2017.11.21 (cu) 2017.11.21 (srn) 2017.11.21 (so) 2017.11.21 (sr) 2017.11.21 (sr-el) 2017.11.21 (sr-ec) 2017.11.21 (sh) 2017.11.21 (fi) 2017.11.21 (sv) 2017.11.21 (su) 2017.11.21 (ss) 2017.11.21 (tl) 2017.11.21 (ta) 2017.11.21 (kab) 2017.11.22 (roa-tara) 2017.11.22 (rif) 2017.11.22 (shi) 2017.11.22 (shi-tfng) 2017.11.22 (shi-latn) 2017.11.22 (tt) 2017.11.22 (tt-cyrl) 2017.11.22 (tt-latn) 2017.11.22 (te) 2017.11.22 (tet) 2017.11.22 (ti) 2017.11.22 (th) 2017.11.22 (tg) 2017.11.22 (tyv) 2017.11.22 (tg-cyrl) 2017.11.22 (tpi) 2017.11.22 (tg-latn) 2017.11.22 (tly) 2017.11.22 (chr) 2017.11.22 (to) 2017.11.22 (chy) 2017.11.22 (tcy) 2017.11.22 (ve) 2017.11.22 (tum) 2017.11.22 (tr) 2017.11.22 (tk) 2017.11.22 (tw) 2017.11.22 (bug) 2017.11.22 (udm) 2017.11.22 (ur) 2017.11.22 (ug) 2017.11.22 (ug-arab) 2017.11.22 (ug-latn) 2017.11.22 (za) 2017.11.22 (vot) 2017.11.22 (fj) 2017.11.22 (vep) 2017.11.22 (val) 2017.11.22 (vec) 2017.11.22 (vls) 2017.11.22 (ruq-latn) 2017.11.22 (ruq) 2017.11.22 (ruq-cyrl) 2017.11.22 (fiu-vro) 2017.11.22 (vo) 2017.11.22 (vro) 2017.11.22 (wa) 2017.11.22 (lzh) 2017.11.22 (wo) 2017.11.22 (war) 2017.11.22 (wuu) 2017.11.22 (xal) 2017.11.22 (xh) 2017.11.22 (ts) 2017.11.22 (yo) 2017.11.22 (yi) 2017.11.22 (yue) 2017.11.22 (diq) 2017.11.22 (zea) 2017.11.22 (zh-hans) 2017.11.22 (zh-hant) 2017.11.22 (zh-cn) 2017.11.22 (zh-hk) 2017.11.22 (zh-mo) 2017.11.22 (zh-my) 2017.11.22 (zh-sg) 2017.11.22 (zh-tw) 2017.11.22 (zu) 2017.11.22 (bat-smg) 2017.11.22 (sgs) 2017.11.28 (code.es.js) 2017.12.02 (es6.js) 2017.12.05 (code.js) 2017.12.05 (code2.js) 2017.12.08 (Togglers.js) 2017.12.08 (beta.js) 2017.12.08 (code.js) 2017.12.08 (code.es.js) 2017.12.08 (code.js) 2017.12.08 (code.es.js) 2017.12.18 (code2.js) 2018.01.03 (it) 2018.01.03 (pt) 2018.01.03 (gl) 2018.01.03 (ca) 2018.01.03 (oc) 2018.01.03 (ro) 2018.01.03 (val) 2018.01.17 (demo.css) 2018.01.17 (demo.css) 2018.01.17 (demo.css) 2018.01.17 (List.css) 2018.01.27 (Babel.css) 2018.02.22 (code.es.js) 2018.02.22 (code-hu.js) 2018.02.22 (code.js) 2018.02.22 (code.js) 2018.03.18 (demo.js) 2018.06.01 (test.js) 2018.06.03 (Context-link.css) 2018.06.13 (Custom-less-header) 2018.06.13 (test.less) 2018.06.13 (test.css) 2018.06.18 (code.2.js) 2018.06.18 (code.2.js) 2018.06.18 (code.2.js) 2018.06.18 (code.2.js) 2018.06.24 (code.js) 2018.06.26 (code.js) 2018.06.26 (code.js) 2018.07.16 (code.js) 2018.07.16 (code.js) 2018.07.16 (black.js) 2018.07.21 (code.js) 2018.07.27 (LakeLinks.js) 2018.07.27 (LakeLinks.css) 2018.08.01 (Custom-FBWidget-config-page) 2018.08.03 (MastheadRightsBadge.css) 2018.08.04 (sr-ec) 2018.08.04 (be) 2018.08.11 (code.js) 2018.08.18 (service-worker.js) 2018.08.23 (uk) 2018.08.23 (code.js) 2018.08.23 (code.js) 2018.08.27 (code.2.js) 2018.09.01 (be) 2018.09.01 (ru) 2018.09.01 (uk) 2018.09.01 (pl) 2018.09.06 (Custom-DiscordBanner-id) 2018.09.10 (FatButton.css) 2018.09.25 (codeptbr.js) 2018.10.03 (es) 2018.10.04 (lua.js) 2018.10.04 (javascript.js) 2018.10.04 (css.js) 2018.10.04 (json.js) 2018.10.04 (plaintext.js) 2018.10.05 (actionscript.js) 2018.10.05 (ada.js) 2018.10.05 (apache.js) 2018.10.05 (applescript.js) 2018.10.05 (asciidoc.js) 2018.10.05 (bash.js) 2018.10.05 (basic.js) 2018.10.05 (brainfuck.js) 2018.10.05 (clojure-repl.js) 2018.10.05 (clojure.js) 2018.10.05 (cmake.js) 2018.10.05 (coffeescript.js) 2018.10.05 (cpp.js) 2018.10.05 (csp.js) 2018.10.05 (d.js) 2018.10.05 (dart.js) 2018.10.05 (diff.js) 2018.10.05 (django.js) 2018.10.05 (dockerfile.js) 2018.10.05 (erlang-repl.js) 2018.10.05 (excel.js) 2018.10.05 (fortran.js) 2018.10.05 (go.js) 2018.10.05 (gradle.js) 2018.10.05 (handlebars.js) 2018.10.05 (haskell.js) 2018.10.05 (htmlbars.js) 2018.10.05 (java.js) 2018.10.05 (julia-repl.js) 2018.10.05 (julia.js) 2018.10.05 (kotlin.js)
LinkPreview shows article preview on link hover. Inspired by mw:extension:Popups .
Installation
Template:Script Install/ImportJS
Settings
Available through window.pPreview
.
Create configuration object (do it at first)
window.pPreview = $.extend(true, window.pPreview, {RegExp: (window.pPreview || {}).RegExp || {} });
csize : 100 - cache size. Example: window.pPreview.csize = 100;
debug : false - debug mode, verbose output. Also available as &debug=1. Example: window.pPreview.debug = true;
defimage : - default image source (before article image loaded). Example: window.pPreview.defimage = 'https://wikia.nocookie.net/someimage' ;
noimage : - image-not-found source. Example: same as defimage.
delay : 100 - hover reaction delay. Example: window.pPreview.delay = 100;
dock : '#mw-content-text, #article-comments' - article container. Example: window.pPreview.dock = '#mw-content-text';
scale : {r: '?', t: '/scale-to-width-down/350?'} - replace r to t in the img src (vignette-based scaling). Use scale=false if no scaling nedeed. Example: window.pPreview.scale = {r: '?', t: '/scale-to-width-down/350?'};
tlen : 1000 - max text length. Example: window.pPreview.tlen = 1000;
wholepage : false - parse whole page instead of section 0. Also available as &wholepage=1. Example: window.pPreview.wholepage = true;
RegExp.iimages : [] - array of RegExp or plain text. Ignored images, will not be used to build preview. Example: window.pPreview.RegExp.iimages = [/myimage\.png/, new RegExp('myim.*'), 'some text'];
RegExp.ipages : [] - array of RegExp or plain text. Ignored pages, preview will not show up. Example: same as iimages.
RegExp.ilinks : [] - array of RegExp or plain text. Ignored links, will have not preview on it. Example: same as iimages.
RegExp.iclasses : [] - array of strings. Ignored classes, links with these classes will have not preview on it. window.pPreview.RegExp.iclasses = ['myclass1', 'myclass2'];
RegExp.iparents : ['[id^=flytabs]'] - array of strings (jQuery/DOM objects are permitted, but not tested). Ignored parent elements, children links of these elements will have not preview on it. By default, tabviews are ignored. window.pPreview.RegExp.iparents = ['.myclass', '#myid', 'div[data-ignore-me=1]'];
.
RegExp.onlyinclude : [] - array of strings (jQuery/DOM objects are permitted, but not tested). Selector to include. If selector found, then other content will be ignored. Example: window.pPreview.RegExp.onlyinclude = ['.myclass', '#myid', '[data-include-me=1]'];
Mega example
window.pPreview = $.extend(true, window.pPreview, {RegExp: (window.pPreview || {}).RegExp || {} });
window.pPreview.defimage = 'https://vignette.wikia.nocookie.net/borderlands/images/0/05/Ajax.gif/revision/latest/scale-to-width-down/350?cb=20170626182120&path-prefix=ru';
window.pPreview.noimage = 'https://vignette.wikia.nocookie.net/borderlands/images/f/f5/%D0%97%D0%B0%D0%B3%D0%BB%D1%83%D1%88%D0%BA%D0%B0.png/revision/latest/scale-to-width-down/200?cb=20160122074659&path-prefix=ru';
window.pPreview.tlen = 1000;
window.pPreview.RegExp.iparents = ['.myclass', '#myid', 'div[data-ignore-me=1]'];
Addons
newpages.js
adds preview button to Special:NewPages elements. Preview will shown up on the upper-left corner.