User talk:AT/WikiSwap

From Guild Wars Wiki
Jump to navigationJump to search

Amazing! a great manifestation to something I've asked for here. thanks. Foo 09:59, 6 September 2007 (UTC)

Glad you like it! I didn't realise anyone else was using it - I might be forced to fix the last few bugs now :( -- AT(talk | contribs) 16:32, 6 September 2007 (UTC)
*raises a hand* I'm using it too! - anja talk 16:37, 6 September 2007 (UTC)
Been using it since it was made. :) -- Gem (gem / talk) 16:41, 6 September 2007 (UTC)

Nice tool, thanks :) Biscuits User Biscuits sig.png 01:36, 9 September 2007 (UTC)

Sweet! I was trying to make one by using Greasemonkey a few months ago, but gave up because I'm a noob at javascript.Sparticuz 15:35, 18 September 2007 (UTC)

Just updated[edit]

You can now (hopefully) switch from things like Guild Wars Wiki:Policy to GuildWiki:Policy. Some things aren't doable though, due to naming differences (Guild Wars Wiki:Formatting and GuildWiki:Style and Formatting being one of the more annoying ones) It may not be working fully yet, so if you come accross any weird bugs or things just not working, please post the urls here so I can debug. -- AT(talk | contribs) 03:44, 19 September 2007 (UTC)

FYI, I'm using it too. Especially useful for switching between watchlists, hehe.
Just a question, is there any way to give the tab it's own keyboard shortcut? You know, like how you can press Alt + Shift + L to go to Watchlist, or Alt + Shift + R to check Recent Changes... perhaps something like Alt + Shift + Tab could switch between wikis, if it's possible. Would be awesome. :P --User Jioruji Derako logo.png Ĵĩôřũĵĩ Đēŗāķō.>.cнаt^ 09:22, 19 September 2007 (UTC)
That's a really good idea, and one I'll look into. If I can do it, I'll make it optional, as I think Alt+Shift+Tab is a binding used by some browsers. -- AT(talk | contribs) 13:48, 19 September 2007 (UTC)
Don't think it is, but Alt + Tab is a Windows binding for switching programs, so that's a no-go. I'm sure there's some random letter that'll work well though, just test them all on an open window in the Wiki to make sure they don't already do something. (Alt + S is Save Page, Alt + P is Preview, and Alt + V is Show Changes... I'll see if I can dig up more bindings.)
But good luck figuring out if it's possible to use bindings in the coding; I checked the page source, and I think the key bindings are built deeper into the system. Most I could find was how to change the messages when you hover over a tab. :P --User Jioruji Derako logo.png Ĵĩôřũĵĩ Đēŗāķō.>.cнаt^ 23:53, 19 September 2007 (UTC)
I was getting mixed up with Ctrl-shift-tab heh, it switches through tabs in FF. As for having alt-shift-tab, I'm beginning to think it's not doable; the best would be alt+shift+"/" or some such, via the accesskey variable in addPortletLink. I'm struggling to make that work though, so I'm going to go poke some people about it. -- AT(talk | contribs) 00:33, 20 September 2007 (UTC)
Alt + Shift + Backslash or something of the sort probably won't run into any issues, who knows. A good idea is, if you manage to figure out a way to code it, simply list off the coding and let people change the shortcut themselves (if the coding's simple enough in that area). That way, if someone runs into issues with that, they can simply change it or remove it entirely. --User Jioruji Derako logo.png Ĵĩôřũĵĩ Đēŗāķō.>.cнаt^ 00:36, 20 September 2007 (UTC)

Sortable tables bug[edit]

Hi AT and thanks for your good work which is greatly appreciated. I'm currently using your script with the latest version of Firefox under Linux and, for some reason, it crashes with all pages containing a "sortable table" when you perform a diff on them. This page or this one are loaded correctly until your script tries to add its "PortletLink" and then Firefox displays a white page. You're probably not responsible for this bug as the "sortable" script is known to be particulary dirty but I was wondering if you have an idea why your script makes it appear? Chriskang 09:34, 9 October 2007 (UTC)

I don't want to advertise my script here, but I made this for Gem as AT's worked not that good (also I want to mention, that WikiSwap is not that cleaner than the SortableTables script ;) ). See this page for more information. poke | talk 09:36, 9 October 2007 (UTC)
Thanks Poke. I'll give a try. Chriskang 09:41, 9 October 2007 (UTC)
I will definitely try and fix this in-between uni work, cheers for letting me know. I have a feeling it's a result of me trying to add access key support, so I'll roll back and see what happens.
Poke: Yeah, I know it's not the most elegant of implementations. But, I'd appreciate if you'd let me know specifics rather than "It's not that clean", that way I can at least improve it (and my general coding skills). -- AT(talk | contribs) 09:58, 9 October 2007 (UTC)
Just rolled back, seemed to fix it. Let me know if anything is still bugging. -- AT(talk | contribs) 10:04, 9 October 2007 (UTC)
Unclean elements are imo even those functions "which should be in wikibits.js" (importScript and addPortletLink) as they don't use valid JS (I'm a fan of valid code :P). This is also the problem of that SortableTables script, it uses elements which are not standardised so all browsers can interpret it as they want..
Another thing is that you use functions which splits the url whereas MediaWiki provides a lot information in given variables (such as page title, server name or namespace). poke | talk 10:13, 9 October 2007 (UTC)
I really, really wish I had known about wgTitle, wgCanonicalNamespace etc before I started. Oh well, live and learn heh. :( -- AT(talk | contribs) 10:20, 9 October 2007 (UTC)
Wow, watching you guys talk is like watching aliens conversing... I can't actually understand what you're saying, but it's not hard for me to know it's quite intelligent. :P
FYI, AT, the rollback has fixed all the problems for me; I actually hadn't realized I was having problems, I simply assumed the pages weren't loading correctly. Will the same issue be present and/or fixed on GuildWiki as well? I'll probably do a hard refresh there just to be sure.
And Poke, that GWWT coding is pretty impressive; I've got it up and running here, and it's already proving useful. Now I just need to figure out a way to get promoted to Admin, so I can try out the other features... --User Jioruji Derako logo.png Jïörüjï Ðērākō.>.cнаt^ 10:24, 9 October 2007 (UTC)
Fixed for me too. Thanks a lot AT. Chriskang 10:29, 9 October 2007 (UTC)

(Reset indent) AFAIK, poke is removing the sysop tools from GWWT soon. Only Gem used them and currently none of the sysops are even allowed to use those features. :-) -- CoRrRan (CoRrRan / talk) 11:10, 9 October 2007 (UTC)

Gah, quick! Someone make me an admin before it's too late! --User Jioruji Derako logo.png Jïörüjï Ðērākō.>.cнаt^ 02:56, 10 October 2007 (UTC)
It is just a list on the left side which you can use to one-click delete a page.. Nothing special. poke | talk 07:56, 10 October 2007 (UTC)
May not be too special for an admin, no... but for someone who generally don't have the ability to delete in the first place, it is special. :P --User Jioruji Derako logo.png Jïörüjï Ðērākō.>.cнаt^ 08:53, 10 October 2007 (UTC)

Wikipedia[edit]

Any chance of adding this to the mix? RT | Talk - A joyous wintersday to all 21:57, 26 December 2007 (UTC)

I'll whip up some custom code for it, but it won't go in the standard source. Will post it here when I'm done. -- AT(talk | contribs) 00:02, 27 December 2007 (UTC)
Done. Copy/Paste this into your monobook.js.
//WikiSwap -  with Wikipedia support for RT
function importScript(page, lang) {
     var url = wgScriptPath + '/index.php?title='
                            + encodeURIComponent(page.replace(' ','_'))
                            + '&action=raw&ctype=text/javascript&dontcountme=s';
     if (lang) url = 'http://' + lang + '.wikipedia.org' + url;
     var s = document.createElement('script');
     s.src = url;
     s.type='text/javascript';
     document.getElementsByTagName('head')[0].appendChild(s);
}

//WikiSwap Functions
importScript('User:AT/wikiswapfuncs.js');


// WikiSwap               
  function wikiSwap() {
    
    var url = new String();
    var urlSwitch = new String();
    var urlGW2 = "http://wiki.guildwars2.com/";
    var urlGW = "http://gw.gamewikis.org/" ;
    var urlGWW = "http://wiki.guildwars.com/" 
    var uri = new Object();
    var label = new String();
    var title = new String();
    getURL(uri);
    if (uri.thisSite == "GWW") {
      label = "Switch to GuildWiki";
      title = "GWiki";
      urlGW = urlGW + uri.pagename;
      if(uri.pagename.indexOf("Guild:") == -1) {
        addTab(urlGW, title, "ca-swap", label, "");
      }
      urlGW2 = urlGW2 + uri.pagename;
      addTab(urlGW2, "GW2W", "ca-swap2", "Switch to GW2W", "");
    }
    if (uri.thisSite == "GWIKI") { 
      label = "Switch to GWW";
      title = "GWW";
      urlGWW = urlGWW + uri.pagename;
      addTab(urlGWW, title, "ca-swap", label, "");
      urlGW2 = urlGW2 + uri.pagename;
      addTab(urlGW2, "GW2W", "ca-swap2", "Switch to GWW", "");
    }
    if (uri.thisSite == "GW2W") {
      urlGWW = urlGWW + uri.pagename;
      addTab(urlGWW, "GWW", "ca-swap", label, "");
      urlGW = urlGW + uri.pagename;
      addTab(urlGW, "GWiki", "ca-swap2", "Switch to GWiki", "");
    }
   var urlWP = "http://en.wikipedia.org/" + uri.pagename;
   addTab(urlWP, "WP", "ca-swap2", "Switch to Wikipedia", "");
  }

addOnloadHook(wikiSwap);

Lemme know if there's any problems -- AT(talk | contribs) 00:10, 27 December 2007 (UTC)

With a little tweaking, you could add about any website up there, couldn't you? Perhaps I'll fiddle around with it on my own, I wouldn't mind having PvXWiki up there too. :D I'd miss out on the automatic updating though, sadly... any plans to add that up to the standard one? --User Jioruji Derako logo.png Jïörüjï Ðērākō.>.cнаt^ 01:26, 27 December 2007 (UTC)
Pretty much, it's not too complicated. Just replace this section with whatever you want:
var urlRandomWiki = "http://randomwiki.com/" + uri.pagename;
addTab(urlRandomWiki, "RW", "ca-swap2", "Switch to Random Wiki", "");
As for adding it to the standard version, no plans, sorry. -- AT(talk | contribs) 02:08, 27 December 2007 (UTC)
I think I see how it works, now. addTab adds the tab itself, chooses the words on it, and the tooltip... hmm, nifty. I'll get tweaking and add it right in... I need to add the setup to my PvX profile too I think, so I can switch back. Thanks for the info AT. --User Jioruji Derako logo.png Jïörüjï Ðērākō.>.cнаt^ 03:43, 27 December 2007 (UTC)
Done and done. Only problem is I can't add the coding to my PvX page... most likely because it looks for your scripting, but it's not on PvX. Would it work if I copied the script from your page (user:AT/wikiswap.js), and put it on PvX Wiki (something like user:Jioruji_Derako/wikiswap.js)? If I switched all the directions to my own page in that instance, would it still work? Or, can the scripting be simply pasted right into my monobook.js right on PvX? Or does the scripting only work from your page? Apologies for the large number of questions, I'm too lazy to click bookmarks if I can have little tabs on everything I visit. (I also press Alt + Shift + L on non-wiki websites.) --User Jioruji Derako logo.png Jïörüjï Ðērākō.>.cнаt^ 04:02, 27 December 2007 (UTC)
Sorry for the late reply! If you've not already done so, I'd be happy to register on PvX and pop the .js into my userspace. -- AT(talk | contribs) 15:25, 30 December 2007 (UTC)
...Well that would work too, hehe. No, haven't done anything myself yet (been to busy with my own wiki now). --User Jioruji Derako logo.png Jïörüjï Ðērākō.>.cнаt^ 16:49, 30 December 2007 (UTC)
Done, should work with the above code. Not got time to test at the moment though, sorry. -- AT(talk | contribs) 17:39, 30 December 2007 (UTC)

wikipedia2[edit]

Hey AT, do you have a version of this ok wikipedia for switching between wikipedia, mediawiki etc? --LemmingUser Lemming64 sigicon.png 18:16, 12 November 2008 (UTC)

Even more general, very useful would be a template to generate links from any wiki. I myself, would like a link from any wikipedia article to the Google images search for the same title. (i.e. from http://en.wikipedia.org/wiki/Guild_Wars to http://images.google.com/images?q=Guild%20Wars). I guess it could be easily figured by any codesmith, but a clearer template would be great. Foo 17:26, 15 November 2008 (UTC)
I've improved wikiswap. Read the quick intro at User:AT/monobook.js for some new usages - you can implement both of the above suggestions with relative ease, but if you have any questions, I still check watchlists every now and then. -- AT(talk | contribs) 02:26, 18 November 2008 (UTC)