coolygreen — 2011-06-17T21:41:26-04:00 — #1
While minifying script files I need to prevent a .js file from it. The instructions ask me to put in the Handle name and not the filename. Can anyone please help me out?
(I did not know whether I should post it here or in WordPress section.)
anarch — 2011-06-18T07:54:45-04:00 — #2
Handles are abstract and typically only relevant to the OS's memory of which they're stored on
coolygreen — 2011-06-18T08:17:48-04:00 — #3
How does this reply help me? please do not put unclear and vague statements that do not help to solve the problem. It frustrates.:injured:
felgall — 2011-06-18T17:56:15-04:00 — #4
scallioxtx — 2011-06-18T18:52:34-04:00 — #5
I'm not 100% sure, but after browsing around a bit (esp http://codex.wordpress.org/Function_Reference/wp_enqueue_script) and checking wp-cycle.php (esp the line
wp_enqueue_script('cycle', WP_CONTENT_URL.'/plugins/wp-cycle/jquery.cycle.all.min.js', array('jquery'), '', true);), I think the handle you're looking for is 'cycle'
anarch — 2011-06-18T22:51:11-04:00 — #6
It helps you by letting you know that your question is as vague as the answer you've received. I've told you what a handle is and I've explained to you that JS isn't typically written with reference to handles by letting you know that OS's usually create the handles rather than scripts.
I may be wrong but i doubt "cycle" is the handle.
As an assembly programmer, what i know about handles tells me that what you're looking for is going to be a seemingly random hex string . i.e. "723FA1-3D4CBC-6FF23A-411DFA"
The handle will be stored in memory(RAM) on the wordpress server at the time of script execution. (Like I said before...)
Unless you have some other enlightening information to provide about exactly what you're trying to do or what you mean by "handle" than I doubt anyone will be able to help you much.
I believe the information you're looking for is probably the reference value of the script object.
If you're attempting to prevent access to a certain script you're going to be defeating yourself by creating the object within the script you want to block.
Otherwise you'll have to invoke an OS call along the lines of "CreateFile()" which will instantiate said "handle" in memory on the server.
Could you point me towards the directions you speak of?
coolygreen — 2011-06-19T05:42:43-04:00 — #7
What can I say? I am a newbie and have no idea what more to add. I had uploaded the message pic and the script in question. Looking at your replies it appears the programmer who created the minifying script is at fault. I think he should have given some sample of what he expects, then maybe you all could have helped.
scallioxtx — 2011-06-19T05:43:34-04:00 — #8
Just curious, have you tried 'cycle' ?
coolygreen — 2011-06-19T05:46:33-04:00 — #9
No. I think I should try contacting the author. I am scared of seeing unexpected behavior so I decided not to "try".
paul_wilkins — 2011-06-19T06:17:47-04:00 — #10
More context is required. Can you please show us more from where your instruction came from?
To ignore a script, just copy the handle (not the filename!) and put it in the 'Scripts to be ignored' box on a separate line.
scallioxtx — 2011-06-19T06:25:55-04:00 — #11
I just tried it on a fresh WP 3.1.3 install with Better WordPress Minify (I assume that's the one you're using) and WP-Cycle and I put the word 'cycle' in the text box 'Scripts to be ignored (not minified)' and that works as expected, see code below:
(check how "bwp-minify" is not in the second src)
coolygreen — 2011-06-19T06:37:22-04:00 — #12
Thanks for the input ScallioXTX. I will try and inform you of the result.
coolygreen — 2011-06-19T06:40:26-04:00 — #13
Thanks ScallioXTX. I will try and report back.
coolygreen — 2011-06-19T07:13:29-04:00 — #14
Sorry, it did not work. First I used the bottom code with wp-cycle and then both. Once I put the code and update, the code vanished from the window and the image rotator stopped.
see it here: Free Accident Insurance | Prevent Accidents, Injuries & Trauma
May be there are some other settings and/or conflicts on my site. But I have no idea
scallioxtx — 2011-06-19T07:57:17-04:00 — #15
Your code is still being minified. Did you use 'cycle' (~not~ 'wp-cycle'), and fill that in in the field 'Scripts to be ignored (not minified)' ?
(see attachment for my working settings)
And indeed it may be a conflict with some other script, but I can't see that from here ...
coolygreen — 2011-06-19T08:01:29-04:00 — #16
Sorry Sir, it does not work. The rotator is unoperative.
scallioxtx — 2011-06-19T08:27:19-04:00 — #17
I see, but it doesn't work because the page has an error:
jQuery is not defined (it says so in the JS console of chrome)
And that error is caused by the minify script not working. The JS url returns an HTTP 400 error, saying the request is not valid. So you don't get jQuery, and the plugin doesn't work because it's dependent on jQuery.
I had the same problem, and fixed by changing line 65 of wp-content/plugins/bwp-minify/min/config.php to:
$min_documentRoot = realpath(dirname(__FILE__).'/../../../..');
But at least what we set out for is working now: the js script is not minified, so we have established that it's handle is, indeed, 'cycle'
coolygreen — 2011-06-19T08:51:46-04:00 — #18
If I read you correctly, the handle name provided is "cycle", yet the minify plugin cannot isolate and blocks the needed jquery.
Till now I have tried this one and wp-minify. Do you know of any better plugins, as I just have the option of NOT minifying altogether.
scallioxtx — 2011-06-19T09:32:12-04:00 — #19
jQuery doesn't load because the minify plugin doesn't work correctly (because it assumes there is a setting available in PHP -- $SERVER['DOCUMENTROOT'] to be precise -- which is not available on your system, for whatever reason).
The change I proposed in my previous post to line 65 to config.php solves that problem and if you do that the plugin works (at least it does on my system), and everything is good to go.
As for the other minify plugins, I have no idea; I've never really looked for any.
coolygreen — 2011-06-19T10:18:33-04:00 — #20
Thanks for your reply. Could you help one last bit more? Please help me configure the setting you told:
"$min_documentRoot = http://www.mysite.com/..'); "
is this what I have to enter?
next page →