将“事件”重命名为jQuery FullCalendar 插件中的对象

发布于 2024-08-28 08:41:40 字数 469 浏览 2 评论 0原文

很棒的插件!!!但是...选择“事件”一词来表示“日历条目”是特别不幸的,

这是一个写得非常好的插件,我对这个东西的功能给这里的工作人员留下了深刻的印象。该文档非常全面和清晰。

恭喜亚当!

然而,这个插件将日历中的条目称为“事件”——这在我的开发团队的对话中引起了很多混乱,因为当我们使用“事件”这个词时,我们会想到诸如 onmouseover< /code>、click 等。我们确实更喜欢 CalendarEventCalendarEntry 这样的术语。

我对 jQuery 还不太有经验,所以我想知道是否有一种简单的方法可以将这些术语之一别名为该插件的 Event/Events 对象?(我知道我们可以重新编码该插件-in 直接,但是当我们下载更新时我们的代码将会中断。)

谢谢!

GREAT PLUGIN!!! BUT... choice of word "Event" to mean a "calendar entry" was particularly unfortunate

This is a wonderfully well-written plug in, and I've really impressed people here at work with what this thing can do. The documentation is astonishingly thorough and clear.

Congratulations to Adam!

HOWEVER, this plug-in refers to entries in the calendar as "Events" -- this has caused a lot of confusion in my development team's conversations, because when we use the word "Event" we think of things like onmouseover, click, etc. We would really prefer a term like CalendarEvent or CalendarEntry.

I am not all that experienced with jQuery yet, so am wondering if there is a simple way to alias one of those terms to this plug-in's Event/Events object? (I know we could recode the plug-in directly, but our code will then break when we download an update.)

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

昔日梦未散 2024-09-04 08:41:40

为什么不编写一个名为 CalendarEvent 的 Facade 类,它只从 Event 类中调用适当的函数?

Why don't you write a Facade class called CalendarEvent that will just call the appropriate function from the Event class?

您的好友蓝忘机已上羡 2024-09-04 08:41:40

我明白。在原始文档中,它们被称为“calEvents”,但为了简洁起见,我将其改回“events”。

当前的文档是这个术语的创造者,但您始终可以对函数参数使用不同的名称。但是,显然您仍然需要使用相同的选项名称,因此解决方案是创建一个类似这样的包装器...

$.fn.jeffsFullCalendar = function(options) {
    options = options || {};
    options.events = options.calEvents;
    options.eventSource = options.calEventSources;
    this.fullCalendar(options);
};

将允许您重命名“events”和“eventSources”选项。基本上是插件的包装

i understand. in the original docs, they were called "calEvents" but i changed it back to "events" for brevity.

the current docs are what coined the term, but you can always use different names for function arguments. however, you'll obviously still need to use the same option names, so a solution would be to create a wrapper sort of like this...

$.fn.jeffsFullCalendar = function(options) {
    options = options || {};
    options.events = options.calEvents;
    options.eventSource = options.calEventSources;
    this.fullCalendar(options);
};

will let you rename the 'events' and 'eventSources' options. basically a wrapper around the plugin

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文