Discussion MediaWiki:Gadget-TargetedTranslations.js
Installation[modifier le wikicode]
I don't think this gadget will be able to work here unless the translationtargetstar
and translationtargetstarchecked
CSS classes from en:Mediawiki:Common.css and the newNode
function from en:Mediawiki:Common.js are also imported. --Yair rand 23 février 2011 à 10:41 (UTC)
- Thanks a lot. JackPotte ($♠) 23 février 2011 à 19:05 (UTC)
Bug[modifier le wikicode]
La fonction apparait dans tout menu déroulant : synonymes, dérivés… JackPotte ($♠) 25 février 2011 à 20:16 (UTC)
- Changing
for (var i=0; i<tables.length; i++) { if (tables[i].className == 'translations') {
- to
function checkIsTransTable(node) { while(node.className != "boite") { node = node.parentNode; } while(node && node.nodeName.substr(0,1) != "H") { node = node.previousSibling; } return /Traductions/.test(node.innerHTML) } for (var i=0; i<tables.length; i++) { if (tables[i].className == 'translations' && checkIsTransTable(tables[i])) {
- would fix it, I think. --Yair rand 27 février 2011 à 17:53 (UTC)
- Perfectly, however the other gadget editor.js supprimé pour laisser place à une nouvelle version — Automatik (discussion) 21 août 2014 à 12:19 (UTC) also do it and doesn't have these lines… JackPotte ($♠) 27 février 2011 à 19:37 (UTC)
- The same function could work. Editor.js also has a
for (var i=0; i<tables.length; i++)
followed by an if statement checking if it's a translation table, near the bottom ofTranslationsAdders
. If thecheckIsTransTable
function was also copied there and the if bit also had&& checkIsTransTable(tables[i])
added to it, it could work. --Yair rand 27 février 2011 à 23:41 (UTC)
- The same function could work. Editor.js also has a
- Perfectly, however the other gadget editor.js supprimé pour laisser place à une nouvelle version — Automatik (discussion) 21 août 2014 à 12:19 (UTC) also do it and doesn't have these lines… JackPotte ($♠) 27 février 2011 à 19:37 (UTC)