Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
Luke Posted October 14, 2006 Posted October 14, 2006 It's nice that IPS has decided to optimize the code to bring the file size down on the javascript files. But often modding involves trying to figure out how certain features work so a mod can be made. Can you guys please provide a "full-jscripts" folder with the un-optimized code to make it easier to read for developers? The "jscripts" directory would be for loading it on the forum, and the "full-jscripts" folder could be just there for development purposes.If you guys could do this that would be awesome :)
Antony Posted October 15, 2006 Posted October 15, 2006 Perhaps the full-jscripts directory could come as part of a development pack rather than being in a release?
Luke Posted October 15, 2006 Posted October 15, 2006 Something like that. I would be glad to get anything, as long as it remained up to date with the releases.
TestingSomething Posted October 15, 2006 Posted October 15, 2006 Luke, you should not be allowed to post here until you finish your report center. lol
Luke Posted October 15, 2006 Posted October 15, 2006 Hey I'm working on it :P....I actually need this for another mod... We'll... did need... I was too determined to find out what I needed to... top secret mod :D...
TestingSomething Posted October 15, 2006 Posted October 15, 2006 I may try to get you to do some custom mods for me. I really have forgotten what all mods I've wanted in the past, there have been so many. One mod in particular I am not so sure you could do and it would be so huge I would maybe not evenw ant to know what it would cost. lol But one mod in particular i will geta quote from you soon hopefully.Anyway can't wait to see what mod you're referring to and also report center. Hoping it will work for gallery and blogs both. I THINK you were always planning on it working for those, along with board of course.Sorry, I have gone beyond off-topic. lol
.Wolf Posted October 23, 2006 Posted October 23, 2006 I would also like to know this. It is almost impossible to edit them in there optimized state.
Will L. Posted October 23, 2006 Posted October 23, 2006 +1I also like how Matt and bfarber has optimized JS files
Jaggi Posted October 24, 2006 Posted October 24, 2006 well i just decided to look @ the js files and thought came across my mind was WTF!!! i have a ajax mod on my site and made use of ipb_topic.js but at the moment it just looks like one long mess, none of its spaced out and pretty impossible to read or make sense of and totally confused. I'm not a javascript buff or anything so was removing all whitespace a way of optimizing it or summit cus atm i'm pretty confused :P.
ellawella Posted October 24, 2006 Posted October 24, 2006 IMO, this has got to go. It's impossible to mod a script that just consists of a one long line.
Michael Posted October 24, 2006 Posted October 24, 2006 How big of a resource saving is this, considering that typically these files are cached anyway? I try to avoid editing these files typically, but sometimes you need to, and it's pretty much impossible now.
Mat Barrie Posted October 24, 2006 Posted October 24, 2006 well i just decided to look @ the js files and thought came across my mind was WTF!!! i have a ajax mod on my site and made use of ipb_topic.js but at the moment it just looks like one long mess, none of its spaced out and pretty impossible to read or make sense of and totally confused. I'm not a javascript buff or anything so was removing all whitespace a way of optimizing it or summit cus atm i'm pretty confused :P .You could load it into Visual Studio or something similar and whack the "Reformat document" (Ctrl+K,Ctrl+D in VS) function, that should set it out the way you want :)Now if it were anything like the way Google optimises their scripts, yeech.
.Wolf Posted October 24, 2006 Posted October 24, 2006 I tried the reformat document thing with my editor but its still quite jumbled.
.KX Posted October 24, 2006 Posted October 24, 2006 How exactly did they 'optimize' the javascript anyway? Just wondering.
bfarber Posted October 24, 2006 Posted October 24, 2006 It's optimized by removing all unnecessary comments, line breaks, and whitespace.If you are adding a function to the js file, why not just add it on a new line? It won't interfer with the existing js, and unlike php where you have an opening and closing tag, the entire js file is parsed.
.KX Posted October 24, 2006 Posted October 24, 2006 Ah I figured you would have removed the comments and line breaks but wouldn't removing all the whitespace mean it was all clumped up? Like in a big splodgy pile? :lol:
Michael Posted October 24, 2006 Posted October 24, 2006 It's optimized by removing all unnecessary comments, line breaks, and whitespace.What if part of your mod requires you to edit part of an existing javascript function?
backdream Posted October 24, 2006 Posted October 24, 2006 +1.I must modify JS file when add some features to my forum.
Luke Posted October 24, 2006 Posted October 24, 2006 The idea behind doing this is it makes the js files smaller, which means the client (browser) has less to download. It does have a rather decent effect on your site... I've already done it on 2.1...So I don't mind that it's optimized. That's actually a very good thing. But what I would like to see is a sub-folder that contains all the same files, just un-optimized. And what would be really neat is if you included a program to do the optimization for you, or a link to a site that does or something. That way when a mod does require you to edit the js files you can do something like:Step 1) Copy /jscripts/full/ipb_global.js to /jscripts/ipb_global.jsStep 2-5) Modification stepsStep 6) Run /jscripts/optimize.php?ipb_global.jsSomething like that would be really neat, as long as optimize.php works :)
Tim Dorr Posted October 24, 2006 Posted October 24, 2006 It's optimized by removing all unnecessary comments, line breaks, and whitespace.If you are adding a function to the js file, why not just add it on a new line? It won't interfer with the existing js, and unlike php where you have an opening and closing tag, the entire js file is parsed.What if you're trying to figure out what a particular JS call does?
ZuCruTrooper2 Posted October 24, 2006 Posted October 24, 2006 ...or what if you're looking for inspiration...Big +1 here...
Management Matt Posted October 24, 2006 Management Posted October 24, 2006 IPB 2.2.0 RC 2 (and future releases) contain a directory called "Development" which contains "javascript_uncompressed".
Alex Posted October 24, 2006 Posted October 24, 2006 Yay thanks, i was editing the profile_portal.js so I could add a new tab (One that was part of profile.php) and it was pretty hard to find it.Cant wait for RC2 now :)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.