write shit
This commit is contained in:
@@ -138,3 +138,16 @@ ccn-i18n-tokenItem-ua=UA:
|
|||||||
ccn-i18n-tokenItem-ip=IP:
|
ccn-i18n-tokenItem-ip=IP:
|
||||||
ccn-i18n-tokenItem-expireOn=过期时间:
|
ccn-i18n-tokenItem-expireOn=过期时间:
|
||||||
ccn-i18n-tokenItem-isMe=这是你当前使用的登录凭据
|
ccn-i18n-tokenItem-isMe=这是你当前使用的登录凭据
|
||||||
|
|
||||||
|
ccn-i18n-datetime-loopStopRuleText-infinity=永远循环。
|
||||||
|
ccn-i18n-datetime-loopStopRuleText-datetime=到{0}停止循环。
|
||||||
|
ccn-i18n-datetime-loopStopRuleText-times=循环{0}次。
|
||||||
|
ccn-i18n-datetime-loopRuleText-modeStrict=严格模式。
|
||||||
|
ccn-i18n-datetime-loopRuleText-modeRough=宽松模式。
|
||||||
|
ccn-i18n-datetime-loopRuleText-year=每{0}年于{1}循环一次。
|
||||||
|
ccn-i18n-datetime-loopRuleText-monthA=每{0}月的第{1}日循环一次。
|
||||||
|
ccn-i18n-datetime-loopRuleText-monthB=每{0}月的倒数第{1}日循环一次。
|
||||||
|
ccn-i18n-datetime-loopRuleText-monthC=每{0}月的第{1}个星期{2}循环一次。
|
||||||
|
ccn-i18n-datetime-loopRuleText-monthD=每{0}月的倒数第{1}个星期{2}循环一次。
|
||||||
|
ccn-i18n-datetime-loopRuleText-week=每{0}周的{1}循环一次。
|
||||||
|
ccn-i18n-datetime-loopRuleText-day=每{0}天循环一次。
|
||||||
|
|||||||
@@ -261,8 +261,76 @@ function ccn_datetime_ResolveLoopRules4Event(loopRules, loopDateTimeStart, loopD
|
|||||||
return realResult;
|
return realResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ccn_datetime_ResolveLoopRules4Text(loopRules) {
|
function ccn_datetime_ResolveLoopRules4Text(strl, startDateTime, timezoneOffset) {
|
||||||
return "";
|
if (strl == '') return "";
|
||||||
|
|
||||||
|
var sp = strl.split('-');
|
||||||
|
if (sp.length != 2) return "";
|
||||||
|
var loopRules = undefined;
|
||||||
|
var loopStopRules = undefined;
|
||||||
|
var datetimeInstance = new Date((startDateTime + timezoneOffset) * 60000)
|
||||||
|
|
||||||
|
if (ccn_datetime_precompiledLoopRules.year.test(sp[0])) {
|
||||||
|
if (RegExp.$1 == 'S')
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-modeStrict');
|
||||||
|
else
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-modeRough');
|
||||||
|
loopRules += $.i18n.prop('ccn-i18n-datetime-loopRuleText-year')
|
||||||
|
.format(parseInt(RegExp.$2), datetimeInstance.toLocaleDateString(undefined, {timeZone: "UTC"}));
|
||||||
|
} else if (ccn_datetime_precompiledLoopRules.month.test(sp[0])) {
|
||||||
|
if (RegExp.$1 == 'S')
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-modeStrict');
|
||||||
|
else
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-modeRough');
|
||||||
|
|
||||||
|
var dayInMonth = ccn_datetime_GetDayInMonth(
|
||||||
|
datetimeInstance.getUTCFullYear(),
|
||||||
|
datetimeInstance.getUTCMonth() + 1,
|
||||||
|
datetimeInstance.getUTCDate());
|
||||||
|
switch(loopMethod) {
|
||||||
|
case 'A':
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-monthA')
|
||||||
|
format(parseInt(RegExp.$3), dayInMonth[0]);
|
||||||
|
break;
|
||||||
|
case 'B':
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-monthB')
|
||||||
|
format(parseInt(RegExp.$3), dayInMonth[1]);
|
||||||
|
break;
|
||||||
|
case 'C':
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-monthC')
|
||||||
|
format(parseInt(RegExp.$3), dayInMonth[2], dayInMonth[3]);
|
||||||
|
break;
|
||||||
|
case 'D':
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-monthD')
|
||||||
|
format(parseInt(RegExp.$3), dayInMonth[4], dayInMonth[5]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (ccn_datetime_precompiledLoopRules.week.test(sp[0])) {
|
||||||
|
var weekOfDayCache = [];
|
||||||
|
for (var i = 0; i < 7; i++) {
|
||||||
|
if (RegExp.$1[i] == 'T')
|
||||||
|
weekOfDayCache.push(ccn_i18n_UniversalGetDayOfWeek(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-week')
|
||||||
|
.format(parseInt(RegExp.$2), weekOfDayCache.join(', '));
|
||||||
|
} else if (ccn_datetime_precompiledLoopRules.day.test(sp[0])) {
|
||||||
|
loopRules = $.i18n.prop('ccn-i18n-datetime-loopRuleText-day')
|
||||||
|
.format(parseInt(RegExp.$1));
|
||||||
|
} else return "";
|
||||||
|
|
||||||
|
|
||||||
|
if (ccn_datetime_precompiledLoopStopRules.infinity.test(sp[1])) {
|
||||||
|
loopStopRules = $.i18n.prop('ccn-i18n-datetime-loopStopRuleText-infinity');
|
||||||
|
} else if (ccn_datetime_precompiledLoopStopRules.datetime.test(sp[1])) {
|
||||||
|
loopStopRules = $.i18n.prop('ccn-i18n-datetime-loopStopRuleText-datetime')
|
||||||
|
.format(new Date(parseInt(RegExp.$1)).toLocaleDateString());
|
||||||
|
} else if (ccn_datetime_precompiledLoopStopRules.times.test(sp[1])) {
|
||||||
|
loopStopRules = $.i18n.prop('ccn-i18n-datetime-loopStopRuleText-times')
|
||||||
|
.format(parseInt(RegExp.$1));
|
||||||
|
} else return "";
|
||||||
|
|
||||||
|
return (loopRules + loopStopRules);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ccn_datetime_LeapYearCountEx(endYear, includeThis, baseYear, includeBase) {
|
function ccn_datetime_LeapYearCountEx(endYear, includeThis, baseYear, includeBase) {
|
||||||
|
|||||||
@@ -82,3 +82,8 @@ function ccn_i18n_UniversalGetMonth(month) {
|
|||||||
return $.i18n.prop('ccn-i18n-universal-month-' + (month + 1));
|
return $.i18n.prop('ccn-i18n-universal-month-' + (month + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// note: day of week is zero based
|
||||||
|
function ccn_i18n_UniversalGetDayOfWeek(dayOfWeek) {
|
||||||
|
return $.i18n.prop('ccn-i18n-universal-week-' + (dayOfWeek + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ function ccn_calendar_calendar_Analyse() {
|
|||||||
color: deserializedDescription.color,
|
color: deserializedDescription.color,
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
isLocked: typeof(ccn_calendar_owned_displayCache[item[0]]) != 'undefined',
|
isLocked: typeof(ccn_calendar_owned_displayCache[item[0]]) != 'undefined',
|
||||||
loopText: " ", // todo: finish this
|
loopText: ccn_datetime_ResolveLoopRules4Text(item[8], item[5], item[7]),
|
||||||
timezoneWarning: mytimezone != item[7],
|
timezoneWarning: mytimezone != item[7],
|
||||||
start: eventDateTime.toLocaleTimeString(),
|
start: eventDateTime.toLocaleTimeString(),
|
||||||
end: undefined // filled in follwing code
|
end: undefined // filled in follwing code
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
<p class="level-item"><b>{{>title}}</b></p>
|
<p class="level-item"><b>{{>title}}</b></p>
|
||||||
<p class="level-item">{{>description}}</p>
|
<p class="level-item">{{>description}}</p>
|
||||||
<p class="level-item"><span>{{>start}}</span>-<span>{{>end}}</span></p>
|
<p class="level-item"><span>{{>start}}</span>-<span>{{>end}}</span></p>
|
||||||
|
{{if loopText != ""}}
|
||||||
|
<p><span class="icon is-small"><i class="fas fa-retweet"></i></span><span>{{>loopText}}</span></p>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="schedule-event-icon">
|
<div class="schedule-event-icon">
|
||||||
{{if isLocked}}
|
{{if isLocked}}
|
||||||
|
|||||||
@@ -22,6 +22,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="ccn-tokenItem-btnLogout-{{:uuid}}" uuid="{{:uuid}}" class="token-item-icon control">
|
<div id="ccn-tokenItem-btnLogout-{{:uuid}}" uuid="{{:uuid}}" class="token-item-icon control">
|
||||||
<a class="button"><span class="icon is-small"><i class="fas fa-sign-out"></i></span></a>
|
<a class="button"><span class="icon is-small"><i class="fas fa-sign-out-alt"></i></span></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user