UI demos in safari

0 views
Skip to first unread message

ScottJehl

unread,
Jan 13, 2009, 10:17:59 AM1/13/09
to jQuery UI Development
I noticed that on the ui demos, any custom CSS that comes with the
demo page is getting stripped out in Safari. It doesn't seem to be
happening in FF though.
View the last two slider demos in safari to see what I mean

Richard D. Worth

unread,
Jan 13, 2009, 10:58:44 PM1/13/09
to jquery...@googlegroups.com
This seems to be happening on the main demo page only. If you view the demo in a new window, it's fine.

- Richard

Eduardo Lundgren

unread,
Jan 16, 2009, 1:14:25 AM1/16/09
to jquery...@googlegroups.com
any idea to fix this?
--
Eduardo Lundgren
Software Engineer
Liferay, Inc.
Enterprise. Open Source. For Life.

Bohdan Ganicky

unread,
Jan 16, 2009, 9:55:10 AM1/16/09
to jQuery UI Development
It seems that Safari (and Chrome) ignores the <style> block when out
of the <head> section. Any idea how to modify the loadDemo() function
so it grabs the <style> block from the demo and appends it to the
<head> section of the main demo page? I've tried it a very very dirty
way and it actually works:

function loadDemo(path) {
$.get(path, function(data) {
...
...
data = data.replace(/<title.*>.*<\/title>/ig,""); // Remove title
tags

// dirty way to make the demo page work in webkit browsers
$('body').append('<div id="mess" class="ui-helper-hidden">'+data+'</
div>');
var $new_demo_style = $('#mess > style');
var $prev_demo_style = $('#prev-demo-style');
$prev_demo_style.length ? $prev_demo_style.replaceWith
($new_demo_style.attr('id','prev-demo-style')) : $('head').append
($new_demo_style.attr('id','prev-demo-style'));
$('#mess').remove();
...
...
}

I guess there must be a cleaner way to do the same thing. :)

--
Bohdan Ganicky

On Jan 16, 7:14 am, Eduardo Lundgren <eduardolundg...@gmail.com>
wrote:
> any idea to fix this?
>

Bohdan Ganicky

unread,
Jan 20, 2009, 10:13:38 AM1/20/09
to jQuery UI Development
I've just commited a quick and dirty fix for #3810:
http://ui.jquery.com/bugs/ticket/3810, see http://ui.jquery.com/bugs/changeset/1716

Strange is, that this bug behaved slightly differently on the website
than in the repository demo index. Were you fixing this issue somehow
on the website already?

--
Bohdan

Paul Bakaus

unread,
Jan 20, 2009, 10:27:09 AM1/20/09
to jquery...@googlegroups.com
Bohdan,

everything you fix on demos/index.html and is ina <script> block must be
merged back to the website. Take a look at trunk/templates/templates/demos.tpl
and you'll see what you mean.

Also, tell me if you don't have access to the website SVN yet, and I'll give it
to you.
--
Paul Bakaus
UI Architect
--
http://paulbakaus.com
http://www.linkedin.com/in/paulbakaus
Reply all
Reply to author
Forward
0 new messages