diff options
author | Bart Visscher <bart@thisnet.nl> | 2011-09-11 22:06:45 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2011-09-14 23:36:22 +0200 |
commit | 7c9f1007d5ce78b4c19f35f425467755f75ba5b6 (patch) | |
tree | 2de2c1c2eccecdb0497c4535a0bab0f9c4fedd08 /apps/calendar | |
parent | 0ff9bc4806bc9296046057b2eadbf29738346b05 (diff) | |
download | nextcloud-server-7c9f1007d5ce78b4c19f35f425467755f75ba5b6.tar.gz nextcloud-server-7c9f1007d5ce78b4c19f35f425467755f75ba5b6.zip |
Fix initial visibility of database settings in setup
Diffstat (limited to 'apps/calendar')
-rw-r--r-- | apps/calendar/js/calendar.js | 111 | ||||
-rw-r--r-- | apps/calendar/templates/calendar.php | 4 | ||||
-rw-r--r-- | apps/calendar/templates/part.choosecalendar.php | 2 | ||||
-rw-r--r-- | apps/calendar/templates/part.choosecalendar.rowfields.php | 4 | ||||
-rw-r--r-- | apps/calendar/templates/part.editcalendar.php | 4 |
5 files changed, 63 insertions, 62 deletions
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index cf66fdd735c..04d709b6ae2 100644 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -318,6 +318,62 @@ Calendar={ addDateInfo:function(selector, date){ $(selector).data('date_info', date); }, + switch2Today:function(){ + Calendar.Date.current = new Date(); + Calendar.UI.updateView(); + }, + Calendar:{ + overview:function(){ + if(oc_cal_opendialog == 0){ + $("#dialog_holder").load(oc_webroot + "/apps/calendar/ajax/choosecalendar.php"); + oc_cal_opendialog = 1; + }else{ + alert(t("calendar", "You can't open more than one dialog per site!")); + } + }, + activation:function(checkbox, calendarid) + { + $.post(oc_webroot + "/apps/calendar/ajax/activation.php", { calendarid: calendarid, active: checkbox.checked?1:0 }, + function(data) { + checkbox.checked = data == 1; + Calendar.UI.loadEvents(); + }); + }, + new:function(object){ + var tr = $(document.createElement('tr')) + .load(oc_webroot + "/apps/calendar/ajax/newcalendar.php"); + $(object).closest('tr').after(tr).hide(); + }, + edit:function(object, calendarid){ + var tr = $(document.createElement('tr')) + .load(oc_webroot + "/apps/calendar/ajax/editcalendar.php?calendarid="+calendarid); + $(object).closest('tr').after(tr).hide(); + }, + submit:function(button, calendarid){ + var displayname = $("#displayname_"+calendarid).val(); + var active = $("#active_"+calendarid+":checked").length; + var description = $("#description_"+calendarid).val(); + var calendarcolor = $("#calendarcolor_"+calendarid).val(); + + var url; + if (calendarid == 'new'){ + url = "ajax/createcalendar.php"; + }else{ + url = "ajax/updatecalendar.php"; + } + $.post(url, { id: calendarid, name: displayname, active: active, description: description, color: calendarcolor }, + function(data){ + if(data.error == "true"){ + }else{ + $(button).closest('tr').prev().html(data.data).show().next().remove(); + Calendar.UI.loadEvents(); + } + }, 'json'); + }, + cancel:function(button, calendarid){ + $(button).closest('tr').prev().show().next().remove(); + }, + }, OneDay:{ forward:function(){ Calendar.Date.forward_day(); @@ -687,11 +743,6 @@ $(document).ready(function(){ //event vars Calendar.UI.loadEvents(); -function oc_cal_switch2today() { - Calendar.Date.current = new Date(); - Calendar.UI.updateView(); -} - var oc_cal_opendialog = 0; function oc_cal_newevent(selector, time){ var date_info = $(selector).data('date_info'); @@ -713,53 +764,3 @@ function oc_cal_newevent(selector, time){ alert(t("calendar", "You can't open more than one dialog per site!")); } } -function oc_cal_choosecalendar(){ - if(oc_cal_opendialog == 0){ - $("#dialog_holder").load(oc_webroot + "/apps/calendar/ajax/choosecalendar.php"); - oc_cal_opendialog = 1; - }else{ - alert(t("calendar", "You can't open more than one dialog per site!")); - } -} -function oc_cal_calender_activation(checkbox, calendarid) -{ - $.post(oc_webroot + "/apps/calendar/ajax/activation.php", { calendarid: calendarid, active: checkbox.checked?1:0 }, - function(data) { - checkbox.checked = data == 1; - Calendar.UI.loadEvents(); - }); -} -function oc_cal_editcalendar(object, calendarid){ - var tr = $(document.createElement('tr')) - .load(oc_webroot + "/apps/calendar/ajax/editcalendar.php?calendarid="+calendarid); - $(object).closest('tr').after(tr).hide(); -} -function oc_cal_newcalendar(object){ - var tr = $(document.createElement('tr')) - .load(oc_webroot + "/apps/calendar/ajax/newcalendar.php"); - $(object).closest('tr').after(tr).hide(); -} -function oc_cal_calendar_submit(button, calendarid){ - var displayname = $("#displayname_"+calendarid).val(); - var active = $("#active_"+calendarid+":checked").length; - var description = $("#description_"+calendarid).val(); - var calendarcolor = $("#calendarcolor_"+calendarid).val(); - - var url; - if (calendarid == 'new'){ - url = "ajax/createcalendar.php"; - }else{ - url = "ajax/updatecalendar.php"; - } - $.post(url, { id: calendarid, name: displayname, active: active, description: description, color: calendarcolor }, - function(data){ - if(data.error == "true"){ - }else{ - $(button).closest('tr').prev().html(data.data).show().next().remove(); - Calendar.UI.loadEvents(); - } - }, 'json'); -} -function oc_cal_calendar_cancel(button, calendarid){ - $(button).closest('tr').prev().show().next().remove(); -} diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index 68a198f6ffb..aedfeda9cb4 100644 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -52,8 +52,8 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur </form> <form> <div id="choosecalendar"> - <input type="button" id="today_input" value="<?php echo $l->t("Today");?>" onclick="oc_cal_switch2today();"/> - <input type="button" id="choosecalendar_input" value="<?php echo $l->t("Calendars");?>" onclick="oc_cal_choosecalendar();" /> + <input type="button" id="today_input" value="<?php echo $l->t("Today");?>" onclick="Calendar.UI.switch2Today();"/> + <input type="button" id="choosecalendar_input" value="<?php echo $l->t("Calendars");?>" onclick="Calendar.UI.Calendar.overview();" /> </div> </form> <form> diff --git a/apps/calendar/templates/part.choosecalendar.php b/apps/calendar/templates/part.choosecalendar.php index 82bd1ff5ab3..4b4cff6f95e 100644 --- a/apps/calendar/templates/part.choosecalendar.php +++ b/apps/calendar/templates/part.choosecalendar.php @@ -12,7 +12,7 @@ for($i = 0; $i < count($option_calendars); $i++){ ?> <tr> <td colspan="4"> - <a href="#" onclick="oc_cal_newcalendar(this);"><?php echo $l->t('New Calendar') ?></a> + <a href="#" onclick="Calendar.UI.Calendar.new(this);"><?php echo $l->t('New Calendar') ?></a> </td> </tr> <tr> diff --git a/apps/calendar/templates/part.choosecalendar.rowfields.php b/apps/calendar/templates/part.choosecalendar.rowfields.php index 1e80125999e..9a202907cd8 100644 --- a/apps/calendar/templates/part.choosecalendar.rowfields.php +++ b/apps/calendar/templates/part.choosecalendar.rowfields.php @@ -1,4 +1,4 @@ <?php - echo "<td width=\"20px\"><input id=\"active_" . $_['calendar']["id"] . "\" type=\"checkbox\" onClick=\"oc_cal_calender_activation(this, " . $_['calendar']["id"] . ")\"" . ($_['calendar']["active"] ? ' checked="checked"' : '') . "></td>"; + echo "<td width=\"20px\"><input id=\"active_" . $_['calendar']["id"] . "\" type=\"checkbox\" onClick=\"Calendar.UI.Calender.activation(this, " . $_['calendar']["id"] . ")\"" . ($_['calendar']["active"] ? ' checked="checked"' : '') . "></td>"; echo "<td><label for=\"active_" . $_['calendar']["id"] . "\">" . $_['calendar']["displayname"] . "</label></td>"; - echo "<td width=\"20px\"><a href=\"#\" onclick=\"showcaldavurl('" . OC_User::getUser() . "', '" . $_['calendar']["uri"] . "');\" title=\"" . $l->t("CalDav Link") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/public.svg\"></a></td><td width=\"20px\"><a href=\"export.php?calid=" . $_['calendar']["id"] . "\" title=\"" . $l->t("Download") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/download.svg\"></a></td><td width=\"20px\"><a href=\"#\" title=\"" . $l->t("Edit") . "\" class=\"action\" onclick=\"oc_cal_editcalendar(this, " . $_['calendar']["id"] . ");\"><img class=\"svg action\" src=\"../../core/img/actions/rename.svg\"></a></td>"; + echo "<td width=\"20px\"><a href=\"#\" onclick=\"showcaldavurl('" . OC_User::getUser() . "', '" . $_['calendar']["uri"] . "');\" title=\"" . $l->t("CalDav Link") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/public.svg\"></a></td><td width=\"20px\"><a href=\"export.php?calid=" . $_['calendar']["id"] . "\" title=\"" . $l->t("Download") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/download.svg\"></a></td><td width=\"20px\"><a href=\"#\" title=\"" . $l->t("Edit") . "\" class=\"action\" onclick=\"Calendar.UI.Calendar.edit(this, " . $_['calendar']["id"] . ");\"><img class=\"svg action\" src=\"../../core/img/actions/rename.svg\"></a></td>"; diff --git a/apps/calendar/templates/part.editcalendar.php b/apps/calendar/templates/part.editcalendar.php index cdfc15f570f..a1a36505ee9 100644 --- a/apps/calendar/templates/part.editcalendar.php +++ b/apps/calendar/templates/part.editcalendar.php @@ -45,6 +45,6 @@ </td> </tr> </table> -<input style="float: left;" type="button" onclick="oc_cal_calendar_submit(this, <?php echo $_['new'] ? "'new'" : $_['calendar']['id'] ?>);" value="<?php echo $_['new'] ? $l->t("Save") : $l->t("Submit"); ?>"> -<input style="float: left;" type="button" onclick="oc_cal_calendar_cancel(this, <?php echo $_['new'] ? "'new'" : $_['calendar']['id'] ?>);" value="<?php echo $l->t("Cancel"); ?>"> +<input style="float: left;" type="button" onclick="Calendar.UI.Calendar.submit(this, <?php echo $_['new'] ? "'new'" : $_['calendar']['id'] ?>);" value="<?php echo $_['new'] ? $l->t("Save") : $l->t("Submit"); ?>"> +<input style="float: left;" type="button" onclick="Calendar.UI.Calendar.cancel(this, <?php echo $_['new'] ? "'new'" : $_['calendar']['id'] ?>);" value="<?php echo $l->t("Cancel"); ?>"> </td> |