[Xerte-dev] Re: FW: selected template access

Fay Cross Fay.Cross at nottingham.ac.uk
Wed Feb 13 09:47:45 GMT 2013


Is it adding the background-image css to the div correctly but it's not appearing or is the code to add the css style failing?  Press F12 in IE to launch the Developer Tool window and see what the current css for that div is.

From: xerte-dev-bounces at lists.nottingham.ac.uk [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 13 February 2013 09:26
To: For Xerte technical developers
Subject: [Xerte-dev] Re: FW: selected template access

Why are you eval()ing  $(data).find('learningObject').attr('header') ??

Because it contains the string 'FileLocation + "media/filename.jpg"' and I don't know what FileLocation is.

From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Smith, John
Sent: 12 February 2013 17:02
To: For Xerte technical developers
Subject: [Xerte-dev] Re: FW: selected template access

Why are you eval()ing  $(data).find('learningObject').attr('header') ??

If you start taking out binary blocks from the custom.css file you'll be able to narrow down the bit that's causing IE to throw a wobbly...

Regards,

John Smith
Learning Technologist
School of Health & Life Sciences
Glasgow Caledonian University

From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: Tuesday, February 12, 2013 4:57 PM
To: For Xerte technical developers
Subject: [Xerte-dev] Re: FW: selected template access

Do we support IE8? I can't get this to work: in FF, the header image works

[cid:image001.jpg at 01CE09CE.EF2D4F00]

But in IE8 it doesn't
[cid:image002.jpg at 01CE09CE.EF2D4F00]

The bottom line is this line in application.js fails
$('#overview').css('background-image', "url(" + eval( $(data).find('learningObject').attr('header'))+ ")");

unless you don't load custom.css, in which case it does work. Custom.css has this lot in it that is relevant...

.jumbotron {
margin-top: 20px;
  position: relative;
  padding: 20px 0;
  color: #fff;
  text-align: center;
//  text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075);
  background: #020031; /* Old browsers */
  background: -moz-linear-gradient(45deg,  #020031 0%, #6d3353 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#020031), color-stop(100%,#6d3353)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(45deg,  #020031 0%,#6d3353 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(45deg,  #020031 0%,#6d3353 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(45deg,  #020031 0%,#6d3353 100%); /* IE10+ */
  background: linear-gradient(45deg,  #020031 0%,#6d3353 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020031', endColorstr='#6d3353',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
  -webkit-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
     -moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
          box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);

Maybe one of you with ore CSS experience knows an answer?

From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Ron Mitchell
Sent: 12 February 2013 16:23
To: 'For Xerte technical developers'
Subject: [Xerte-dev] FW: selected template access


Hi all
I've been testing Julian's new site stuff and wanted to test a way of changing the links displayed in properties when viewing properties with a site LO selected. I have this working locally after adding the additional links to url_library.php and then using a case statement to check for project name in properties_library.php

However I don't want to risk the wrath of the cave! ;-)
Is there a better/elegant/more future proof way to do this?

In properties_library.php I've added a switch checking for template name and if it's 'site' show just the play_site link but if it's not site by default show the flash and html 5 links that we see now. The links obviously come from url_library.php. Here's the relevant code in site properties_library.php:

$query_name_response = mysql_query($query_for_template_name);

        $row_name = mysql_fetch_array($query_name_response);

                              switch($row_name['template_name']){

                                             case "site":
                                             echo "<p><a target=\"new\" href='" . $xerte_toolkits_site->site_url . url_return("play_site", $_POST['template_id']) . "'>" . $xerte_toolkits_site->site_url . url_return("play_site", $_POST['template_id']) . "</a></p>";
                                                                           break;

                                             default:

                                             echo "<p>" . PROPERTIES_LIBRARY_PROJECT_LINK . "</p>";

        echo "<p><a target=\"new\" href='" . $xerte_toolkits_site->site_url . url_return("play", $_POST['template_id']) . "'>" . $xerte_toolkits_site->site_url . url_return("play", $_POST['template_id']) . "</a></p>";

                              echo "<p>" . PROPERTIES_LIBRARY_PROJECT_HTML5_LINK . "</p>";

                              echo "<p><a target=\"new\" href='" . $xerte_toolkits_site->site_url . url_return("play_html5", $_POST['template_id']) . "'>" . $xerte_toolkits_site->site_url . url_return("play_html5", $_POST['template_id']) . "</a></p>";

                              $temp_string = get_template_screen_size($row_name['template_name'], $row_name['template_framework']);

        $temp_array = explode("~",$temp_string);

        echo "<br><br><p>" . PROPERTIES_LIBRARY_PROJECT_IFRAME . "</p><form><textarea rows='3' cols='40' onfocus='this.select()'><iframe src='"  . $xerte_toolkits_site->site_url .  url_return("play", $_POST['template_id']) .  "' width='" . $temp_array[0] . "' height='" . $temp_array[1] . "' frameborder=\"0\" style=\"float:left; position:relative; top:0px; left:0px; z-index:0;\"></></iframe></textarea></form>";

                                                                           break;
                              }}}

and here's what a site template and other/Notts template shows:

[cid:image003.jpg at 01CE09CE.EF2D4F00][cid:image004.jpg at 01CE09CE.EF2D4F00]

I think I can hear rumblings from the cave already :-(

Ron

From: Julian Tenney [mailto:Julian.Tenney at nottingham.ac.uk]
Sent: 12 February 2013 14:16
To: Ron Mitchell
Subject: RE: selected template access

> Do you want me to have a look at displaying the correct play link in properties? Also .htaccess additions?

BY all means. There is no hurry, though. Now we have the temaplte working I toolkits we can i) decide how far we want to take it; ii) sort all this other stuff out.

From: Ron Mitchell [mailto:ronm at mitchellmedia.co.uk]
Sent: 12 February 2013 13:19
To: 'Ron Mitchell'; 'Julian Tenney'
Subject: RE: selected template access

That worked...

changed name to site
parent_templates/site/site.rlt

created a new project

preview_site and play_site both work.

Do you want me to have a look at displaying the correct play link in properties? Also .htaccess additions?

From: Ron Mitchell [mailto:ronm at mitchellmedia.co.uk]
Sent: 12 February 2013 13:13
To: 'Ron Mitchell'; 'Julian Tenney'
Subject: RE: selected template access

Tried that but no joy.
Renamed in the db as bootstrap and then changed /parent_templates/site to parent_templates/bootstrap and now it works.

Probably better though to find out why it wouldn't work via parent_templates/site/site.rlt oh just thinking perhaps I needed to create a new project after that change...

From: Ron Mitchell [mailto:ronm at mitchellmedia.co.uk]
Sent: 12 February 2013 13:04
To: 'Ron Mitchell'; 'Julian Tenney'
Subject: RE: selected template access

Looks like the code uses the name from the originaltemplatedetails table in the db. Changes that to site and then it looks for /xot19/modules/xerte/parent_templates/site/site.rlt any reason not to rename bootstrap.rlt to site.rlt?

From: Ron Mitchell [mailto:ronm at mitchellmedia.co.uk]
Sent: 12 February 2013 12:58
To: 'Julian Tenney'
Subject: RE: selected template access

Turned on debugging... something in the code still looking for the bootstrap folder?

Warning: file_get_contents(/xot19/modules/xerte/parent_templates/bootstrap/bootstrap.rlt)

Don't think it's cache.

From: Ron Mitchell [mailto:ronm at mitchellmedia.co.uk]
Sent: 12 February 2013 12:50
To: 'Julian Tenney'
Subject: RE: selected template access

I wouldn't do it in basic.sql although if you don't want it available to all remove the *
Just set who it's available to via management.php

There's a slight issue possibly caused by the renaming...

Have tested on two different installs - I can create a new project based on the template but clicking insert doesn't do anything? It worked when it was called Bootstrap! ;-)

From: Julian Tenney [mailto:Julian.Tenney at nottingham.ac.uk]
Sent: 12 February 2013 11:11
To: Ron Mitchell
Subject: RE: selected template access

In basic.sql, instead of '*' for the access field?

From: Ron Mitchell [mailto:ronm at mitchellmedia.co.uk]
Sent: 12 February 2013 11:11
To: 'Julian Tenney'
Subject: selected template access

it's username comma username
e.g. ronm,rmitchell

From: Ron Mitchell [mailto:ronm at mitchellmedia.co.uk]
Sent: 12 February 2013 10:52
To: 'Julian Tenney'
Subject: RE: Bootstrap

BTW Pat didn't answer your question about enabling for specific users - looks like it's username.
Not sure what the delimiter is but I guess either , ; or space - testing that now...





Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education's Widening Participation Initiative of the Year 2009 and Herald Society's Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education's Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20130213/b8a2a2ac/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 17840 bytes
Desc: image001.jpg
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20130213/b8a2a2ac/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 16674 bytes
Desc: image002.jpg
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20130213/b8a2a2ac/attachment-0005.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 19112 bytes
Desc: image003.jpg
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20130213/b8a2a2ac/attachment-0006.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 27493 bytes
Desc: image004.jpg
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20130213/b8a2a2ac/attachment-0007.jpg>


More information about the Xerte-dev mailing list