wikimedia-gadgets / twinkle

The English Wikipedia twinkle javascript helper
http://en.wikipedia.org/wiki/Wikipedia:Twinkle
Other
138 stars 152 forks source link

G13 tagging #175

Closed Technical-13 closed 11 years ago

Technical-13 commented 11 years ago

The G13 tagging option should only be available on pages that have an {{AFC submission|...}} template or are in [[WT:Articles for creation/...]] (or the WP: project space). Also, it should only be available for articles that haven't been edited in six months. Finally, if while you are working on this you could have Twinkle add the timestamp of the last edit in the template call, that would allow for an upcoming modification in the {{db-g13}} template to work (just a little notifying div for the administrator telling them if the article was eligible at the time of tagging and if it wasn't if it is now). So, what I'm asking on this is for it to tag G13s as {{db-g13|ts=(timestamp)}}. Thanks.

atlight commented 11 years ago

Twinkle doesn't know the page wikitext when the speedy dialog opens. Apart from that the rest seems do-able.

Technical-13 commented 11 years ago

https://en.wikipedia.org/w/api.php?action=query&titles=' + mw.config.get( 'wgPageName' ) + '&prop=templates&tltemplates=Template:AFC_submission would tell it if the template was on the page without getting the wikitext. (I think)

atlight commented 11 years ago

That would delay the loading of the Twinkle dialog box.

I think I've told you this before, but I assume that Twinkle users have a certain amount of intelligence. If they are unsure whether a page meets the CSD criteria, they should read the policy - there is even a link at the bottom of the CSD dialog box. In fact, they really should have read the policy before starting to use Twinkle. Twinkle is no here to babysit users.

As for your other comment about adding the timestamp, that is more easily done. At present, though, the G13 template (as displayed on the template page) is just showing an empty red box in the middle. I wonder if that will be seen when it is transcluded?

Technical-13 commented 11 years ago

Sounds like you have only part of the:

/* Show hidden items that have class="sysop-show" START */
div.sysop-show, p.sysop-show { 
  display: block !important;
}
span.sysop-show, small.sysop-show { 
  display: inline !important;
}
table.sysop-show { 
  display: table !important;
}
li.sysop-show{
  display: list-item !important;
}
/* Show hidden items that have class="sysop-show". END */

Set up. All of it shows properly for me...

atlight commented 11 years ago

Maybe because I just fixed the template? :)

atlight commented 11 years ago

Hm, I see. I have replied at the template talk page.

It will take a bit more work to add this feature to Twinkle and I am quite short on time right now, so I would not be averse to a pull request being submitted for this feature.

Technical-13 commented 11 years ago

Myself and [[User:Sphilbrick]] were seeing it all correctly before your "fix" @atlight which is why I'm thinking that you may be missing part of the code or have something "overriding" it someplace else.

Technical-13 commented 11 years ago

Please see http://en.wikipedia.org/wiki/Wikipedia_talk:Criteria_for_speedy_deletion#A_query_about_G13_template as Twinkle is the last major tool that hasn't added this yet. Thanks!

atlight commented 11 years ago

My comment above still applies:

It will take a bit more work to add this feature to Twinkle and I am quite short on time right now, so I would not be averse to a pull request being submitted for this feature.

I might (if I'm lucky) have time next week, but since you're a JavaScript coder yourself, couldn't you contribute a patch in the meantime?

Technical-13 commented 11 years ago

@mc10 is https://github.com/azatoth/twinkle/blob/master/modules/twinklespeedy.js#L1367 the timestamp of the last edit before the tagging? Doesn't that need to come from the API? I've been trying to dig through the code to find where it is stored... Found:

kevinji commented 11 years ago

Shoot my bad, I misread the documentation and thought it was the date of the edit. Let me reopen this.

Technical-13 commented 11 years ago

https://bugzilla.wikimedia.org/show_bug.cgi?id=19276 or https://bugzilla.wikimedia.org/show_bug.cgi?id=54619 might simplify this...

kevinji commented 11 years ago

Better? (Those Bugzilla bugs would be very helpful if resolved, but as they are not, we cannot currently rely on them.)

kevinji commented 11 years ago

Hmm, testing shows that the datetime is wrong. I'm completely confused.

EDIT: Ohh, touched is actually not the last edit date; it's the last time the page has been purged/reloaded by the server. I guess I'll have to use the lastrevid and make another API call to retrieve the date.

Technical-13 commented 11 years ago

Looks right to me? Try importing my "admin eye.js" to your common.js... importScript( 'User:Technical 13/Scripts/admin eye.js" );// [[User:Technical 13/Scripts/admin eye.js]] then bypass... Once you do that, look at your diff and in the dropdown that "Move" is hiding in (if you are using Vector), you'll see O.o --- click that and look at template. ;)

Ahh.. Yes.. I see now. You can still use my script, but it probably won't help you in this case. :tongue:

kevinji commented 11 years ago

There we go, this should actually work. I also squashed the previous changes together to combine the commits.