Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted October 14, 200618 yr 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 :)
October 15, 200618 yr Perhaps the full-jscripts directory could come as part of a development pack rather than being in a release?
October 15, 200618 yr Something like that. I would be glad to get anything, as long as it remained up to date with the releases.
October 15, 200618 yr Luke, you should not be allowed to post here until you finish your report center. lol
October 15, 200618 yr 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...
October 15, 200618 yr 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
October 23, 200618 yr I would also like to know this. It is almost impossible to edit them in there optimized state.
October 24, 200618 yr 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.
October 24, 200618 yr IMO, this has got to go. It's impossible to mod a script that just consists of a one long line.
October 24, 200618 yr 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.
October 24, 200618 yr 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.
October 24, 200618 yr I tried the reformat document thing with my editor but its still quite jumbled.
October 24, 200618 yr 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.
October 24, 200618 yr 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:
October 24, 200618 yr 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?
October 24, 200618 yr 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 :)
October 24, 200618 yr 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?
October 24, 200618 yr Management IPB 2.2.0 RC 2 (and future releases) contain a directory called "Development" which contains "javascript_uncompressed".
October 24, 200618 yr 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 :)
Archived
This topic is now archived and is closed to further replies.