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"
28 var in_progress = false;
30 $(document).ready(function() {
31 $.ajaxSetup({cache: false});
32 msie = $.browser.msie ;
34 // Allow folks to stop the ajax page updates with the pause/break key
35 $(document).keypress(function(event) {
36 if(event.keyCode == '19') {
37 event.preventDefault();
38 if(stopped == false) {
40 $('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
50 function NavUpdate() {
52 if($('#live-network').length) { src = 'network'; liveUpdate(); }
53 if($('#live-profile').length) { src = 'profile'; liveUpdate(); }
54 if($('#live-display').length) {
57 window.location.href=window.location.href
60 if($('#live-photos').length) {
63 window.location.href=window.location.href
68 $.get("ping",function(data) {
69 $(data).find('result').each(function() {
70 var net = $(this).find('net').text();
71 if(net == 0) { net = ''; }
72 $('#net-update').html(net);
73 var home = $(this).find('home').text();
74 if(home == 0) { home = ''; }
75 $('#home-update').html(home);
76 var mail = $(this).find('mail').text();
77 if(mail == 0) { mail = ''; }
78 $('#mail-update').html(mail);
79 var intro = $(this).find('intro').text();
80 if(intro == 0) { intro = ''; }
81 $('#notify-update').html(intro);
85 timer = setTimeout(NavUpdate,30000);
89 function liveUpdate() {
90 if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
91 if(($('.comment-edit-text-full').length) || (in_progress)) {
92 livetime = setTimeout(liveUpdate, 10000);
98 $.get('update_' + src + '?p=' + profile_uid + '&msie=' + ((msie) ? 1 : 0),function(data) {
100 $('.wall-item-outside-wrapper',data).each(function() {
101 var ident = $(this).attr('id');
102 if($('#' + ident).length == 0) {
103 $('img',this).each(function() {
104 $(this).attr('src',$(this).attr('dst'));
106 $('#' + prev).after($(this));
110 $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago'));
111 $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
112 $('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like'));
113 $('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike'));
114 $('#' + ident + ' ' + '.my-comment-photo').each(function() {
115 $(this).attr('src',$(this).attr('dst'));
122 $('.like-rotator').hide();
127 function imgbright(node) {
128 $(node).attr("src",$(node).attr("src").replace('hide','show'));
129 $(node).css('width',24);
130 $(node).css('height',24);
133 function imgdull(node) {
134 $(node).attr("src",$(node).attr("src").replace('show','hide'));
135 $(node).css('width',16);
136 $(node).css('height',16);
139 // Since our ajax calls are asynchronous, we will give a few
140 // seconds for the first ajax call (setting like/dislike), then
141 // run the updater to pick up any changes and display on the page.
142 // The updater will turn any rotators off when it's done.
143 // This function will have returned long before any of these
144 // events have completed and therefore there won't be any
145 // visible feedback that anything changed without all this
146 // trickery. This still could cause confusion if the "like" ajax call
147 // is delayed and NavUpdate runs before it completes.
149 function dolike(ident,verb) {
150 $('#like-rotator-' + ident.toString()).show();
151 $.get('like/' + ident.toString() + '?verb=' + verb );
152 if(timer) clearTimeout(timer);
153 timer = setTimeout(NavUpdate,3000);
157 function getPosition(e) {
158 var cursor = {x:0, y:0};
159 if ( e.pageX || e.pageY ) {
164 if( e.clientX || e.clientY ) {
165 cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
166 cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
178 var lockvisible = false;
180 function lockview(event,id) {
181 event = event || window.event;
182 cursor = getPosition(event);
188 $.get('lockview/' + id, function(data) {
189 $('#panel').html(data);
190 $('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
196 function lockviewhide() {