]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix initial visibility of database settings in setup
authorBart Visscher <bart@thisnet.nl>
Sun, 11 Sep 2011 20:06:45 +0000 (22:06 +0200)
committerBart Visscher <bartv@thisnet.nl>
Wed, 14 Sep 2011 21:36:22 +0000 (23:36 +0200)
apps/calendar/js/calendar.js
apps/calendar/templates/calendar.php
apps/calendar/templates/part.choosecalendar.php
apps/calendar/templates/part.choosecalendar.rowfields.php
apps/calendar/templates/part.editcalendar.php
core/js/setup.js

index cf66fdd735c41c0290601e9fd0dfb6db5fc316a9..04d709b6ae2ce69d08f6b69a09d1e295e20de308 100644 (file)
@@ -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();
-}
index 68a198f6ffb408a6194233b8676241ccc3dc3892..aedfeda9cb48f37b3f9894ab7ad26e0a38e39504 100644 (file)
@@ -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>
index 82bd1ff5ab3963a2294c9f0aa70169e5f1d07fab..4b4cff6f95edf8b8b4c71f2eb3dc8b5c4b05195d 100644 (file)
@@ -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>
index 1e80125999e47e5b3bab3d937138009c620fe5c8..9a202907cd8888832755821434ef8435e27f4bac 100644 (file)
@@ -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>";
index cdfc15f570f1914241206d1eefe02765d18bd674..a1a36505ee9dd0419962cab50cede754c42dbf5e 100644 (file)
@@ -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>
index 01b8c1303970a93e15d8b3923dfae1a93818423f..7c44362f05194c43e5dfe39d5181125e1478b511 100644 (file)
@@ -3,9 +3,9 @@ $(document).ready(function() {
        $('#datadirField').hide(250);
        if($('#hasSQLite').val()=='true'){
                $('#databaseField').hide();
-               $('#use_other_db').slideUp();
-               $('#dbhost').hide(250);
-               $('#dbhostlabel').hide(250);
+               $('#use_other_db').hide();
+               $('#dbhost').hide();
+               $('#dbhostlabel').hide();
        }
 
        $('#sqlite').click(function() {