85 |
85 |
setCookie("sms-login", false);
|
86 |
86 |
}
|
87 |
87 |
|
|
88 |
//make sure the given docid is public then call checkLogin()
|
|
89 |
function checkPublicAccess(docid)
|
|
90 |
{
|
|
91 |
var lastpublicaccess = getCookie("sms-last-public-access");
|
|
92 |
if(lastpublicaccess == null || lastpublicaccess != docid)
|
|
93 |
{ //only make it public if it wasn't already made public
|
|
94 |
makepublic(docid);
|
|
95 |
}
|
|
96 |
checkLogin();
|
|
97 |
}
|
|
98 |
|
88 |
99 |
//make sure the user is logged in.
|
89 |
100 |
function checkLogin()
|
90 |
101 |
{
|
... | ... | |
220 |
231 |
'<a href="/sms/metacat?action=read&docid=' + docid + '&qformat=sms">' + docid +
|
221 |
232 |
'</a> is now publicly readable.</p>');
|
222 |
233 |
slideDown("#uploadstatus");
|
223 |
|
//alert('success: ' + "#makepublic");
|
224 |
|
//slideUp("#makepublic");
|
|
234 |
setCookie("sms-last-public-access", docid);
|
225 |
235 |
}
|
226 |
236 |
else
|
227 |
237 |
{
|
... | ... | |
323 |
333 |
{
|
324 |
334 |
setCookie('sms-current-tab', 'search');
|
325 |
335 |
//hide all, then slide down the search pane
|
326 |
|
$('#uploaddiv').fadeOut("slow");
|
327 |
|
$('#browseresultdiv').fadeOut("slow");
|
|
336 |
$('#uploaddiv').hide();
|
|
337 |
$('#browseresultdiv').hide();
|
328 |
338 |
$('#searchdiv').fadeIn("slow");
|
329 |
339 |
switchTabs('search');
|
330 |
340 |
}
|
... | ... | |
334 |
344 |
{
|
335 |
345 |
setCookie('sms-current-tab', 'upload');
|
336 |
346 |
//hide all, then slide down the upload pane
|
337 |
|
$('#searchdiv').fadeOut("slow");
|
338 |
|
$('#browseresultdiv').fadeOut("slow");
|
|
347 |
$('#searchdiv').hide();
|
|
348 |
$('#browseresultdiv').hide();
|
339 |
349 |
$('#uploaddiv').fadeIn("slow");
|
340 |
350 |
$('#uploadetabimg').hide();
|
341 |
351 |
$('#uploadtabimgsel').show();
|
... | ... | |
346 |
356 |
function showBrowsePane()
|
347 |
357 |
{
|
348 |
358 |
setCookie('sms-current-tab', 'browse');
|
|
359 |
var page = getCookie('sms-browse-pagestart');
|
|
360 |
if(!page)
|
|
361 |
{
|
|
362 |
page = 0;
|
|
363 |
}
|
349 |
364 |
var contentLoaded = getCookie('sms-browse-content-loaded');
|
350 |
365 |
if(!contentLoaded)
|
351 |
366 |
{
|
352 |
|
reloadSearchContent('/sms/metacat?action=query&anyfield=%25&returnfield=dataset/title&qformat=sms&pagesize=10&pagestart=0');
|
|
367 |
reloadSearchContent('/sms/metacat?action=query&anyfield=%25&returnfield=dataset/title&qformat=sms&pagesize=10&pagestart=' + page);
|
353 |
368 |
}
|
354 |
369 |
//hide all, then slide down the browse pane
|
355 |
|
$('#searchdiv').fadeOut("slow");
|
356 |
|
$('#uploaddiv').fadeOut("slow");
|
|
370 |
$('#searchdiv').hide();
|
|
371 |
$('#uploaddiv').hide();
|
357 |
372 |
$('#browseresultdiv').fadeIn("slow");
|
358 |
373 |
$('#browsetabimg').hide();
|
359 |
374 |
$('#browsetabimgsel').show();
|
360 |
375 |
switchTabs('browse');
|
361 |
376 |
}
|
362 |
377 |
|
|
378 |
//switch to a given tab
|
363 |
379 |
function switchTabs(tab)
|
364 |
380 |
{
|
365 |
381 |
if(tab == 'browse')
|