Fix initial visibility of database settings in setup
This commit is contained in:
parent
0ff9bc4806
commit
7c9f1007d5
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>";
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue