Remove trailing whitespace throughout project
This commit is contained in:
parent
74b8f16aa2
commit
bd6140a8cc
1753 changed files with 24077 additions and 24077 deletions
|
@ -2,16 +2,16 @@
|
|||
|
||||
<!-- $This file is distributed under the terms of the license in LICENSE$ -->
|
||||
|
||||
<!-- ======================================================================
|
||||
Build script for the ORNG Shindig webapp.
|
||||
|
||||
<!-- ======================================================================
|
||||
Build script for the ORNG Shindig webapp.
|
||||
|
||||
This can be used on its own, or invoked from the "orng" target of the main build file.
|
||||
====================================================================== -->
|
||||
|
||||
<project name="ORNG-shindig" default="describe">
|
||||
|
||||
<!-- =================================
|
||||
target: describe
|
||||
<!-- =================================
|
||||
target: describe
|
||||
================================= -->
|
||||
<target name="describe" description="--> Describe the targets (this is the default).">
|
||||
<echo>
|
||||
|
@ -21,13 +21,13 @@ deploy - Configure the application and deploy directly into the Tomcat webapps
|
|||
</echo>
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: all
|
||||
<!-- =================================
|
||||
target: all
|
||||
================================= -->
|
||||
<target name="all" depends="clean, deploy" description="--> Run 'clean', then 'deploy'" />
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: properties
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: properties
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="properties">
|
||||
<property name="build.properties.file" location="../webapp/config/build.properties" />
|
||||
|
@ -39,7 +39,7 @@ deploy - Configure the application and deploy directly into the Tomcat webapps
|
|||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
|
||||
|
||||
<property file="${build.properties.file}" />
|
||||
|
||||
<fail unless="tomcat.home" message="${build.properties.file} must contain a value for tomcat.home" />
|
||||
|
@ -48,14 +48,14 @@ deploy - Configure the application and deploy directly into the Tomcat webapps
|
|||
|
||||
<property name="runtime.properties.file" location="${vitro.home}/runtime.properties" />
|
||||
|
||||
<fail message="The runtime properties file "${runtime.properties.file}" does not exist.">
|
||||
<fail message="The runtime properties file "${runtime.properties.file}" does not exist.">
|
||||
<condition>
|
||||
<not>
|
||||
<available file="${runtime.properties.file}" />
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
|
||||
|
||||
<property file="${runtime.properties.file}" />
|
||||
|
||||
<fail unless="VitroConnection.DataSource.url" message="${runtime.properties.file} must contain a value for VitroConnection.DataSource.url" />
|
||||
|
@ -110,16 +110,16 @@ deploy - Configure the application and deploy directly into the Tomcat webapps
|
|||
<property name="shindig.properties.template.file" location="${basedir}/shindigorng.properties.template" />
|
||||
<property name="shindig.properties.modified.file" location="${build.shindig.dir}/shindigorng.properties" />
|
||||
<property name="shindig.properties.deployed.file" location="${shindig.config.dir}/shindigorng.properties" />
|
||||
|
||||
|
||||
<!-- sample-gadgets webapp -->
|
||||
<property name="sample.webapp.original.dir" location="./sample-gadgets" />
|
||||
<property name="sample.webapp.deployed.dir" location="${tomcat.webapps.dir}/sample-gadgets" />
|
||||
|
||||
|
||||
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: clean
|
||||
<!-- =================================
|
||||
target: clean
|
||||
================================= -->
|
||||
<target name="clean" depends="properties" description="--> Delete all artifacts">
|
||||
<delete includeemptydirs="true" failonerror="false">
|
||||
|
@ -130,8 +130,8 @@ deploy - Configure the application and deploy directly into the Tomcat webapps
|
|||
</delete>
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: prepare
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: prepare
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="prepare" depends="properties">
|
||||
<mkdir dir="${build.dir}" />
|
||||
|
@ -141,8 +141,8 @@ deploy - Configure the application and deploy directly into the Tomcat webapps
|
|||
<mkdir dir="${shindig.config.dir}" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: modifyPropertiesFile
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: modifyPropertiesFile
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="modifyPropertiesFile" depends="properties, prepare">
|
||||
<copy file="${shindig.properties.template.file}" toFile="${shindig.properties.modified.file}">
|
||||
|
@ -157,8 +157,8 @@ deploy - Configure the application and deploy directly into the Tomcat webapps
|
|||
</copy>
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: deploy
|
||||
<!-- =================================
|
||||
target: deploy
|
||||
================================= -->
|
||||
<target name="deploy" depends="modifyPropertiesFile" description="--> Deploy the application directly into the Tomcat webapps directory.">
|
||||
<copy file="${shindig.properties.modified.file}" tofile="${shindig.properties.deployed.file}" />
|
||||
|
@ -168,4 +168,4 @@ deploy - Configure the application and deploy directly into the Tomcat webapps
|
|||
</copy>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
|
|
@ -14,28 +14,28 @@
|
|||
<Content type="html" view="default, home, profile">
|
||||
<![CDATA[<!--HTML-->
|
||||
<!DOCTYPE html>
|
||||
|
||||
|
||||
<!-- #includes -->
|
||||
<link rel="stylesheet" href="css/gadget.css" type="text/css" media="screen, projection" >
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/os.js" ></script>
|
||||
|
||||
|
||||
<style>
|
||||
.links_title { font-family:Verdana, Arial; font-size: 14px; }
|
||||
.links_body { font-family:Arial; font-size: 12px; }
|
||||
.links_credit { font-family:Arial; font-size:10px; }
|
||||
.links_save_button { height:20px; font-size:11px; }
|
||||
.links_save_button { height:20px; font-size:11px; }
|
||||
a, a:visited { color: #0088CC; text-decoration: none; }
|
||||
a:hover { color: #005580; text-decoration: underline; }
|
||||
</style>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var g_max_links = 5;
|
||||
var g_oLinks = []; // declare it like this to make json work
|
||||
|
||||
|
||||
// ========================================
|
||||
|
||||
|
||||
function sort_by (field, reverse, primer) {
|
||||
reverse = (reverse) ? -1 : 1;
|
||||
return function(a,b) {
|
||||
|
@ -51,100 +51,100 @@
|
|||
}
|
||||
}
|
||||
// ========================================
|
||||
|
||||
|
||||
|
||||
|
||||
// ========================================
|
||||
|
||||
|
||||
function deleteArrayItem (array_index) {
|
||||
g_oLinks.splice(array_index,1);
|
||||
|
||||
|
||||
// write links data to gadget database
|
||||
osapi.appdata.update({'userId': '@viewer', 'appId': '@app', 'data': {'links' : gadgets.json.stringify(g_oLinks)} }).execute(function(result) {
|
||||
if (result.error) {
|
||||
if (result.error) {
|
||||
alert("Error " + result.error.code + " writing application data: " + result.error.message + ". Your edited link list was not saved.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// show links w/o deleted item even if data write fails - array already spliced
|
||||
displayData();
|
||||
}
|
||||
// ========================================
|
||||
|
||||
|
||||
|
||||
|
||||
// ========================================
|
||||
|
||||
|
||||
function readData(callback) {
|
||||
osapi.appdata.get({'userId': '@owner', 'appId':'@app', 'fields' : ['links']} ).execute(function(result){
|
||||
|
||||
|
||||
// get incoming link data (in json string format)
|
||||
var viewer = os.osapi.getViewerFromResult(result);
|
||||
|
||||
|
||||
// convert to json object format
|
||||
g_oLinks = gadgets.json.parse(viewer.links) || [];
|
||||
|
||||
|
||||
// execute the callback;
|
||||
callback();
|
||||
|
||||
}); /* end osapi.appdata.get */
|
||||
|
||||
}); /* end osapi.appdata.get */
|
||||
}
|
||||
// ========================================
|
||||
|
||||
|
||||
// ========================================
|
||||
|
||||
|
||||
|
||||
// ========================================
|
||||
|
||||
function displayData() {
|
||||
|
||||
|
||||
// if links data exists
|
||||
if (g_oLinks) {
|
||||
|
||||
|
||||
// sort object by link name, case-insensitive, A-Z
|
||||
g_oLinks.sort(sort_by('link_name', false, function(a){return a.toUpperCase()}));
|
||||
|
||||
|
||||
if (document.getElementById("edit_links_table")){
|
||||
|
||||
|
||||
// EDIT MODE - build table to hold retrieved app data
|
||||
var links_table_data = "<table cellspacing='10' cellpadding='0' border='0'><tr>";
|
||||
var favicon_path_array;
|
||||
|
||||
|
||||
for (i in g_oLinks) {
|
||||
cell_name = g_oLinks[i].link_name;
|
||||
cell_url = g_oLinks[i].link_url;
|
||||
cell_url2 = g_oLinks[i].link_url;
|
||||
|
||||
|
||||
favicon_path_array = cell_url.split("//");
|
||||
cell_url2 = favicon_path_array[1];
|
||||
favicon_path_array = cell_url2.split("/");
|
||||
cell_url2 = favicon_path_array[0];
|
||||
cell_favicon="<img height='16' width=16' src='http://www.google.com/s2/favicons?domain=" + cell_url2 + "' />";
|
||||
|
||||
|
||||
// build and add table row
|
||||
links_table_data = links_table_data
|
||||
+ "<tr>" + "<td>" + cell_favicon + "</td>"
|
||||
+ "<td>" + "<a href='" + cell_url + "' target='_blank'>" + cell_name + "</a></td>"
|
||||
+ "<td>" + cell_url + "</td>"
|
||||
+ "<td><input type='button' class='links_save_button' value='Delete' onClick='deleteArrayItem("
|
||||
+ "<td><input type='button' class='links_save_button' value='Delete' onClick='deleteArrayItem("
|
||||
+ i + ")'" + "></td>" + "</tr>";
|
||||
}
|
||||
|
||||
|
||||
// close the table
|
||||
links_table_data = links_table_data + "</tr></table>";
|
||||
|
||||
|
||||
// put appdata table markup in designated div
|
||||
// and set height based on which view view this is
|
||||
document.getElementById("edit_links_table").innerHTML=links_table_data;
|
||||
gadgets.window.adjustHeight(250 + ((g_oLinks.length - 1) * 28 * 2) + 10 );
|
||||
}
|
||||
|
||||
if(document.getElementById("view_links_table")){
|
||||
|
||||
|
||||
if(document.getElementById("view_links_table")){
|
||||
|
||||
// VIEW MODE - build table to hold retrieved app data
|
||||
links_table_data = "<table cellspacing='10' cellpadding='0' border='0'><tr>";
|
||||
|
||||
|
||||
for (i in g_oLinks) {
|
||||
cell_name = g_oLinks[i].link_name;
|
||||
cell_url = g_oLinks[i].link_url;
|
||||
cell_url2 = g_oLinks[i].link_url;
|
||||
|
||||
|
||||
favicon_path_array = cell_url.split("//");
|
||||
cell_url2 = favicon_path_array[1];
|
||||
favicon_path_array = cell_url2.split("/");
|
||||
|
@ -155,14 +155,14 @@
|
|||
links_table_data = links_table_data
|
||||
+ "<tr>" + "<td>" + cell_favicon + "</td>"
|
||||
+ "<td onClick=\"gadgetEventTrack('go_to_website', cell_name)\">" + "<a href='" + cell_url + "' target='_blank'>" + cell_name + "</a></td>" + "</tr>";
|
||||
}
|
||||
}
|
||||
// close the table
|
||||
links_table_data = links_table_data + "</tr></table>";
|
||||
|
||||
|
||||
// put appdata table markup in designated div
|
||||
document.getElementById("view_links_table").innerHTML=links_table_data;
|
||||
if (g_oLinks.length > 0) {
|
||||
gadgets.window.adjustHeight( 12 + ((g_oLinks.length - 1) * 30) + 34 );
|
||||
gadgets.window.adjustHeight( 12 + ((g_oLinks.length - 1) * 30) + 34 );
|
||||
}
|
||||
else {
|
||||
gadgets.pubsub.publish("hide");
|
||||
|
@ -171,10 +171,10 @@
|
|||
} /* end if link data exists */
|
||||
}
|
||||
// ========================================
|
||||
|
||||
|
||||
|
||||
|
||||
// ========================================
|
||||
|
||||
|
||||
function saveData() {
|
||||
|
||||
// get link name and url from form
|
||||
|
@ -182,24 +182,24 @@
|
|||
var new_link_url=document.getElementById("linkurl").value;
|
||||
|
||||
if (g_oLinks.length < g_max_links || !g_oLinks) {
|
||||
|
||||
|
||||
// check for empty input boxes
|
||||
if(new_link_name=="" || new_link_url==""){
|
||||
alert("Please provide both a Link Name and a URL");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// prepend http header if missing
|
||||
if(new_link_url.indexOf("://") == -1){new_link_url = "http://" + new_link_url;}
|
||||
|
||||
var newLinkNdx = g_oLinks.length;
|
||||
g_oLinks[newLinkNdx] = {};
|
||||
g_oLinks[newLinkNdx].link_name = new_link_name;
|
||||
g_oLinks[newLinkNdx].link_url = new_link_url;
|
||||
g_oLinks[newLinkNdx] = {};
|
||||
g_oLinks[newLinkNdx].link_name = new_link_name;
|
||||
g_oLinks[newLinkNdx].link_url = new_link_url;
|
||||
|
||||
// write links data to gadget database
|
||||
osapi.appdata.update({'userId': '@viewer', 'appId': '@app', 'data': {'links' : gadgets.json.stringify(g_oLinks)} }).execute(function(result) {
|
||||
if (result.error) {
|
||||
if (result.error) {
|
||||
alert("Error " + result.error.code + " writing application data: " + result.error.message);
|
||||
} else {
|
||||
|
||||
|
@ -210,7 +210,7 @@
|
|||
alert("Your links information is saved. Don't forget to use the Hide / Show links to make this section visible or hidden on your profile page.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
alert("You already have the maximum number of links.");
|
||||
}
|
||||
|
@ -218,32 +218,32 @@
|
|||
// ==============================================================
|
||||
|
||||
function gadgetEventTrack(action, label, value) {
|
||||
|
||||
|
||||
var message = {'action' : action};
|
||||
if (label) {message.label = label;}
|
||||
if (value) {message.value = value;}
|
||||
|
||||
|
||||
gadgets.pubsub.publish("analytics", message);
|
||||
}
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
]]></Content>
|
||||
<!-- ==================== END COMBINED VIEWS ==================== -->
|
||||
|
||||
<!-- ==================== START HOME/EDIT VIEW ==================== -->
|
||||
<Content type="html" view="home" preferred_height="300" preferred_width="700">
|
||||
<![CDATA[<!--HTML-->
|
||||
|
||||
|
||||
<h3 style="padding-left:10px; padding-top: 0px;">Manage Links to Other Websites</h3>
|
||||
|
||||
<div style="padding:5px 0px 0px 25px;">
|
||||
Add up to five websites to your profile.
|
||||
Enter the website name, as you want it to appear on your profile, and its URL.
|
||||
Add up to five websites to your profile.
|
||||
Enter the website name, as you want it to appear on your profile, and its URL.
|
||||
Some samples include a link to your lab web site, your research program or your research blog.<br /><br />
|
||||
</div>
|
||||
|
||||
|
||||
<!-- display the new link input fields -->
|
||||
<div class='question' style="padding:0px 0px 5px 12px;">
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
|
@ -260,19 +260,19 @@
|
|||
</td>
|
||||
<td> </td>
|
||||
<td><br /><br /><input type="button" style="margin-bottom: 8px;" value="Save" onClick="saveData();"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<h4 style="padding-left:10px; padding-top: 0px;">Your Current Websites:</h4>
|
||||
<div id="edit_links_table" style="padding:0px 0px 10px 25px;"></div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
gadgets.util.registerOnLoadHandler(function() {
|
||||
readData(displayData)
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
]]></Content>
|
||||
<!-- ==================== END HOME/EDIT VIEW ==================== -->
|
||||
|
||||
|
@ -280,15 +280,15 @@
|
|||
<!-- ==================== START PROFILE VIEW ==================== -->
|
||||
<Content type="html" view="profile" preferred_height="100" preferred_width="670">
|
||||
<![CDATA[<!--HTML-->
|
||||
|
||||
<div id="view_links_table" style="padding:0px 0px 10px 20px;"></div>
|
||||
|
||||
|
||||
<div id="view_links_table" style="padding:0px 0px 10px 20px;"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
gadgets.util.registerOnLoadHandler(function() {
|
||||
readData(displayData)
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
]]></Content>
|
||||
<!-- ==================== END PROFILE VIEW ==================== -->
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
|
||||
<Content type="html" view="default, home, profile"><![CDATA[<!--HTML-->
|
||||
<!DOCTYPE html>
|
||||
|
||||
|
||||
<!-- #includes -->
|
||||
<link rel="stylesheet" href="css/gadget.css" type="text/css" media="screen, projection" >
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/os.js" ></script>
|
||||
|
||||
|
||||
<style>
|
||||
.mentor_title {
|
||||
font-family: Verdana, Arial;
|
||||
|
@ -31,7 +31,7 @@
|
|||
.mentor_credit {
|
||||
font-family: Arial;
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
.mentor_list {
|
||||
font-family: Arial;
|
||||
font-size: 11px;
|
||||
|
@ -40,132 +40,132 @@
|
|||
font-family: Arial;
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
a, a:visited { color: #0088CC; text-decoration: none; }
|
||||
a:hover { color: #005580; text-decoration: underline; }
|
||||
</style>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var g_chars_allowed=2000;
|
||||
var g_textarea_content="";
|
||||
|
||||
|
||||
function limit_chars(){
|
||||
num_chars = document.getElementById("facultyNarrative").value.length;
|
||||
num_chars = document.getElementById("facultyNarrative").value.length;
|
||||
if (num_chars > g_chars_allowed) {
|
||||
alert("Your narrative exceeds the maximum number of characters.");
|
||||
document.getElementById("facultyNarrative").value = g_textarea_content;
|
||||
}
|
||||
else {
|
||||
g_textarea_content = document.getElementById("facultyNarrative").value;
|
||||
else {
|
||||
g_textarea_content = document.getElementById("facultyNarrative").value;
|
||||
}
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
function gadgetEventTrack(action, label, value) {
|
||||
|
||||
|
||||
var message = {'action' : action};
|
||||
if (label) {message.label = label;}
|
||||
if (value) {message.value = value;}
|
||||
|
||||
|
||||
gadgets.pubsub.publish("analytics", message);
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
function displayMentorAppData() {
|
||||
|
||||
|
||||
var fields = ["careerMentor", "coMentor", "leadResearch", "projectMentor",
|
||||
"contactEmail", "contactPhone", "contactAssistant",
|
||||
"assistantName", "assistantEmail", "assistantPhone",
|
||||
"contactEmail", "contactPhone", "contactAssistant",
|
||||
"assistantName", "assistantEmail", "assistantPhone",
|
||||
"narrative", "lastUpdate"];
|
||||
|
||||
|
||||
osapi.appdata.get( {'userId': '@owner', 'appId':'@app', 'fields': fields } ).execute(function(result) {
|
||||
|
||||
if (result.error) {
|
||||
if (result.error) {
|
||||
alert("Error " + result.error.code + " reading application data: " + result.error.message);
|
||||
} else {
|
||||
|
||||
// get incoming mentor data
|
||||
|
||||
// get incoming mentor data
|
||||
var viewer = os.osapi.getViewerFromResult(result);
|
||||
|
||||
|
||||
if (viewer.careerMentor == "T" && document.getElementById("edit_career_mentor") )
|
||||
document.getElementById("edit_career_mentor").checked = true;
|
||||
if (viewer.coMentor == "T" && document.getElementById("edit_co_mentor") )
|
||||
document.getElementById("edit_co_mentor").checked = true;
|
||||
document.getElementById("edit_co_mentor").checked = true;
|
||||
if (viewer.leadResearch == "T" && document.getElementById("edit_lead_research") )
|
||||
document.getElementById("edit_lead_research").checked = true;
|
||||
document.getElementById("edit_lead_research").checked = true;
|
||||
if (viewer.projectMentor == "T" && document.getElementById("edit_project_mentor") )
|
||||
document.getElementById("edit_project_mentor").checked = true;
|
||||
|
||||
document.getElementById("edit_project_mentor").checked = true;
|
||||
|
||||
if (viewer.contactEmail == "T" && document.getElementById("edit_email"))
|
||||
document.getElementById("edit_email").checked = true;
|
||||
if (viewer.contactPhone == "T" && document.getElementById("edit_phone"))
|
||||
document.getElementById("edit_phone").checked = true;
|
||||
if (viewer.contactAssistant == "T" && document.getElementById("edit_assistant"))
|
||||
document.getElementById("edit_assistant").checked = true;
|
||||
document.getElementById("edit_assistant").checked = true;
|
||||
|
||||
if (viewer.assistantName && document.getElementById("edit_assistant_name") )
|
||||
if (viewer.assistantName && document.getElementById("edit_assistant_name") )
|
||||
document.getElementById("edit_assistant_name").value = viewer.assistantName;
|
||||
if (viewer.assistantEmail && document.getElementById("edit_assistant_email") )
|
||||
document.getElementById("edit_assistant_email").value = viewer.assistantEmail;
|
||||
if (viewer.assistantPhone && document.getElementById("edit_assistant_phone") )
|
||||
document.getElementById("edit_assistant_phone").value = viewer.assistantPhone;
|
||||
|
||||
|
||||
if (viewer.narrative)
|
||||
document.getElementById("facultyNarrative").value = viewer.narrative;
|
||||
|
||||
|
||||
if (viewer.lastUpdate)
|
||||
document.getElementById("last_updated").innerHTML = viewer.lastUpdate;
|
||||
|
||||
|
||||
// VIEW MODE - build table to hold retrieved app data
|
||||
|
||||
|
||||
var view_window_height=80;
|
||||
var mentor_as = "hidden";
|
||||
var mentor_contact = "hidden";
|
||||
|
||||
|
||||
|
||||
|
||||
if (viewer.careerMentor == "T" && document.getElementById("mentor_as_career_mentor") && document.getElementById("mentor_as") ) {
|
||||
document.getElementById("mentor_as").style.display = "block";
|
||||
document.getElementById("mentor_as_career_mentor").style.display = "block";
|
||||
view_window_height += 20;
|
||||
mentor_as = "visible";
|
||||
}
|
||||
|
||||
|
||||
if (viewer.coMentor == "T" && document.getElementById("mentor_as_co_mentor") && document.getElementById("mentor_as") ) {
|
||||
document.getElementById("mentor_as").style.display = "block";
|
||||
document.getElementById("mentor_as_co_mentor").style.display = "block";
|
||||
view_window_height += 20;
|
||||
mentor_as = "visible";
|
||||
}
|
||||
|
||||
|
||||
if (viewer.leadResearch == "T" && document.getElementById("mentor_as_lead_research") && document.getElementById("mentor_as") ) {
|
||||
document.getElementById("mentor_as").style.display = "block";
|
||||
document.getElementById("mentor_as_lead_research").style.display = "block";
|
||||
view_window_height += 20;
|
||||
mentor_as = "visible";
|
||||
}
|
||||
|
||||
if (viewer.projectMentor == "T" && document.getElementById("mentor_as_project_mentor") && document.getElementById("mentor_as") ) {
|
||||
|
||||
if (viewer.projectMentor == "T" && document.getElementById("mentor_as_project_mentor") && document.getElementById("mentor_as") ) {
|
||||
document.getElementById("mentor_as").style.display = "block";
|
||||
document.getElementById("mentor_as_project_mentor").style.display = "block";
|
||||
view_window_height += 20;
|
||||
mentor_as = "visible";
|
||||
}
|
||||
|
||||
if (viewer.contactEmail == "T" && document.getElementById("mentor_contact_email") && document.getElementById("mentor_contact") ) {
|
||||
|
||||
if (viewer.contactEmail == "T" && document.getElementById("mentor_contact_email") && document.getElementById("mentor_contact") ) {
|
||||
document.getElementById("mentor_contact").style.display = "block";
|
||||
document.getElementById("mentor_contact_email").style.display = "block";
|
||||
view_window_height += 20;
|
||||
mentor_contact = "visible";
|
||||
}
|
||||
|
||||
|
||||
if (viewer.contactPhone == "T" && document.getElementById("mentor_contact_phone") && document.getElementById("mentor_contact") ) {
|
||||
document.getElementById("mentor_contact").style.display = "block";
|
||||
document.getElementById("mentor_contact_phone").style.display = "block";
|
||||
view_window_height += 20;
|
||||
mentor_contact = "visible";
|
||||
}
|
||||
|
||||
|
||||
if (viewer.contactAssistant == "T" && document.getElementById("mentor_contact_assistant") && document.getElementById("mentor_contact") ) {
|
||||
document.getElementById("mentor_contact").style.display = "block";
|
||||
document.getElementById("mentor_contact_assistant").style.display = "block";
|
||||
|
@ -179,52 +179,52 @@
|
|||
document.getElementById("mentor_assistant_name").innerHTML += viewer.assistantName;
|
||||
view_window_height += 20;
|
||||
}
|
||||
|
||||
|
||||
if (viewer.assistantEmail && document.getElementById("mentor_assistant") && document.getElementById("mentor_assistant_email") ) {
|
||||
document.getElementById("mentor_assistant_email").style.display = "block";
|
||||
document.getElementById("mentor_assistant_email").innerHTML += viewer.assistantEmail;
|
||||
view_window_height += 20;
|
||||
}
|
||||
|
||||
|
||||
if (viewer.assistantPhone && document.getElementById("mentor_assistant") && document.getElementById("mentor_assistant_phone") ) {
|
||||
document.getElementById("mentor_assistant_phone").style.display = "block";
|
||||
document.getElementById("mentor_assistant_phone").innerHTML += viewer.assistantPhone;
|
||||
view_window_height += 20;
|
||||
}
|
||||
|
||||
|
||||
if (viewer.narrative) {
|
||||
document.getElementById("facultyNarrative").style.display = "block";
|
||||
var p_chars = viewer.narrative;
|
||||
|
||||
// count the characters and calculate number of rows
|
||||
p_num_chars = p_chars.length;
|
||||
|
||||
// count the characters and calculate number of rows
|
||||
p_num_chars = p_chars.length;
|
||||
document.getElementById("facultyNarrative").innerHTML = p_chars;
|
||||
p_lines = Math.round(p_num_chars / 100);
|
||||
if (p_lines < 1) {p_lines = 1}
|
||||
view_window_height += (p_lines * 15);
|
||||
|
||||
|
||||
// note works in FF but not IE:
|
||||
// view_window_height += document.getElementById('facultyNarrative').offsetHeight;
|
||||
}
|
||||
|
||||
|
||||
if (viewer.lastUpdated)
|
||||
document.getElementById("last_updated").innerHTML = viewer.lastUpdated;
|
||||
|
||||
|
||||
if (mentor_as == "visible") {view_window_height += 20};
|
||||
if (mentor_contact == "visible") {view_window_height += 20};
|
||||
|
||||
|
||||
// adjust the window height - only do this here if in profile VIEW (not in EDIT)
|
||||
if (document.getElementById("mentor_as")) {
|
||||
if (document.getElementById("mentor_as")) {
|
||||
gadgets.window.adjustHeight(view_window_height);
|
||||
}
|
||||
|
||||
|
||||
} /* end else */
|
||||
|
||||
}); /*osapi.appdata.get*/
|
||||
|
||||
}); /*osapi.appdata.get*/
|
||||
}
|
||||
|
||||
|
||||
function saveMentorAppData() {
|
||||
|
||||
|
||||
var mentor_today = new Date();
|
||||
var weekday=new Array(7);
|
||||
weekday[0]="Sunday";
|
||||
|
@ -234,7 +234,7 @@
|
|||
weekday[4]="Thursday";
|
||||
weekday[5]="Friday";
|
||||
weekday[6]="Saturday";
|
||||
|
||||
|
||||
var month=new Array(12);
|
||||
month[0]="January";
|
||||
month[1]="February";
|
||||
|
@ -247,43 +247,43 @@
|
|||
month[8]="September";
|
||||
month[9]="October";
|
||||
month[10]="November";
|
||||
month[11]="December";
|
||||
|
||||
month[11]="December";
|
||||
|
||||
var mentor_day = weekday[mentor_today.getDay()]
|
||||
var mentor_month = month[mentor_today.getMonth()]
|
||||
var mentor_date = mentor_today.getDate();
|
||||
var mentor_year = mentor_today.getFullYear();
|
||||
var current_date = mentor_day + " " + mentor_month + " " + mentor_date + ", " + mentor_year;
|
||||
|
||||
// pack the data into an Object (md for mentor data)
|
||||
// with property names that match the values in the "fields" array
|
||||
// used by osapi.appdate.get in displayMentorAppData
|
||||
var current_date = mentor_day + " " + mentor_month + " " + mentor_date + ", " + mentor_year;
|
||||
|
||||
// pack the data into an Object (md for mentor data)
|
||||
// with property names that match the values in the "fields" array
|
||||
// used by osapi.appdate.get in displayMentorAppData
|
||||
var md = {};
|
||||
|
||||
|
||||
md.careerMentor = document.getElementById("edit_career_mentor").checked ? "T" : "F";
|
||||
md.coMentor = document.getElementById("edit_co_mentor").checked ? "T" : "F";
|
||||
md.leadResearch = document.getElementById("edit_lead_research").checked ? "T" : "F";
|
||||
md.projectMentor = document.getElementById("edit_project_mentor").checked ? "T" : "F";
|
||||
|
||||
|
||||
md.contactEmail = document.getElementById("edit_email").checked ? "T" : "F";
|
||||
md.contactPhone = document.getElementById("edit_phone").checked ? "T" : "F";
|
||||
md.contactAssistant = document.getElementById("edit_assistant").checked ? "T" : "F";
|
||||
|
||||
|
||||
md.assistantName = document.getElementById("edit_assistant_name").value;
|
||||
md.assistantEmail = document.getElementById("edit_assistant_email").value;
|
||||
md.assistantPhone = document.getElementById("edit_assistant_phone").value;
|
||||
md.narrative = document.getElementById("facultyNarrative").value;
|
||||
md.lastUpdate = current_date;
|
||||
|
||||
|
||||
osapi.appdata.update({'userId': '@viewer', 'appId':'@app', 'data':md }).execute(function(result) {
|
||||
if (result.error) {
|
||||
if (result.error) {
|
||||
alert("Error " + result.error.code + " writing application data: " + result.error.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
]]></Content>
|
||||
|
||||
<!-- ==================== END COMBINED VIEWS ==================== -->
|
||||
|
@ -292,23 +292,23 @@
|
|||
<!-- ==================== START HOME/EDIT VIEW ==================== -->
|
||||
|
||||
<Content type="html" view="default, home" preferred_width="700"><![CDATA[<!--HTML-->
|
||||
|
||||
|
||||
<h4 style="padding-left:12px;">Add Faculty Mentoring to Your Profile</h4>
|
||||
|
||||
|
||||
<div id='AddEdit' style="padding:15px 0px 0px 12px;">
|
||||
Add details about your availability to mentor UCSF faculty.
|
||||
Learn about the <a href="http://academicaffairs.ucsf.edu/ccfl/faculty_mentoring_program.php" target="_blank" title="Go to the UCSF Faculty Mentoring Website">Faculty Mentoring Program</a>
|
||||
Add details about your availability to mentor UCSF faculty.
|
||||
Learn about the <a href="http://academicaffairs.ucsf.edu/ccfl/faculty_mentoring_program.php" target="_blank" title="Go to the UCSF Faculty Mentoring Website">Faculty Mentoring Program</a>
|
||||
and the <a href="http://ctsi.ucsf.edu/training/mdp-announcement" target="_blank" title="Go to the CTSI MDP Web page">CTSI Mentor Development Program</a>
|
||||
<br /><br />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<div style="float:left;">
|
||||
<span class="mentor_message">
|
||||
Be sure to <b>SAVE</b> your work below.</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="updated" style="float:right; display:block; text-align:left; padding-right:10px; font-size: 10px;">
|
||||
Last Updated: <span id="last_updated" style="font-size: 10px;"></span>
|
||||
</div>
|
||||
|
@ -328,11 +328,11 @@
|
|||
<td valign="middle" class="mentor_list">
|
||||
<input id="edit_lead_research" type="checkbox">Lead Research / Scholarly Mentor </td>
|
||||
<td valign="middle" class="mentor_list">
|
||||
<input id="edit_project_mentor" type="checkbox">Project Mentor</td>
|
||||
<input id="edit_project_mentor" type="checkbox">Project Mentor</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class='question'>
|
||||
<h4>My Contact Preference:</h4>
|
||||
<table cellspacing="0" cellpadding="15">
|
||||
|
@ -349,7 +349,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='question' style="padding:0px 0px 0px 10px;">
|
||||
<span class="mentor_list"><b>Assistant Details</b></span><br>
|
||||
<fieldset class='details roundbox'>
|
||||
|
@ -369,23 +369,23 @@
|
|||
<td> </td>
|
||||
<td><label class='textlabel'>Phone</label>
|
||||
<input id="edit_assistant_phone"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='question'>
|
||||
<h4>Mentoring Narrative: <img src="images/hovertiptarget.png" border="0" onClick="document.getElementById('sample').style.display='block';">
|
||||
<span class="mentor_message"> Be sure to <b>SAVE</b> your work below.</span></h4>
|
||||
|
||||
|
||||
<div id="sample" style="display:none; border:1px solid #383838; padding:10px 10px 10px 10px; margin:10px; height:160px;">
|
||||
|
||||
|
||||
<div style="padding-bottom: 5px;">
|
||||
<button style="float:right;" onClick="document.getElementById('sample').style.display='none';">Close</button><br>
|
||||
<center><b>Sample Mentor Narratives</b> (cut and paste to create your own)</center><br>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="height:110px; padding: 0px 0px 0 5px;overflow:auto;">
|
||||
EXAMPLE 1:<br />
|
||||
Dr. Brown is willing to mentor faculty, fellows, residents and students interested in an academic research career. Most often her mentees have had training in clinical research methods or will obtain training through the CTSI CTST. For students, it is expected they will have dedicated time for research. Through email or meeting, if there is a “match” for research interest, time, and training, further discussions as to project, goals, and access to resources (space, databases, and statistical support) will be discussed to provide a productive experience.
|
||||
|
@ -394,17 +394,17 @@
|
|||
I am highly qualified to participate as a lead mentor or co-mentor at UCSF. My program of research is focused on health outcomes associated with disturbed sleep in various populations of healthy women and women with chronic illnesses like HIV/AIDS and cancer. I have completed cross-sectional studies, longitudinal studies, and most recently, randomized clinical trials to improve sleep. I have mentored doctoral students and postdoctoral fellows studying various patient populations, from the very young to very old. During my tenure at UCSF, I have directly supervised over 30 doctoral students, mentored 14 postdoctoral trainees, and served as a lead mentor for 6 pre-tenured faculty. I have been the Director for a T32 Nurse Research Training Grant since 1996, and I have been honored with being voted mentor of the year by doctoral students on two occasions. I play a significant role in the clinical and translational (CTSI) research mentoring and career development programs at UCSF. I am the seminar leader for the first session in the CTSI Mentor Development program on “Rewards and Challenges of Mentoring” and I have co-mentored two KL2 scholars. I have published over 50 peer-reviewed research articles with trainees as first-author, and serve as a consultant on two external K awards as well as three external R01 awards with former mentees. Finally, I have served on many different NIH study section review panels, and I served as the Chair of an NIH study section (2008-2010), which allows me to be particularly effective in mentoring early career principal investigators who are writing their first NIH applications.
|
||||
<br><br>
|
||||
I can provide mentees a cubicle space with my research team, tangible resources such as access to large datasets for secondary analysis as needed, and intangible resources such as attending our formal research team meetings and our informal spontaneous group discussions as well as networking at national sleep research conferences.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<textarea id="facultyNarrative" rows='9' cols='72' class='roundbox' style="margin-left:12px;" name="facultyNarrative" onKeyDown="limit_chars()" onKeyUp="limit_chars()" onMouseout="limit_chars()"></textarea>
|
||||
<span style="margin-left:12px;white-space:nowrap">(2000 characters max)</span>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<center>
|
||||
<input type="button" onClick="saveMentorAppData();" value="Save">
|
||||
|
@ -412,12 +412,12 @@
|
|||
<input type="button" onClick="displayMentorAppData()" value="Cancel">
|
||||
</center>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript" >
|
||||
// retrieve last-saved data and map it to the fields in the markup
|
||||
displayMentorAppData();
|
||||
gadgets.window.adjustHeight(700);
|
||||
</script>
|
||||
</script>
|
||||
|
||||
]]></Content>
|
||||
|
||||
|
@ -427,7 +427,7 @@
|
|||
<!-- ==================== START PROFILE VIEW ==================== -->
|
||||
|
||||
<Content type="html" view="default, profile" preferred_width="670"><![CDATA[<!--HTML-->
|
||||
|
||||
|
||||
<div class="updated" style="display:block; text-align:left; padding: 5px 10px 10px 0; font-size: 10px;">
|
||||
Last Updated: <span id="last_updated" style="font-size: 10px;"></span>
|
||||
</div>
|
||||
|
@ -435,7 +435,7 @@
|
|||
<div>
|
||||
<p id="facultyNarrative" style="margin-left:20px; margin-right:20px; font-family:Arial; font-size:12px; display:none;"></p>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="mentor_as" style="display:none; margin-left:20px;">
|
||||
<span class='detailtitle'>Available to Mentor as: </span> (<a href="http://ctsi.ucsf.edu/training/mdp-seminar1-definitions" target="_blank" title="Go to the Mentor Role Definitions Web page" onClick="gadgetEventTrack('view_mentor_roles', 'http://ctsi.ucsf.edu/training/mdp-seminar1-definitions'); return true">Review Mentor Role Definitions</a>):
|
||||
<span id="mentor_as_career_mentor" style="display:none; padding-botom:3px;"><span style="font-size:18px;"> <b>·</b> </span>Career Mentor</span>
|
||||
|
@ -443,36 +443,36 @@
|
|||
<span id="mentor_as_lead_research" style="display:none; padding-botom:3px;"><span style="font-size:18px;"> <b>·</b> </span>Lead Research / Scholarly Mentor</span>
|
||||
<span id="mentor_as_project_mentor" style="display:none; padding-botom:3px;"><span style="font-size:18px;"> <b>·</b> </span>Project Mentor</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="mentor_contact" style="padding:10px 0 0 0; display:none; margin-left: 20px;">
|
||||
<span class='detailtitle'>Contact for Mentoring:</span>
|
||||
<ul style="width:400px;">
|
||||
<li id="mentor_contact_email" style="display:none; padding-botom:3px;"><span style="font-size:18px;"> <b>·</b> </span>Email (see above)</li>
|
||||
<li id="mentor_contact_phone" style="display:none; padding-botom:3px;"><span style="font-size:18px;"> <b>·</b> </span>Phone (see above)</li>
|
||||
<li id="mentor_contact_assistant" style="display:none; padding-botom:3px;"><span style="font-size:18px;"> <b>·</b> </span>Assistant</li>
|
||||
<li id="mentor_contact_assistant" style="display:none; padding-botom:3px;"><span style="font-size:18px;"> <b>·</b> </span>Assistant</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="mentor_assistant" style="padding:5px 0 0 0; display:none; margin-left: 55px;">
|
||||
<div id="mentor_assistant_name" style="display:none; height:20px;">Name: </div>
|
||||
<div id="mentor_assistant_email" style="display:none; height:20px;">Email: </div>
|
||||
<div id="mentor_assistant_phone" style="display:none; height:20px;">Phone: </div>
|
||||
</div>
|
||||
|
||||
<div style="padding:10px 0px 0px 20px;">
|
||||
Learn about the <a href="http://academicaffairs.ucsf.edu/ccfl/faculty_mentoring_program.php" target="_blank" title="Go to the UCSF Faculty Mentoring Website" onClick="gadgetEventTrack('go_to_program', 'http://academicaffairs.ucsf.edu/ccfl/faculty_mentoring_program.php'); return true">Faculty Mentoring Program</a>
|
||||
<div style="padding:10px 0px 0px 20px;">
|
||||
Learn about the <a href="http://academicaffairs.ucsf.edu/ccfl/faculty_mentoring_program.php" target="_blank" title="Go to the UCSF Faculty Mentoring Website" onClick="gadgetEventTrack('go_to_program', 'http://academicaffairs.ucsf.edu/ccfl/faculty_mentoring_program.php'); return true">Faculty Mentoring Program</a>
|
||||
and the <a href="http://ctsi.ucsf.edu/training/mdp-announcement" target="_blank" title="Go to the CTSI | MDP Web page" onClick="gadgetEventTrack('go_to_development', 'http://ctsi.ucsf.edu/training/mdp-announcement'); return true">CTSI Mentor Development Program</a>
|
||||
<br /><br />
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
displayMentorAppData();
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
]]></Content>
|
||||
|
||||
<!-- ==================== END PROFILE VIEW ==================== -->
|
||||
|
||||
</Module>
|
||||
</Module>
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
</ModulePrefs>
|
||||
<Content type="html" view="canvas, small"><![CDATA[<!--HTML-->
|
||||
<!DOCTYPE html>
|
||||
|
||||
|
||||
<!-- #includes -->
|
||||
<link rel="stylesheet" href="css/gadget.css" type="text/css" media="screen, projection" >
|
||||
<script type="text/javascript" src="js/os.js" ></script>
|
||||
<script type="text/javascript" src="js/jquery-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="js/environment.js"></script>
|
||||
|
||||
|
||||
<style>
|
||||
.tool_title {font-family:Arial,Helvetica; font-size:14px;}
|
||||
.tool_title_orange {font-weight:bold; font-family:Arial,Helvetica; font-size:14px; color:#CA7C29;margin-top:-1px;}
|
||||
|
@ -25,30 +25,30 @@
|
|||
.tool_table_cell_small {font-family:Arial,Helvetica;font-size:11px;}
|
||||
.tool_table_cell_small span a {font-size:11px;}
|
||||
.tool_table_cell_small span {font-size:11px;display:inline-block;margin-right: -15px; }
|
||||
.tool_toggle_button {font-size: 13px;padding:0 5px;}
|
||||
.tool_toggle_button {font-size: 13px;padding:0 5px;}
|
||||
a, a:visited { color: #0088CC; text-decoration: none; }
|
||||
a:hover { color: #005580; text-decoration: underline; }
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
// ==============================================================
|
||||
|
||||
function gadgetEventTrack(action, label, value) {
|
||||
|
||||
|
||||
var message = {'action' : action};
|
||||
if (label) {message.label = label;}
|
||||
if (value) {message.value = value;}
|
||||
|
||||
|
||||
gadgets.pubsub.publish("analytics", message);
|
||||
}
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
|
||||
function showHelp() {
|
||||
|
||||
|
||||
var pop = window.open('Create a Group Help','','top=200,left=200,width=450,height=340,scrollbars=0,status=0,menubar=0,location=0,resizable=0');
|
||||
pop.document.title = "Create a Group Help";
|
||||
pop.document.write("<html><head></head><body><div style='margin:10px; font-family:Arial; font-size:12px;'>");
|
||||
pop.document.write("<html><head></head><body><div style='margin:10px; font-family:Arial; font-size:12px;'>");
|
||||
pop.document.write("Create a list of profiles and start a UCSF Chatter group or email list from here. "
|
||||
+ "Here's how:<br><ol>"
|
||||
+ "<li>Click the 'Create Now!' button</li>"
|
||||
|
@ -66,33 +66,33 @@
|
|||
+ "To learn more about UCSF Chatter, go to "
|
||||
+ "<a href='http://it.ucsf.edu/services/chatter' target='_blank'>"
|
||||
+ "http://it.ucsf.edu/services/chatter</a>");
|
||||
pop.document.write("<br><br><center>"
|
||||
+ "<input type = 'button' value = 'Close' onclick = 'window.close();'>"
|
||||
pop.document.write("<br><br><center>"
|
||||
+ "<input type = 'button' value = 'Close' onclick = 'window.close();'>"
|
||||
+ "</center>");
|
||||
pop.document.write("</body></html>");
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
|
||||
function getNewProfilesStats(sender, message) {
|
||||
var stats = gadgets.json.parse(message);
|
||||
// display the action item table and update it
|
||||
$("#actions").show();
|
||||
if (message === 0) {
|
||||
document.getElementById("add_profiles").innerHTML = "No Profiles found";
|
||||
document.getElementById("add_profiles").innerHTML = "No Profiles found";
|
||||
}
|
||||
else {
|
||||
document.getElementById("add_profiles").innerHTML = "<a style='font-size:11px;' href='javascript:addNewProfiles();'>Add " + message + " to list</a>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function addNewProfiles() {
|
||||
document.getElementById("add_profiles").innerHTML = "Adding profiles...";
|
||||
document.getElementById("list_profiles").innerHTML = "Merging into list...";
|
||||
document.getElementById("add_profiles").innerHTML = "Adding profiles...";
|
||||
document.getElementById("list_profiles").innerHTML = "Merging into list...";
|
||||
readIdsFromDB(function(existingIds) {
|
||||
gadgets.pubsub.subscribe("JSONPersonIds", getNewIdsCallback(existingIds));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getNewIdsCallback(existingIds) {
|
||||
return function(sender, message) {
|
||||
// extract the array of incoming person IDs
|
||||
|
@ -101,7 +101,7 @@
|
|||
var addedListSize = getListSize(newIds);
|
||||
|
||||
var priorListSize = getListSize(existingIds);
|
||||
|
||||
|
||||
// merge the incoming and existing person ID arrays
|
||||
// existing array already populated
|
||||
for (var baseURI in newIds) {
|
||||
|
@ -110,7 +110,7 @@
|
|||
}
|
||||
existingIds[baseURI] = dedupeArray(existingIds[baseURI].concat(newIds[baseURI]));
|
||||
}
|
||||
|
||||
|
||||
var newListSize = getListSize(existingIds);
|
||||
|
||||
showCurrentListSize(newListSize);
|
||||
|
@ -122,63 +122,63 @@
|
|||
}
|
||||
else {
|
||||
document.getElementById("add_profiles").innerHTML = (addedListSize == 1 ? "Profile already in list" : "Profiles already in list");
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
|
||||
function getListSize(ids) {
|
||||
var cnt = 0;
|
||||
for (var baseURI in ids) {
|
||||
cnt += ids[baseURI].length;
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
|
||||
function showCurrentListSize(count) {
|
||||
if (count > 0) {
|
||||
document.getElementById("list_profiles").innerHTML = "<a href='javascript:gadgets.views.requestNavigateTo(\"canvas\");'>" + count + " Profiles in list</a>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("list_profiles").innerHTML = "List is currently empty";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showToolVersion(canvasMode) {
|
||||
|
||||
|
||||
// fetch the extended state
|
||||
osapi.appdata.get({'userId':'@viewer', 'appId':'@app', 'fields':['extended']} )
|
||||
.execute(function(result) {
|
||||
.execute(function(result) {
|
||||
if (os.osapi.getViewerFromResult(result).extended == "True") {
|
||||
if (canvasMode) {
|
||||
document.getElementById("extended_functions").style.display = "inline-block";
|
||||
document.getElementById("extended_functions").style.padding = "0 0 0 20px";
|
||||
document.getElementById("canvas_help").innerHTML =
|
||||
document.getElementById("canvas_help").innerHTML =
|
||||
'Create a UCSF Chatter group or email list that includes the people below. '
|
||||
+ 'To manage your UCSF Chatter group after you create it, such as adding or '
|
||||
+ 'To manage your UCSF Chatter group after you create it, such as adding or '
|
||||
+ 'removing members, go to UCSF Chatter directly.' ;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// this is what people who have limited functionality (only chatter group) see
|
||||
if (canvasMode) {
|
||||
document.getElementById("basic_functions").style.display = "inline-block";
|
||||
document.getElementById("basic_functions").style.padding = "0 0 0 20px";
|
||||
document.getElementById("canvas_help").innerHTML =
|
||||
document.getElementById("canvas_help").innerHTML =
|
||||
'Create a UCSF Chatter group that includes the people below. '
|
||||
+ 'To manage your group after you create it, such as adding or '
|
||||
+ 'To manage your group after you create it, such as adding or '
|
||||
+ 'removing members, go to UCSF Chatter directly.' ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if we are not in canvas mode, show the On/Off state correctly
|
||||
if (!canvasMode) {
|
||||
if (!canvasMode) {
|
||||
readCountFromDB( function(count) {
|
||||
showCurrentListSize(count);
|
||||
});
|
||||
});
|
||||
gadgets.pubsub.subscribe("PersonResultCount", getNewProfilesStats);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// ==============================================================
|
||||
|
@ -192,16 +192,16 @@
|
|||
}
|
||||
return uriList;
|
||||
}
|
||||
|
||||
// first argument is an map of data,
|
||||
// second argument is the callback function to execute after updating the data
|
||||
function saveData(ids, callback) {
|
||||
|
||||
// first argument is an map of data,
|
||||
// second argument is the callback function to execute after updating the data
|
||||
function saveData(ids, callback) {
|
||||
osapi.appdata.update({'userId': '@viewer', 'appId':'@app', 'data': {'count' : '' + getListSize(ids), 'ids' : gadgets.json.stringify(ids)}}).execute(callback);
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
|
||||
function readCountFromDB(callback) {
|
||||
osapi.appdata.get({'userId':'@viewer', 'appId':'@app', 'fields':'count'}).execute(function(result) {
|
||||
osapi.appdata.get({'userId':'@viewer', 'appId':'@app', 'fields':'count'}).execute(function(result) {
|
||||
// a map of {baseURI1 : ["string", "string"], baseURI2 : ["string", "string"]}
|
||||
var count = os.osapi.getViewerFromResult(result).count || 0;
|
||||
callback(count);
|
||||
|
@ -209,59 +209,59 @@
|
|||
}
|
||||
|
||||
function readIdsFromDB(callback) {
|
||||
osapi.appdata.get({'userId':'@viewer', 'appId':'@app', 'fields':'ids'}).execute(function(result) {
|
||||
osapi.appdata.get({'userId':'@viewer', 'appId':'@app', 'fields':'ids'}).execute(function(result) {
|
||||
// a map of {baseURI1 : ["string", "string"], baseURI2 : ["string", "string"]}
|
||||
var existingIds = os.osapi.getViewerFromResult(result).ids || "{}";
|
||||
callback(gadgets.json.parse(existingIds));
|
||||
});
|
||||
}
|
||||
// ==============================================================
|
||||
// ==============================================================
|
||||
|
||||
function deleteList() {
|
||||
osapi.appdata['delete']({'userId':'@viewer', 'appId':'@app', 'fields': ['ids', 'count']} )
|
||||
.execute(function(result){
|
||||
if (result.error) {
|
||||
if (result.error) {
|
||||
alert("Error " + result.error.code + " deleting application data: " + result.error.message);
|
||||
} else {
|
||||
document.getElementById("canvas_email_list_textarea").value = "";
|
||||
document.getElementById("canvas_full_list_textarea").value = "";
|
||||
document.getElementById("canvas_profile_list").innerHTML = "";
|
||||
document.getElementById("number_selected").innerHTML = "Select Profiles";
|
||||
}
|
||||
}
|
||||
}); /* end osapi.appdata.delete */
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
function dedupeArray(arrHasDupes) {
|
||||
var deduped = [];
|
||||
$.each(arrHasDupes, function(i, el){
|
||||
if($.inArray(el, deduped) === -1) deduped.push(el);
|
||||
});
|
||||
return deduped;
|
||||
return deduped;
|
||||
}
|
||||
// ==============================================================
|
||||
// ==============================================================
|
||||
|
||||
function displayProfileList(existingIds) {
|
||||
function displayProfileList(existingIds) {
|
||||
var uris = toURIList(existingIds);
|
||||
// put these as individual fields in an ontology.js file
|
||||
// pass in as options to getRdf call
|
||||
// pass in as options to getRdf call
|
||||
var fullName = 'http://profiles.catalyst.harvard.edu/ontology/prns#fullName';
|
||||
var preferredTitle = 'http://vivoweb.org/ontology/core#preferredTitle';
|
||||
var email = 'http://vivoweb.org/ontology/core#email';
|
||||
var email = 'http://vivoweb.org/ontology/core#email';
|
||||
var strTable="<table cellspacing='0' cellpadding='0' width='640'><tr>";
|
||||
|
||||
|
||||
// build the table header row
|
||||
strTable += "<td align='left' valign='top' class='tool_table_cell'>" + "<u><b>Name</b></u></td>";
|
||||
strTable += "<td align='left' valign='top' class='tool_table_cell'>" + "<u><b>Title</b></u></td>";
|
||||
strTable += "<td align='left' valign='top' class='tool_table_cell'>" + "<u><b>Email Address</b></u></td>";
|
||||
strTable += "</tr>";
|
||||
|
||||
|
||||
for (i in uris) {
|
||||
//strTable += "<tr id='" + uris[i] + "'><div id='displayPerson_" + i + "'></div></tr>";
|
||||
strTable += "<tr id='" + uris[i] + "'></tr>";
|
||||
}
|
||||
}
|
||||
strTable += "</table>";
|
||||
|
||||
|
||||
// dispay the empty table in canvas view
|
||||
document.getElementById("canvas_profile_list").innerHTML = strTable;
|
||||
document.getElementById("number_selected").innerHTML = "Your list includes (" + uris.length + ")" + " selected profiles";
|
||||
|
@ -269,14 +269,14 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
// initialize the export divs
|
||||
document.getElementById("canvas_email_list_textarea").value = "";
|
||||
document.getElementById("canvas_full_list_textarea").value = "";
|
||||
|
||||
|
||||
// load in groups of ten
|
||||
var batchSize = 10;
|
||||
var batchCount = Math.floor(uris.length/batchSize) + (uris.length % batchSize == 0 ? 0 : 1);
|
||||
for (i = 0; i < uris.length; i += batchSize) {
|
||||
var ids = '';
|
||||
for (j = 0; j < batchSize && i+j < uris.length; j++) {
|
||||
ids += (j > 0 ? ',' : '') + uris[i + j];
|
||||
ids += (j > 0 ? ',' : '') + uris[i + j];
|
||||
}
|
||||
osapi.rdf.getRDF(ids).execute(function(data) {
|
||||
var people = data.list;
|
||||
|
@ -286,16 +286,16 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
for (var j = 0; j < people.length; j++) {
|
||||
var base = people[j].base;
|
||||
people[j] = jsonldHelper.getItem(people[j]);
|
||||
|
||||
|
||||
// put in div now so people can see progress
|
||||
var table_row = "<td align='left' valign='top' class='tool_table_cell'>" + people[j][fullName] + "</td>";
|
||||
table_row += "<td align='left' valign='top' class='tool_table_cell'>" + people[j][preferredTitle] + "</td>";
|
||||
table_row += "<td align='left' valign='top' class='tool_table_cell email'>" + (people[j][email] ? people[j][email] : "") + "</td>";
|
||||
|
||||
|
||||
document.getElementById(base + people[j]['@id']).innerHTML = table_row;
|
||||
}
|
||||
// see if we are done and if so turn off progress bar and
|
||||
// add to export lists
|
||||
// add to export lists
|
||||
if (--batchCount == 0) {
|
||||
var full_list = "";
|
||||
var email_list = "";
|
||||
|
@ -305,49 +305,49 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
}
|
||||
var row = "";
|
||||
$("td", tr).each(function(fld_index, td){
|
||||
var txt = $(td).text();
|
||||
var txt = $(td).text();
|
||||
row += txt + ";";
|
||||
if(fld_index == 2 && txt != "") {
|
||||
email_list += txt + "\n";
|
||||
}
|
||||
});
|
||||
full_list += row + "\n";
|
||||
|
||||
|
||||
});
|
||||
document.getElementById("canvas_full_list_textarea").value = full_list;
|
||||
document.getElementById("canvas_email_list_textarea").value = email_list;
|
||||
|
||||
|
||||
document.getElementById("progress").style.display="none";
|
||||
}
|
||||
});
|
||||
}
|
||||
} /* end displayProfileList */
|
||||
|
||||
// ==============================================================
|
||||
|
||||
|
||||
// ==============================================================
|
||||
|
||||
function copyEmailDivToClipboard() {
|
||||
|
||||
|
||||
$("#canvas_email_list").show();
|
||||
$("#canvas_email_list_text").show();
|
||||
$("#canvas_full_list").hide();
|
||||
$("#canvas_full_list_text").hide();
|
||||
$("#canvas_profile_list").hide();
|
||||
$("#canvas_profile_list").hide();
|
||||
}
|
||||
// ==============================================================
|
||||
|
||||
// ==============================================================
|
||||
|
||||
function copyFullDivToClipboard() {
|
||||
$("#canvas_full_list").show();
|
||||
$("#canvas_full_list_text").show();
|
||||
$("#canvas_email_list").hide();
|
||||
$("#canvas_email_list_text").hide();
|
||||
$("#canvas_profile_list").hide();
|
||||
}
|
||||
// ==============================================================
|
||||
}
|
||||
// ==============================================================
|
||||
var root = (typeof ENV_LOCAL_URL === 'undefined')? "": ENV_LOCAL_URL;
|
||||
var chatterProxyURL = root + "/chatter/ChatterProxyService.svc";
|
||||
var chatterProxyURL = root + "/chatter/ChatterProxyService.svc";
|
||||
|
||||
function getNodeIdFromURI(uri) {
|
||||
if (typeof uri === 'string') {
|
||||
if (typeof uri === 'string') {
|
||||
var c = uri.split('/');
|
||||
return c[c.length-1];
|
||||
}
|
||||
|
@ -355,11 +355,11 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
var retval = [];
|
||||
for ( i = 0; i < uri.length; i++) {
|
||||
retval[i] = getNodeIdFromURI(uri[i]);
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function createGroup(name, description, ownerId, users) {
|
||||
document.getElementById("progress").style.display="block";
|
||||
|
||||
|
@ -368,11 +368,11 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
"description": description,
|
||||
"ownerId": ownerId,
|
||||
"users": users};
|
||||
|
||||
|
||||
sendRequest(false, false, chatterProxyURL + "/group/new", params, function(data) {
|
||||
document.getElementById("progress").style.display="none";
|
||||
if(data.Success) {
|
||||
showMessage("<strong>Success! Your UCSF Chatter group '" + name + "' has been created.</strong><br> "
|
||||
showMessage("<strong>Success! Your UCSF Chatter group '" + name + "' has been created.</strong><br> "
|
||||
+ "<a target='_blank' href='" + data.URL + "'>Go to UCSF Chatter to start working with your group.</a>");
|
||||
$("input#goup_name").val("");
|
||||
}
|
||||
|
@ -384,10 +384,10 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
showMessage("Server error " + obj.rc + " : " + obj.errors, true);
|
||||
});
|
||||
}
|
||||
|
||||
// ==============================================================
|
||||
|
||||
// ==============================================================
|
||||
function sendRequest(cache, signed, url, post_params, success, error) {
|
||||
var params = {};
|
||||
var params = {};
|
||||
if (signed) {
|
||||
params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
|
||||
}
|
||||
|
@ -397,35 +397,35 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
if(cache == false) {
|
||||
params[gadgets.io.RequestParameters.REFRESH_INTERVAL] = 0;
|
||||
}
|
||||
|
||||
|
||||
gadgets.io.makeRequest(url, function(obj) {
|
||||
if(obj.data != null) {
|
||||
success(obj.data);
|
||||
}
|
||||
else if(obj.errors != null) {
|
||||
else if(obj.errors != null) {
|
||||
if(error) {
|
||||
error(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
, params);
|
||||
}
|
||||
|
||||
// ==============================================================
|
||||
|
||||
// ==============================================================
|
||||
function showMessage(msg, isError) {
|
||||
$("div.message").html(msg);
|
||||
if(isError == true) {
|
||||
$("div.message").removeClass("info");
|
||||
$("div.message").removeClass("info");
|
||||
$("div.message").addClass("error");
|
||||
}
|
||||
else {
|
||||
$("div.message").removeClass("error");
|
||||
$("div.message").removeClass("error");
|
||||
$("div.message").addClass("info");
|
||||
}
|
||||
$("div.message").removeClass("hidden");
|
||||
$("div.message").removeClass("hidden");
|
||||
}
|
||||
|
||||
// ==============================================================
|
||||
|
||||
// ==============================================================
|
||||
function getUserList() {
|
||||
var items = [];
|
||||
$("div#canvas_profile_list tr").each( function(index, elem) {
|
||||
|
@ -433,15 +433,15 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
if(id != null && id != "") {
|
||||
items.push(getNodeIdFromURI(id));
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return items.join(',');
|
||||
}
|
||||
// ==============================================================
|
||||
// ==============================================================
|
||||
</script>]]></Content>
|
||||
<Content type="html" view="small" preferred_height="75" preferred_width="190"><![CDATA[<!--HTML-->
|
||||
<!DOCTYPE html>
|
||||
|
||||
|
||||
<table id="button_and_help" cellspacing="6" cellpadding="5" style="display:block;">
|
||||
<tr>
|
||||
<td class="tool_table_cell_small" style="width:145px">Add profiles to your list</td>
|
||||
|
@ -458,12 +458,12 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
<td class="tool_table_cell_small" valign="top" style="padding-top:4px"><span id="list_profiles" onClick="gadgetEventTrack('list_profiles')">Loading...</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function init() {
|
||||
showToolVersion(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gadgets.util.registerOnLoadHandler(init);
|
||||
</script>]]></Content>
|
||||
<Content type="html" view="canvas" preferred_height="600" preferred_width="700"><![CDATA[<!--HTML-->
|
||||
|
@ -499,9 +499,9 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
a, a:visited { color: #0088CC; text-decoration: none; }
|
||||
a:hover { color: #005580; text-decoration: underline; }
|
||||
p { width: 640px; }
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<!-- top menu links -->
|
||||
<div style="width:640px;">
|
||||
<p id="number_selected" class="tool_title_orange" style="margin-left:20px;margin-top:20px\9;">
|
||||
|
@ -510,7 +510,7 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
<p class="tool_body" style="margin-left:20px; margin-bottom:10px;">
|
||||
<div id="extended_functions" style="display:none;">
|
||||
<a href="" id="create_group">Create UCSF Chatter Group</a> |
|
||||
<a href="javascript:gadgetEventTrack('export_email');copyEmailDivToClipboard();">Export email addresses only</a> |
|
||||
<a href="javascript:gadgetEventTrack('export_email');copyEmailDivToClipboard();">Export email addresses only</a> |
|
||||
<a href="javascript:gadgetEventTrack('export_all_data');copyFullDivToClipboard();">Export all data</a> |
|
||||
<a href="" id="compose-email">Compose email to list</a><p>
|
||||
</div>
|
||||
|
@ -519,7 +519,7 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
</div>
|
||||
<a href="javascript:gadgetEventTrack('delete_list');deleteList();" style="margin-left:20px;">Delete list</a>
|
||||
</p>
|
||||
|
||||
|
||||
<p id="progress" style="margin-left:20px;">
|
||||
<br><br>
|
||||
<img src="images/waiting.gif">
|
||||
|
@ -527,73 +527,73 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
<b>This may take a minute or two, based on the size of your selected Profiles list.</b></p>
|
||||
</div>
|
||||
<div id="create_group" class="hidden">
|
||||
<div class="message hidden"><strong>Success! Your UCSF Chatter group has been created.</strong><br>
|
||||
<div class="message hidden"><strong>Success! Your UCSF Chatter group has been created.</strong><br>
|
||||
Go to UCSF Chatter to start working with your group.</div>
|
||||
<table><tr>
|
||||
<table><tr>
|
||||
<td nowrap valign="top">UCSF Chatter Group Name:</td>
|
||||
<td><input id="group_name" type="text" style="width:218px"></input><br><br></td></tr><tr>
|
||||
<td nowrap valign="top" align="right">Group Description:</td>
|
||||
<td><textarea id="group_description" rows="4" cols="25"></textarea><br><br></td></tr><tr><td> </td>
|
||||
<td><input id="create" type="button" value="Create"></input>
|
||||
<input id="close" type="button" value="Cancel/Close"></input></td></tr></table>
|
||||
<input id="close" type="button" value="Cancel/Close"></input></td></tr></table>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="canvas_email_list" style="display:none; background:#FFF; width:670px; height:50px; margin-left:20px;">
|
||||
Copy and paste the email addresses below into an Excel spreadsheet or email client "To" field.
|
||||
<input type="button" style="height:22px; font-size:10; margin-left:40px; margin-top: 6px;" value="Close" onClick="document.getElementById('canvas_email_list').style.display='none';document.getElementById('canvas_email_list_text').style.display='none';document.getElementById('canvas_profile_list').style.display='block';"></button>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- holds the email address list to be copied to the clipboard -->
|
||||
<div id="canvas_email_list_text" style="display:none; width:658px; height:450px; color:#000; margin:0px 5px 0px 5px;">
|
||||
<textarea id="canvas_email_list_textarea" rows="27" cols="78" style="border:1px solid #000; margin: 0px 8px 0px 8px;">
|
||||
</textarea>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="canvas_full_list" style="display:none; background:#FFF; width:640px; height:50px; margin-left: 20px;">
|
||||
Copy and paste the profile data below into an Excel spreadsheet or external text editor.
|
||||
<input type="button" style="height:22px; font-size:10; margin-left:40px; margin-top: 6px;" value="Close" onClick="document.getElementById('canvas_full_list').style.display='none';document.getElementById('canvas_full_list_text').style.display='none';document.getElementById('canvas_profile_list').style.display='block';"></button>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- holds the full profile list to be copied to the clipboard -->
|
||||
<div id="canvas_full_list_text" style="display:none; width:640px; height:450px; color:#000; margin:0px 5px 0px 5px;">
|
||||
<textarea id="canvas_full_list_textarea" rows="27" cols="78" style="border:1px solid #000; margin: 0px 8px 0px 8px;">
|
||||
</textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- holds the visible profile details list -->
|
||||
<div id="canvas_profile_list" style="display:none; margin-left:20px; height:463px; height:443px\9; width: 660px; overflow:auto;"></div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function init() {
|
||||
// update UI
|
||||
showToolVersion(true);
|
||||
readIdsFromDB(displayProfileList);
|
||||
readIdsFromDB(displayProfileList);
|
||||
document.getElementById("canvas_profile_list").style.display="block";
|
||||
|
||||
|
||||
$("a#create_group").click(function(event){
|
||||
event.preventDefault();
|
||||
$("div.message").addClass("hidden");
|
||||
$("div.message").addClass("hidden");
|
||||
$("div#create_group").removeClass("hidden");
|
||||
});
|
||||
});
|
||||
$("input#close").click(function(event){
|
||||
$("div#create_group").addClass("hidden");
|
||||
});
|
||||
|
||||
|
||||
$("input#create").click(function(event){
|
||||
$("div.message").addClass("hidden");
|
||||
$("div.message").addClass("hidden");
|
||||
var name = $("div#create_group input#group_name").val();
|
||||
var description = $("div#create_group #group_description").val();
|
||||
if(name == null || name == '') {
|
||||
showMessage("Please enter a group name.", true);
|
||||
}
|
||||
else {
|
||||
else {
|
||||
osapi.people.getViewer({ fields: ['id'] }).execute(function(result) {
|
||||
var users = getUserList();
|
||||
createGroup(name, description, getNodeIdFromURI(result.id), users);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#compose-email").click(function(event){
|
||||
var emails = [];
|
||||
var emailElem = $("td.email");
|
||||
|
@ -602,8 +602,8 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
emailElem.each(function(index, elem) {
|
||||
var email = $.trim($(elem).text());
|
||||
if(email != '') {
|
||||
|
@ -618,7 +618,7 @@ var email = 'http://vivoweb.org/ontology/core#email';
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
gadgets.util.registerOnLoadHandler(init);
|
||||
</script>]]></Content>
|
||||
</Module>
|
||||
</Module>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<script type="text/javascript" src="js/jquery-1.4.4.js"></script>
|
||||
<script type="text/javascript" src="js/prettyprint.js" ></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
// use pretty print!
|
||||
function loadPeople() {
|
||||
osapi.people.getViewer().execute(function(result) {
|
||||
|
@ -41,7 +41,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
function onLoadPeopleOsapi(person, divId) {
|
||||
function onLoadPeopleOsapi(person, divId) {
|
||||
html = new Array();
|
||||
html.push('<ul>');
|
||||
html.push('<li>You are looking at ' + person.displayName + '</li>');
|
||||
|
@ -50,11 +50,11 @@
|
|||
document.getElementById(divId).innerHTML = html.join('');
|
||||
}
|
||||
|
||||
function onLoadPeopleRdf(person, divId) {
|
||||
function onLoadPeopleRdf(person, divId) {
|
||||
html = new Array();
|
||||
html.push('<ul>');
|
||||
html.push('<li>You are looking at ' + person.label + '</li>');
|
||||
html.push('<li>Their URI is ' + (person.uri || person._about) + '</li>');
|
||||
html.push('<li>Their URI is ' + (person.uri || person._about) + '</li>');
|
||||
html.push('<li>Their email is ' + person.primaryEmail + '</li>');
|
||||
html.push('</ul>');
|
||||
var ppTable = prettyPrint(person);
|
||||
|
@ -70,7 +70,7 @@
|
|||
function submitform() {
|
||||
var rdfurl = document.getElementById('rdfurl');
|
||||
if (ndx == 0 || priorurl[ndx] != rdfurl.value) {
|
||||
priorurl[ndx++] = rdfurl.value;
|
||||
priorurl[ndx++] = rdfurl.value;
|
||||
}
|
||||
document.getElementById('rdf').innerHTML = '...fetching content...';
|
||||
osapi.rdf.getRDF(rdfurl.value).execute(function(result) {
|
||||
|
@ -107,4 +107,4 @@
|
|||
<div id='rdf'></div>
|
||||
</div> ]]>
|
||||
</Content>
|
||||
</Module>
|
||||
</Module>
|
||||
|
|
|
@ -7,45 +7,45 @@
|
|||
<Content type="html"><![CDATA[<!--HTML-->
|
||||
<!-- #includes -->
|
||||
<!DOCTYPE html>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
.gadget_text {
|
||||
font-family: Verdana, Arial;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
|
||||
.gadgets-gadget-chrome {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
|
||||
|
||||
<pre><div id="content" class="gadget_text"></div></pre>
|
||||
<script>
|
||||
|
||||
function parseXml(xml) {
|
||||
|
||||
function parseXml(xml) {
|
||||
if (jQuery.browser.msie) {
|
||||
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
|
||||
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
|
||||
xmlDoc.loadXML(xml);
|
||||
xml = xmlDoc;
|
||||
}
|
||||
|
||||
|
||||
return xml;
|
||||
}
|
||||
}
|
||||
|
||||
function handleResponse(obj) {
|
||||
var ids = [];
|
||||
var theXML = obj.text;
|
||||
|
||||
|
||||
// IE hack
|
||||
theXML = parseXml(theXML);
|
||||
theXML = parseXml(theXML);
|
||||
|
||||
// JB hack
|
||||
$("#content").append( "Additional search results for " + gadgets.util.getUrlParameters()['keyword'] )
|
||||
|
||||
$("#content").append( "Additional search results for " + gadgets.util.getUrlParameters()['keyword'] )
|
||||
|
||||
gadgets.window.adjustHeight();
|
||||
};
|
||||
|
||||
|
|
|
@ -15,30 +15,30 @@
|
|||
<Content type="html" view="default, home, profile" preferred_height="470" preferred_width="670"><![CDATA[<!--HTML-->
|
||||
<!DOCTYPE html>
|
||||
<base target="_blank"/>
|
||||
|
||||
<!-- TODO: Fix height for OSDE. Should be removed -->
|
||||
|
||||
<!-- TODO: Fix height for OSDE. Should be removed -->
|
||||
<!--script type="text/javascript">
|
||||
gadgets.window.adjustHeight(700);
|
||||
</script-->
|
||||
|
||||
|
||||
<!-- #includes -->
|
||||
<link rel="stylesheet" href="css/gadget.css" type="text/css" media="screen, projection">
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/os.js" ></script>
|
||||
|
||||
|
||||
<!-- Styles -->
|
||||
<style type="text/css">
|
||||
.slideshare_title { font-family: Arial, helvetica; font-size: 14px;}
|
||||
.slideshare_body { font-family: Arial, helvetica; font-size: 11px;}
|
||||
.slideshare_body { font-family: Arial, helvetica; font-size: 11px;}
|
||||
.slideshare_credit { font-family: Arial, helvetica; font-size: 10px;}
|
||||
.ss-link{ margin:10px 0px 10px 0px; }
|
||||
a, a:visited { color: #0088CC; text-decoration: none; }
|
||||
a:hover { color: #005580; text-decoration: underline; }
|
||||
</style>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function gotoSlideshare() {
|
||||
|
||||
function gotoSlideshare() {
|
||||
var action = 'go_to_slideshare';
|
||||
var href = $('div.ss-link a').attr('href');
|
||||
gadgets.pubsub.subscribe("analytics", function(sender, message){
|
||||
|
@ -48,14 +48,14 @@
|
|||
});
|
||||
gadgetEventTrack(action, href);
|
||||
}
|
||||
|
||||
|
||||
function gadgetEventTrack(action, label, value) {
|
||||
var message = {'action' : action};
|
||||
if (label) {message.label = label;}
|
||||
if (value) {message.value = value;}
|
||||
gadgets.pubsub.publish("analytics", message);
|
||||
}
|
||||
|
||||
|
||||
// ========================================
|
||||
function getUserNameAndPreview(userId){
|
||||
osapi.appdata.get({'userId': userId, 'groupId': '@self', 'appId':'@app', 'fields': ['username']})
|
||||
|
@ -65,15 +65,15 @@
|
|||
$('input[name=username]').val(username);
|
||||
if(username != null && username != "") { // only render flash if there's a username
|
||||
preview(username);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// ========================================
|
||||
|
||||
|
||||
// ========================================
|
||||
function preview(username){
|
||||
var url = "http://static.slidesharecdn.com/swf/multiwidget.swf";
|
||||
|
||||
|
||||
$('#preview').html(
|
||||
'<div style="width:577px;margin:auto;">' +
|
||||
'<object style="margin:0px" width="600" height="428" ' +
|
||||
|
@ -87,36 +87,36 @@
|
|||
'<param name="flashVars" value="feedurl=user/'+ username + '&widgettitle=Slides%20by%20'+ username +'"/>' +
|
||||
'<embed src="http://static.slidesharecdn.com/swf/multiwidget.swf" ' +
|
||||
' name="slideshow" ' +
|
||||
' flashVars="feedurl=user/'+ username + '&widgettitle=Slides%20by%20'+ username +'"' +
|
||||
' flashVars="feedurl=user/'+ username + '&widgettitle=Slides%20by%20'+ username +'"' +
|
||||
' type="application/x-shockwave-flash"' +
|
||||
' pluginspage="http://www.adobe.com/go/getflashplayer"' +
|
||||
' allowscriptaccess="always"' +
|
||||
' allowfullscreen="true"' +
|
||||
' pluginspage="http://www.adobe.com/go/getflashplayer"' +
|
||||
' allowscriptaccess="always"' +
|
||||
' allowfullscreen="true"' +
|
||||
' width="600" ' +
|
||||
' height="428">' +
|
||||
'</embed>' +
|
||||
'</object>' +
|
||||
'<div class="ss-link">Having trouble seeing this? <a href="http://www.slideshare.net/'+ username + '" target="_top">View at SlideShare</a><div/>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
);
|
||||
|
||||
$('div.ss-link a').click(function(event){
|
||||
event.preventDefault();
|
||||
gotoSlideshare();
|
||||
}); //click
|
||||
gotoSlideshare();
|
||||
}); //click
|
||||
}
|
||||
// ========================================
|
||||
|
||||
|
||||
// ========================================
|
||||
gadgets.util.registerOnLoadHandler(function(){
|
||||
var viewName=gadgets.views.getCurrentView().getName();
|
||||
|
||||
|
||||
if(viewName=='home'){
|
||||
var innerDiv=$('#inner_home_settings').html();
|
||||
$('#settings').html(innerDiv);
|
||||
|
||||
|
||||
$('#secondHeader').show();
|
||||
|
||||
|
||||
getUserNameAndPreview('@viewer');
|
||||
|
||||
$('span.save').click(function(){
|
||||
|
@ -124,7 +124,7 @@
|
|||
osapi.appdata.update({'userId': '@viewer', 'groupId': '@self', 'appId':'@app', 'data':{'username':username} })
|
||||
.execute(function(response){
|
||||
});
|
||||
|
||||
|
||||
$('#preview').html('');
|
||||
if(username != null && username != "") {
|
||||
preview(username);
|
||||
|
@ -133,18 +133,18 @@
|
|||
}
|
||||
else{
|
||||
getUserNameAndPreview('@owner');
|
||||
}
|
||||
}); // registerOnLoadHandler
|
||||
}
|
||||
}); // registerOnLoadHandler
|
||||
// ========================================
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="secondHeader" style="display:none; margin:0px 10px 0px 10px;">
|
||||
<span class="slideshare_title"><b>SlideShare: A great way to share presentations</b></span>
|
||||
</div>
|
||||
|
||||
<div id="settings" style="clear:both; margin:0px 10px 0px 10px;">
|
||||
|
||||
<div id="settings" style="clear:both; margin:0px 10px 0px 10px;">
|
||||
</div>
|
||||
<br>
|
||||
<div id="preview">
|
||||
|
@ -152,18 +152,18 @@
|
|||
<br><br>
|
||||
]]>
|
||||
</Content>
|
||||
<Content type="html" view="home" preferred_height="670" preferred_width="700"><![CDATA[<!--HTML-->
|
||||
<Content type="html" view="home" preferred_height="670" preferred_width="700"><![CDATA[<!--HTML-->
|
||||
<div id="inner_home_settings" style="display:none;">
|
||||
<p class="slideshare_body">
|
||||
If you already have a SlideShare account and have uploaded presentations, simply follow these steps:<br>
|
||||
</p>
|
||||
<p class="slideshare_body" style="padding-left:20px;">
|
||||
<ol>
|
||||
<li class="slideshare_body">Enter your SlideShare Username below and click Save/Preview.
|
||||
<li class="slideshare_body">Enter your SlideShare Username below and click Save/Preview.
|
||||
Any public presentations that you've uploaded to SlideShare will be shown in the preview below.</li>
|
||||
<li class="slideshare_body">Make sure these presentations are the ones you want to share on your profile.</li>
|
||||
<li class="slideshare_body">Click the "Show" link (above, upper right) to make the presentations publicly available within your profile.</li>
|
||||
<li class="slideshare_body">To remove the presentations, delete your SlideShare Username and click Save/Preview.
|
||||
<li class="slideshare_body">To remove the presentations, delete your SlideShare Username and click Save/Preview.
|
||||
Make sure to "Hide" your presentations from the public if you delete your SlideShare Username.</li>
|
||||
</ol>
|
||||
</p>
|
||||
|
@ -172,11 +172,11 @@
|
|||
</span>
|
||||
<span class="save slideshare_body" style="text-decoration:underline;cursor:pointer;color:#44F; display:inline;" title="Save this Username and preview the presentations.">Save/Preview</span>
|
||||
<br><br>
|
||||
<span class="slideshare_body">Don't have a SlideShare account yet?
|
||||
<span class="slideshare_body">Don't have a SlideShare account yet?
|
||||
Go to <a href="http://www.slideshare.net" target="_blank" style="font-size:12px;text-decoration:none; cursor:pointer;color:#44F;" title="Go to the SlideShare Web site">
|
||||
SlideShare</a> now to create an account and upload presentations.</span>
|
||||
</div>
|
||||
</div>
|
||||
]]>
|
||||
</Content>
|
||||
</Module>
|
||||
</Module>
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
<Require feature="dynamic-height" />
|
||||
</ModulePrefs>
|
||||
<Content type="html" view="default, home, profile"><![CDATA[<!--HTML-->
|
||||
<!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<!-- #includes -->
|
||||
<link rel="stylesheet" href="css/gadget.css" type="text/css" media="screen, projection">
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.blockUI.js"></script>
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.blockUI.js"></script>
|
||||
<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
|
||||
<script type="text/javascript" src="js/os.js" ></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var ucsf = ucsf || {};
|
||||
ucsf.twitter = {};
|
||||
|
@ -29,7 +29,7 @@
|
|||
if (value) {message.value = value;}
|
||||
gadgets.pubsub.publish("analytics", message);
|
||||
};
|
||||
|
||||
|
||||
ucsf.twitter.getUsername=function(callback) {
|
||||
osapi.appdata.get({'userId': '@owner', 'groupId': '@self', 'appId':'@app', 'fields': ['twitter_username']})
|
||||
.execute(function(response){
|
||||
|
@ -40,12 +40,12 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
ucsf.twitter.render=function(username) {
|
||||
$("#twitter-wjs").remove();
|
||||
$(".twitter-gadget .content").empty();
|
||||
$(".twitter-gadget .content").append('<a width="520" height="300" class="twitter-timeline" href="https://twitter.com/'+username+'" data-screen-name="'+username+'" data-widget-id="320982656688996353">Tweets by @'+username+'</a>')
|
||||
|
||||
|
||||
var fjs=document.getElementsByTagName("script")[0];
|
||||
var p=/^http:/.test(document.location)?'http':'https';
|
||||
js=document.createElement("script");
|
||||
|
@ -53,41 +53,41 @@
|
|||
js.src=p+"://platform.twitter.com/widgets.js";
|
||||
fjs.parentNode.insertBefore(js,fjs);
|
||||
}
|
||||
|
||||
|
||||
ucsf.twitter.preview=function(widget_id) {
|
||||
if(widget_id) {
|
||||
ucsf.twitter.render(widget_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
]]></Content>
|
||||
<Content type="html" view="profile" preferred_width="670"><![CDATA[<!--HTML-->
|
||||
<Content type="html" view="profile" preferred_width="670"><![CDATA[<!--HTML-->
|
||||
<script type="text/javascript">
|
||||
ucsf.twitter.profilePageInit = function() {
|
||||
gadgets.window.adjustHeight(300);
|
||||
ucsf.twitter.getUsername(ucsf.twitter.preview);
|
||||
}
|
||||
gadgets.util.registerOnLoadHandler(ucsf.twitter.profilePageInit);
|
||||
</script>
|
||||
|
||||
gadgets.util.registerOnLoadHandler(ucsf.twitter.profilePageInit);
|
||||
</script>
|
||||
|
||||
<!-- Styles -->
|
||||
<style type="text/css">
|
||||
.twitter-gadget .content {text-align: center;}
|
||||
<style type="text/css">
|
||||
.twitter-gadget .content {text-align: center;}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="twitter-gadget">
|
||||
<div class="content">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
]]></Content>
|
||||
<Content type="html" view="home" preferred_width="700"><![CDATA[<!--HTML-->
|
||||
<script type="text/javascript">
|
||||
<Content type="html" view="home" preferred_width="700"><![CDATA[<!--HTML-->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(".twitter-gadget .save").click(function() {
|
||||
$(".twitter-gadget").block({ message: "Saving..." });
|
||||
osapi.appdata.update({'userId': '@owner', 'groupId': '@self', 'appId':'@app', 'data':{'twitter_username':$('.twitter-gadget input').val()} }).execute(function(response){
|
||||
$(".twitter-gadget").unblock();
|
||||
});
|
||||
});
|
||||
});
|
||||
$(".twitter-gadget .preview").click(function() {
|
||||
var username = $('.twitter-gadget input').val();
|
||||
|
@ -102,7 +102,7 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
ucsf.twitter.homePageInit = function() {
|
||||
gadgets.window.adjustHeight(50);
|
||||
ucsf.twitter.getUsername(function(username) {
|
||||
|
@ -110,24 +110,24 @@
|
|||
$('.twitter-gadget .content').show();
|
||||
gadgets.window.adjustHeight(350);
|
||||
ucsf.twitter.preview(username);
|
||||
});
|
||||
});
|
||||
}
|
||||
gadgets.util.registerOnLoadHandler(ucsf.twitter.homePageInit);
|
||||
gadgets.util.registerOnLoadHandler(ucsf.twitter.homePageInit);
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Styles -->
|
||||
<style type="text/css">
|
||||
.twitter-gadget {margin-top: 10px;}
|
||||
<style type="text/css">
|
||||
.twitter-gadget {margin-top: 10px;}
|
||||
.twitter-gadget input {width: 400px;}
|
||||
.twitter-gadget .label {margin-right: 10px;font-weight: bold;}
|
||||
.twitter-gadget .preview, .twitter-gadget .save {margin-left: 10px;color: #3B6394; cursor:pointer;}
|
||||
.twitter-gadget .content {margin-top: 10px; margin-left: 20px;}
|
||||
.twitter-gadget .content {margin-top: 10px; margin-left: 20px;}
|
||||
</style>
|
||||
|
||||
<div class="twitter-gadget">
|
||||
|
||||
<div class="twitter-gadget">
|
||||
<span class="label">Widget Id:</span><input type="text" name="keywords"></input><span class="preview">Preview</span><span class="save">Save</span>
|
||||
<div class="content" style="display:none">
|
||||
<div class="content" style="display:none">
|
||||
</div>
|
||||
</div>
|
||||
]]></Content>
|
||||
</Module>
|
||||
</Module>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app
|
||||
version="2.5"
|
||||
<web-app
|
||||
version="2.5"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
>
|
||||
</web-app>
|
||||
</web-app>
|
||||
|
|
|
@ -104,23 +104,23 @@ DROP PROCEDURE IF EXISTS `orng_registerAppPerson`;
|
|||
DROP PROCEDURE IF EXISTS `orng_upsertAppData`;
|
||||
DROP PROCEDURE IF EXISTS `orng_deleteAppData`;
|
||||
|
||||
DELIMITER //
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE orng_registerAppPerson (uid varchar(255), aid INT, v BOOL)
|
||||
BEGIN
|
||||
IF (v)
|
||||
THEN
|
||||
INSERT INTO orng_app_registry (appId, personId, createdDT) values (aid, uid, now());
|
||||
ELSE
|
||||
ELSE
|
||||
DELETE FROM orng_app_registry where appId = aid AND personId = uid;
|
||||
END IF;
|
||||
END //
|
||||
DELIMITER ;
|
||||
END IF;
|
||||
END //
|
||||
DELIMITER ;
|
||||
|
||||
DELIMITER //
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE orng_upsertAppData(uid varchar(255), aid INT, kn varchar(255),v varchar(4000))
|
||||
BEGIN
|
||||
DECLARE cnt int;
|
||||
SELECT count(*) FROM orng_appdata WHERE userId = uid AND appId = aid and keyname = kn INTO cnt;
|
||||
SELECT count(*) FROM orng_appdata WHERE userId = uid AND appId = aid and keyname = kn INTO cnt;
|
||||
IF (cnt > 0)
|
||||
THEN
|
||||
UPDATE orng_appdata set `value` = v, updatedDT = NOW() WHERE userId = uid AND appId = aid and keyname = kn;
|
||||
|
@ -128,26 +128,26 @@ BEGIN
|
|||
INSERT INTO orng_appdata (userId, appId, keyname, `value`) values (uid, aid, kn, v);
|
||||
END IF;
|
||||
-- if keyname is VISIBLE, do more
|
||||
IF (kn = 'VISIBLE' AND v = 'Y')
|
||||
IF (kn = 'VISIBLE' AND v = 'Y')
|
||||
THEN
|
||||
CALL orng_registerAppPerson(uid, aid, 1);
|
||||
ELSEIF (kn = 'VISIBLE' )
|
||||
THEN
|
||||
CALL orng_registerAppPerson(uid, aid, 0);
|
||||
END IF;
|
||||
END //
|
||||
DELIMITER ;
|
||||
END //
|
||||
DELIMITER ;
|
||||
|
||||
DELIMITER //
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE orng_deleteAppData(uid varchar(255), aid INT, kn varchar(255))
|
||||
BEGIN
|
||||
DELETE FROM orng_appdata WHERE userId = uid AND appId = aid and keyname = kn;
|
||||
-- if keyname is VISIBLE, do more
|
||||
IF (kn = 'VISIBLE' )
|
||||
IF (kn = 'VISIBLE' )
|
||||
THEN
|
||||
CALL orng_registerAppPerson(uid, aid, 0);
|
||||
END IF;
|
||||
END //
|
||||
END //
|
||||
DELIMITER ;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue