[PC-BSD Commits] r1990 - in websites/pbidir.com/bibivu: bin etc tpl/css tpl/css/jquery tpl/img tpl/img/jquery tpl/js tpl/pbidir

svn at pcbsd.org svn at pcbsd.org
Wed May 28 20:16:07 PDT 2008


Author: fabry
Date: 2008-05-28 20:16:06 -0700 (Wed, 28 May 2008)
New Revision: 1990

Added:
   websites/pbidir.com/bibivu/tpl/css/jquery/
   websites/pbidir.com/bibivu/tpl/css/jquery/ui.tabs.css
   websites/pbidir.com/bibivu/tpl/img/jquery/
   websites/pbidir.com/bibivu/tpl/img/jquery/loading.gif
   websites/pbidir.com/bibivu/tpl/img/jquery/tab.png
   websites/pbidir.com/bibivu/tpl/js/jquery-ui-1.5b3.packed.js
Modified:
   websites/pbidir.com/bibivu/bin/start.php
   websites/pbidir.com/bibivu/etc/display.conf.php
   websites/pbidir.com/bibivu/tpl/js/functions.js
   websites/pbidir.com/bibivu/tpl/pbidir/pbi_versions.php
Log:
Grouping the PBI releases by bits and showing them as TABS defaulting to the one that the user has setup in the preferences.

Modified: websites/pbidir.com/bibivu/bin/start.php
===================================================================
--- websites/pbidir.com/bibivu/bin/start.php	2008-05-28 18:51:23 UTC (rev 1989)
+++ websites/pbidir.com/bibivu/bin/start.php	2008-05-29 03:16:06 UTC (rev 1990)
@@ -267,16 +267,31 @@
 			$filters[] = array('field'=>'current_status_id', 'operator'=>'=', 'value'=>'100');
 			$filters[] = array('field'=>'pbi_id', 'operator'=>'=', 'value'=>$pbi['id']);
 
-			if($this->display->get('is_logged')){
+			$bits = load_library('cookies')->get('bits');
+			if($bits=='' && $this->display->get('is_logged')){
 				$bits = $this->permissions->get('bits', '');
-			}else{
-				$bits = load_library('cookies')->get('bits');
 			}
-			if($bits!=''){
-				$filters[] = array('field'=>'bits', 'operator'=>'=', 'value'=>$bits);
+			
+			$filters_32 = $filters;
+			$filters_32[] = array('field'=>'bits', 'operator'=>'=', 'value'=>'32');
+
+			$filters_64 = $filters;
+			$filters_64[] = array('field'=>'bits', 'operator'=>'=', 'value'=>'64');
+
+			$limit = '';	//was 3
+			$pbi_releases[32] = load_library('pbi_release')->get_all($filters_32, array('pcbsd_version DESC'), array(), $limit);
+			$pbi_releases[64] = load_library('pbi_release')->get_all($filters_64, array('pcbsd_version DESC'), array(), $limit);
+
+			if($bits==64){
+				krsort($pbi_releases);
 			}
-			$limit = '';	//was 3
-			$this->display->assign('pbi_releases', load_library('pbi_release')->get_all($filters, array('date_added DESC'), array(), $limit));
+
+			//checking if everything was found
+			if(isset($pbi_releases[32]) && (!is_array($pbi_releases[32]) || count($pbi_releases[32])==0))		unset($pbi_releases[32]);
+			if(isset($pbi_releases[64]) && (!is_array($pbi_releases[64]) || count($pbi_releases[64])==0))		unset($pbi_releases[64]);
+
+			$this->display->assign('bits', $bits);
+			$this->display->assign('pbi_releases', $pbi_releases);
 			
 			$filters = array();
 			$filters[] = array('field'=>'active', 'operator'=>'=', 'value'=>'y');

Modified: websites/pbidir.com/bibivu/etc/display.conf.php
===================================================================
--- websites/pbidir.com/bibivu/etc/display.conf.php	2008-05-28 18:51:23 UTC (rev 1989)
+++ websites/pbidir.com/bibivu/etc/display.conf.php	2008-05-29 03:16:06 UTC (rev 1990)
@@ -49,11 +49,22 @@
 $display['link'][1]['href']			= TPLWEBPATH.'css/pbidir.css';
 $display['link'][1]['media']		= 'all';
 
+$display['link'][2]['type']			= 'text/css';
+$display['link'][2]['rel']			= 'stylesheet';
+$display['link'][2]['title']		= 'default';
+$display['link'][2]['href']			= TPLWEBPATH.'css/jquery/ui.tabs.css';
+$display['link'][2]['media']		= 'all';
+
 $display['script'][0]['type']		= 'text/javascript';
 $display['script'][0]['language']	= 'javascript';
-$display['script'][0]['src']		= TPLWEBPATH.'js/jquery-1.2.1.pack.js';
+$display['script'][0]['src']		= 'http://code.jquery.com/jquery-latest.js';
+//$display['script'][0]['src']		= TPLWEBPATH.'js/jquery-1.2.1.pack.js';
 //$display['script'][0]['src']		= 'http://code.jquery.com/nightlies/jquery-nightly.pack.js';
 
+$display['script'][1]['type']		= 'text/javascript';
+$display['script'][1]['language']	= 'javascript';
+$display['script'][1]['src']		= TPLWEBPATH.'js/jquery-ui-1.5b3.packed.js';
+
 /*
 $display['script'][1]['type']		= 'text/javascript';
 $display['script'][1]['language']	= 'javascript';

Added: websites/pbidir.com/bibivu/tpl/css/jquery/ui.tabs.css

Added: websites/pbidir.com/bibivu/tpl/img/jquery/loading.gif


Property changes on: websites/pbidir.com/bibivu/tpl/img/jquery/loading.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: websites/pbidir.com/bibivu/tpl/img/jquery/tab.png


Property changes on: websites/pbidir.com/bibivu/tpl/img/jquery/tab.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: websites/pbidir.com/bibivu/tpl/js/functions.js
===================================================================
--- websites/pbidir.com/bibivu/tpl/js/functions.js	2008-05-28 18:51:23 UTC (rev 1989)
+++ websites/pbidir.com/bibivu/tpl/js/functions.js	2008-05-29 03:16:06 UTC (rev 1990)
@@ -1,384 +1,388 @@
-// JavaScript Document
-var voted = 0;
-var filter_using = 0;
-$(function(){
-  imageScroller("viewerFrame");
-
-  // Document is ready
-  imgLoader = new Image();// preload image
-  imgLoader.src = pathToLoadImage;
-  $(document).ajaxStart(function(){
-	$("body").append("<div id='divBox_load'><img src='"+imgLoader.src+"' /></div>");
-	$('#divBox_load').show();
-  });
-
-  $(document).ajaxStop(function(){
-	divBox();
-	$('#divBox_load').hide().trigger("unload").unbind().remove();
-  });
-  init();
-});
-function init(){
-  divBox();
-  
-  $('table.sortable thead tr th').click(function() { 
-	  filter_using = this.column + 1;
-  }); 
-
-  $('table.sortable tbody tr:not([th]):odd').removeClass('row_even').addClass('row_odd');
-  $('table.sortable tbody tr:not([th]):even').removeClass('row_odd').addClass('row_even');
-  $('table.sortable tbody tr:not([th])').hover(
-											   function() { $(this).addClass("row_hover"); },
-											   function() { $(this).removeClass("row_hover"); }
-											   ).click(
-											   		   function(){$(this).toggleClass("row_highlight"); }
-											   		   );
-  $('#filter').bind('change',
-					function(){
-						if($('#filter').val()==''){
-							$('table.sortable tbody tr').show();
-						} else {
-							$('table.sortable tbody tr').each(function() {
-																	  if ($('td:nth-child('+filter_using+')', this).text().toLowerCase().indexOf($('#filter').val().toLowerCase())>=0) {
-																		  $(this).show();
-																	  } else if ($('th',this).length == 0){
-																		  $(this).hide();
-																	  } else {
-																		  $(this).hide;
-																	  }
-																	});
-						};
-					});
-}
-function mailprotect (user, domain, ext, name) {
-	document.write("<" + "a" + " hr" + "ef=" + "mai" + "lto:" + user + "@" + domain + "." + ext + ">" + name + "</" + "a>");
-}
-
-function updateVote(tvote) {
-	if(voted<=0){
-		if(tvote<=0 && voted>0){
-			tvote = voted;
-		}
-		$('.vote_vote').removeClass('vote_selected').removeClass('vote_selected_back');
-		if(tvote>0){
-			$('#vote_10 a').html(tvote + "");
-			$('#vote_' + tvote).addClass('vote_selected');
-			for(i=1;i<=tvote;i++){
-				$('#vote_' + i).addClass('vote_selected_back');
-			}
-		} else {
-			$('#vote_10 a').html("");
-		}
-	}
-}
-
-function saveVote(pbi_id,tvote){
-	if(voted<=0 && tvote>0){
-		$.post(pbi_id + "/vote/"+ tvote,
-			{ajax:1},
-			function(data,textStatus){
-				if(textStatus=='success'){
-					if(data == 'success' || data>0){
-						voted=tvote;
-						no_more_votes();
-						if(data>0){
-							$('.rating_bar').html(data).width(data*10);
-						}
-						alert ('Thank you for your vote !');
-					} else {
-						alert ('Error: ' + data);
-					}
-				} else {
-					alert ('Error casting your vote!!' + "\n\n" + textStatus);
-				}
-			});
-	} else if(voted>0){
-		no_more_votes();
-	}
-}
-
-function no_more_votes(){
-	if(voted>0){
-		var tvote = $('#vote_10 a').html();
-		$('.vote_vote').html("&nbsp;");
-		$('#vote_10').html(tvote);
-	}
-}
-
-/*******************************************
- *  COMMENTS
- ******************************************/
-function check_comment_submit(){
-	var pbi_comment = jQuery.trim($('#pbi_comment').val());
-	if(pbi_comment==''){
-		alert('You must enter a comment !!');
-		return false;
-	}
-	return true;
-}
-
-function load_comment_form(form_uri){
-	$('#comment_form_div').load(form_uri,
-		function(){
-			$('#pbi_comment').focus();
-		});
-}
-
-
-function saveComment(save_comment_uri){
-	if(check_comment_submit()){
-		$.post(
-			save_comment_uri,
-			{
-				pbi_comment: $.trim($('#pbi_comment').val()),
-				ajax:1
-			},
-			function(xml){
-				var _error = '';
-				var _date = '';
-				var _user = '';
-				var _body = '';
-				$("message",xml).each(function(){
-					_error	= $('error',this).text();
-					if(_error==''){
-						_cid	= $('cid',this).text();
-						_date	= $('date',this).text();
-						_user	= $('user',this).text();
-						_body	= $('body',this).text().replace(/\n/g, '<br />');
-						_usr_uri= $('usr_uri',this).text();
-						prependComment(_cid, _user, _date, _body, _usr_uri);
-						$('#comment_form_div').html("");
-					} else {
-						alert ('Error Saving your comment!!' + "\n\n" + _error);
-						return false;
-					}
-				})
-			}
-		);
-		return false;	//using ajax !!! - set this to TRUE if want to post the form via BROWSER POST, remove the "$.post" as well
-	} else {
-		return false;
-	}
-}
-
-/*******************************************
- * create a new comment
- ******************************************/
-function showComment(cid, user, date, comment, user_uri){
-	var newMSG = '';
-	newMSG = newMSG + '<div class="comment_message" id="cid' + cid + '"><div class="comment_header">';
-	newMSG = newMSG + '<span class="comment_user"><a href="' + user_uri + '" target="_top">' + user + '</a></span>';
-	if(can_comment_delete){
-		newMSG = newMSG + '<span class="comment_actions"><a href="javascript:void(0);" onclick="deleteComment(' + cid + ');" target="_top">delete #' + cid + '</a></span>';
-	}
-	newMSG = newMSG + '<span class="comment_date">' + date + '</span>';
-	newMSG = newMSG + '</div>';
-	newMSG = newMSG + '<div class="comment_body">' + comment + '</div>';
-	newMSG = newMSG + '</div>';
-	return newMSG;
-}
-
-function deleteComment(cid){
-	if(cid!=''){
-		if(confirm('Are you sure you want to remove Comment #' + cid)){
-			$.get(delete_comment_uri + "/" + cid,
-				function(data,textStatus){
-					if(textStatus=='success'){
-						if(data == 'success'){
-							$('#cid' + cid).trigger("unload").unbind().remove();
-						} else {
-							alert ('Error: ' + data);
-						}
-					} else {
-						alert ('Error deleting the comment!!' + "\n\n" + textStatus);
-					}
-				});
-		}
-	}
-}
-
-function appendComment(cid, user, date, comment, user_uri){
-	$('#comment_list').append(showComment(cid, user, date, comment, user_uri));
-}
-
-function prependComment(cid, user, date, comment, user_uri){
-	$('#comment_list').prepend(showComment(cid, user, date, comment, user_uri));
-}
-
-/*******************************************
- * subscription
- ******************************************/
-function subscribe_pbi(uri){
-	$.get(
-		uri,
-		function(data,textStatus){
-			if(textStatus=='success'){
-				$('#subscribe_pbi').html(data);
-			} else {
-				alert ('Error updating subscription!!' + "\n\n" + textStatus);
-			}
-		}
-	);
-	return false;
-}
-/*******************************************
- * manage Forms via XML
- ******************************************/
-function postForm(form,uri, message_success){
-	var message_success = (message_success == null) ? false : message_success;
-	var ok = false;
-	if(uri.indexOf('delete')>=0){
-		ok=confirm('You sure you want to continue ?');
-	} else {
-		ok=true;
-	}
-	if(!ok) return false;
-	var values = {'ajax':''};
-	var sel = {};
-	var getValue = (function(what, tt){
-		var nn = $(what).attr("name");
-		var vv = $(what).val();
-		values[nn] = vv;
-		if(tt == 'select')	sel[nn] = $('#'+nn+vv,what).text();
-		else				sel[nn] = null;
-	});
-	$('.' + form + ' input').each(function(){getValue(this, 'input');});
-	$('.' + form + ' select').each(function(){getValue(this,'select');});
-	$('.' + form + ' textarea').each(function(){getValue(this,'textarea');});
-	$.post(
-		uri,
-		values,
-		function(data){
-			if(data=='success'){
-				if(message_success==true){
-					alert('Action Successfully Completed !!');
-				}
-				//need to update the table ROW as well
-				divBox_remove();
-				if(values['id']<=0){
-					//need to refresh the page
-					window.location.reload();
-				} else if(uri.indexOf('delete')>=0){
-					$('#rec' + values['id']).trigger("unload").unbind().remove();
-				} else {
-					for (var key in values){
-						var txt = $('#' + key + '_' + values['id']).html();
-						if(null != txt){
-							vv = null==sel[key]?values[key]:sel[key];
-							if(txt.indexOf("<a")>=0){
-								$('#' + key + '_' + values['id'] + ' a').text(vv);
-							} else if(txt.indexOf("<img")>=0){
-								$('#' + key + '_' + values['id'] + ' img').attr('src',vv);
-							} else {
-								$('#' + key + '_' + values['id']).text(vv);
-							}
-						}
-					}
-				}
-			} else {
-				alert('Error!!' + "\n\n" + data);
-			}
-		}
-	);
-	return false;
-}
-
-
-function show_related_table(uri, field_to, field_from, div, click_from){
-	var t = {};
-	t[field_to] = field_from;
-	t["_srt_field_to"] = field_to;
-	t["_srt_field_from"] = field_from;
-	t["_srt_div"] = div;
-	t["ajax"] = '1';
-	if(click_from!=''){
-		$(click_from).html($(click_from).html().replace(/show|refresh/i,'Loading') + '...');
-	}
-	$.post(uri,t, function(data){
-						   $('#'+div).html(data);
-						   init();
-						   if(click_from!=''){
-							   $(click_from).html($(click_from).html().replace(/Loading/i,'Refresh').replace(/\.\.\./,''));
-						   }
-						});
-}
-
-/*******************************************
- * show a new DIV with content
- ******************************************/
-function divBox(){
-	$('.divBox').click(function(){
-								if(this.tagName.toLowerCase()=='a'){
-									divBox_open($(this).attr('href'));
-//								} else if($(this).parent().tagName.toLowerCase()=='a') {
-								} else {
-									divBox_open($(this).parent().attr('href'));
-								}
-								return false;
-								}).removeClass('divBox');
-}
-function divBox_open(uri){
-	//I did not like some functionalities of thickbox
-	//so here is my solution
-	//create a new div as large as the .content div
-	//starting to the same TOP and LEFT of .content
-	//and pretty much emulate the thickbox
-	if(uri=="") return false;
-	divBox_remove();
-	var divName = 'FP_divBOX';
-	var ddiv = $( "<div id='"+divName+"'><br /></div>" );
-	ddiv.load(uri);
-	var orig = $('#content');
-	var offset = orig.offset();
-	var oWidth = orig.width();
-	var oHeight = orig.height();
-
-	var t = orig;
-	while(oWidth == 0){
-		t = t.parent();
-		oWidth = t.width();
-	}
-    orig.after(ddiv);
-	ddiv.show();
-	orig.hide();
-}
-function divBox_remove(){
-	var divName = 'FP_divBOX';
-	var orig = $('#content');
-	$('#' + divName).hide().trigger("unload").unbind().remove();
-	orig.show();
-}
-
-
-function imageScroller(frame){
-	var _imgFrame = $('.' + frame);
-	var _child = "a";
-	var _itv;
-	var imgScroller = function(){
-		autoStop();
-		_imgFrame.find(_child+":first").clone().show().appendTo( _imgFrame );
-//		_h = $('img',_imgFrame.find(_child+":first")).height()
-		$('img',_imgFrame.find(_child+":first")).animate({height:0},'slow', function(){
-			_imgFrame.find(_child+":first").remove().hide();
-			autoPlay(); 
-		});
-																								   
-		
-//		_imgFrame.animate( {marginTop:-_h}, 'slow' ,'', function(){
-//			_imgFrame.find(_child+":first").remove().hide();
-//			_imgFrame.css("marginTop",0);
-//			autoPlay(); 
-//		});
-	};
-	
-	var autoPlay = function(){
-	  _itv = window.setInterval(imgScroller, 3000);
-	};
-	var autoStop = function(){
-		window.clearInterval(_itv);
-	};
-	if(_imgFrame.find(_child).size()>1){
-//	if(_imgFrame.width() < (_width*_imgFrame.find(_child).size())){
-		autoPlay();
-	}
-};
+// JavaScript Document
+var voted = 0;
+var filter_using = 0;
+$(function(){
+  //tabbing on the pbi page
+  $('.pbi_releases > ul').tabs();
+
+  //images scroller for pbi page
+  imageScroller("viewerFrame");
+
+  // Document is ready
+  imgLoader = new Image();// preload image
+  imgLoader.src = pathToLoadImage;
+  $(document).ajaxStart(function(){
+	$("body").append("<div id='divBox_load'><img src='"+imgLoader.src+"' /></div>");
+	$('#divBox_load').show();
+  });
+
+  $(document).ajaxStop(function(){
+	divBox();
+	$('#divBox_load').hide().trigger("unload").unbind().remove();
+  });
+  init();
+});
+function init(){
+  divBox();
+  
+  $('table.sortable thead tr th').click(function() { 
+	  filter_using = this.column + 1;
+  }); 
+
+  $('table.sortable tbody tr:not([th]):odd').removeClass('row_even').addClass('row_odd');
+  $('table.sortable tbody tr:not([th]):even').removeClass('row_odd').addClass('row_even');
+  $('table.sortable tbody tr:not([th])').hover(
+											   function() { $(this).addClass("row_hover"); },
+											   function() { $(this).removeClass("row_hover"); }
+											   ).click(
+											   		   function(){$(this).toggleClass("row_highlight"); }
+											   		   );
+  $('#filter').bind('change',
+					function(){
+						if($('#filter').val()==''){
+							$('table.sortable tbody tr').show();
+						} else {
+							$('table.sortable tbody tr').each(function() {
+																	  if ($('td:nth-child('+filter_using+')', this).text().toLowerCase().indexOf($('#filter').val().toLowerCase())>=0) {
+																		  $(this).show();
+																	  } else if ($('th',this).length == 0){
+																		  $(this).hide();
+																	  } else {
+																		  $(this).hide;
+																	  }
+																	});
+						};
+					});
+}
+function mailprotect (user, domain, ext, name) {
+	document.write("<" + "a" + " hr" + "ef=" + "mai" + "lto:" + user + "@" + domain + "." + ext + ">" + name + "</" + "a>");
+}
+
+function updateVote(tvote) {
+	if(voted<=0){
+		if(tvote<=0 && voted>0){
+			tvote = voted;
+		}
+		$('.vote_vote').removeClass('vote_selected').removeClass('vote_selected_back');
+		if(tvote>0){
+			$('#vote_10 a').html(tvote + "");
+			$('#vote_' + tvote).addClass('vote_selected');
+			for(i=1;i<=tvote;i++){
+				$('#vote_' + i).addClass('vote_selected_back');
+			}
+		} else {
+			$('#vote_10 a').html("");
+		}
+	}
+}
+
+function saveVote(pbi_id,tvote){
+	if(voted<=0 && tvote>0){
+		$.post(pbi_id + "/vote/"+ tvote,
+			{ajax:1},
+			function(data,textStatus){
+				if(textStatus=='success'){
+					if(data == 'success' || data>0){
+						voted=tvote;
+						no_more_votes();
+						if(data>0){
+							$('.rating_bar').html(data).width(data*10);
+						}
+						alert ('Thank you for your vote !');
+					} else {
+						alert ('Error: ' + data);
+					}
+				} else {
+					alert ('Error casting your vote!!' + "\n\n" + textStatus);
+				}
+			});
+	} else if(voted>0){
+		no_more_votes();
+	}
+}
+
+function no_more_votes(){
+	if(voted>0){
+		var tvote = $('#vote_10 a').html();
+		$('.vote_vote').html("&nbsp;");
+		$('#vote_10').html(tvote);
+	}
+}
+
+/*******************************************
+ *  COMMENTS
+ ******************************************/
+function check_comment_submit(){
+	var pbi_comment = jQuery.trim($('#pbi_comment').val());
+	if(pbi_comment==''){
+		alert('You must enter a comment !!');
+		return false;
+	}
+	return true;
+}
+
+function load_comment_form(form_uri){
+	$('#comment_form_div').load(form_uri,
+		function(){
+			$('#pbi_comment').focus();
+		});
+}
+
+
+function saveComment(save_comment_uri){
+	if(check_comment_submit()){
+		$.post(
+			save_comment_uri,
+			{
+				pbi_comment: $.trim($('#pbi_comment').val()),
+				ajax:1
+			},
+			function(xml){
+				var _error = '';
+				var _date = '';
+				var _user = '';
+				var _body = '';
+				$("message",xml).each(function(){
+					_error	= $('error',this).text();
+					if(_error==''){
+						_cid	= $('cid',this).text();
+						_date	= $('date',this).text();
+						_user	= $('user',this).text();
+						_body	= $('body',this).text().replace(/\n/g, '<br />');
+						_usr_uri= $('usr_uri',this).text();
+						prependComment(_cid, _user, _date, _body, _usr_uri);
+						$('#comment_form_div').html("");
+					} else {
+						alert ('Error Saving your comment!!' + "\n\n" + _error);
+						return false;
+					}
+				})
+			}
+		);
+		return false;	//using ajax !!! - set this to TRUE if want to post the form via BROWSER POST, remove the "$.post" as well
+	} else {
+		return false;
+	}
+}
+
+/*******************************************
+ * create a new comment
+ ******************************************/
+function showComment(cid, user, date, comment, user_uri){
+	var newMSG = '';
+	newMSG = newMSG + '<div class="comment_message" id="cid' + cid + '"><div class="comment_header">';
+	newMSG = newMSG + '<span class="comment_user"><a href="' + user_uri + '" target="_top">' + user + '</a></span>';
+	if(can_comment_delete){
+		newMSG = newMSG + '<span class="comment_actions"><a href="javascript:void(0);" onclick="deleteComment(' + cid + ');" target="_top">delete #' + cid + '</a></span>';
+	}
+	newMSG = newMSG + '<span class="comment_date">' + date + '</span>';
+	newMSG = newMSG + '</div>';
+	newMSG = newMSG + '<div class="comment_body">' + comment + '</div>';
+	newMSG = newMSG + '</div>';
+	return newMSG;
+}
+
+function deleteComment(cid){
+	if(cid!=''){
+		if(confirm('Are you sure you want to remove Comment #' + cid)){
+			$.get(delete_comment_uri + "/" + cid,
+				function(data,textStatus){
+					if(textStatus=='success'){
+						if(data == 'success'){
+							$('#cid' + cid).trigger("unload").unbind().remove();
+						} else {
+							alert ('Error: ' + data);
+						}
+					} else {
+						alert ('Error deleting the comment!!' + "\n\n" + textStatus);
+					}
+				});
+		}
+	}
+}
+
+function appendComment(cid, user, date, comment, user_uri){
+	$('#comment_list').append(showComment(cid, user, date, comment, user_uri));
+}
+
+function prependComment(cid, user, date, comment, user_uri){
+	$('#comment_list').prepend(showComment(cid, user, date, comment, user_uri));
+}
+
+/*******************************************
+ * subscription
+ ******************************************/
+function subscribe_pbi(uri){
+	$.get(
+		uri,
+		function(data,textStatus){
+			if(textStatus=='success'){
+				$('#subscribe_pbi').html(data);
+			} else {
+				alert ('Error updating subscription!!' + "\n\n" + textStatus);
+			}
+		}
+	);
+	return false;
+}
+/*******************************************
+ * manage Forms via XML
+ ******************************************/
+function postForm(form,uri, message_success){
+	var message_success = (message_success == null) ? false : message_success;
+	var ok = false;
+	if(uri.indexOf('delete')>=0){
+		ok=confirm('You sure you want to continue ?');
+	} else {
+		ok=true;
+	}
+	if(!ok) return false;
+	var values = {'ajax':''};
+	var sel = {};
+	var getValue = (function(what, tt){
+		var nn = $(what).attr("name");
+		var vv = $(what).val();
+		values[nn] = vv;
+		if(tt == 'select')	sel[nn] = $('#'+nn+vv,what).text();
+		else				sel[nn] = null;
+	});
+	$('.' + form + ' input').each(function(){getValue(this, 'input');});
+	$('.' + form + ' select').each(function(){getValue(this,'select');});
+	$('.' + form + ' textarea').each(function(){getValue(this,'textarea');});
+	$.post(
+		uri,
+		values,
+		function(data){
+			if(data=='success'){
+				if(message_success==true){
+					alert('Action Successfully Completed !!');
+				}
+				//need to update the table ROW as well
+				divBox_remove();
+				if(values['id']<=0){
+					//need to refresh the page
+					window.location.reload();
+				} else if(uri.indexOf('delete')>=0){
+					$('#rec' + values['id']).trigger("unload").unbind().remove();
+				} else {
+					for (var key in values){
+						var txt = $('#' + key + '_' + values['id']).html();
+						if(null != txt){
+							vv = null==sel[key]?values[key]:sel[key];
+							if(txt.indexOf("<a")>=0){
+								$('#' + key + '_' + values['id'] + ' a').text(vv);
+							} else if(txt.indexOf("<img")>=0){
+								$('#' + key + '_' + values['id'] + ' img').attr('src',vv);
+							} else {
+								$('#' + key + '_' + values['id']).text(vv);
+							}
+						}
+					}
+				}
+			} else {
+				alert('Error!!' + "\n\n" + data);
+			}
+		}
+	);
+	return false;
+}
+
+
+function show_related_table(uri, field_to, field_from, div, click_from){
+	var t = {};
+	t[field_to] = field_from;
+	t["_srt_field_to"] = field_to;
+	t["_srt_field_from"] = field_from;
+	t["_srt_div"] = div;
+	t["ajax"] = '1';
+	if(click_from!=''){
+		$(click_from).html($(click_from).html().replace(/show|refresh/i,'Loading') + '...');
+	}
+	$.post(uri,t, function(data){
+						   $('#'+div).html(data);
+						   init();
+						   if(click_from!=''){
+							   $(click_from).html($(click_from).html().replace(/Loading/i,'Refresh').replace(/\.\.\./,''));
+						   }
+						});
+}
+
+/*******************************************
+ * show a new DIV with content
+ ******************************************/
+function divBox(){
+	$('.divBox').click(function(){
+								if(this.tagName.toLowerCase()=='a'){
+									divBox_open($(this).attr('href'));
+//								} else if($(this).parent().tagName.toLowerCase()=='a') {
+								} else {
+									divBox_open($(this).parent().attr('href'));
+								}
+								return false;
+								}).removeClass('divBox');
+}
+function divBox_open(uri){
+	//I did not like some functionalities of thickbox
+	//so here is my solution
+	//create a new div as large as the .content div
+	//starting to the same TOP and LEFT of .content
+	//and pretty much emulate the thickbox
+	if(uri=="") return false;
+	divBox_remove();
+	var divName = 'FP_divBOX';
+	var ddiv = $( "<div id='"+divName+"'><br /></div>" );
+	ddiv.load(uri);
+	var orig = $('#content');
+	var offset = orig.offset();
+	var oWidth = orig.width();
+	var oHeight = orig.height();
+
+	var t = orig;
+	while(oWidth == 0){
+		t = t.parent();
+		oWidth = t.width();
+	}
+    orig.after(ddiv);
+	ddiv.show();
+	orig.hide();
+}
+function divBox_remove(){
+	var divName = 'FP_divBOX';
+	var orig = $('#content');
+	$('#' + divName).hide().trigger("unload").unbind().remove();
+	orig.show();
+}
+
+
+function imageScroller(frame){
+	var _imgFrame = $('.' + frame);
+	var _child = "a";
+	var _itv;
+	var imgScroller = function(){
+		autoStop();
+		_imgFrame.find(_child+":first").clone().show().appendTo( _imgFrame );
+//		_h = $('img',_imgFrame.find(_child+":first")).height()
+		$('img',_imgFrame.find(_child+":first")).animate({height:0},'slow', function(){
+			_imgFrame.find(_child+":first").remove().hide();
+			autoPlay(); 
+		});
+																								   
+		
+//		_imgFrame.animate( {marginTop:-_h}, 'slow' ,'', function(){
+//			_imgFrame.find(_child+":first").remove().hide();
+//			_imgFrame.css("marginTop",0);
+//			autoPlay(); 
+//		});
+	};
+	
+	var autoPlay = function(){
+	  _itv = window.setInterval(imgScroller, 3000);
+	};
+	var autoStop = function(){
+		window.clearInterval(_itv);
+	};
+	if(_imgFrame.find(_child).size()>1){
+//	if(_imgFrame.width() < (_width*_imgFrame.find(_child).size())){
+		autoPlay();
+	}
+};

Added: websites/pbidir.com/bibivu/tpl/js/jquery-ui-1.5b3.packed.js

Modified: websites/pbidir.com/bibivu/tpl/pbidir/pbi_versions.php
===================================================================
--- websites/pbidir.com/bibivu/tpl/pbidir/pbi_versions.php	2008-05-28 18:51:23 UTC (rev 1989)
+++ websites/pbidir.com/bibivu/tpl/pbidir/pbi_versions.php	2008-05-29 03:16:06 UTC (rev 1990)
@@ -1,30 +1,41 @@
-<div class="pbi_releases">
-<?php
-if(is_array($pbi_releases) && count($pbi_releases)>0){
-	?><table class="list sortable" cellpadding="0" cellspacing="0">
-	<thead class="head">
-		<tr>
-			<th width="100"><?=load_library('lang')->get('pbi_version')?></th>
-			<th><?=load_library('lang')->get('pbi_summary')?></th>
-			<th width="75"><?=load_library('lang')->get('pbi_size')?></th>
-			<th width="75"><?=load_library('lang')->get('pbi_added')?></th>
-			<th width="75"><?=load_library('lang')->get('pcbsd')?></th>
-		</tr>
-	</thead>
-	<tbody><?php
-	foreach($pbi_releases as $pbi_release){
-		?><tr>
-			<td align="left"><a href="<?=$download_uri?>/<?=$pbi['id']?>/<?=$pbi_release['id']?>"><?=$pbi_release['version'].($pbi_release['bits']!='32'?' x'.$pbi_release['bits']:'')?></a></td>
-			<td align="left"><?=$pbi_release['summary']?></td>
-			<td align="right"><?=load_library('format')->bytes($pbi_release['size']*1024*1024)?></td>
-			<td align="right"><?=load_library('format')->date($pbi_release['date_last_modified'])?></td>
-			<td align="right"><?=$pbi_release['pcbsd_version']?></td>
-		</tr><?php
-	}
-?></tbody>
-</table><?php
-} else {
-	// No Releases Found !
-}
-?>
-</div>
\ No newline at end of file
+<?php
+if(is_array($pbi_releases) && count($pbi_releases)>0){
+	?>
+<div class="pbi_releases"><?php
+	?><ul><?php
+	foreach($pbi_releases as $key=>$value){
+		?><li><a href="#x<?=$key?>"><span><?=$key?> bit</span></a></li><?php
+	}
+	?></ul><?php
+	foreach($pbi_releases as $key=>$value){
+		?><div id="x<?=$key?>">
+		<table class="list sortable" cellpadding="0" cellspacing="0">
+			<thead class="head">
+				<tr>
+					<th width="100"><?=load_library('lang')->get('pbi_version')?></th>
+					<th><?=load_library('lang')->get('pbi_summary')?></th>
+					<th width="75"><?=load_library('lang')->get('pbi_size')?></th>
+					<th width="75"><?=load_library('lang')->get('pbi_added')?></th>
+					<th width="75"><?=load_library('lang')->get('pcbsd')?></th>
+				</tr>
+			</thead>
+			<tbody><?php
+		foreach($value as $pbi_release){
+			?><tr>
+				<td align="left"><a href="<?=$download_uri?>/<?=$pbi['id']?>/<?=$pbi_release['id']?>"><?=$pbi_release['version']?></a></td>
+				<td align="left"><?=$pbi_release['summary']?></td>
+				<td align="right"><?=load_library('format')->bytes($pbi_release['size']*1024*1024)?></td>
+				<td align="right"><?=load_library('format')->date($pbi_release['date_last_modified'])?></td>
+				<td align="right"><?=$pbi_release['pcbsd_version']?></td>
+			</tr><?php
+		}
+		?></tbody>
+		</table>
+	</div><?php
+	}
+	?>
+</div><?php
+} else {
+	// No Releases Found !
+}
+?>
\ No newline at end of file



More information about the Commits mailing list