Log In · Register

 
 
Closed TopicStart new topic
minimize xanga modules (photo)
jbongo
post Feb 25 2007, 11:13 AM
Post #1


Newbie
*

Group: Member
Posts: 2
Joined: Feb 2007
Member No: 505,833



ok, for those of you who like using codes on your xanga page you may know that there is some code to minimize your side modules. this particular code was written by easteregg, but he no longer works with code for xanga. with the release of the photo module (aka javascript module) the code also minimizes that. you can set the code to minimize or not minimize the first module that has your information in it (that is on the left). i was wondering if it was possible to edit the code so it would not minimize the photo (java) module.

here is the code to minimize the modules...

to see what the script does and the photo module go here,

QUOTE
<script type="text/javascript">
//
// ============================
// "Minimize your modules"
// version 2.0, July, 2005
// ============================
//
// ©2005 EasterEgg
//
// - 1.0 May 2005, intitial release.
// - 2.0 July 2005, bug fix plus option to display the top module by default.
//
// Thanks goes to BrandonReese at Xanga for making a suggestion to improve the code.
//
// For use at Xanga only. This won't have any effect if you're using a Xanga skin.
// This script is freeware, and is provided 'as is', without guarantees of any kind.
// It has been tested on the Mac and Windows platform (IE, FireFox and Netscape,
// doesn't work in Opera though).
//
// None of the comments in this script may be removed. I'd appreciate if you would
// let me know if you want to make this script available to others on your own site.
//
// This script "minimizes" your left side modules, and turns the headers into links.
// Upon clicking one of those links, the module will either be displayed or, when it
// is displayed already, will be hidden again.
//
// If you change the value of displayTopModule to 1, the top module will be displayed
// by default. Set it's value to 0 if you don't want this.
//

displayTopModule = 1;

allTables = document.getElementsByTagName('table');

leftSideModules = new Array();
for (i=0; i<allTables.length; ++i)
{
if (allTables[i].className == 'left')
{
allTables[i].id = 'leftsidemod' + leftSideModules.length;
leftSideModules.push(allTables[i]);
}

}
function toggleDisplayOrHide(anElement,idNr)
{
extraRow = document.getElementById(idNr).getElementsByTagName('TR')[2];
if (anElement.style.display == 'none')
{
anElement.style.display = ''
if (extraRow)
document.getElementById(idNr).getElementsByTagName('TR')[2].style.display = '';
}
else
{
anElement.style.display = 'none';
if (extraRow)
document.getElementById(idNr).getElementsByTagName('TR')[2].style.display = 'none';
}
}
headerLinkColor = '';
topStyleSheet = document.getElementsByTagName('style')[0];
if (document.URL.indexOf('weblogs'))
topStyleSheet = document.getElementsByTagName('style')[1];
if (topStyleSheet)
{
searchStr = 'table.left TH { color: ';
searchStrPos = topStyleSheet.innerHTML.indexOf(searchStr);
if (searchStrPos)
{
searchStrPos = searchStrPos + searchStr.length;
headerLinkColor = topStyleSheet.innerHTML.substring(searchStrPos, searchStrPos + 7);
}
}
for (n = 0; n<leftSideModules.length; ++n)
{
if (navigator.userAgent.indexOf('Opera') == -1)
{
temp1 = leftSideModules[n].getElementsByTagName('TH')[0].innerHTML;
temp2 = '<a href=\"#\" onclick=\"java script:toggleDisplayOrHide(document.getElementById(' +
'\'' + leftSideModules[n].id + '\').getElementsByTagName(\'TR\')[1],\'' +
leftSideModules[n].id + '\'); return false;\" style=\"text-decoration: none; color: ' +
headerLinkColor + ';\">' + temp1 + '</a>';
leftSideModules[n].getElementsByTagName('TH')[0].innerHTML = temp2;
if ((n == 0) && (displayTopModule == 1))
leftSideModules[n].getElementsByTagName('TR')[1].style.display = ''
else
leftSideModules[n].getElementsByTagName('TR')[1].style.display = 'none';
if (leftSideModules[n].getElementsByTagName('TR')[2])
leftSideModules[n].getElementsByTagName('TR')[2].style.display = 'none';
}
}
</script>
 
*digital.fragrance*
post Feb 25 2007, 01:18 PM
Post #2





Guest






You should submit this to Xanga Scripts.
Topic Closed
 
talcumpowder
post Feb 26 2007, 07:18 PM
Post #3


You'll find me in your dreams.
*******

Group: Official Member
Posts: 8,536
Joined: Mar 2005
Member No: 114,010



-> Topic Re-opened.

While I personally don't think it's possible (the class for the "photo module" happens to be the same, which would make it the last module), perhaps someone else could do so?
 
jbongo
post Jun 27 2007, 03:45 PM
Post #4


Newbie
*

Group: Member
Posts: 2
Joined: Feb 2007
Member No: 505,833



man, it took me a while to get back this. i don't use it much anyhow. but i found a solution for it a long time ago. since they closed it i couldn't reply. here is the fix.. (remember this is only good with the old xanga look and feel. It does not work with the new themes as far as I'm aware. If i'm wrong please let me know)

at the beginning you set either 1 or 0 (like the Display top module option)

<script type="text/javascript">
//
// ============================
// "Minimize your modules"
// version 2.0, July, 2005
// ============================
//
// ©2005 EasterEgg
//
// - 1.0 May 2005, intitial release.
// - 2.0 July 2005, bug fix plus option to display the top module by default.
//
// Thanks goes to BrandonReese at Xanga for making a suggestion to improve the code.
//
// For use at Xanga only. This won't have any effect if you're using a Xanga skin.
// This script is freeware, and is provided 'as is', without guarantees of any kind.
// It has been tested on the Mac and Windows platform (IE, FireFox and Netscape,
// doesn't work in Opera though).
//
// None of the comments in this script may be removed. I'd appreciate if you would
// let me know if you want to make this script available to others on your own site.
//
// This script "minimizes" your left side modules, and turns the headers into links.
// Upon clicking one of those links, the module will either be displayed or, when it
// is displayed already, will be hidden again.
//
// If you change the value of displayTopModule to 1, the top module will be displayed
// by default. Set it's value to 0 if you don't want this.
//

displayTopModule = 1;
displayPhotoModule = 1;

allTables = document.getElementsByTagName('table');

leftSideModules = new Array();
for (i=0; i<allTables.length; ++i)
{
if (allTables[i].className == 'left')
{
allTables[i].id = 'leftsidemod' + leftSideModules.length;
leftSideModules.push(allTables[i]);
}

}
function toggleDisplayOrHide(anElement,idNr)
{
extraRow = document.getElementById(idNr).getElementsByTagName('TR')[2];
if (anElement.style.display == 'none')
{
anElement.style.display = ''
if (extraRow)
document.getElementById(idNr).getElementsByTagName('TR')[2].style.display = '';
}
else
{
anElement.style.display = 'none';
if (extraRow)
document.getElementById(idNr).getElementsByTagName('TR')[2].style.display = 'none';
}
}
headerLinkColor = '';
topStyleSheet = document.getElementsByTagName('style')[0];
if (document.URL.indexOf('weblogs'))
topStyleSheet = document.getElementsByTagName('style')[1];
if (topStyleSheet)
{
searchStr = 'table.left TH { color: ';
searchStrPos = topStyleSheet.innerHTML.indexOf(searchStr);
if (searchStrPos)
{
searchStrPos = searchStrPos + searchStr.length;
headerLinkColor = topStyleSheet.innerHTML.substring(searchStrPos, searchStrPos + 7);
}
}
for (n = 0; n<leftSideModules.length; ++n)
{
if (navigator.userAgent.indexOf('Opera') == -1)
{
temp1 = leftSideModules[n].getElementsByTagName('TH')[0].innerHTML;
temp2 = '<a href=\"#\" onclick=\"java script:toggleDisplayOrHide(document.getElementById(' +
'\'' + leftSideModules[n].id + '\').getElementsByTagName(\'TR\')[1],\'' +
leftSideModules[n].id + '\'); return false;\" style=\"text-decoration: none; color: ' +
headerLinkColor + ';\">' + temp1 + '</a>';
leftSideModules[n].getElementsByTagName('TH')[0].innerHTML = temp2;
if ((n == 0) && (displayTopModule == 1))
leftSideModules[n].getElementsByTagName('TR')[1].style.display = ''

else if ((n == 4) && (displayPhotoModule == 1)) leftSideModules[n].getElementsByTagName('TR')[1].style.display = ''
else
leftSideModules[n].getElementsByTagName('TR')[1].style.display = 'none';
if (leftSideModules[n].getElementsByTagName('TR')[2])
leftSideModules[n].getElementsByTagName('TR')[2].style.display = 'none';
}
}
</script>
 
YourSuperior
post Jun 28 2007, 05:48 AM
Post #5


;)
*******

Group: Staff Alumni
Posts: 9,573
Joined: Feb 2005
Member No: 99,124



Nice Script. Click here to submit the script to createblog. _smile.gif
 

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: