mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-10 02:18:48 +00:00
Initial Release of the calendar plugin
This commit is contained in:
parent
45cc9885fc
commit
7115197a33
561 changed files with 189494 additions and 0 deletions
2845
dav/common/wdcal/js/jquery.calendar.js
Normal file
2845
dav/common/wdcal/js/jquery.calendar.js
Normal file
File diff suppressed because it is too large
Load diff
210
dav/common/wdcal/js/main.js
Normal file
210
dav/common/wdcal/js/main.js
Normal file
|
@ -0,0 +1,210 @@
|
|||
$(function () {
|
||||
"use strict";
|
||||
|
||||
$.fn.animexxCalendar = function (option) {
|
||||
//(wdcal_view, std_theme, data_feed_url, readonly, height_diff) {
|
||||
|
||||
var url_cal_add = "?";
|
||||
$(this).find(".calselect input[type=checkbox]").each(function() {
|
||||
if ($(this).prop("checked")) url_cal_add += "cal[]=" + $(this).val() + "&";
|
||||
});
|
||||
|
||||
var def = {
|
||||
calendars:[],
|
||||
calendars_show:[],
|
||||
view:"week",
|
||||
theme:0,
|
||||
onWeekOrMonthToDay:wtd,
|
||||
onBeforeRequestData:cal_beforerequest,
|
||||
onAfterRequestData:cal_afterrequest,
|
||||
onRequestDataError:cal_onerror,
|
||||
autoload:true,
|
||||
data_feed_url:"",
|
||||
url:option.data_feed_url + url_cal_add + "method=list",
|
||||
quickAddUrl:option.data_feed_url + url_cal_add + "method=add",
|
||||
quickUpdateUrl:option.data_feed_url + url_cal_add + "method=update",
|
||||
quickDeleteUrl:option.data_feed_url + url_cal_add + "method=remove"
|
||||
};
|
||||
|
||||
option = $.extend(def, option);
|
||||
|
||||
var $animexxcal = $(this),
|
||||
$gridcontainer = $animexxcal.find(".gridcontainer"),
|
||||
$dv = $animexxcal.find(".calhead"),
|
||||
$caltoolbar = $animexxcal.find(".ctoolbar"),
|
||||
$txtdatetimeshow = $animexxcal.find(".txtdatetimeshow"),
|
||||
$loadingpanel = $animexxcal.find(".loadingpanel"),
|
||||
$loaderrpanel = $animexxcal.find(".loaderror");
|
||||
|
||||
var _MH = document.documentElement.clientHeight;
|
||||
var dvH = $dv.height() + 2;
|
||||
|
||||
option.height = _MH - dvH - option.height_diff;
|
||||
if (option.height < 300) option.height = 300;
|
||||
option.eventItems = [];
|
||||
|
||||
$animexxcal.find(".hdtxtshow").datepicker({
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
onSelect: function(dateText, inst) {
|
||||
var r = new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay);
|
||||
var p = $gridcontainer.gotoDate(r).BcalGetOp();
|
||||
if (p && p.datestrshow) {
|
||||
$animexxcal.find(".txtdatetimeshow").text(p.datestrshow);
|
||||
}
|
||||
}
|
||||
});
|
||||
$animexxcal.find(".txtdatetimeshow").css("cursor", "pointer").bind("click", function() {
|
||||
$animexxcal.find(".hdtxtshow").datepicker("show");
|
||||
});
|
||||
|
||||
var p = $gridcontainer.bcalendar(option).BcalGetOp();
|
||||
if (p && p.datestrshow) {
|
||||
$txtdatetimeshow.text(p.datestrshow);
|
||||
}
|
||||
|
||||
$caltoolbar.noSelect();
|
||||
|
||||
function cal_beforerequest(type) {
|
||||
var t = "Lade Daten...";
|
||||
switch (type) {
|
||||
case 1:
|
||||
t = "Lade Daten...";
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
t = "Wird bearbeitete ...";
|
||||
break;
|
||||
}
|
||||
$loaderrpanel.hide();
|
||||
$loadingpanel.html(t).show();
|
||||
}
|
||||
|
||||
function cal_afterrequest(type) {
|
||||
var p = $gridcontainer.BcalGetOp();
|
||||
if (p && p.datestrshow) {
|
||||
$txtdatetimeshow.text(p.datestrshow);
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 1:
|
||||
$loadingpanel.hide();
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
$loadingpanel.html("Erfolg!");
|
||||
$gridcontainer.reload();
|
||||
window.setTimeout(function () {
|
||||
$loadingpanel.hide();
|
||||
}, 2000);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cal_onerror(type, data) {
|
||||
$loaderrpanel.show();
|
||||
}
|
||||
|
||||
function wtd(p) {
|
||||
if (p && p.datestrshow) {
|
||||
$txtdatetimeshow.text(p.datestrshow);
|
||||
}
|
||||
$caltoolbar.find("div.fcurrent").removeClass("fcurrent");
|
||||
$animexxcal.find(".showdaybtn").addClass("fcurrent");
|
||||
}
|
||||
|
||||
//to show day view
|
||||
$animexxcal.find(".showdaybtn").on("click", function (e) {
|
||||
//document.location.href="#day";
|
||||
$caltoolbar.find("div.fcurrent").removeClass("fcurrent");
|
||||
$(this).addClass("fcurrent");
|
||||
var p = $gridcontainer.switchView("day").BcalGetOp();
|
||||
if (p && p.datestrshow) {
|
||||
$txtdatetimeshow.text(p.datestrshow);
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
//to show week view
|
||||
$animexxcal.find(".showweekbtn").on("click", function (e) {
|
||||
//document.location.href="#week";
|
||||
$caltoolbar.find("div.fcurrent").removeClass("fcurrent");
|
||||
$(this).addClass("fcurrent");
|
||||
var p = $gridcontainer.switchView("week").BcalGetOp();
|
||||
if (p && p.datestrshow) {
|
||||
$txtdatetimeshow.text(p.datestrshow);
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
//to show month view
|
||||
$animexxcal.find(".showmonthbtn").on("click", function (e) {
|
||||
//document.location.href="#month";
|
||||
$caltoolbar.find("div.fcurrent").removeClass("fcurrent");
|
||||
$(this).addClass("fcurrent");
|
||||
var p = $gridcontainer.switchView("month").BcalGetOp();
|
||||
if (p && p.datestrshow) {
|
||||
$txtdatetimeshow.text(p.datestrshow);
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$animexxcal.find(".showreflashbtn").on("click", function (e) {
|
||||
$gridcontainer.reload();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
//go to today
|
||||
$animexxcal.find(".showtodaybtn").on("click", function (e) {
|
||||
var p = $gridcontainer.gotoDate().BcalGetOp();
|
||||
if (p && p.datestrshow) {
|
||||
$txtdatetimeshow.text(p.datestrshow);
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
});
|
||||
//previous date range
|
||||
$animexxcal.find(".sfprevbtn").on("click", function (e) {
|
||||
var p = $gridcontainer.previousRange().BcalGetOp();
|
||||
if (p && p.datestrshow) {
|
||||
$txtdatetimeshow.text(p.datestrshow);
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
//next date range
|
||||
$animexxcal.find(".sfnextbtn").on("click", function (e) {
|
||||
var p = $gridcontainer.nextRange().BcalGetOp();
|
||||
if (p && p.datestrshow) {
|
||||
$txtdatetimeshow.text(p.datestrshow);
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$animexxcal.find(".calselect input[type=checkbox]").on("click change", function() {
|
||||
var url_cal_add = option.data_feed_url + "?";
|
||||
$animexxcal.find(".calselect input[type=checkbox]").each(function() {
|
||||
if ($(this).prop("checked")) url_cal_add += "cal[]=" + $(this).val() + "&";
|
||||
});
|
||||
/*
|
||||
url:option.data_feed_url + url_cal_add + "method=list",
|
||||
quickAddUrl:option.data_feed_url + url_cal_add + "method=add",
|
||||
quickUpdateUrl:option.data_feed_url + url_cal_add + "method=update",
|
||||
quickDeleteUrl:option.data_feed_url + url_cal_add + "method=remove"
|
||||
|
||||
*/
|
||||
var url = url_cal_add + "method=list";
|
||||
var p = $gridcontainer.BcalGetOp();
|
||||
if (p.url != url) {
|
||||
$gridcontainer.BcalSetOp({
|
||||
"url": url_cal_add + "method=list",
|
||||
"quickAddUrl": url_cal_add + "method=add",
|
||||
"quickUpdateUrl": url_cal_add + "method=update",
|
||||
"quickDeleteUrl": url_cal_add + "method=remove"
|
||||
});
|
||||
$gridcontainer.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
57
dav/common/wdcal/js/wdCalendar_lang_DE.js
Normal file
57
dav/common/wdcal/js/wdCalendar_lang_DE.js
Normal file
|
@ -0,0 +1,57 @@
|
|||
var i18n = $.extend({}, i18n || {}, {
|
||||
xgcalendar: {
|
||||
dateformat: {
|
||||
"fulldaykey": "ddMMyyyy",
|
||||
"fulldayshow": "d L yyyy",
|
||||
"separator": ".",
|
||||
"year_index": 2,
|
||||
"month_index": 1,
|
||||
"day_index": 0,
|
||||
"day": "d",
|
||||
"sun": "So",
|
||||
"mon": "Mo",
|
||||
"tue": "Di",
|
||||
"wed": "Mi",
|
||||
"thu": "Do",
|
||||
"fri": "Fr",
|
||||
"sat": "Sa",
|
||||
"jan": "Jan",
|
||||
"feb": "Feb",
|
||||
"mar": "Mär",
|
||||
"apr": "Apr",
|
||||
"may": "Mai",
|
||||
"jun": "Jun",
|
||||
"jul": "Jul",
|
||||
"aug": "Aug",
|
||||
"sep": "Sep",
|
||||
"oct": "Okt",
|
||||
"nov": "Nov",
|
||||
"dec": "Dez"
|
||||
},
|
||||
"no_implemented": "Nicht eingebaut",
|
||||
"to_date_view": "Zum aktuellen Datum gehen",
|
||||
"i_undefined": "Undefined",
|
||||
"allday_event": "Ganztages-Termin",
|
||||
"repeat_event": "Wiederholter Termin",
|
||||
"time": "Zeit",
|
||||
"event": "Termin",
|
||||
"location": "Ort",
|
||||
"participant": "Teilnehmer",
|
||||
"get_data_exception": "Exception when getting data",
|
||||
"new_event": "Neuer Termin",
|
||||
"confirm_delete_event": "Diesen Termin wirklich löschen? ",
|
||||
"confrim_delete_event_or_all": "Nur diesen einen Termin löschen, oder alle Wiederholungen? \r\n[OK] für diesen einen, [Abbrechen] für alle.",
|
||||
"data_format_error": "Data format error! ",
|
||||
"invalid_title": "Der Titel des Termins darf nicht leer sein und kein ($<>) enthalten.",
|
||||
"view_no_ready": "View is not ready",
|
||||
"example": "e.g., Treffen in Raum 23",
|
||||
"content": "Was",
|
||||
"create_event": "Termin anlegen",
|
||||
"update_detail": "Details bearbeiten",
|
||||
"click_to_detail": "Details anzeigen",
|
||||
"i_delete": "Löschen",
|
||||
"day_plural": "Tage",
|
||||
"others": "Weitere: ",
|
||||
"item": ""
|
||||
}
|
||||
});
|
57
dav/common/wdcal/js/wdCalendar_lang_EN.js
Normal file
57
dav/common/wdcal/js/wdCalendar_lang_EN.js
Normal file
|
@ -0,0 +1,57 @@
|
|||
var i18n = $.extend({}, i18n || {}, {
|
||||
xgcalendar: {
|
||||
dateformat: {
|
||||
"fulldaykey": "ddMMyyyy",
|
||||
"fulldayshow": "d L yyyy",
|
||||
"separator": ".",
|
||||
"year_index": 2,
|
||||
"month_index": 1,
|
||||
"day_index": 0,
|
||||
"day": "d",
|
||||
"sun": "Su",
|
||||
"mon": "Mo",
|
||||
"tue": "Tu",
|
||||
"wed": "Mi",
|
||||
"thu": "Th",
|
||||
"fri": "Fr",
|
||||
"sat": "Sa",
|
||||
"jan": "Jan",
|
||||
"feb": "Feb",
|
||||
"mar": "Mar",
|
||||
"apr": "Apr",
|
||||
"may": "May",
|
||||
"jun": "Jun",
|
||||
"jul": "Jul",
|
||||
"aug": "Aug",
|
||||
"sep": "Sep",
|
||||
"oct": "Oct",
|
||||
"nov": "Nov",
|
||||
"dec": "Dec"
|
||||
},
|
||||
"no_implemented": "Not implemented",
|
||||
"to_date_view": "Go to today",
|
||||
"i_undefined": "Undefined",
|
||||
"allday_event": "All-day event",
|
||||
"repeat_event": "Recurring event",
|
||||
"time": "Time",
|
||||
"event": "Event",
|
||||
"location": "Loaction",
|
||||
"participant": "Attendees",
|
||||
"get_data_exception": "Exception when getting data",
|
||||
"new_event": "New event",
|
||||
"confirm_delete_event": "Do you really want to delete this event?",
|
||||
"confrim_delete_event_or_all": "Do you want to delete this event alone, or all recurrences? \r\n[OK] for this single item, [Abort] for all.",
|
||||
"data_format_error": "Data format error!",
|
||||
"invalid_title": "The title of an event must not be empty and must not contain ($<>).",
|
||||
"view_no_ready": "View is not ready",
|
||||
"example": "e.g., Meeting in room 23",
|
||||
"content": "Title",
|
||||
"create_event": "Create event",
|
||||
"update_detail": "Edit",
|
||||
"click_to_detail": "Show details",
|
||||
"i_delete": "Delete",
|
||||
"day_plural": "days",
|
||||
"others": "More: ",
|
||||
"item": ""
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue