Page MenuHomePhabricator

No OneTemporary

diff --git a/lang/en/lang.php b/lang/en/lang.php
--- a/lang/en/lang.php
+++ b/lang/en/lang.php
@@ -1,33 +1,34 @@
<?php
$lang['created_by_davcal'] = 'Created by DAVCal for DokuWiki';
$lang['unknown_error'] = 'Unknown Error';
$lang['event_added'] = 'Event added';
$lang['event_edited'] = 'Event edited';
$lang['event_deleted'] = 'Event deleted';
$lang['no_permission'] = 'You don\'t have permission to modify this calendar';
$lang['settings'] = 'Settings/Sync';
$lang['settings_saved'] = 'Settings saved successfully';
$lang['error_saving'] = 'Error saving settings.';
$lang['local_time'] = 'Local time (Browser based)';
$lang['js']['create_new_event'] = 'Create new Event';
$lang['js']['cancel'] = 'Cancel';
$lang['js']['create'] = 'Create';
$lang['js']['save'] = 'Save';
$lang['js']['settings'] = 'Settings';
$lang['js']['edit'] = 'Edit';
$lang['js']['delete'] = 'Delete';
$lang['js']['edit_event'] = 'Edit Event';
$lang['js']['allday'] = 'All Day Event';
$lang['js']['title'] = 'Title';
$lang['js']['from'] = 'From';
$lang['js']['to'] = 'To';
$lang['js']['yes'] = 'Yes';
$lang['js']['confirmation'] = 'Confirmation';
$lang['js']['ok'] = 'OK';
$lang['js']['info'] = 'Info';
$lang['js']['really_delete_this_event'] = 'Really delete this event?';
$lang['js']['timezone'] = 'Timezone';
$lang['js']['weeknumbers'] = 'Week Numbers';
$lang['js']['use_lang_tz'] = 'Use Timezone from language setting';
$lang['js']['only_workweek'] = 'Show only Work Week';
$lang['js']['sync_url'] = 'DAVCal URL';
+$lang['js']['error_retrieving_data'] = 'There was an error retrieving data from the calendar server.';
diff --git a/script.js b/script.js
--- a/script.js
+++ b/script.js
@@ -1,550 +1,478 @@
/* DOKUWIKI:include_once fullcalendar-2.4.0/moment.js */
/* DOKUWIKI:include_once fullcalendar-2.4.0/fullcalendar.js */
/* DOKUWIKI:include_once fullcalendar-2.4.0/lang/de.js */
/* DOKUWIKI:include_once fullcalendar-2.4.0/lang/en.js */
/* DOKUWIKI:include_once datetimepicker-2.4.5/jquery.datetimepicker.js */
jQuery(function() {
// Redefine functions for using moment.js with datetimepicker
Date.parseDate = function( input, format ){
return moment(input,format).toDate();
};
Date.prototype.dateFormat = function( format ){
return moment(this).format(format);
};
// Attach to event links
jQuery('div.fullCalendarSettings a').each(function() {
var $link = jQuery(this);
var href = $link.attr('href');
if (!href) return;
$link.click(
function(e) {
dw_davcal__modals.showSettingsDialog();
e.preventDefault();
return '';
}
);
}
);
var postArray = { };
jQuery.post(
DOKU_BASE + 'lib/exe/ajax.php',
{
call: 'plugin_davcal',
id: JSINFO.id,
action: 'getSettings',
params: postArray
},
function(data)
{
var result = data['result'];
if(result === true)
{
dw_davcal__modals.settings = data['settings'];
var wknum = false;
var tz = false;
var we = true;
if(data['settings']['weeknumbers'] == 1)
wknum = true;
if(data['settings']['timezone'] !== '')
tz = data['settings']['timezone'];
if(data['settings']['workweek'] == 1)
we = false;
// Initialize the davcal popup
var res = jQuery('#fullCalendar').fullCalendar({
dayClick: function(date, jsEvent, view) {
- dw_davcal__modals.showNewEventDialog(date);
+ dw_davcal__modals.showEditEventDialog(date, false);
},
eventClick: function(calEvent, jsEvent, view) {
- dw_davcal__modals.showEditEventDialog(calEvent);
+ dw_davcal__modals.showEditEventDialog(calEvent, true);
},
events: {
url: DOKU_BASE + 'lib/exe/ajax.php',
type: 'POST',
data: {
call: 'plugin_davcal',
action: 'getEvents',
id: JSINFO.id
},
error: function() {
- //alert('there was an error retrieving calendar data');
+ dw_davcal__modals.msg = LANG.plugins.davcal['error_retrieving_data'];
+ dw_davcal__modals.showDialog(false);
}
},
header: {
left: 'title',
center: 'today prev,next',
right: 'month,agendaWeek,agendaDay'
},
lang: JSINFO.plugin.davcal['language'],
weekNumbers: wknum,
timezone: tz,
weekends: we,
});
}
}
);
});
var dw_davcal__modals = {
- $newEventDialog : null,
$editEventDialog: null,
- $infoDialog: null,
- $confirmDialog: null,
+ $dialog: null,
$settingsDialog: null,
msg: null,
completeCb: null,
action: null,
uid: null,
settings: null,
showSettingsDialog : function() {
if(dw_davcal__modals.$settingsDialog)
return;
var dialogButtons = {};
dialogButtons[LANG.plugins.davcal['save']] = function() {
var postArray = { };
jQuery("input[class=dw_davcal__settings], select[class=dw_davcal__settings]").each(function() {
if(jQuery(this).attr('type') == 'checkbox')
{
postArray[jQuery(this).prop('name')] = jQuery(this).prop('checked') ? 1 : 0;
}
else
{
postArray[jQuery(this).prop('name')] = jQuery(this).val();
}
});
jQuery('#dw_davcal__ajaxsettings').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />');
jQuery.post(
DOKU_BASE + 'lib/exe/ajax.php',
{
call: 'plugin_davcal',
id: JSINFO.id,
action: 'saveSettings',
params: postArray
},
function(data)
{
var result = data['result'];
var html = data['html'];
jQuery('#dw_davcal__ajaxsettings').html(html);
if(result === true)
{
location.reload();
}
}
);
};
dialogButtons[LANG.plugins.davcal['cancel']] = function () {
dw_davcal__modals.hideSettingsDialog();
};
dw_davcal__modals.$settingsDialog = jQuery(document.createElement('div'))
.dialog({
autoOpen: false,
draggable: true,
title: LANG.plugins.davcal['settings'],
resizable: true,
buttons: dialogButtons,
})
.html(
'<div><table>' +
//'<tr><td>' + LANG.plugins.davcal['use_lang_tz'] + '</td><td><input type="checkbox" name="use_lang_tz" id="dw_davcal__settings_use_lang_tz" class="dw_davcal__settings"></td></tr>' +
'<tr><td>' + LANG.plugins.davcal['timezone'] + '</td><td><select name="timezone" id="dw_davcal__settings_timezone" class="dw_davcal__settings"></select></td></tr>' +
'<tr><td>' + LANG.plugins.davcal['weeknumbers'] + '</td><td><input type="checkbox" name="weeknumbers" id="dw_davcal__settings_weeknumbers" class="dw_davcal__settings"></td></tr>' +
'<tr><td>' + LANG.plugins.davcal['only_workweek'] + '</td><td><input type="checkbox" name="workweek" id="dw_davcal__settings_workweek" class="dw_davcal__settings"></td></tr>' +
'<tr><td>' + LANG.plugins.davcal['sync_url'] + '</td><td><input type="text" name="syncurl" readonly="readonly" value="' + dw_davcal__modals.settings['syncurl'] + '"></td></tr>' +
'</table>' +
'</div>' +
'<div id="dw_davcal__ajaxsettings"></div>'
)
.parent()
.attr('id','dw_davcal__settings')
.show()
.appendTo('.dokuwiki:first');
// attach event handlers
jQuery('#dw_davcal__settings .ui-dialog-titlebar-close').click(function(){
dw_davcal__modals.hideSettingsDialog();
});
var $tzdropdown = jQuery('#dw_davcal__settings_timezone');
jQuery('#fullCalendarTimezoneList option').each(function() {
jQuery('<option />', {value: jQuery(this).val(),
text: jQuery(this).text()}).appendTo($tzdropdown);
});
if(dw_davcal__modals.settings)
{
if(dw_davcal__modals.settings['timezone'] !== '')
jQuery('#dw_davcal__settings_timezone').val(dw_davcal__modals.settings['timezone']);
if(dw_davcal__modals.settings['weeknumbers'] == 1)
jQuery('#dw_davcal__settings_weeknumbers').prop('checked', true);
else
jQuery('#dw_davcal__settings_weeknumbers').prop('checked', false);
if(dw_davcal__modals.settings['workweek'] == 1)
jQuery('#dw_davcal__settings_workweek').prop('checked', true);
else
jQuery('#dw_davcal__settings_workweek').prop('checked', false);
}
},
- showEditEventDialog : function(calEvent) {
+ showEditEventDialog : function(event, edit) {
if(dw_davcal__modals.$editEventDialog)
return;
-
+
+ var title = '';
var dialogButtons = {};
- dialogButtons[LANG.plugins.davcal['edit']] = function() {
- var postArray = { };
- jQuery("input.dw_davcal__editevent").each(function() {
- if(jQuery(this).attr('type') == 'checkbox')
- {
- postArray[jQuery(this).prop('name')] = jQuery(this).prop('checked') ? 1 : 0;
- }
- else
- {
- postArray[jQuery(this).prop('name')] = jQuery(this).val();
- }
- });
- jQuery('#dw_davcal__ajaxedit').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />');
- jQuery.post(
- DOKU_BASE + 'lib/exe/ajax.php',
- {
- call: 'plugin_davcal',
- id: JSINFO.id,
- action: 'editEvent',
- params: postArray
- },
- function(data)
- {
- var result = data['result'];
- var html = data['html'];
- jQuery('#dw_davcal__ajaxedit').html(html);
- if(result === true)
+ var calEvent = [];
+ if(edit)
+ {
+ calEvent = event;
+ title = LANG.plugins.davcal['edit_event'];
+ dialogButtons[LANG.plugins.davcal['edit']] = function() {
+ if(!dw_davcal__modals.checkEvents())
+ return;
+ var postArray = { };
+ jQuery("input.dw_davcal__editevent").each(function() {
+ if(jQuery(this).attr('type') == 'checkbox')
+ {
+ postArray[jQuery(this).prop('name')] = jQuery(this).prop('checked') ? 1 : 0;
+ }
+ else
+ {
+ postArray[jQuery(this).prop('name')] = jQuery(this).val();
+ }
+ });
+ jQuery('#dw_davcal__ajaxedit').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />');
+ jQuery.post(
+ DOKU_BASE + 'lib/exe/ajax.php',
+ {
+ call: 'plugin_davcal',
+ id: JSINFO.id,
+ action: 'editEvent',
+ params: postArray
+ },
+ function(data)
+ {
+ var result = data['result'];
+ var html = data['html'];
+ jQuery('#dw_davcal__ajaxedit').html(html);
+ if(result === true)
+ {
+ jQuery('#fullCalendar').fullCalendar('refetchEvents');
+ dw_davcal__modals.hideEditEventDialog();
+ }
+ }
+ );
+ };
+ dialogButtons[LANG.plugins.davcal['delete']] = function() {
+ dw_davcal__modals.action = 'deleteEvent';
+ dw_davcal__modals.msg = LANG.plugins.davcal['really_delete_this_event'];
+ dw_davcal__modals.completeCb = function(data) {
+ if(data.result == false)
+ {
+ dw_davcal__modals.msg = data.errmsg;
+ dw_davcal__modals.showDialog(false);
+ }
+ else
{
jQuery('#fullCalendar').fullCalendar('refetchEvents');
dw_davcal__modals.hideEditEventDialog();
}
- }
- );
- };
+ };
+ dw_davcal__modals.showDialog(true);
+ };
+ }
+ else
+ {
+ calEvent.start = event;
+ calEvent.end = moment(event);
+ calEvent.start.hour(12);
+ calEvent.start.minute(0);
+ calEvent.end.hour(13);
+ calEvent.end.minute(0);
+ calEvent.allDay = false;
+ calEvent.title = '';
+ calEvent.id = '0';
+ title = LANG.plugins.davcal['create_new_event'];
+ dialogButtons[LANG.plugins.davcal['create']] = function() {
+ if(!dw_davcal__modals.checkEvents())
+ return;
+
+ var postArray = { };
+ jQuery("input.dw_davcal__editevent").each(function() {
+ if(jQuery(this).attr('type') == 'checkbox')
+ {
+ postArray[jQuery(this).prop('name')] = jQuery(this).prop('checked') ? 1 : 0;
+ }
+ else
+ {
+ postArray[jQuery(this).prop('name')] = jQuery(this).val();
+ }
+ });
+ jQuery('#dw_davcal__ajaxnew').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />');
+ jQuery.post(
+ DOKU_BASE + 'lib/exe/ajax.php',
+ {
+ call: 'plugin_davcal',
+ id: JSINFO.id,
+ action: 'newEvent',
+ params: postArray
+ },
+ function(data)
+ {
+ var result = data['result'];
+ var html = data['html'];
+ jQuery('#dw_davcal__ajaxedit').html(html);
+ if(result === true)
+ {
+ jQuery('#fullCalendar').fullCalendar('refetchEvents');
+ dw_davcal__modals.hideEditEventDialog();
+ }
+ }
+ );
+ };
+ }
dialogButtons[LANG.plugins.davcal['cancel']] = function() {
dw_davcal__modals.hideEditEventDialog();
};
- dialogButtons[LANG.plugins.davcal['delete']] = function() {
- dw_davcal__modals.action = 'deleteEvent';
- dw_davcal__modals.msg = LANG.plugins.davcal['really_delete_this_event'];
- dw_davcal__modals.completeCb = function(data) {
- if(data.result == false)
- {
- dw_davcal__modals.msg = data.errmsg;
- dw_davcal__modals.showInfoDialog();
- }
- else
- {
- jQuery('#fullCalendar').fullCalendar('refetchEvents');
- dw_davcal__modals.hideEditEventDialog();
- }
- };
- dw_davcal__modals.showConfirmDialog();
- };
dw_davcal__modals.uid = calEvent.id;
dw_davcal__modals.$editEventDialog = jQuery(document.createElement('div'))
.dialog({
autoOpen: false,
draggable: true,
- title: LANG.plugins.davcal['edit_event'],
+ title: title,
resizable: true,
buttons: dialogButtons,
})
.html(
'<div><table><tr><td>' + LANG.plugins.davcal['title'] + '</td><td><input type="text" id="dw_davcal__eventname_edit" name="eventname" class="dw_davcal__editevent"></td></tr>' +
'<tr><td>' + LANG.plugins.davcal['from'] + '</td><td><input type="text" name="eventfrom" id="dw_davcal__eventfrom_edit" class="dw_davcal__editevent dw_davcal__date"><input type="text" name="eventfromtime" id="dw_davcal__eventfromtime_edit" class="dw_davcal__editevent dw_davcal__time"></td></tr>' +
'<tr><td>' + LANG.plugins.davcal['to'] + '</td><td><input type="text" name="eventto" id="dw_davcal__eventto_edit" class="dw_davcal__editevent dw_davcal__date"><input type="text" name="eventtotime" id="dw_davcal__eventtotime_edit" class="dw_davcal__editevent dw_davcal__time"></td></tr>' +
'<tr><td colspan="2"><input type="checkbox" name="allday" id="dw_davcal__allday_edit" class="dw_davcal__editevent">' + LANG.plugins.davcal['allday'] + '</td></tr>' +
'</table>' +
'<input type="hidden" name="uid" id="dw_davcal__uid_edit" class="dw_davcal__editevent">' +
'</div>' +
'<div id="dw_davcal__ajaxedit"></div>'
)
.parent()
.attr('id','dw_davcal__edit')
.show()
.appendTo('.dokuwiki:first');
jQuery('#dw_davcal__uid_edit').val(calEvent.id);
jQuery('#dw_davcal__eventname_edit').val(calEvent.title);
jQuery('#dw_davcal__eventfrom_edit').val(calEvent.start.format('YYYY-MM-DD'));
jQuery('#dw_davcal__eventfromtime_edit').val(calEvent.start.format('HH:mm'));
if(calEvent.allDay && (calEvent.end === null))
{
jQuery('#dw_davcal__eventto_edit').val(calEvent.start.format('YYYY-MM-DD'));
jQuery('#dw_davcal__eventtotime_edit').val(calEvent.start.format('HH:mm'));
}
else if(calEvent.allDay)
{
endEvent = moment(calEvent.end);
endEvent.subtract(1, 'days');
jQuery('#dw_davcal__eventto_edit').val(endEvent.format('YYYY-MM-DD'));
jQuery('#dw_davcal__eventotime_edit').val(endEvent.format('HH:mm'));
}
else
{
jQuery('#dw_davcal__eventto_edit').val(calEvent.end.format('YYYY-MM-DD'));
jQuery('#dw_davcal__eventtotime_edit').val(calEvent.end.format('HH:mm'));
}
jQuery('#dw_davcal__allday_edit').prop('checked', calEvent.allDay);
// attach event handlers
jQuery('#dw_davcal__edit .ui-dialog-titlebar-close').click(function(){
dw_davcal__modals.hideEditEventDialog();
});
jQuery('#dw_davcal__eventfrom_edit').datetimepicker({format:'YYYY-MM-DD',
formatDate:'YYYY-MM-DD',
datepicker: true,
timepicker: false,
});
jQuery('#dw_davcal__eventfromtime_edit').datetimepicker({format:'HH:mm',
formatTime:'HH:mm',
datepicker: false,
timepicker: true,
step: 15});
jQuery('#dw_davcal__eventto_edit').datetimepicker({format:'YYYY-MM-DD',
formatDate:'YYYY-MM-DD',
datepicker: true,
timepicker: false,
});
jQuery('#dw_davcal__eventtotime_edit').datetimepicker({format:'HH:mm',
formatTime:'HH:mm',
datepicker: false,
timepicker: true,
step:15});
jQuery('#dw_davcal__allday_edit').change(function() {
if(jQuery(this).is(":checked"))
{
jQuery('#dw_davcal__eventfromtime_edit').prop('readonly', true);
jQuery('#dw_davcal__eventtotime_edit').prop('readonly', true);
}
else
{
jQuery('#dw_davcal__eventfromtime_edit').prop('readonly', false);
jQuery('#dw_davcal__eventtotime_edit').prop('readonly', false);
}
});
jQuery('#dw_davcal__allday_edit').change();
},
- showNewEventDialog : function(date) {
- if(dw_davcal__modals.$newEventDialog)
- return;
- var dialogButtons = {};
- dialogButtons[LANG.plugins.davcal['create']] = function() {
- var postArray = { };
- jQuery("input.dw_davcal__newevent").each(function() {
- if(jQuery(this).attr('type') == 'checkbox')
- {
- postArray[jQuery(this).prop('name')] = jQuery(this).prop('checked') ? 1 : 0;
- }
- else
- {
- postArray[jQuery(this).prop('name')] = jQuery(this).val();
- }
- });
- jQuery('#dw_davcal__ajaxnew').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />');
- jQuery.post(
- DOKU_BASE + 'lib/exe/ajax.php',
- {
- call: 'plugin_davcal',
- id: JSINFO.id,
- action: 'newEvent',
- params: postArray
- },
- function(data)
- {
- var result = data['result'];
- var html = data['html'];
- jQuery('#dw_davcal__ajaxnew').html(html);
- if(result === true)
- {
- jQuery('#fullCalendar').fullCalendar('refetchEvents');
- dw_davcal__modals.hideNewEventDialog();
- }
- }
- );
- };
- dialogButtons[LANG.plugins.davcal['cancel']] = function() {
- dw_davcal__modals.hideNewEventDialog();
- };
- dw_davcal__modals.$newEventDialog = jQuery(document.createElement('div'))
- .dialog({
- autoOpen: false,
- draggable: true,
- title: LANG.plugins.davcal['create_new_event'],
- resizable: true,
- buttons: dialogButtons,
- })
- .html(
- '<div><table><tr><td>' + LANG.plugins.davcal['title'] + '</td><td><input type="text" name="eventname" class="dw_davcal__newevent"></td></tr>' +
- '<tr><td>' + LANG.plugins.davcal['from'] + '</td><td><input type="text" value="' + date.format('YYYY-MM-DD') + '" name="eventfrom" id="dw_davcal__eventfrom" class="dw_davcal__newevent dw_davcal__date"><input type="text" value="12:00" name="eventfromtime" id="dw_davcal__eventfromtime" class="dw_davcal__newevent dw_davcal__time"></td></tr>' +
- '<tr><td>' + LANG.plugins.davcal['to'] + '</td><td><input type="text" name="eventto" value="' + date.format('YYYY-MM-DD') + '" id="dw_davcal__eventto" class="dw_davcal__newevent dw_davcal__date"><input type="text" name="eventtotime" value="12:00" id="dw_davcal__eventtotime" class="dw_davcal__newevent dw_davcal__time"></td></tr>' +
- '<tr><td colspan="2"><input type="checkbox" name="allday" id="dw_davcal__allday" class="dw_davcal__newevent">' + LANG.plugins.davcal['allday'] + '</td></tr>' +
- '</table>' +
- '</div>' +
- '<div id="dw_davcal__ajaxnew"></div>'
- )
- .parent()
- .attr('id','dw_davcal__createnew')
- .show()
- .appendTo('.dokuwiki:first');
-
- // attach event handlers
- jQuery('#dw_davcal__createnew .ui-dialog-titlebar-close').click(function(){
- dw_davcal__modals.hideNewEventDialog();
- });
- jQuery('#dw_davcal__eventfrom').datetimepicker({format:'YYYY-MM-DD',
- formatDate:'YYYY-MM-DD',
- datepicker: true,
- timepicker: false,
- });
- jQuery('#dw_davcal__eventfromtime').datetimepicker({format:'HH:mm',
- formatTime:'HH:mm',
- datepicker: false,
- timepicker: true,
- step: 15});
- jQuery('#dw_davcal__eventto').datetimepicker({format:'YYYY-MM-DD',
- formatDate:'YYYY-MM-DD',
- datepicker: true,
- timepicker: false,
- });
- jQuery('#dw_davcal__eventtotime').datetimepicker({format:'HH:mm',
- formatTime:'HH:mm',
- datepicker: false,
- timepicker: true,
- step:15});
- jQuery('#dw_davcal__allday').change(function() {
- if(jQuery(this).is(":checked"))
- {
- jQuery('#dw_davcal__eventfromtime').prop('readonly', true);
- jQuery('#dw_davcal__eventtotime').prop('readonly', true);
- }
- else
- {
- jQuery('#dw_davcal__eventfromtime').prop('readonly', false);
- jQuery('#dw_davcal__eventtotime').prop('readonly', false);
- }
- });
- },
-
- showConfirmDialog : function()
+ showDialog : function(confirm)
{
if(dw_davcal__modals.$confirmDialog)
return;
var dialogButtons = {};
- dialogButtons[LANG.plugins.davcal['yes']] = function() {
- jQuery.post(
- DOKU_BASE + 'lib/exe/ajax.php',
- {
- call: 'plugin_davcal',
- id: JSINFO.id,
- action: dw_davcal__modals.action,
- params: {
- uid: dw_davcal__modals.uid
+ var title = '';
+ if(confirm)
+ {
+ title = LANG.plugins.davcal['confirmation'];
+ dialogButtons[LANG.plugins.davcal['yes']] = function() {
+ jQuery.post(
+ DOKU_BASE + 'lib/exe/ajax.php',
+ {
+ call: 'plugin_davcal',
+ id: JSINFO.id,
+ action: dw_davcal__modals.action,
+ params: {
+ uid: dw_davcal__modals.uid
+ }
+ },
+ function(data)
+ {
+ dw_davcal__modals.completeCb(data);
}
- },
- function(data)
- {
- dw_davcal__modals.completeCb(data);
- }
- );
- dw_davcal__modals.hideConfirmDialog();
- };
- dialogButtons[LANG.plugins.tagrevisions['cancel']] = function() {
- dw_davcal__modals.hideConfirmDialog();
- };
- dw_davcal__modals.$confirmDialog = jQuery(document.createElement('div'))
+ );
+ dw_davcal__modals.hideDialog();
+ };
+ dialogButtons[LANG.plugins.tagrevisions['cancel']] = function() {
+ dw_davcal__modals.hideDialog();
+ };
+ }
+ else
+ {
+ title = LANG.plugins.davcal['info'];
+ dialogButtons[LANG.plugins.davcal['ok']] = function() {
+ dw_davcal__modals.hideDialog();
+ };
+ }
+ dw_davcal__modals.$dialog = jQuery(document.createElement('div'))
.dialog({
autoOpen: false,
draggable: true,
- title: LANG.plugins.tagrevisions['confirmation'],
+ title: title,
resizable: true,
buttons: dialogButtons,
})
.html(
'<div>' + dw_davcal__modals.msg + '</div>'
)
.parent()
.attr('id','dw_davcal__confirm')
.show()
.appendTo('.dokuwiki:first');
// attach event handlers
jQuery('#dw_davcal__confirm .ui-dialog-titlebar-close').click(function(){
- dw_davcal__modals.hideConfirmDialog();
+ dw_davcal__modals.hideDialog();
});
},
- showInfoDialog : function() {
- if(dw_davcal__modal.$infoDialog)
- return;
- var dialogButtons = {};
- dialogButtons[LANG.plugins.davcal['ok']] = function() {
- dw_davcal__modals.hideInfoDialog();
- };
- dw_davcal__modals.$infoDialog = jQuery(document.createElement('div'))
- .dialog({
- autoOpen: false,
- draggable: true,
- title: LANG.plugins.davcal['info'],
- resizable: true,
- buttons: dialogButtons,
- })
- .html(
- '<div>' + dw_davcal__modals.msg + '</div>'
- )
- .parent()
- .attr('id','dw_davcal__info')
- .show()
- .appendTo('.dokuwiki:first');
-
- // attach event handlers
- jQuery('#dw_davcal__info .ui-dialog-titlebar-close').click(function(){
- dw_davcal__modals.hideInfoDialog();
- });
- },
-
- hideNewEventDialog : function() {
- dw_davcal__modals.$newEventDialog.empty();
- dw_davcal__modals.$newEventDialog.remove();
- dw_davcal__modals.$newEventDialog = null;
- },
-
hideEditEventDialog : function() {
dw_davcal__modals.$editEventDialog.empty();
dw_davcal__modals.$editEventDialog.remove();
dw_davcal__modals.$editEventDialog = null;
},
- hideInfoDialog : function() {
- dw_davcal__modals.$infoDialog.empty();
- dw_davcal__modals.$infoDialog.remove();
- dw_davcal__modals.$infoDialog = null;
- },
-
- hideConfirmDialog: function() {
- dw_davcal__modals.$confirmDialog.empty();
- dw_davcal__modals.$confirmDialog.remove();
- dw_davcal__modals.$confirmDialog = null;
+ hideDialog: function() {
+ dw_davcal__modals.$dialog.empty();
+ dw_davcal__modals.$dialog.remove();
+ dw_davcal__modals.$dialog = null;
},
hideSettingsDialog: function() {
dw_davcal__modals.$settingsDialog.empty();
dw_davcal__modals.$settingsDialog.remove();
dw_davcal__modals.$settingsDialog = null;
}
};
diff --git a/style.css b/style.css
--- a/style.css
+++ b/style.css
@@ -1,54 +1,48 @@
@import "fullcalendar-2.4.0/fullcalendar.less";
@import "datetimepicker-2.4.5/jquery.datetimepicker.less";
/* modal windows */
-#dw_davcal__createnew,
#dw_davcal__edit,
-#dw_davcal__info,
#dw_davcal__settings,
#dw_davcal__confirm {
position: absolute;
background-color: #fff;
color: #000;
z-index: 20;
overflow: hidden;
}
#dw_davcal__edit .ui-dialog-content,
-#dw_davcal__info .ui-dialog-content,
#dw_davcal__confirm .ui-dialog-content,
-#dw_davcal__settings .ui-dialog-content,
-#dw_davcal__createnew .ui-dialog-content {
+#dw_davcal__settings .ui-dialog-content, {
padding-left: 0;
padding-right: 0;
}
#dw_davcal__confirm,
-#dw_davcal__info,
-#dw_davcal__edit,
-#dw_davcal__createnew {
+#dw_davcal__edit, {
position: absolute;
top: 50%;
left: 50%;
width: 300px;
height: 260px;
margin:-130px 0 0 -150px;
}
#dw_davcal__settings {
position: absolute;
top: 50%;
left: 50%;
width: 350px;
height: 320px;
margin:-160px 0 0 -175px;
}
.dw_davcal__date {
width: 90px;
}
.dw_davcal__time {
width: 50px;
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Jan 24, 3:48 AM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
532619
Default Alt Text
(33 KB)

Event Timeline