Closed (won't fix)
Project:
jQuery UI
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2009 at 10:47 UTC
Updated:
13 Jul 2010 at 15:06 UTC
Jump to comment: Most recent file
Hi,
I tried by specifying compression type for jquery_ui_add function as specified in the README.txt file.
But it is always using minified format. Actually this optional parameter support is not exist in the code. Please check the attached patch to fix this bug.
cheers,
Prajwala
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | jquery_ui_external_compress_type_bug.patch | 1.49 KB | pflame |
| jquery_ui_external_compress_type_bug.patch | 1.48 KB | pflame |
Comments
Comment #1
pflame commentedComment #2
SamPolenta commentedBug verified. I would add that this part of the readme file:
also doesn't work. There is simply no code in the module for this.
Comment #3
pflame commentedYes you are correct. The correct path is Administer >> Site Configuration >> Jquery Update. There is a mistake in the readme file
Comment #4
psynaptic commentedUsing the jQuery Update settings page at Administer >> Site Configuration >> jQuery Update (?q=admin/settings/jquery_update) does change the file included via jquery_ui_add(). I have tested it and it works fine.
I don't see anything about specifying the compression type in README.txt for jquery_ui. I think just having the global setting under jquery_update is enough. Is there any reason I have missed that we might want to add the compression via the function call?
Edit: Ahh.. I see it now... It was removed from the dev version. Here are the diffs showing that is the case:
The top paragraph still seems valid:
5. If desired, configure the module at Administer >> Site configuration >>jQuery UI. Here you may select which level of compression the jQuery library
should use. It defaults to 'minified' compression, which strips comments and
white space.
Should this be added back (obviously with the path change mentioned in #3)?
Comment #5
pflame commentedI feel it is better to add. Is the patch about explicitly specifying compression type is tested?
Comment #6
psynaptic commented@prajwala: Do you intend to use different compression levels for different jQuery UI files? I would think having a setting in the admin is enough to turn minification on or off depending on if you're developing the site or not. This would be enough for me and I'm guessing others but if you have a use case that might help.
If you want to get this patch committed you will need to follow Drupal's coding standards.
Comment #7
pflame commentedIt will be useful while developing, because I don't want to use any compression while I am developing, I can able to debug easily. So I prefer using no compression while development. of course I can able to change it using jquery_update admin settings page, but that will effect all pages. This is written in the README.txt file. I am using 6.x-1.2 version of jquery_ui.
This point is specified in README.txt but not implemented it.
I added new patch by following drupal coding standards.
Thanks,
Prajwala
Comment #8
sunI'm not sure this makes sense in any way.
Anyway, I'll reconsider later.
Constants are all uppercase in Drupal.
Please wrap this (entire) ternary operator condition in braces, clarifying where the condition starts and ends, i.e. after the equal sign and before the semicolon.
Comment #9
avpadernoI thought that the ternary operator has precedence over the assignment operator; if that is the case, the parenthesis are not necessary (or sun is talking of something else, and I have not understood what he meant).
Comment #10
avpadernoI don't think that allowing any third-party modules to decide the type of compression is something that makes sense; it should be the administrator users to decide the used compression, basing on the files they copied.
Comment #11
sunI agree, this does not make sense. You can override the compression type via the administrative settings or by overriding the variable via settings.php on your development/staging site.
Also, README.txt no longer states that one is able to do this anyway - which means this option was removed as part of another issue (probably bug report).
Comment #12
pflame commentedThe above message is there in the README.txt 1.3 version. Now it is changed. So this patch may not be useful now. We can change these settings through jquery_update configuration page, so no need to create another configuration for the jquery_ui to change the level of jquery compression.
Comment #13
avpadernoComment #14
slybud commentedJust in case someone wonders :
variable_get('jquery_update_compression_type', 'mini');
=> for the jquery_update module version I am using (2.0-alpha1), this variable will never take the 'mini' value, only 'min'
So testing the value 'mini' for the variable $compression may be useless