Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

feature request - javascript customization tool - SearchUnit - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
notnet
#1 Posted : Wednesday, February 24, 2016 3:09:11 PM
Rank: Member

Groups: Registered

Joined: 1/29/2016
Posts: 10
Hi, I'm not sure where the best place to make a feature request is, so I'll add it here.

It would be great to have some sort of javascript customization tool to cut down the file size by removing features not in use, as Bootstrap does. For example, I don't use previews, locations, security groups, autocomplete, etc. I could probably reduce the javascript size by quite a bit without code related to those. I do already minimize the file, which trims about 40%, but it's still larger than I'd like. I can make some changes myself, but that makes later upgrades more difficult.

If you do have advice for trimming unused features, that would be great too.

Thanks!
Jim
#2 Posted : Wednesday, February 24, 2016 8:14:16 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
Location: Canada
Hi, I'll record it as a feature request. You can save about 63KB by removing jQuery from our script, assuming you're referencing jQuery anyway.

It should be the first block, from

(function () {
var _KSQ =
....

to

......br) : 0); }; });
})();

you'll also need to call

KSQ = $;

Before our script is loaded.


If other people would like this facility it would be great if they would post here.

Thanks
Jim
-your feedback is helpful to other users, thank you!


notnet
#3 Posted : Wednesday, February 24, 2016 9:18:57 PM
Rank: Member

Groups: Registered

Joined: 1/29/2016
Posts: 10
Great, thanks! I thought that might be removable, but was concerned that your code might be referencing customizations in it. Is that not the case?

Have you tested the rest of the code with newer versions of jquery? It appears to be using 1.2.6, but I'm using 1.10.2.
Jim
#4 Posted : Wednesday, February 24, 2016 9:33:40 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
Location: Canada
Sorry I meant to write this too, you'll need to call

KSQ = $;

Before our script is loaded.

The only change we made was to the variable name ($), we rely on it being called KSQ to prevent collisions with external jQuery imports.

Sorry no we had no reason to test it against other versions so that hasn't been done, however my feeling would be that it will be fine - of course you'd need to verify that.

Jim
PS the only reason we used 1.2 was because it was smaller than newer versions.
-your feedback is helpful to other users, thank you!


Xtopher
#5 Posted : Thursday, February 25, 2016 4:40:52 PM
Rank: Member

Groups: Registered

Joined: 2/18/2016
Posts: 11
Voting up. I'd like that feature! Thx
notnet
#6 Posted : Monday, March 7, 2016 5:54:46 PM
Rank: Member

Groups: Registered

Joined: 1/29/2016
Posts: 10
FYI, I snipped out the built-in jQuery and relied on my existing 1.10.2 and it almost works. It fails in SearchUnit.js at line 1002 where it makes this call:
Code:
if(!sheet){
    var style=KSQ(document.createElement("style"))
        .attr(options)
        .appendTo("head")[0];
...

Newer jQuery throws an exception processing the "options" parameter.
I'll survive with the extra bloat for now. Thanks!
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.