M
Mike Gifford
A year or so ago you I got some help generating the javascript I've
included at the bottom of this page to convert:
<!-- Start index3col.tpl -->
to:
<a
href="/admin/BE_editTemplateAdmin.php?submit=edit&file=index3col.tpl"><img
src="/BE/buttons/templateView.gif"></a>
So that I can more easily identify the templates which are used in our
GPL CMS.
Unfortunately we've changed our comments structure for identifying our
templates site to use:
<!-- END FILE index3col.tpl -->
Unfortunately I keep getting this as a result:
<a
href="/admin/BE_editTemplateAdmin.php?submit=edit&file=FILE%20index3col.tpl%20"><img
src="/BE/buttons/templateView.gif"></a>
Any suggestions you might have to modify this would be appreciated..
I've tried changing:
if (text.substr(0,7)==" START ") {
to:
if (text.substr(0,10)==" END FILE ") {
and:
var newNode = createNewNode(text.substr(7));
to:
var newNode = createNewNode(text.substr(10));
But this doesn't seem to be having any impact. I'm browsing this with
firefox.
Mike
<script type="text/javascript">
<!--
// Code Contributed by Lasse Nielsen - http://www.infimum.dk
function convert(node) {
if (!node) {node = document.body;}
switch (node.nodeType) {
case Node.COMMENT_NODE:
var text = node.nodeValue;
if (text.substr(0,7)==" START ") {
var newNode = createNewNode(text.substr(7));
node.parentNode.replaceChild(newNode,node);
}
break
case Node.ELEMENT_NODE:
for (var i=0;i<node.childNodes.length;i++) {
convert(node.childNodes);
}
break;
default:
break;
}
}
function createNewNode(text) {
var a = document.createElement("a");
a.href =
"{ROOTURL}/admin/BE_editTemplateAdmin.php?submit=edit&file="+escape(text);
var img = document.createElement("img");
img.src = "{IMAGEURL}/BE/buttons/templateView.gif";
a.appendChild(img);
return a;
}
-->
</script>
<input type="button" value="Convert!" onclick="convert()" />
included at the bottom of this page to convert:
<!-- Start index3col.tpl -->
to:
<a
href="/admin/BE_editTemplateAdmin.php?submit=edit&file=index3col.tpl"><img
src="/BE/buttons/templateView.gif"></a>
So that I can more easily identify the templates which are used in our
GPL CMS.
Unfortunately we've changed our comments structure for identifying our
templates site to use:
<!-- END FILE index3col.tpl -->
Unfortunately I keep getting this as a result:
<a
href="/admin/BE_editTemplateAdmin.php?submit=edit&file=FILE%20index3col.tpl%20"><img
src="/BE/buttons/templateView.gif"></a>
Any suggestions you might have to modify this would be appreciated..
I've tried changing:
if (text.substr(0,7)==" START ") {
to:
if (text.substr(0,10)==" END FILE ") {
and:
var newNode = createNewNode(text.substr(7));
to:
var newNode = createNewNode(text.substr(10));
But this doesn't seem to be having any impact. I'm browsing this with
firefox.
Mike
<script type="text/javascript">
<!--
// Code Contributed by Lasse Nielsen - http://www.infimum.dk
function convert(node) {
if (!node) {node = document.body;}
switch (node.nodeType) {
case Node.COMMENT_NODE:
var text = node.nodeValue;
if (text.substr(0,7)==" START ") {
var newNode = createNewNode(text.substr(7));
node.parentNode.replaceChild(newNode,node);
}
break
case Node.ELEMENT_NODE:
for (var i=0;i<node.childNodes.length;i++) {
convert(node.childNodes);
}
break;
default:
break;
}
}
function createNewNode(text) {
var a = document.createElement("a");
a.href =
"{ROOTURL}/admin/BE_editTemplateAdmin.php?submit=edit&file="+escape(text);
var img = document.createElement("img");
img.src = "{IMAGEURL}/BE/buttons/templateView.gif";
a.appendChild(img);
return a;
}
-->
</script>
<input type="button" value="Convert!" onclick="convert()" />