Can't Edit Blocks

Permalink
I know it has to be JS injected CSS that's causing it, but what could be causing the block editor popups to open in a new page, lose all css styling, and lose javascript function(is it cause it's in a new page?

GundlachMarketing
 
GundlachMarketing replied on at Permalink Reply
GundlachMarketing
So i found where the reset.css was in the javascript. I disabled it and put it above the header required. I've tried disabling both the reset and normalize scripts, and the ccm-highlighter still only gives me a sliver in the top left corner of the block or area. The edit popups still gives me no css and it fullscreens. Super Frustrated! I feel like I've wasted a whole pot of coffee and two nights sleep tring to get this figured out. (Deadlines: keeping you awake when your toddler can finally sleep through the night)
JohntheFish replied on at Permalink Reply
JohntheFish
The way most buttons work is they are an html link element with the address of the popup content url in the button.

When you click a button, javascript intercepts the link and, rather than allowing it to continue, does an ajax request to load the popup dialog.

If the javascript fails to intercept the link being clicked, you will get the url served directly - the new page you are experiencing.

So something on your page is breaking javascript execution and thus preventing the event handler from attaching or executing.

Have a look in the developer console for script errors. You probably have either some faulty script or an asset collision (ie loading the same jquery asset from more than one location and the 2 versions then collide in the namespace and break jquery.)
GundlachMarketing replied on at Permalink Reply
GundlachMarketing
[02:26:36.199] TypeError: c.browser is undefined @http://localhost/testing/concrete5.6.2.1/concrete/js/jquery.ui.js?v...

So? I'm looking for a variable c in one of the themes JS files?
Also on page load there's this:

[02:29:31.338] TypeError: $.browser is undefined @http://localhost/testing/concrete5.6.2.1/concrete/js/jquery.rating....
GundlachMarketing replied on at Permalink Reply
GundlachMarketing
It's a jQuery collision, but I'm not sure how to fix it. Should I just replace all instances of c with something else?
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
The $.browser method has been deprecated in jQuery.
http://api.jquery.com/jQuery.browser/...

c5.6.2.1 still uses jQuery 1.7.2 so while deprecated, it should still be available.

What addons or themes do you have that could be using using $.browser?

Could anything be replacing jQuery with a later version such as a CDN or an optimiser?
GundlachMarketing replied on at Permalink Reply 2 Attachments
GundlachMarketing
I have two jQuery files in my theme. I'm trying to turn a responsive html5 template into a theme (note to self: avoid converting jQuery dependent templates to Concrete5 themes!) I changed the c variable to anythingbutc, because of the c.browser error, but that's because it's in a different window fml. how am I supposed to make this code backward compatible to accommodate deprecated functions? Is it possible?


Edit:
I found the import
//@ sourceMappingURL=jquery-1.10.2.min.map
But can this be rolled back?
(I guess now's a good time to learn jQuery eh?)

BAH! I changed it to 1.7.2 ... and NOTHING! still $.browser undefined.
JohntheFish replied on at Permalink Reply
JohntheFish
jQuery removed $.browser because it is more maintainable for code to test for browser capabilities rather than test for a browser and compare it to a list.

The best way to make things responsive is with css media queries, so that different stylesheets get loaded depending on screen size and type. For really old IE, you can use IE conditional comments. (I wrote a howto on that a while back)

For more about css media queries, you will need a theme expert (that I am not).
GundlachMarketing replied on at Permalink Reply
GundlachMarketing
The skel.js is dependent upon the 1.10.2 if I pull the jquery out... oooh! yes! I replaced the jquery.min.js with the jquery.js from the core and voila! everything works like a charm. Thanks for all of your tips and guidance. I really appreciate it.

And I beat you at your own game... literallyhttp://www.c5magic.co.uk/add-ons/concrete-paving/play-game/...
programmieraffe replied on at Permalink Reply 1 Attachment
programmieraffe
Hi,

is your content block working? I stripped out jquery of skelJS, but the tinymce is not working.

I can see in the javascript console that skelJS somehow intercepts the ajax calls for the tinymce js files:
404 File Not Found:http://localhost/my_c5//plugins/advlink/editor_plugin.js...

If I switch back to the default theme, content block is (of course) working fine.

Best regards,
Matthias