Project

General

Profile

« Previous | Next » 

Revision 4002

Added by berkley over 16 years ago

cleaned up the upload functionality a bit.

View differences:

lib/style/skins/sms/index.jsp
81 81
              <%
82 82
                if(status != null && status.equals("success"))
83 83
                {
84
                  out.print("Your <a href=\"http://linus.nceas.ucsb.edu/sms/metacat?docid=" + docid 
85
                  + "&action=read&qformat=sms\">file</a> was successfully uploaded.");
84
                  out.print("Your file was successfully uploaded with id <a href=\"http://linus.nceas.ucsb.edu/sms/metacat?docid=" + docid 
85
                  + "&action=read&qformat=sms\">" + docid + "</a>.");
86 86
                }
87 87
                else
88 88
                {
lib/style/skins/sms/util.js
26 26
    }, "XML");
27 27
}
28 28

  
29
function updateStatus()
30
{
31
  var url = window.location.href;
32
  if(url.indexOf('docid') != -1)
33
  { //if there's a docid in the url, set the cookie
34
    var docid = url.substring(url.indexOf("docid=") + 6, url.indexOf("&status"));
35
    var docidcookie = getCookie("sms-lastdocid");
36
    if(docid != docidcookie)
37
    { //set the cookie for next time
38
      setCookie("sms-lastdocid", docid);
39
      //slideDown("#uploadstatus");
40
      $('#uploadstatus').css("display", "block");
41
    }
42
    else
43
    { //hide the status
44
      $('#uploadstatus').css("display", "none");
45
      //slideUp("#uploadstatus");
46
    }
47
  }
48
  
49
}
50

  
29 51
function setLoginHeader(loggedin)
30 52
{
31 53
  if(loggedin)
32 54
  {
55
    updateStatus();
33 56
    var user = getCookie("sms-user");
34 57
    $('#loginheader').replaceWith("<h2 style=\"text-align:center\" id=\"loginheader\">" 
35 58
      + user + " Logged In <a href=\"javascript:\" onclick=\"logout()\" style=\"font-size:70%\">[logout]</a></h2>");
lib/style/skins/sms/sms.css
40 40
{
41 41
  text-decoration:none;
42 42
  color:white;
43
  font-size: 70%;
44 43
}

Also available in: Unified diff