fullcalendar-rails 2.0.1.0 → 2.0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fa0fdf42fe02f3c67dbe026cfa47b54406bd8c3
4
- data.tar.gz: fb4675d0dccd346565ea5520c0b7c7079e3e066e
3
+ metadata.gz: 2b0ae3ec2d5afa8adf8aed5c04a8c244ef4437c6
4
+ data.tar.gz: c3067afd6f042586f32724aa0ce94d552ddbcfb8
5
5
  SHA512:
6
- metadata.gz: 7275c96c7951c3f9ee80487c2ea938ac9c747c842339a2da734dda07ecb84a7788d80446d777ed4234450337db9356df88382565855f466aa2e68c63691e51ed
7
- data.tar.gz: 51a9629b8fdfe32729b50f94c072bb4ccccbb5a62e410bceab02e26cabbd4eb1d5c59562e7e2f10b36c394eb0b50383754a4708aac1db1a8a27728c181214ce1
6
+ metadata.gz: cdf65c537286e3467ab9a8fd3acfaf040c599d93eda4f4ef4936884e261003a680e837420b64231b70279a5636da0673191af13e1375c90bf3c8dcc8f2ce459f
7
+ data.tar.gz: 43d5914f669c28d683f2e7307b46761049af0641e08ec0a570bf1c55fc0d145a3a5ff6a21dc890341473518e8bf6113950914c9a3fc0683693a8f97cdf963070
@@ -1,5 +1,5 @@
1
1
  module Fullcalendar
2
2
  module Rails
3
- VERSION = "2.0.1.0"
3
+ VERSION = "2.0.2.0"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * FullCalendar v2.0.1
2
+ * FullCalendar v2.0.2
3
3
  * Docs & License: http://arshaw.com/fullcalendar/
4
4
  * (c) 2013 Adam Shaw
5
5
  */
@@ -168,7 +168,7 @@ var rtlDefaults = {
168
168
 
169
169
  ;;
170
170
 
171
- var fc = $.fullCalendar = { version: "2.0.1" };
171
+ var fc = $.fullCalendar = { version: "2.0.2" };
172
172
  var fcViews = fc.views = {};
173
173
 
174
174
 
@@ -1336,11 +1336,21 @@ function EventManager(options) { // assumed to be a calendar
1336
1336
 
1337
1337
  function fetchEventSource(source, fetchID) {
1338
1338
  _fetchEventSource(source, function(events) {
1339
+ var isArraySource = $.isArray(source.events);
1340
+ var i;
1341
+ var event;
1342
+
1339
1343
  if (fetchID == currentFetchID) {
1340
1344
 
1341
1345
  if (events) {
1342
- for (var i=0; i<events.length; i++) {
1343
- var event = buildEvent(events[i], source);
1346
+ for (i=0; i<events.length; i++) {
1347
+ event = events[i];
1348
+
1349
+ // event array sources have already been convert to Event Objects
1350
+ if (!isArraySource) {
1351
+ event = buildEvent(event, source);
1352
+ }
1353
+
1344
1354
  if (event) {
1345
1355
  cache.push(event);
1346
1356
  }
@@ -1474,6 +1484,7 @@ function EventManager(options) { // assumed to be a calendar
1474
1484
  function addEventSource(sourceInput) {
1475
1485
  var source = buildEventSource(sourceInput);
1476
1486
  if (source) {
1487
+ sources.push(source);
1477
1488
  pendingSourceCnt++;
1478
1489
  fetchEventSource(source, currentFetchID); // will eventually call reportEvents
1479
1490
  }
@@ -1501,6 +1512,14 @@ function EventManager(options) { // assumed to be a calendar
1501
1512
  }
1502
1513
 
1503
1514
  if (source) {
1515
+
1516
+ // for array sources, we convert to standard Event Objects up front
1517
+ if ($.isArray(source.events)) {
1518
+ source.events = $.map(source.events, function(eventInput) {
1519
+ return buildEvent(eventInput, source);
1520
+ });
1521
+ }
1522
+
1504
1523
  for (i=0; i<normalizers.length; i++) {
1505
1524
  normalizers[i].call(t, source);
1506
1525
  }
@@ -1599,30 +1618,31 @@ function EventManager(options) { // assumed to be a calendar
1599
1618
 
1600
1619
 
1601
1620
  function removeEvents(filter) {
1621
+ var eventID;
1602
1622
  var i;
1603
- if (!filter) { // remove all
1604
- cache = [];
1605
- // clear all array sources
1606
- for (i=0; i<sources.length; i++) {
1607
- if ($.isArray(sources[i].events)) {
1608
- sources[i].events = [];
1609
- }
1610
- }
1611
- }else{
1612
- if (!$.isFunction(filter)) { // an event ID
1613
- var id = filter + '';
1614
- filter = function(e) {
1615
- return e._id == id;
1616
- };
1617
- }
1618
- cache = $.grep(cache, filter, true);
1619
- // remove events from array sources
1620
- for (i=0; i<sources.length; i++) {
1621
- if ($.isArray(sources[i].events)) {
1622
- sources[i].events = $.grep(sources[i].events, filter, true);
1623
- }
1623
+
1624
+ if (filter == null) { // null or undefined. remove all events
1625
+ filter = function() { return true; }; // will always match
1626
+ }
1627
+ else if (!$.isFunction(filter)) { // an event ID
1628
+ eventID = filter + '';
1629
+ filter = function(event) {
1630
+ return event._id == eventID;
1631
+ };
1632
+ }
1633
+
1634
+ // Purge event(s) from our local cache
1635
+ cache = $.grep(cache, filter, true); // inverse=true
1636
+
1637
+ // Remove events from array sources.
1638
+ // This works because they have been converted to official Event Objects up front.
1639
+ // (and as a result, event._id has been calculated).
1640
+ for (i=0; i<sources.length; i++) {
1641
+ if ($.isArray(sources[i].events)) {
1642
+ sources[i].events = $.grep(sources[i].events, filter, true);
1624
1643
  }
1625
1644
  }
1645
+
1626
1646
  reportEvents(cache);
1627
1647
  }
1628
1648
 
@@ -1631,7 +1651,7 @@ function EventManager(options) { // assumed to be a calendar
1631
1651
  if ($.isFunction(filter)) {
1632
1652
  return $.grep(cache, filter);
1633
1653
  }
1634
- else if (filter) { // an event ID
1654
+ else if (filter != null) { // not null, not undefined. an event ID
1635
1655
  filter += '';
1636
1656
  return $.grep(cache, function(e) {
1637
1657
  return e._id == filter;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * FullCalendar v2.0.1 Google Calendar Plugin
2
+ * FullCalendar v2.0.2 Google Calendar Plugin
3
3
  * Docs & License: http://arshaw.com/fullcalendar/
4
4
  * (c) 2013 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * FullCalendar v2.0.1 Stylesheet
2
+ * FullCalendar v2.0.2 Stylesheet
3
3
  * Docs & License: http://arshaw.com/fullcalendar/
4
4
  * (c) 2013 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * FullCalendar v2.0.1 Print Stylesheet
2
+ * FullCalendar v2.0.2 Print Stylesheet
3
3
  * Docs & License: http://arshaw.com/fullcalendar/
4
4
  * (c) 2013 Adam Shaw
5
5
  */
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fullcalendar-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1.0
4
+ version: 2.0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bokmann