User talk:Essjay

Javascript js/css Refrencing between wiki
Hello again, this time it's about soemthing I'm trying to do with .js, and you seem to be the best around at that.

I started adding some .js and .css stuff for myself (thanks to what you have), so I tryed building a tool which would add stuff to the monobook.css and monobook.js on another wiki just by entering the subdomain name into the tool. I can't use the method used in the status changer because that requires js to already be located at the target wiki, and I tryed opening up another window using js to do that but neither of those methods worked. Now I attempted using AJAX, but it dosen't seem to work. So far what I've got testing out is at Anime:User:Dantman/wikiviewclone.js, is there anything that can be done for it? (you may need this in your monobook.js there for you to be able to test it. //If we are inside of the wikiview clone tool then add the .js to the load. if( window.location.href.match(/^^http:\/\/en.anime.wikia.com\/(wiki\/|index.php?title=)User:Dantman\/wikiviewclone.js/i) )	document.write(' '); Dantman (Talk) 06:01, 26 February 2007 (UTC)


 * Sadly, I'm not really much of a javascripter; Splarka is much better act the actual coding, so you might ask him for help with the debugging. I can tell you, however, that we have requested that the tech team make it possible to specify a "master" css/js that would work for you on all wikis. Until that time, what I have been doing is using a Firefox extension called Signature to store my CSS and JS, and then using the menu that produces to insert them onto the appropriate wiki. Though I haven't figured out how to make it work for CSS, there is a code you can put into your monobook.js that lets you include an external JS; I use it to automatically include my central monobook.js onto other wikis, which has the benefit that any change I make here is automatically carried over to the otheres. You can see the code at http://starter.wikia.com/wiki/User:Essjay/monobook.js. Essjay ( Talk )  05:09, 27 February 2007 (UTC)


 * Ya, saddly, I also have a feeling that I've run into another case of cross-site scripting. In other words, scripting which browsers have security to stop, so it may not actualy be possible. Right now it's just the .js and .css, but I suppose if It gets big I'll just build myself another pywikipedia bot. Ya, I found out about how to add .js from your scripts. As for .css it only takes a simple @include, take a look at w:c:naruto:User:Dantman/monobook.css which refrences my Anime:User:Dantman/monobook.css. I also use that trick in the Wikia Anime Project, basicly I have Anime:MediaWiki:Anime-Common.css, Anime:MediaWiki:Anime-Monobook.css, and Anime:MediaWiki:Anime-Monobook.js which every wiki in the project reference. Oh ya, there's also a reference from that global Anime-Common.css to a set of Userbox styles. It just means that coupled with my 3 bots for the project Anime:Project:Bots/AutoTemplate, Anime:Project:Bots/ImageMirror, and Anime:Project:Bots/UserBox all the wiki in the project can share the same important things. Also, if you take a look at my Anime:User:Dantman/monobook.js, then you'll notice a few additions I made to the code you use. Namely the ability to list a set of domains which sysop or statuschanger features should show up (Which allows you to reference your .js from anywhere without the wrong tabs showing up.) I also added a Wikia tab which allows you to switch over to a identical page on another wiki you list a domain for. (Like switching from viewing userpage on one wiki to another, it's also helpfull in the sense that you can go to one edit page for a monobook.css which has a reference to another, and then just click on a link to go to the edit page on another wiki to copy it over.) The proxycheck, and other IP only tools should also only show up on ip's not registered users. And I also added a link to a user's Editcount in both the user tab and in the toolbox. If you want to know where any of it is, I can tell you, but copying it directly wouldn't be a good idea because I moved a lot arround (my statuschanger (yet to be setup) has a tabmenu instead of links in the personal bar, and sysop menu stuff has been moved to the usermenu), and I removed a lot of stuff that I didn't want. Dantman (Talk) 06:21, 27 February 2007 (UTC)


 * Oh wow; I'll look into all of that as soon as I can! Essjay ( Talk )  06:24, 27 February 2007 (UTC)


 * Oh ya, one little trick. Since updating the .css in the project is a common habit, and opera is annoying with it's caching (It's hard to clean things out sometimes.) I keep the @import's outside of the nowiki and pre tags. The trick is that when you view a page referencing the main .css file normaly, it treats it as a link, so all it takes is to simply click on that link, and hit refresh while viewing the .css to clear out the old stuff. Without that tecnique I'd half to muddle through the source or worse, grab a link from the source, then copy text from there to. Dantman (Talk) 06:28, 27 February 2007 (UTC)