G13 tagging #175

Closed
Technical-13 opened this Issue Sep 6, 2013 · 16 comments

Projects

None yet

3 participants

@Technical-13

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
Collaborator

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

@Technical-13

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
Collaborator

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

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
Collaborator

Maybe because I just fixed the template? :)

@atlight
Collaborator

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

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

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
Collaborator

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?

@mc10 mc10 added a commit that closed this issue Sep 26, 2013
@mc10 mc10 Add timestamp parameter to g13 (fixes #175)
Minor style changes for consistency
14dada3
@mc10 mc10 closed this in 14dada3 Sep 26, 2013
@Technical-13

@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:

  • var touched = $(xmlDoc).find('page').attr('touched');
  • var starttimestamp = $(xmlDoc).find('page').attr('starttimestamp');
  • ctx.lastEditTime = $(xml).find('page').attr('touched'); That seem to be the correct value, but I was having difficulty finding the global variable for that.
@mc10
Collaborator

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

@mc10 mc10 reopened this Sep 26, 2013
@mc10 mc10 added a commit that closed this issue Sep 26, 2013
@mc10 mc10 Use the last-revision date/time (should actually fix #175)
Add getLastEditTime() to the API of Morebits.wiki.page

Passing the pageobj seems overkill though (as we're using it only
for G13), but I don't see a better solution
140c534
@mc10 mc10 closed this in 140c534 Sep 26, 2013
@mc10
Collaborator

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

@mc10
Collaborator

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.

@mc10 mc10 reopened this Sep 26, 2013
@Technical-13

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. 👅

@mc10 mc10 added a commit that closed this issue Sep 26, 2013
@mc10 mc10 Add timestamp parameter to G13 (fixes #175)
Add getCurrentID() to the API of Morebits.wiki.page

Minor style changes for consistency, expand jshint.json

Passing the pageobj seems overkill though (as we're using it only
for G13), but I don't see a better solution
34fa873
@mc10 mc10 closed this in 34fa873 Sep 26, 2013
@mc10
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment