|
@@ -150,7 +150,7 @@ $(document).ready(function() {
|
|
|
================================================= */
|
|
|
|
|
|
// If the user clicks on the "Collaborators" button, show the collaborators window
|
|
|
- $("div.collaborators button").on("click", function() {
|
|
|
+ $("div#collaborators button").on("click", function() {
|
|
|
// Show the collaborators window
|
|
|
$("div#shadow").css("display", "block");
|
|
|
$("div#collaborators-window").css("display", "block");
|
|
@@ -339,7 +339,7 @@ $(document).ready(function() {
|
|
|
$("div#collaborators-window table").html(htmlToAppend);
|
|
|
|
|
|
// Update the button to open the collaborators window
|
|
|
- $("div.collaborators button span").text("Collaborators (" + $("td.collaborators-active span").length + " active)");
|
|
|
+ $("div#collaborators button span").text("Collaborators (" + $("td.collaborators-active span").length + " active)");
|
|
|
|
|
|
// Toggle the text explaining that the canvas is saved automatically
|
|
|
$("p#save-canvas").hide();
|
|
@@ -1447,37 +1447,33 @@ $(document).ready(function() {
|
|
|
Getting the current date
|
|
|
================================================= */
|
|
|
|
|
|
- /*
|
|
|
- var fullDate = new Date();
|
|
|
- var twoDigitMonth = fullDate.getMonth() + "";
|
|
|
- if (twoDigitMonth.length == 1) twoDigitMonth = "0" + twoDigitMonth;
|
|
|
- var twoDigitDate = fullDate.getDate() + "";
|
|
|
- if (twoDigitDate.length == 1) twoDigitDate = "0" + twoDigitDate;
|
|
|
-
|
|
|
- var currentDate = fullDate.getFullYear() + "-" + twoDigitMonth + "-" + twoDigitDate;
|
|
|
- // Set the current date in the date input field
|
|
|
- $('.proj_date').val(currentDate);
|
|
|
- */
|
|
|
-
|
|
|
var fullDate = new Date();
|
|
|
+ var fourDigitYear = fullDate.getFullYear();
|
|
|
var twoDigitMonth = fullDate.getMonth() + 1 + "";
|
|
|
- if (twoDigitMonth.length == 1) twoDigitMonth = "0" + twoDigitMonth;
|
|
|
var twoDigitDate = fullDate.getDate() + "";
|
|
|
- if (twoDigitDate.length == 1) twoDigitDate = "0" + twoDigitDate;
|
|
|
|
|
|
- var currentDate = fullDate.getFullYear() + "-" + twoDigitMonth + "-" + twoDigitDate;
|
|
|
+ if(twoDigitMonth.length == 1) {
|
|
|
+ twoDigitMonth = "0" + twoDigitMonth;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(twoDigitDate.length == 1) {
|
|
|
+ twoDigitDate = "0" + twoDigitDate;
|
|
|
+ }
|
|
|
+
|
|
|
+ var currentDate = fourDigitYear + "-" + twoDigitMonth + "-" + twoDigitDate;
|
|
|
+
|
|
|
// Set the current date in the date input field
|
|
|
- $('.proj_date').val(currentDate);
|
|
|
+ // $('.proj_date').val(currentDate);
|
|
|
|
|
|
/* ================================================
|
|
|
USER LOGS OUT (dropdown menu)
|
|
|
================================================= */
|
|
|
|
|
|
- $('.user-profile').on('click', '#logout', function() {
|
|
|
+ $('#user-profile').on('click', '#logout', function() {
|
|
|
var url = 'php/logout.php';
|
|
|
$.post(url, function(data, status) {
|
|
|
if (data == 200) {
|
|
|
- $('.user-profile').hide();
|
|
|
+ $('#user-profile').hide();
|
|
|
$('.invited-members').hide();
|
|
|
window.location.href="https://www.ethicscanvas.org";
|
|
|
}
|
|
@@ -1506,7 +1502,7 @@ $(document).ready(function() {
|
|
|
if (key === 'field_00[]') {
|
|
|
$('.form-header').find('input.proj_title').val(value[
|
|
|
0]);
|
|
|
- $('.form-header').find('input.proj_date').val(value[1]);
|
|
|
+ // $('.form-header').find('input.proj_date').val(value[1]);
|
|
|
}
|
|
|
else if (key !== 'new_item') {
|
|
|
if ($.type(value) === "array") {
|
|
@@ -2015,8 +2011,8 @@ $(document).ready(function() {
|
|
|
|
|
|
// php variables are retieved in the header of the canvas index.php as js variables -->
|
|
|
var name_save_canvas = $('.form-header').find('.proj_title').val();
|
|
|
- var date_save_canvas = $('.form-header').find('.proj_date').val();
|
|
|
- // var date_save_canvas = currentDate;
|
|
|
+ // var date_save_canvas = $('.form-header').find('.proj_date').val();
|
|
|
+ var date_save_canvas = currentDate;
|
|
|
var save_canvas_obj = {
|
|
|
'email_save_canvas': email_save_canvas,
|
|
|
'name_save_canvas': name_save_canvas,
|