Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...XML Doc and skinXML Doc and skin
Previous
 
Next
New Post
7/15/2009 8:19 AM
 

Greetings,

Was wondering if someone could provide a little help.  We have recently started using a new skin and find out that it is not displaying properly in safari or chrome.  The issue comes with the javascript code and xmlDoc.load.  Webkit browsers do not use .load so the settings that are being pulled by it are not working.  Maybe the code will make it more clear/

<script type="text/javascript" language="JavaScript">
if (window.ActiveXObject)
{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");}
else if (document.implementation.createDocument)
{xmlDoc=document.implementation.createDocument("","",null);}
else { Your browser cannot handle this script');}
xmlDoc.async=false;
xmlDoc.load("/Portals/_default/Skins/Minimalist-SkyBlue-Gradient/settings-skin.xml");
x2=xmlDoc.getElementsByTagName('skindisplay');
var backgroundColorValue=x2.item(0).attributes[0].value;
var backgroundStyleValue=x2.item(0).attributes[1].value;
var borderStyleValue=x2.item(0).attributes[2].value;
var borderTypeValue=x2.item(0).attributes[3].value;
var backgroundCssUrl='/Portals/_default/Skins/Minimalist-SkyBlue-Gradient/backgrounds/'+backgroundColorValue+'/'+backgroundStyleValue+'.css';
var borderStyleCssUrl='/Portals/_default/Skins/Minimalist-SkyBlue-Gradient/BorderStyle-'+borderStyleValue+'.css';
var borderTypeCssUrl='/Portals/_default/Skins/Minimalist-SkyBlue-Gradient/BorderType-'+borderTypeValue+'.css';
var jsSkinPath='/Portals/_default/Skins/Minimalist-SkyBlue-Gradient/';
function changeCssSource(elementId,elementUrl){
document.getElementById(elementId).setAttribute("href", elementUrl);
}
if (borderTypeValue=="Open") {
changeCssSource('borderTypeClassTag',borderTypeCssUrl); 
}
else {
changeCssSource('backgroundClassTag',backgroundCssUrl);
changeCssSource('borderStyleClassTag',borderStyleCssUrl);
changeCssSource('borderTypeClassTag',borderTypeCssUrl); 
}
//<![CDATA[
if (document.all && /MSIE (5\.5|6)/.test(navigator.userAgent) &&
document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule)
{
document.styleSheets[0].addRule('.compRule', 'behavior: url(/Portals/_default/Skins/Minimalist-SkyBlue-Gradient/compRule.htc)');
}
//]]>
</script>
So, this code is pulling an xml file of settings (specifically these settins load the background color/type and border color and type).  Since webkit browsers will not obey xmlDoc.load that isn't coming through.

We've tried to contact the skin author with no success and we would really like to see this get fixed.  If you have any ideas as to how to fix this (the general consensus is to use xmlhttprequest instead of xmldoc.load, but i am not a coder so i wouldn't know how to write that)
we'd appreciate it.

THanks!
 
New Post
7/15/2009 1:44 PM
 

I think i have figured it out. 

I replaced

xmlDoc.load("<%=skinpath%>settings-skin.xml");

with

xmlDoc = new XMLHttpRequest();
xmlDoc.open("GET", "<%=skinpath%>settings-skin.xml", false);
xmlDoc.send();
xmlDoc=xmlDoc.responseXML;

and the code seems to work.  if anyone sees anything wrong with this let me know.  Otherwise, it seems to work across all browsers.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...XML Doc and skinXML Doc and skin


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out