(file) Return to global.js CVS log (file) (dir) Up to [RizwankCVS] / geekymedia_web / photo / sspadmin / scripts

  1 rizwank 1.1 // SSP Admin
  2             // Global JS Functions
  3             
  4             // Declarations
  5             var curSize;
  6             
  7             // Load Pic into iFrame
  8             function editPic(i,a)
  9             {
 10             	var e = document.getElementById('pic-holder');
 11             	e.src = 'edit-pic.php?pid='+i+'&aid='+a;
 12             	clearClasses();
 13             	document.getElementById(i).className += ' selected';
 14             }
 15             
 16             // Make sure of Delete
 17             function albumDeleteConfirm(i)
 18             {
 19             	var r = confirm('Are you sure you want to delete this album?');
 20             	
 21             	if (r == true) {
 22 rizwank 1.1 		location.href = 'delete-album-exe.php?aid='+i;
 23             	}
 24             }
 25             
 26             function dynAlbumDeleteConfirm(i)
 27             {
 28             	var r = confirm('Are you sure you want to delete this dynamic album?');
 29             	
 30             	if (r == true) {
 31             		location.href = 'delete-dynamic-album-exe.php?did='+i;
 32             	}
 33             }
 34             
 35             // Resize Thumbs
 36             function sizeThumbs(sw)
 37             {
 38             	if (sw)
 39             		var elem = document.getElementById('pic-spread');
 40             	else
 41             		var elem = document.getElementById('pic-spread-full');
 42             	var sel = document.getElementById('thumb-size');
 43 rizwank 1.1 	var a = elem.getElementsByTagName('IMG');
 44             	var b = elem.getElementsByTagName('DIV');
 45             	
 46             	var s = sel.value;
 47             	curSize = s;
 48             	
 49             	for (var i=0; i < a.length; i++)
 50             	{
 51             		a[i].height = s;
 52             	}
 53             	for (var i=0; i < b.length; i++)
 54             	{
 55             		b[i].style.height = (s-10)+'px';
 56             		if (sw) { b[i].getElementsByTagName('A')[0].style.height = (s-16)+'px' };
 57             	}
 58             	if (sw==true)
 59             	{
 60             		elem.style.height = ((s*2)+30)+'px';
 61             	}
 62             }
 63             
 64 rizwank 1.1 function clearClasses ()
 65             {
 66             	var elem = document.getElementById('pic-spread');
 67             	var a = elem.getElementsByTagName('IMG');
 68             	var b = elem.getElementsByTagName('DIV');
 69             	
 70             	for (i=0; i < a.length; i++)
 71             	{
 72             		a[i].className = '';
 73             	}
 74             	
 75             	for (i=0; i < b.length; i++)
 76             	{
 77             		myString = new String(b[i].className)
 78             		rExp = /selected/gi;
 79             		newString = new String ("")
 80             		results = myString.replace(rExp, newString)
 81             		b[i].className = results;
 82             	}
 83             }
 84             
 85 rizwank 1.1 function saveOrderDB(ai) {
 86             	var elem = document.getElementById('pic-spread');
 87             	var a = document.getElementsByTagName('LI');
 88             	var qStr = '';
 89             	for (var i=0; i < a.length; i++)
 90             	{
 91             		qStr += (i+1)+','+a[i].id+'|';
 92             	}
 93             	location.href = 'album-order-exe.php?q='+qStr+'&aid='+ai;
 94             }
 95             
 96             function saveAlbOrder() {
 97             	var elem = document.getElementById('albums');
 98             	var a = elem.getElementsByTagName('LI');
 99             	var qStr = '';
100             	for (var i=0; i < a.length; i++)
101             	{
102             		qStr += (i+1)+','+a[i].id+'|';
103             	}
104             	location.href = 'album-display-order-exe.php?q='+qStr;
105             }
106 rizwank 1.1 
107             function saveDynAlbOrder(did) {
108             	var elem = document.getElementById('albums');
109             	var a = elem.getElementsByTagName('LI');
110             	var qStr = '';
111             	for (var i=0; i < a.length; i++)
112             	{
113             		qStr += (i+1)+','+a[i].id+'|';
114             	}
115             	location.href = 'dynamic-display-order-exe.php?q='+qStr+'&did='+did;
116             }

Rizwan Kassim
Powered by
ViewCVS 0.9.2