2 function openClose(theID) {
3 if(document.getElementById(theID).style.display == "block") {
4 document.getElementById(theID).style.display = "none"
7 document.getElementById(theID).style.display = "block"
11 function openMenu(theID) {
12 document.getElementById(theID).style.display = "block"
15 function closeMenu(theID) {
16 document.getElementById(theID).style.display = "none"
29 $(document).ready(function() {
30 $.ajaxSetup({cache: false});
31 msie = $.browser.msie ;
33 // Allow folks to stop the ajax page updates with the pause/break key
34 $(document).keypress(function(event) {
35 if(event.keyCode == '19') {
36 event.preventDefault();
37 if(stopped == false) {
39 $('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
49 function NavUpdate() {
51 if($('#live-network').length) { src = 'network'; liveUpdate(); }
52 if($('#live-profile').length) { src = 'profile'; liveUpdate(); }
53 if($('#live-display').length) {
56 window.location.href=window.location.href
59 if($('#live-photos').length) {
62 window.location.href=window.location.href
67 $.get("ping",function(data) {
68 $(data).find('result').each(function() {
69 var net = $(this).find('net').text();
70 if(net == 0) { net = ''; }
71 $('#net-update').html(net);
72 var home = $(this).find('home').text();
73 if(home == 0) { home = ''; }
74 $('#home-update').html(home);
75 var mail = $(this).find('mail').text();
76 if(mail == 0) { mail = ''; }
77 $('#mail-update').html(mail);
78 var intro = $(this).find('intro').text();
79 if(intro == 0) { intro = ''; }
80 $('#notify-update').html(intro);
84 timer = setTimeout(NavUpdate,30000);
88 function liveUpdate() {
89 if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
90 if($('.comment-edit-text-full').length) {
91 livetime = setTimeout(liveUpdate, 10000);
96 $.get('update_' + src + '?p=' + profile_uid + '&msie=' + ((msie) ? 1 : 0),function(data) {
97 $('.wall-item-outside-wrapper',data).each(function() {
98 var ident = $(this).attr('id');
99 if($('#' + ident).length == 0) {
100 $('img',this).each(function() {
101 $(this).attr('src',$(this).attr('dst'));
103 $('#' + prev).after($(this));
107 $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago'));
108 $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
109 $('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like'));
110 $('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike'));
111 $('#' + ident + ' ' + '.my-comment-photo').each(function() {
112 $(this).attr('src',$(this).attr('dst'));
119 $('.like-rotator').hide();
124 function imgbright(node) {
125 $(node).attr("src",$(node).attr("src").replace('hide','show'));
126 $(node).css('width',24);
127 $(node).css('height',24);
130 function imgdull(node) {
131 $(node).attr("src",$(node).attr("src").replace('show','hide'));
132 $(node).css('width',16);
133 $(node).css('height',16);
136 // Since our ajax calls are asynchronous, we will give a few
137 // seconds for the first ajax call (setting like/dislike), then
138 // run the updater to pick up any changes and display on the page.
139 // The updater will turn any rotators off when it's done.
140 // This function will have returned long before any of these
141 // events have completed and therefore there won't be any
142 // visible feedback that anything changed without all this
143 // trickery. This still could cause confusion if the "like" ajax call
144 // is delayed and NavUpdate runs before it completes.
146 function dolike(ident,verb) {
147 $('#like-rotator-' + ident.toString()).show();
148 $.get('like/' + ident.toString() + '?verb=' + verb );
149 if(timer) clearTimeout(timer);
150 timer = setTimeout(NavUpdate,3000);
154 function getPosition(e) {
155 var cursor = {x:0, y:0};
156 if ( e.pageX || e.pageY ) {
161 if( e.clientX || e.clientY ) {
162 cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
163 cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
175 var lockvisible = false;
177 function lockview(event,id) {
178 event = event || window.event;
179 cursor = getPosition(event);
185 $.get('lockview/' + id, function(data) {
186 $('#panel').html(data);
187 $('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
193 function lockviewhide() {