Posts by: juergen

Posts: 1415
Post: 4414
Topic: Favicons

Browsers will automatically look for a favicon.ico in the server root directory. But thats not always feasible, for instance if you host your CMS site for testing purposes in a subdirectory. If you want to tie your favicon.png to the gp|Easy theme you could use this code in the template.php:

<link rel="shortcut icon" type="image/png" href="<?php global $dirPrefix, $page; echo 'http://'.$_SERVER['SERVER_NAME'].$dirPrefix.'/themes/'.$page->theme_name; ?>/favicon.png" />

/edit: If you want this even to work in a secure server environment (https://), use this:

<link rel="shortcut icon" type="image/png" href="<?php global $dirPrefix, $page; echo ($_SERVER['SERVER_PORT'] != 443 ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].$dirPrefix.'/themes/'.$page->theme_name; ?>/favicon.png" />

Edited: 7 years ago
Post: 4411
Topic: Javascript Error

Maybe this link helps.

7 years ago
Post: 4410
Topic: Javascript Error

Sounds totally familiar to me but I can't remember what it was... (or how i managed to get it and how to get rid of it)
Have you tried to switch off "Combine JS Files" in gpeasy configuration to see in which script the error occurs?

 

Edited: 7 years ago
Post: 4409
Topic: jQuery events - double firing problem (3.0.1 & 3.0.2)

Yes, $page->head_script .= works perfectly. Thanks a lot!

And I am so impatient to read the chapter on "How to prevent your javascript from being fired twice".

Yes, and not to mention the "How to simply invoke a CKeditor instance in admin area" section. Eagerly awaitng this ;-)

 

Edited: 7 years ago
Post: 4403
Topic: jQuery events - double firing problem (3.0.1 & 3.0.2)

It's just a joke but one not to be crawled by image bots.  user: really   pass: easy4

7 years ago
Post: 4401
Topic: jQuery events - double firing problem (3.0.1 & 3.0.2)

*sigh* seems I have to get me this one* ... When will it be out again? ;-)
*use u: really p:easy4

Edited: 7 years ago
Post: 4398
Topic: jQuery events - double firing problem (3.0.1 & 3.0.2)

I can see no double HTML. What I see is that the entire script tag is removed from the DOM at runtime (and probably executed otherwise - can't find it in generated source but I'm not much of a jQuery debugger).

I could imagine that it is executed bevore it's extracted and then - wherever this might be - it's executed again.
This is clearly beyond my JS knowledge and I'm running out of terminology now...

 

Anyway, $page->jQueryCode does the job except that I cannot define variables with global scope this way. But I already found a way around this.

Edited: 7 years ago
Post: 4397
Topic: jQuery UI Custom Extensions and future gp|Easy versions

Hmm. Since the admin UI always loads in front of the visitor UI there will always be potential conflicts if different jQuery UI version components will be loaded - no matter how smart it gets filtered/enqueued. A complete jQUI version that can be loaded modular with LoadjQueryUI( [component_list] ) could prevent this.

For my understanding LoadjQueryUI( [component_list] ) called from Admin.php only loads when this specific admin page is accessed. Same for Gadgets and Special Pages/File includes and template.php. If it's only going to be loaded when needed (wherever) and all (multiple) calls will be filtered/combined to one custom jQUI everything is fine and there is no need for discrete admin/visitor functions.

jQuery UI theming is a lesser and completely different problem (if I'm right). If one loads a "deviant" jQUI-theme-css in admin mode (like I currently do *g*) the worst case is that the gp|Easy theme in the background will look different while he/she is logged in. Or vice versa depending on which css is loaded first. It could also get mixed depending on the components :-) Currently the differnet jQUI themes-elements use almost the same amount of space. It will hardly mess up a layout when they get switched/mixed. Might look ugly though. Anyway, it would'nt break functionality.

Edited: 7 years ago
Post: 4394
Topic: jQuery events - double firing problem (3.0.1 & 3.0.2)

fly06 - thanks for the hint. Actually this is the first time I have such a problem. Will come in handy sometimes.

Josh -  $page->jQueryCode ... sounds great. I'll use this.

I'm still burying my oldschool one-event-per-function-javascript thinking. But it's a zombie ;-)

7 years ago
Post: 4383
Topic: jQuery events - double firing problem (3.0.1 & 3.0.2)

Seems that in admin mode events bound with jQuery fire double.

<script type="text/javascript">
 $(document).ready( function() {
  $("h1").click( function() { alert("Click!"); } );
 });
</script>

When I click on a h1 element I get two alerts in a row. Seems to be a bug.

Here is a small Test Plugin: EventTest.zip
Where does the double binding come from? Looks like the domready function gets initialized twice.

 

Edited: 7 years ago

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register