upjs-rails 0.12.3 → 0.12.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3eb33da9d6d267e5f81bbf2b99705cd6040d43c2
4
- data.tar.gz: ef207a1688fc627ed3426acdb565ce2786e2d9af
3
+ metadata.gz: 3c8d6c62b9bfd8ae9442bff02716548ed96e43d4
4
+ data.tar.gz: 0288151f1e12724d7a0575a45a659177e1e1736a
5
5
  SHA512:
6
- metadata.gz: 2bbb0a472c1b7d96f332aa3de98009b6fe7589a474279ed548e5b4d9113a7ce3127fc2af1e3fe06bb74146bc2a5701ad3b44d602714f018fdfdd30f6a1004498
7
- data.tar.gz: 085ed31b540ef88a215441d3c3b4b2016d83cf9e8d14a2b86c2ecd1c316bea1c6ce26cdb6d7d7ecd81b698b8720904715851764b5710fe757e9784aa7ae0020c
6
+ metadata.gz: 654c7febe25e8c905335e7d93fc9a5bbb024038e20af843ce65255b919cff8b3afac6a222c964068efd06c9e551f848c7685c25f4fff07c9c72be4e491d0977c
7
+ data.tar.gz: 6e212c099be579e46d25eec39db8911c4012b6cc54dbd96a08283db045086b6ec9cf51176c1f2332d4e9e9f433a133c09f4e4527045608455771218d365cd8e6
data/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  This project mostly adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
7
 
8
+ 0.12.4
9
+ ------
10
+
11
+ ### Compatible changes
12
+
13
+ - When [morphing](/up.morph), prevent flickering caused by long repaint frames
14
+ - When [morphing](/up.morph) don't un-highlight current navigation sections in the element that is being destroyed. This makes for a smoother transition.
15
+ - Fix a bug where compositing wasn't forced properly during an animation
16
+
17
+
8
18
  0.12.3
9
19
  ------
10
20
 
data/dist/up.js CHANGED
@@ -25,7 +25,7 @@ If you use them in your own code, you will get hurt.
25
25
  var slice = [].slice;
26
26
 
27
27
  up.util = (function($) {
28
- var $createElementFromSelector, ANIMATION_PROMISE_KEY, CONSOLE_PLACEHOLDERS, ajax, any, argNames, cache, castedAttr, clientSize, compact, config, contains, copy, copyAttributes, createElement, createElementFromHtml, createSelectorFromElement, cssAnimate, debug, detect, each, emptyJQuery, endsWith, error, escapePressed, evalConsoleTemplate, extend, findWithSelf, finishCssAnimate, fixedToAbsolute, forceCompositing, identity, ifGiven, isArray, isBlank, isDeferred, isDefined, isElement, isFunction, isGiven, isHash, isJQuery, isMissing, isNull, isNumber, isObject, isPresent, isPromise, isStandardPort, isString, isUndefined, isUnmodifiedKeyEvent, isUnmodifiedMouseEvent, last, locationFromXhr, map, measure, memoize, merge, methodFromXhr, multiSelector, nextFrame, normalizeMethod, normalizeUrl, nullJquery, offsetParent, once, only, option, options, presence, presentAttr, remove, resolvableWhen, resolvedDeferred, resolvedPromise, scrollbarWidth, select, setMissingAttrs, startsWith, temporaryCss, times, toArray, trim, unJquery, uniq, unwrapElement, warn;
28
+ var $createElementFromSelector, ANIMATION_PROMISE_KEY, CONSOLE_PLACEHOLDERS, ajax, any, cache, castedAttr, clientSize, compact, config, contains, copy, copyAttributes, createElement, createElementFromHtml, createSelectorFromElement, cssAnimate, debug, detect, each, emptyJQuery, endsWith, error, escapePressed, evalConsoleTemplate, extend, findWithSelf, finishCssAnimate, fixedToAbsolute, forceCompositing, identity, ifGiven, isArray, isBlank, isDeferred, isDefined, isElement, isFunction, isGiven, isHash, isJQuery, isMissing, isNull, isNumber, isObject, isPresent, isPromise, isStandardPort, isString, isUndefined, isUnmodifiedKeyEvent, isUnmodifiedMouseEvent, last, locationFromXhr, map, measure, memoize, merge, methodFromXhr, multiSelector, nextFrame, normalizeMethod, normalizeUrl, nullJquery, offsetParent, once, only, option, options, presence, presentAttr, remove, resolvableWhen, resolvedDeferred, resolvedPromise, scrollbarWidth, select, setMissingAttrs, startsWith, temporaryCss, times, toArray, trim, unJquery, uniq, unwrapElement, warn;
29
29
  memoize = function(func) {
30
30
  var cache, cached;
31
31
  cache = void 0;
@@ -578,7 +578,7 @@ If you use them in your own code, you will get hurt.
578
578
  forceCompositing = function($element) {
579
579
  var memo, oldTransforms;
580
580
  oldTransforms = $element.css(['transform', '-webkit-transform']);
581
- if (isBlank(oldTransforms)) {
581
+ if (isBlank(oldTransforms) || oldTransforms['transform'] === 'none') {
582
582
  memo = function() {
583
583
  return $element.css(oldTransforms);
584
584
  };
@@ -1102,18 +1102,7 @@ If you use them in your own code, you will get hurt.
1102
1102
  bottom: ''
1103
1103
  });
1104
1104
  };
1105
- argNames = function(fun) {
1106
- var code, match, pattern;
1107
- code = fun.toString();
1108
- pattern = new RegExp('\\(([^\\)]*)\\)');
1109
- if (match = code.match(pattern)) {
1110
- return match[1].split(/\s*,\s*/);
1111
- } else {
1112
- return error('Could not parse argument names of %o', fun);
1113
- }
1114
- };
1115
1105
  return {
1116
- argNames: argNames,
1117
1106
  offsetParent: offsetParent,
1118
1107
  fixedToAbsolute: fixedToAbsolute,
1119
1108
  presentAttr: presentAttr,
@@ -1320,7 +1309,7 @@ we can't currently get rid off.
1320
1309
  On older browsers Up.js will prevent itself from booting, leaving you with
1321
1310
  a classic server-side application.
1322
1311
 
1323
- @up.browser.isSupported
1312
+ @method up.browser.isSupported
1324
1313
  */
1325
1314
  isSupported = function() {
1326
1315
  return (!isIE8OrWorse()) && isRecentJQuery();
@@ -1355,7 +1344,7 @@ This event is triggered after Up.js has inserted an HTML fragment into the DOM t
1355
1344
  console.log("Looks like we have a new %o!", $fragment);
1356
1345
  });
1357
1346
 
1358
- The event is triggered *before* Up has compiled the fragment with your [custom behavior](/up.magic).
1347
+ The event is triggered *before* Up has compiled the fragment with your [custom elements](/up.syntax).
1359
1348
  Upon receiving the event, Up.js will start compilation.
1360
1349
 
1361
1350
 
@@ -1377,8 +1366,6 @@ animation before removing the fragment from the DOM.
1377
1366
 
1378
1367
  We need to work on this page:
1379
1368
 
1380
- - Decide whether to refactor this into document events
1381
- - Decide whether `fragment:enter` and `fragment:leave` would be better names
1382
1369
  - Decide if we wouldn't rather document events in the respective module (e.g. proxy).
1383
1370
 
1384
1371
  @class up.bus
@@ -1388,112 +1375,8 @@ We need to work on this page:
1388
1375
  var slice = [].slice;
1389
1376
 
1390
1377
  up.bus = (function($) {
1391
- var emit, nobodyPrevents, reset, u;
1392
- u = up.util;
1393
-
1394
- /**
1395
- Emits an event with the given name and properties.
1396
-
1397
- \#\#\#\# Example
1398
-
1399
- up.on('my:event', function(event) {
1400
- console.log(event.foo);
1401
- });
1402
-
1403
- up.emit('my:event', { foo: 'bar' });
1404
- * Prints "bar" to the console
1405
-
1406
- @method up.emit
1407
- @param {String} eventName
1408
- The name of the event.
1409
- @param {Object} [eventProps={}]
1410
- A list of properties to become part of the event object
1411
- that will be passed to listeners. Note that the event object
1412
- will by default include properties like `preventDefault()`
1413
- or `stopPropagation()`.
1414
- @param {jQuery} [eventProps.$element=$(document)]
1415
- The element on which the event is trigered.
1416
- @protected
1417
- */
1418
- emit = function(eventName, eventProps) {
1419
- var $target, event;
1420
- if (eventProps == null) {
1421
- eventProps = {};
1422
- }
1423
- event = $.Event(eventName, eventProps);
1424
- $target = eventProps.$element || $(document);
1425
- u.debug("Emitting %o on %o with props %o", eventName, $target, eventProps);
1426
- $target.trigger(event);
1427
- return event;
1428
- };
1429
-
1430
- /**
1431
- [Emits an event](/up.emit) and returns whether any listener has prevented the default action.
1432
-
1433
- @method up.bus.nobodyPrevents
1434
- @param {String} eventName
1435
- @param {Object} eventProps
1436
- @protected
1437
- */
1438
- nobodyPrevents = function() {
1439
- var args, event;
1440
- args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
1441
- event = emit.apply(null, args);
1442
- return !event.isDefaultPrevented();
1443
- };
1444
-
1445
- /**
1446
- Resets Up.js to the state when it was booted.
1447
- All custom event handlers, animations, etc. that have been registered
1448
- will be discarded.
1449
-
1450
- This is an internal method for to enable unit testing.
1451
- Don't use this in production.
1452
-
1453
- @protected
1454
- @method up.reset
1455
- */
1456
- reset = function() {
1457
- return up.emit('up:framework:reset');
1458
- };
1459
- return {
1460
- emit: emit,
1461
- nobodyPrevents: nobodyPrevents,
1462
- reset: reset
1463
- };
1464
- })(jQuery);
1465
-
1466
- up.reset = up.bus.reset;
1467
-
1468
- up.emit = up.bus.emit;
1469
-
1470
- }).call(this);
1471
-
1472
- /**
1473
- Registering behavior and custom elements
1474
- ========================================
1475
-
1476
- Up.js keeps a persistent Javascript environment during page transitions.
1477
- To prevent memory leaks it is important to cleanly set up and tear down
1478
- event handlers and custom elements.
1479
-
1480
- \#\#\# Incomplete documentation!
1481
-
1482
- We need to work on this page:
1483
-
1484
- - Better class-level introduction for this module
1485
-
1486
- @class up.magic
1487
- */
1488
-
1489
- (function() {
1490
- var slice = [].slice;
1491
-
1492
- up.magic = (function($) {
1493
- var DESTROYABLE_CLASS, DESTROYER_KEY, applyCompiler, compile, compiler, compilers, data, defaultCompilers, defaultLiveDescriptions, destroy, hello, live, liveDescriptions, onEscape, reset, snapshot, u, upListenerToJqueryListener;
1378
+ var defaultLiveDescriptions, emit, emitReset, live, liveDescriptions, nobodyPrevents, onEscape, restoreSnapshot, snapshot, u, upListenerToJqueryListener;
1494
1379
  u = up.util;
1495
- DESTROYABLE_CLASS = 'up-destroyable';
1496
- DESTROYER_KEY = 'up-destroyer';
1497
1380
  liveDescriptions = [];
1498
1381
  defaultLiveDescriptions = null;
1499
1382
 
@@ -1505,7 +1388,7 @@ We need to work on this page:
1505
1388
  return function(event) {
1506
1389
  var $me;
1507
1390
  $me = event.$element || $(this);
1508
- return upListener.apply($me.get(0), [event, $me, data($me)]);
1391
+ return upListener.apply($me.get(0), [event, $me, up.syntax.data($me)]);
1509
1392
  };
1510
1393
  };
1511
1394
 
@@ -1562,7 +1445,6 @@ We need to work on this page:
1562
1445
  $(this).something();
1563
1446
  });
1564
1447
 
1565
-
1566
1448
  @method up.on
1567
1449
  @param {String} events
1568
1450
  A space-separated list of event names to bind.
@@ -1596,6 +1478,150 @@ We need to work on this page:
1596
1478
  };
1597
1479
  };
1598
1480
 
1481
+ /**
1482
+ Emits an event with the given name and properties.
1483
+
1484
+ \#\#\#\# Example
1485
+
1486
+ up.on('my:event', function(event) {
1487
+ console.log(event.foo);
1488
+ });
1489
+
1490
+ up.emit('my:event', { foo: 'bar' });
1491
+ * Prints "bar" to the console
1492
+
1493
+ @method up.emit
1494
+ @param {String} eventName
1495
+ The name of the event.
1496
+ @param {Object} [eventProps={}]
1497
+ A list of properties to become part of the event object
1498
+ that will be passed to listeners. Note that the event object
1499
+ will by default include properties like `preventDefault()`
1500
+ or `stopPropagation()`.
1501
+ @param {jQuery} [eventProps.$element=$(document)]
1502
+ The element on which the event is trigered.
1503
+ @protected
1504
+ */
1505
+ emit = function(eventName, eventProps) {
1506
+ var $target, event;
1507
+ if (eventProps == null) {
1508
+ eventProps = {};
1509
+ }
1510
+ event = $.Event(eventName, eventProps);
1511
+ $target = eventProps.$element || $(document);
1512
+ u.debug("Emitting %o on %o with props %o", eventName, $target, eventProps);
1513
+ $target.trigger(event);
1514
+ return event;
1515
+ };
1516
+
1517
+ /**
1518
+ [Emits an event](/up.emit) and returns whether any listener has prevented the default action.
1519
+
1520
+ @method up.bus.nobodyPrevents
1521
+ @param {String} eventName
1522
+ @param {Object} eventProps
1523
+ @protected
1524
+ */
1525
+ nobodyPrevents = function() {
1526
+ var args, event;
1527
+ args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
1528
+ event = emit.apply(null, args);
1529
+ return !event.isDefaultPrevented();
1530
+ };
1531
+ onEscape = function(handler) {
1532
+ return live('keydown', 'body', function(event) {
1533
+ if (u.escapePressed(event)) {
1534
+ return handler(event);
1535
+ }
1536
+ });
1537
+ };
1538
+
1539
+ /**
1540
+ Makes a snapshot of the currently registered event listeners,
1541
+ to later be restored through [`up.bus.reset`](/up.bus.reset).
1542
+
1543
+ @private
1544
+ */
1545
+ snapshot = function() {
1546
+ return defaultLiveDescriptions = u.copy(liveDescriptions);
1547
+ };
1548
+
1549
+ /**
1550
+ Resets the list of registered event listeners to the
1551
+ moment when the framework was booted.
1552
+
1553
+ @private
1554
+ */
1555
+ restoreSnapshot = function() {
1556
+ var description, i, len, ref;
1557
+ for (i = 0, len = liveDescriptions.length; i < len; i++) {
1558
+ description = liveDescriptions[i];
1559
+ if (!u.contains(defaultLiveDescriptions, description)) {
1560
+ (ref = $(document)).off.apply(ref, description);
1561
+ }
1562
+ }
1563
+ return liveDescriptions = u.copy(defaultLiveDescriptions);
1564
+ };
1565
+
1566
+ /**
1567
+ Resets Up.js to the state when it was booted.
1568
+ All custom event handlers, animations, etc. that have been registered
1569
+ will be discarded.
1570
+
1571
+ This is an internal method for to enable unit testing.
1572
+ Don't use this in production.
1573
+
1574
+ @protected
1575
+ @method up.reset
1576
+ */
1577
+ emitReset = function() {
1578
+ return up.emit('up:framework:reset');
1579
+ };
1580
+ live('up:framework:boot', snapshot);
1581
+ live('up:framework:reset', restoreSnapshot);
1582
+ return {
1583
+ on: live,
1584
+ emit: emit,
1585
+ nobodyPrevents: nobodyPrevents,
1586
+ onEscape: onEscape,
1587
+ emitReset: emitReset
1588
+ };
1589
+ })(jQuery);
1590
+
1591
+ up.on = up.bus.on;
1592
+
1593
+ up.emit = up.bus.emit;
1594
+
1595
+ up.reset = up.bus.emitReset;
1596
+
1597
+ }).call(this);
1598
+
1599
+ /**
1600
+ Custom elements
1601
+ ===============
1602
+
1603
+ Up.js keeps a persistent Javascript environment during page transitions.
1604
+ To prevent memory leaks it is important to cleanly set up and tear down
1605
+ event handlers and custom elements.
1606
+
1607
+ \#\#\# Incomplete documentation!
1608
+
1609
+ We need to work on this page:
1610
+
1611
+ - Better class-level introduction for this module
1612
+
1613
+ @class up.syntax
1614
+ */
1615
+
1616
+ (function() {
1617
+ var slice = [].slice;
1618
+
1619
+ up.syntax = (function($) {
1620
+ var DESTROYABLE_CLASS, DESTROYER_KEY, applyCompiler, compile, compiler, compilers, data, defaultCompilers, destroy, hello, reset, snapshot, u;
1621
+ u = up.util;
1622
+ DESTROYABLE_CLASS = 'up-destroyable';
1623
+ DESTROYER_KEY = 'up-destroyer';
1624
+
1599
1625
  /**
1600
1626
  Registers a function to be called whenever an element with
1601
1627
  the given selector is inserted into the DOM.
@@ -1815,16 +1841,17 @@ We need to work on this page:
1815
1841
  we can support getting or setting individual keys.
1816
1842
 
1817
1843
  @protected
1818
- @method up.magic.data
1844
+ @method up.syntax.data
1819
1845
  @param {String|Element|jQuery} elementOrSelector
1820
1846
  */
1821
1847
 
1822
1848
  /*
1823
- Stores a JSON-string with the element.
1849
+ Looks for an `up-data` attribute on the given element, then parses
1850
+ its value as JSON and returns the JSON object.
1824
1851
 
1825
1852
  If an element annotated with [`up-data`] is inserted into the DOM,
1826
1853
  Up will parse the JSON and pass the resulting object to any matching
1827
- [`up.compiler`](/up.magic.compiler) handlers.
1854
+ [`up.compiler`](/up.syntax.compiler) handlers.
1828
1855
 
1829
1856
  Similarly, when an event is triggered on an element annotated with
1830
1857
  [`up-data`], the parsed object will be passed to any matching
@@ -1833,6 +1860,10 @@ We need to work on this page:
1833
1860
  @ujs
1834
1861
  @method [up-data]
1835
1862
  @param {JSON} [up-data]
1863
+ @return
1864
+ The JSON-decoded value of the `up-data` attribute.
1865
+
1866
+ Returns an empty object (`{}`) if the element has no (or an empty) `up-data` attribute.
1836
1867
  */
1837
1868
  data = function(elementOrSelector) {
1838
1869
  var $element, json;
@@ -1847,32 +1878,21 @@ We need to work on this page:
1847
1878
 
1848
1879
  /**
1849
1880
  Makes a snapshot of the currently registered event listeners,
1850
- to later be restored through [`up.bus.reset`](/up.bus.reset).
1881
+ to later be restored through `reset`.
1851
1882
 
1852
1883
  @private
1853
- @method up.magic.snapshot
1854
1884
  */
1855
1885
  snapshot = function() {
1856
- defaultLiveDescriptions = u.copy(liveDescriptions);
1857
1886
  return defaultCompilers = u.copy(compilers);
1858
1887
  };
1859
1888
 
1860
1889
  /**
1861
- Resets the list of registered event listeners to the
1890
+ Resets the list of registered compiler directives to the
1862
1891
  moment when the framework was booted.
1863
1892
 
1864
1893
  @private
1865
- @method up.magic.reset
1866
1894
  */
1867
1895
  reset = function() {
1868
- var description, i, len, ref;
1869
- for (i = 0, len = liveDescriptions.length; i < len; i++) {
1870
- description = liveDescriptions[i];
1871
- if (!u.contains(defaultLiveDescriptions, description)) {
1872
- (ref = $(document)).off.apply(ref, description);
1873
- }
1874
- }
1875
- liveDescriptions = u.copy(defaultLiveDescriptions);
1876
1896
  return compilers = u.copy(defaultCompilers);
1877
1897
  };
1878
1898
 
@@ -1901,38 +1921,27 @@ We need to work on this page:
1901
1921
  });
1902
1922
  return $element;
1903
1923
  };
1904
- onEscape = function(handler) {
1905
- return live('keydown', 'body', function(event) {
1906
- if (u.escapePressed(event)) {
1907
- return handler(event);
1908
- }
1909
- });
1910
- };
1911
- live('ready', (function() {
1924
+ up.on('ready', (function() {
1912
1925
  return hello(document.body);
1913
1926
  }));
1914
- live('up:fragment:inserted', function(event) {
1927
+ up.on('up:fragment:inserted', function(event) {
1915
1928
  return compile(event.$element);
1916
1929
  });
1917
- live('up:fragment:destroy', function(event) {
1930
+ up.on('up:fragment:destroy', function(event) {
1918
1931
  return destroy(event.$element);
1919
1932
  });
1920
- live('up:framework:boot', snapshot);
1921
- live('up:framework:reset', reset);
1933
+ up.on('up:framework:boot', snapshot);
1934
+ up.on('up:framework:reset', reset);
1922
1935
  return {
1923
1936
  compiler: compiler,
1924
- on: live,
1925
1937
  hello: hello,
1926
- onEscape: onEscape,
1927
1938
  data: data
1928
1939
  };
1929
1940
  })(jQuery);
1930
1941
 
1931
- up.compiler = up.magic.compiler;
1942
+ up.compiler = up.syntax.compiler;
1932
1943
 
1933
- up.on = up.magic.on;
1934
-
1935
- up.hello = up.magic.hello;
1944
+ up.hello = up.syntax.hello;
1936
1945
 
1937
1946
  up.ready = function() {
1938
1947
  return up.util.error('up.ready no longer exists. Please use up.hello instead.');
@@ -2230,13 +2239,13 @@ This modules contains functions to scroll the viewport and reveal contained elem
2230
2239
 
2231
2240
  This will scroll a `<div class="main">...</div>` to a Y-position of 100 pixels:
2232
2241
 
2233
- up.scoll('.main', 100);
2242
+ up.scroll('.main', 100);
2234
2243
 
2235
2244
  \#\#\#\# Animating the scrolling motion
2236
2245
 
2237
2246
  The scrolling can (optionally) be animated.
2238
2247
 
2239
- up.scoll('.main', 100, {
2248
+ up.scroll('.main', 100, {
2240
2249
  easing: 'swing',
2241
2250
  duration: 250
2242
2251
  });
@@ -2735,16 +2744,11 @@ This modules contains functions to scroll the viewport and reveal contained elem
2735
2744
  Changing page fragments programmatically
2736
2745
  ========================================
2737
2746
 
2738
- This module contains Up's core functions to insert, change
2739
- or destroy page fragments.
2747
+ This module contains Up.js's core functions to [change](/up.replace) or [destroy](/up.destroy)
2748
+ page fragments via Javascript.
2740
2749
 
2741
- \#\#\# Incomplete documentation!
2742
-
2743
- We need to work on this page:
2744
-
2745
- - Explain the UJS approach vs. pragmatic approach
2746
- - Examples
2747
-
2750
+ All the other Up.js modules (like [`up.link`](/up.link) or [`up.modal`](/up.modal))
2751
+ are based on this module.
2748
2752
 
2749
2753
  @class up.flow
2750
2754
  */
@@ -3167,28 +3171,32 @@ We need to work on this page:
3167
3171
  }).call(this);
3168
3172
 
3169
3173
  /**
3170
- Animation and transitions
3171
- =========================
3174
+ Animation
3175
+ =========
3172
3176
 
3173
- Any fragment change in Up.js can be animated.
3177
+ Whenever you change a page fragment (through methods like
3178
+ [`up.replace`](/up.replace) or UJS attributes like [`up-target`](/up-target))
3179
+ you can animate the change.
3180
+
3181
+ For instance, when you replace a selector `.list` with a new `.list`
3182
+ from the server, you can add an `up-transition="cross-fade"` attribute
3183
+ to smoothly fade out the old `.list` while fading in the new `.list`:
3184
+
3185
+ <a href="/users" up-target=".list" up-transition="cross-fade">Show users</a>
3174
3186
 
3175
- <a href="/users" data-target=".list" up-transition="cross-fade">Show users</a>
3187
+ When we morph between an old an new element, we call it a *transition*.
3188
+ In contrast, when we animate a new element without simultaneously removing an
3189
+ old element, we call it an *animation*.
3176
3190
 
3177
- Or a dialog open:
3191
+ An example for an animation is opening a new dialog, which we can animate
3192
+ using the `up-animation` attribute:
3178
3193
 
3179
3194
  <a href="/users" up-modal=".list" up-animation="move-from-top">Show users</a>
3180
3195
 
3181
- Up.js ships with a number of predefined animations and transitions,
3182
- and you can easily define your own using Javascript or CSS.
3183
-
3184
-
3185
- \#\#\# Incomplete documentation!
3186
-
3187
- We need to work on this page:
3188
-
3189
- - Explain the difference between transitions and animations
3190
- - Demo the built-in animations and transitions
3191
- - Explain ghosting
3196
+ Up.js ships with a number of predefined [animations](/up.animate#named-animation)
3197
+ and [transitions](/up.morph#named-animation).
3198
+ You can also easily [define your own animations](/up.animation)
3199
+ or [transitions](/up.transition) using Javascript or CSS.
3192
3200
 
3193
3201
 
3194
3202
  @class up.motion
@@ -3358,7 +3366,7 @@ We need to work on this page:
3358
3366
  oldCopy.moveTop(newScrollTop - oldScrollTop);
3359
3367
  $old.hide();
3360
3368
  showNew = u.temporaryCss($new, {
3361
- visibility: 'hidden'
3369
+ opacity: '0'
3362
3370
  });
3363
3371
  promise = block(oldCopy.$ghost, newCopy.$ghost);
3364
3372
  $old.data(GHOSTING_PROMISE_KEY, promise);
@@ -3366,9 +3374,9 @@ We need to work on this page:
3366
3374
  promise.then(function() {
3367
3375
  $old.removeData(GHOSTING_PROMISE_KEY);
3368
3376
  $new.removeData(GHOSTING_PROMISE_KEY);
3377
+ showNew();
3369
3378
  oldCopy.$bounds.remove();
3370
- newCopy.$bounds.remove();
3371
- return showNew();
3379
+ return newCopy.$bounds.remove();
3372
3380
  });
3373
3381
  return promise;
3374
3382
  };
@@ -3433,6 +3441,24 @@ We need to work on this page:
3433
3441
  - `move-to-bottom/fade-in`
3434
3442
  - `move-to-left/move-from-top`
3435
3443
 
3444
+ \#\#\#\# Implementation details
3445
+
3446
+ During a transition both the old and new element occupy
3447
+ the same position on the screen.
3448
+
3449
+ Since the CSS layout flow will usually not allow two elements to
3450
+ overlay the same space, Up.js:
3451
+
3452
+ - The old and new elements are cloned
3453
+ - The old element is removed from the layout flow using `display: hidden`
3454
+ - The new element is hidden, but still leaves space in the layout flow by setting `visibility: hidden`
3455
+ - The clones are [absolutely positioned](https://developer.mozilla.org/en-US/docs/Web/CSS/position#Absolute_positioning)
3456
+ over the original elements.
3457
+ - The transition is applied to the cloned elements.
3458
+ At no point will the hidden, original elements be animated.
3459
+ - When the transition has finished, the clones are removed from the DOM and the new element is shown.
3460
+ The old element remains hidden in the DOM.
3461
+
3436
3462
  @method up.morph
3437
3463
  @param {Element|jQuery|String} source
3438
3464
  @param {Element|jQuery|String} target
@@ -3452,6 +3478,7 @@ We need to work on this page:
3452
3478
  */
3453
3479
  morph = function(source, target, transitionOrName, options) {
3454
3480
  var $new, $old, animation, deferred, parsedOptions, parts, transition;
3481
+ u.debug('Morphing %o to %o (using %o)', source, target, transitionOrName);
3455
3482
  $old = $(source);
3456
3483
  $new = $(target);
3457
3484
  parsedOptions = u.only(options, 'reveal', 'restoreScroll');
@@ -3486,7 +3513,7 @@ We need to work on this page:
3486
3513
  };
3487
3514
 
3488
3515
  /**
3489
- Cause the side effects of a successful transitions, but instantly.
3516
+ This causes the side effects of a successful transition, but instantly.
3490
3517
  We use this to skip morphing for old browsers, or when the developer
3491
3518
  decides to only animate the new element (i.e. no real ghosting or transition) .
3492
3519
 
@@ -3624,7 +3651,8 @@ We need to work on this page:
3624
3651
  Returns a new promise that resolves once all promises in arguments resolve.
3625
3652
 
3626
3653
  Other then [`$.when` from jQuery](https://api.jquery.com/jquery.when/),
3627
- the combined promise will have a `resolve` method.
3654
+ the combined promise will have a `resolve` method. This `resolve` method
3655
+ will resolve all the wrapped promises.
3628
3656
 
3629
3657
  @method up.motion.when
3630
3658
  @param promises...
@@ -3814,13 +3842,13 @@ making requests to these URLs return insantly.
3814
3842
  The cache is cleared whenever the user makes a non-`GET` request
3815
3843
  (like `POST`, `PUT` or `DELETE`).
3816
3844
 
3817
- The proxy can also used to speed up reaction times by preloading
3818
- links when the user hovers over the click area (or puts the mouse/finger
3819
- down before releasing). This way the
3820
- response will already be cached when the user performs the click.
3845
+ The proxy can also used to speed up reaction times by [preloading
3846
+ links when the user hovers over the click area](/up-preload) (or puts the mouse/finger
3847
+ down before releasing). This way the response will already be cached when
3848
+ the user performs the click.
3821
3849
 
3822
3850
  Spinners
3823
- ---------
3851
+ --------
3824
3852
 
3825
3853
  You can listen to [framework events](/up.bus) to implement a spinner
3826
3854
  (progress indicator) that appears during a long-running request,
@@ -3835,12 +3863,15 @@ Here is the Javascript to make it alive:
3835
3863
  show = function() { $element.show() };
3836
3864
  hide = function() { $element.hide() };
3837
3865
 
3838
- up.bus.on('proxy:busy', show);
3839
- up.bus.on('proxy:idle', hide);
3866
+ showOff = up.on('proxy:busy', show);
3867
+ hideOff = up.on('proxy:idle', hide);
3868
+
3869
+ hide();
3840
3870
 
3871
+ // Clean up when the element is removed from the DOM
3841
3872
  return function() {
3842
- up.bus.off('proxy:busy', show);
3843
- up.bus.off('proxy:idle', hide);
3873
+ showOff();
3874
+ hideOff();
3844
3875
  };
3845
3876
 
3846
3877
  });
@@ -4225,7 +4256,7 @@ Read on
4225
4256
  - You can [open fragments in popups or modal dialogs](/up.modal).
4226
4257
  - You can give users [immediate feedback](/up.navigation) when a link is clicked or becomes current, without waiting for the server.
4227
4258
  - [Controlling Up.js pragmatically through Javascript](/up.flow)
4228
- - [Defining custom tags and event handlers](/up.magic)
4259
+ - [Defining custom tags](/up.syntax)
4229
4260
 
4230
4261
 
4231
4262
  @class up.link
@@ -5232,7 +5263,7 @@ We need to work on this page:
5232
5263
  return autoclose();
5233
5264
  }
5234
5265
  });
5235
- up.magic.onEscape(function() {
5266
+ up.bus.onEscape(function() {
5236
5267
  return close();
5237
5268
  });
5238
5269
 
@@ -5711,7 +5742,7 @@ For small popup overlays ("dropdowns") see [up.popup](/up.popup) instead.
5711
5742
  return autoclose();
5712
5743
  }
5713
5744
  });
5714
- up.magic.onEscape(function() {
5745
+ up.bus.onEscape(function() {
5715
5746
  return close();
5716
5747
  });
5717
5748
 
@@ -5756,26 +5787,61 @@ For small popup overlays ("dropdowns") see [up.popup](/up.popup) instead.
5756
5787
  /**
5757
5788
  Tooltips
5758
5789
  ========
5759
-
5760
- Elements that have an `up-tooltip` attribute will show the attribute
5761
- value in a tooltip when a user hovers over the element.
5762
-
5763
- \#\#\# Incomplete documentation!
5764
-
5765
- We need to work on this page:
5766
-
5767
- - Show the tooltip's HTML structure and how to style the elements
5768
- - Explain how to position tooltips using `up-position`
5769
- - We should have a position about tooltips that contain HTML.
5770
-
5790
+
5791
+ Up.js comes with a basic tooltip implementation.
5792
+
5793
+ You can an [`up-tooltip`](/up-tooltip) attribute to any HTML tag to show a tooltip whenever
5794
+ the user hovers over the element:
5795
+
5796
+ <a href="/decks" up-tooltip="Show all decks">Decks</a>
5797
+
5798
+
5799
+ \#\#\#\# Styling
5800
+
5801
+ The [default styles](https://github.com/makandra/upjs/blob/master/lib/assets/stylesheets/up/tooltip.css.sass)
5802
+ show a simple tooltip with white text on a gray background.
5803
+ A gray triangle points to the element.
5804
+
5805
+ To change the styling, simply override CSS rules for the `.up-tooltip` selector and its `:after`
5806
+ selector that is used the triangle.
5807
+
5808
+ The HTML of a tooltip element is simply this:
5809
+
5810
+ <div class="up-tooltip">
5811
+ Show all decks
5812
+ </div>
5813
+
5814
+ The tooltip element is appended to the end of `<body>`.
5771
5815
 
5772
5816
  @class up.tooltip
5773
5817
  */
5774
5818
 
5775
5819
  (function() {
5776
5820
  up.tooltip = (function($) {
5777
- var attach, close, createElement, setPosition, u;
5821
+ var attach, close, config, createElement, reset, setPosition, u;
5778
5822
  u = up.util;
5823
+
5824
+ /**
5825
+ Sets default options for future tooltips.
5826
+
5827
+ @method up.tooltip.config
5828
+ @property
5829
+ @param {String} [config.position]
5830
+ The default position of tooltips relative to the element.
5831
+ Can be either `"top"` or `"bottom"`.
5832
+ @param {String} [config.openAnimation='fade-in']
5833
+ The animation used to open a tooltip.
5834
+ @param {String} [config.closeAnimation='fade-out']
5835
+ The animation used to close a tooltip.
5836
+ */
5837
+ config = u.config({
5838
+ position: 'top',
5839
+ openAnimation: 'fade-in',
5840
+ closeAnimation: 'fade-out'
5841
+ });
5842
+ reset = function() {
5843
+ return config.reset();
5844
+ };
5779
5845
  setPosition = function($link, $tooltip, position) {
5780
5846
  var css, linkBox, tooltipBox;
5781
5847
  linkBox = u.measure($link);
@@ -5814,7 +5880,7 @@ We need to work on this page:
5814
5880
  /**
5815
5881
  Opens a tooltip over the given element.
5816
5882
 
5817
- up.tooltip.open('.help', {
5883
+ up.tooltip.attach('.help', {
5818
5884
  html: 'Enter multiple words or phrases'
5819
5885
  });
5820
5886
 
@@ -5834,9 +5900,9 @@ We need to work on this page:
5834
5900
  }
5835
5901
  $link = $(linkOrSelector);
5836
5902
  html = u.option(options.html, $link.attr('up-tooltip-html'));
5837
- text = u.option(options.text, $link.attr('up-tooltip'), $link.attr('title'));
5838
- position = u.option(options.position, $link.attr('up-position'), 'top');
5839
- animation = u.option(options.animation, u.castedAttr($link, 'up-animation'), 'fade-in');
5903
+ text = u.option(options.text, $link.attr('up-tooltip'));
5904
+ position = u.option(options.position, $link.attr('up-position'), config.position);
5905
+ animation = u.option(options.animation, u.castedAttr($link, 'up-animation'), config.openAnimation);
5840
5906
  animateOptions = up.motion.animateOptions(options, $link);
5841
5907
  close();
5842
5908
  $tooltip = createElement({
@@ -5860,7 +5926,7 @@ We need to work on this page:
5860
5926
  $tooltip = $('.up-tooltip');
5861
5927
  if ($tooltip.length) {
5862
5928
  options = u.options(options, {
5863
- animation: 'fade-out'
5929
+ animation: config.closeAnimation
5864
5930
  });
5865
5931
  options = u.merge(options, up.motion.animateOptions(options));
5866
5932
  return up.destroy($tooltip, options);
@@ -5872,11 +5938,19 @@ We need to work on this page:
5872
5938
 
5873
5939
  <a href="/decks" up-tooltip="Show all decks">Decks</a>
5874
5940
 
5875
- You can also make an existing `title` attribute appear as a tooltip:
5941
+ To make the tooltip appear below the element instead of above the element,
5942
+ add an `up-position` attribute:
5876
5943
 
5877
- <a href="/decks" title="Show all decks" up-tooltip>Decks</a>
5944
+ <a href="/decks" up-tooltip="Show all decks" up-position="bottom">Decks</a>
5878
5945
 
5879
5946
  @method [up-tooltip]
5947
+ @param {String} [up-animation]
5948
+ The animation used to open the tooltip.
5949
+ Defaults to [`up.tooltip.config.openAnimation`](/up.tooltip.config).
5950
+ @param {String} [up-position]
5951
+ The default position of tooltips relative to the element.
5952
+ Can be either `"top"` or `"bottom"`.
5953
+ Defaults to [`up.tooltip.config.position`](/up.tooltip.config).
5880
5954
  @ujs
5881
5955
  */
5882
5956
 
@@ -5900,9 +5974,10 @@ We need to work on this page:
5900
5974
  return close();
5901
5975
  });
5902
5976
  up.on('up:framework:reset', close);
5903
- up.magic.onEscape(function() {
5977
+ up.bus.onEscape(function() {
5904
5978
  return close();
5905
5979
  });
5980
+ up.on('up:framework:reset', reset);
5906
5981
  return {
5907
5982
  attach: attach,
5908
5983
  close: close,
@@ -6029,7 +6104,7 @@ by providing instant feedback for user interactions.
6029
6104
  urls = sectionUrls($section);
6030
6105
  if (currentUrls.matchesAny(urls)) {
6031
6106
  return $section.addClass(klass);
6032
- } else {
6107
+ } else if ($section.hasClass(klass) && $section.closest('.up-destroying').length === 0) {
6033
6108
  return $section.removeClass(klass);
6034
6109
  }
6035
6110
  });
data/dist/up.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(){window.up={}}).call(this),function(){var t=[].slice;up.util=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,P,E,A,O,$,D,j,U,z,R,M,L,W,F,I,_,Q,N,K,H,q,B,J,G,X,V,Y,Z,te,ee,ne,re,oe,ue,ie,ae,se,le,ce,pe,fe,de,me,he,ve,ge,ye,be,we,ke,xe,Se,Ce,Te,Pe,Ee,Ae,Oe,$e,De,je,Ue,ze,Re;return ue=function(e){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],r?n:(r=!0,n=e.apply(null,o))}},u=function(t){return t=m(t),t.selector&&(t.headers={"X-Up-Selector":t.selector}),e.ajax(t)},X=function(t,e){return(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},pe=function(t,n){var r,o,u;return r=null,V(t)?(r=e("<a>").attr({href:t}).get(0),M(r.hostname)&&(r.href=r.href)):r=je(t),o=r.protocol+"//"+r.hostname,X(r.protocol,r.port)||(o+=":"+r.port),u=r.pathname,"/"!==u[0]&&(u="/"+u),(null!=n?n.stripTrailingSlash:void 0)===!0&&(u=u.replace(/\/$/,"")),o+=u,(null!=n?n.hash:void 0)===!0&&(o+=r.hash),(null!=n?n.search:void 0)!==!1&&(o+=r.search),o},ce=function(t){return t?t.toUpperCase():"GET"},n=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;for(v=t.split(/[ >]/),o=null,p=f=0,m=v.length;m>f;p=++f){for(a=v[p],i=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",u=[],c=null,d=0,h=i.length;h>d;d++)switch(s=i[d],s[0]){case".":u.push(s.substr(1));break;case"#":c=s.substr(1);break;default:g=s}l="<"+g,u.length&&(l+=' class="'+u.join(" ")+'"'),c&&(l+=' id="'+c+'"'),l+=">",n=e(l),r&&n.appendTo(r),0===p&&(o=n),r=n}return o},v=function(t,e){var n;return n=document.createElement(t),J(e)&&(n.innerHTML=e),n},w=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["debug",n].concat(t.call(e)))},Re=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["warn",n].concat(t.call(e)))},T=function(){var n,r,o,u;throw r=1<=arguments.length?t.call(arguments,0):[],r[0]="[UP] "+r[0],(u=up.browser).puts.apply(u,["error"].concat(t.call(r))),o=E.apply(null,r),n=ye(e(".up-error"))||e('<div class="up-error"></div>').prependTo("body"),n.addClass("up-error"),n.text(o),new Error(o)},o=/\%[odisf]/g,E=function(){var e,n,r,u;return e=1<=arguments.length?t.call(arguments,0):[],u=e[0],n=0,r=80,u.replace(o,function(){var t,o;return n+=1,t=e[n],o=typeof t,"string"===o?(t=t.replace(/\s+/g," "),t.length>r&&(t=t.substr(0,r)+"\u2026"),t='"'+t+'"'):t="undefined"===o?"undefined":"number"===o||"function"===o?t.toString():JSON.stringify(t),t.length>r&&(t=t.substr(0,r)+" \u2026",("object"===o||"function"===o)&&(t+=" }")),t})},y=function(t){var e,n,r,o,u,i,a;for(w("Creating selector from element %o",t),n=(e=t.attr("class"))?e.split(" "):[],r=t.attr("id"),a=t.prop("tagName").toLowerCase(),r&&(a+="#"+r),o=0,i=n.length;i>o;o++)u=n[o],a+="."+u;return a},g=function(t){var e,n,r,o,u,i,a,s,l,c,p,f;return l=function(t){return"<"+t+"(?: [^>]*)?>"},i=function(t){return"</"+t+">"},e="(?:.|\\n)*?",u=function(t){return"("+t+")"},f=new RegExp(l("head")+e+l("title")+u(e)+i("title")+e+i("body"),"i"),o=new RegExp(l("body")+u(e)+i("body"),"i"),(r=t.match(o))?(s=document.createElement("html"),n=v("body",r[1]),s.appendChild(n),(p=t.match(f))&&(a=v("head"),s.appendChild(a),c=v("title",p[1]),a.appendChild(c)),s):v("div",t)},A=e.extend,De=e.trim,x=function(t,e){var n,r,o,u,i;for(i=[],n=o=0,u=t.length;u>o;n=++o)r=t[n],i.push(e(r,n));return i},re=x,U=function(t){return t},Oe=function(t,e){var n,r,o,u;for(u=[],n=r=0,o=t-1;o>=0?o>=r:r>=o;n=o>=0?++r:--r)u.push(e(n));return u},H=function(t){return null===t},Y=function(t){return void 0===t},W=function(t){return!Y(t)},K=function(t){return Y(t)||H(t)},_=function(t){return!K(t)},M=function(t){return K(t)||B(t)&&0===Object.keys(t).length||0===t.length},ye=function(t,e){return null==e&&(e=J),e(t)?t:null},J=function(t){return!M(t)},I=function(t){return"function"==typeof t},V=function(t){return"string"==typeof t},q=function(t){return"number"==typeof t},Q=function(t){return"object"==typeof t&&!!t},B=function(t){return Q(t)||"function"==typeof t},F=function(t){return!(!t||1!==t.nodeType)},N=function(t){return t instanceof jQuery},G=function(t){return B(t)&&I(t.then)},L=function(t){return G(t)&&I(t.resolve)},z=function(t){return _(t)?t:void 0},R=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},$e=function(t){return Array.prototype.slice.call(t)},m=function(t){return R(t)?t.slice():A({},t)},je=function(t){return N(t)?t.get(0):t},ie=function(t,e){return A(m(t),e)},ge=function(t,e){var n,r,o,u;if(o=t?m(t):{},e)for(r in e)n=e[r],u=o[r],_(u)?B(n)&&B(u)&&(o[r]=ge(u,n)):o[r]=n;return o},ve=function(){var e,n,r,o,u,i;for(n=1<=arguments.length?t.call(arguments,0):[],u=void 0,r=0,o=n.length;o>r;r++)if(e=n[r],i=e,I(i)&&(i=i()),_(i)){u=i;break}return u},k=function(t,e){var n,r,o,u;for(u=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){u=n;break}return u},i=function(t,e){var n;return n=k(t,e),W(n)},p=function(t){return Te(t,_)},Ue=function(t){var e;return e={},Te(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},Te=function(t,e){var n;return n=[],x(t,function(t){return e(t)?n.push(t):void 0}),n},be=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,u;for(u=[],t=0,o=r.length;o>t;t++)n=r[t],u.push(e.attr(n));return u}(),k(o,J)},le=function(t){return setTimeout(t,0)},ee=function(t){return t[t.length-1]},c=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Ce=ue(function(){var t,n,r;return t=e("<div>").css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),t.appendTo(document.body),n=t.get(0),r=n.offsetWidth-n.clientWidth,t.remove(),r}),me=function(t){var e;return e=void 0,function(){return null!=t&&(e=t()),t=void 0,e}},Ae=function(t,e,n){var r,o;return o=t.css(Object.keys(e)),t.css(e),r=function(){return t.css(o)},n?(n(),r()):me(r)},j=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),M(n)?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},b=function(t,n,o){var u,i,a,s,l,c;return u=e(t),up.browser.canCssAnimation()?(o=ge(o,{duration:300,delay:0,easing:"ease"}),i=e.Deferred(),s={"transition-property":Object.keys(n).join(", "),"transition-duration":o.duration+"ms","transition-delay":o.delay+"ms","transition-timing-function":o.easing},l=j(u),c=Ae(u,s),u.css(n),i.then(l),i.then(c),u.data(r,i),i.then(function(){return u.removeData(r)}),a=setTimeout(function(){return i.resolve()},o.duration+o.delay),i.then(function(){return clearTimeout(a)}),i):(u.css(n),xe())},r="up-animation-promise",$=function(t){return e(t).each(function(){var t;return(t=e(this).data(r))?t.resolve():void 0})},oe=function(t,n){var r,o,u,i,a,s;return n=ge(n,{relative:!1,inner:!1,full:!1}),n.relative?n.relative===!0?i=t.position():(r=e(n.relative),a=t.offset(),r.is(document)?i=a:(u=r.offset(),i={left:a.left-u.left,top:a.top-u.top})):i=t.offset(),o={left:i.left,top:i.top},n.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),n.full&&(s=c(),o.right=s.width-(o.left+o.width),o.bottom=s.height-(o.top+o.height)),o},h=function(t,e){var n,r,o,u,i;for(u=t.get(0).attributes,i=[],r=0,o=u.length;o>r;r++)n=u[r],i.push(n.specified?e.attr(n.name,n.value):void 0);return i},O=function(t,e){return t.find(e).addBack(e)},P=function(t){return 27===t.keyCode},Ee=function(t,e){return 0===t.indexOf(e)},C=function(t,e){return t.indexOf(e)===t.length-e.length},d=function(t,e){return t.indexOf(e)>=0},l=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},ne=function(t){return t.getResponseHeader("X-Up-Location")},ae=function(t){return t.getResponseHeader("X-Up-Method")},he=function(){var e,n,r,o,u,i;for(i=arguments[0],o=2<=arguments.length?t.call(arguments,1):[],e={},n=0,u=o.length;u>n;n++)r=o[n],i.hasOwnProperty(r)&&(e[r]=i[r]);return e},Z=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},te=function(t){var e;return e=Y(t.button)||0===t.button,e&&Z(t)},xe=function(){var t;return t=e.Deferred(),t.resolve(),t},Se=function(){return xe().promise()},fe=function(){return{is:function(){return!1},attr:function(){},find:function(){return[]}}},ke=function(){var n,r;return n=1<=arguments.length?t.call(arguments,0):[],r=e.when.apply(e,n),r.resolve=function(){return x(n,function(t){return"function"==typeof t.resolve?t.resolve():void 0})},r},Pe=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],r.push(K(t.attr(n))?t.attr(n,o):void 0);return r},we=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},S=function(){return e([])},se=function(t){var n,r,o,u,a,s,l;for(a={},l=[],r=[],o=0,u=t.length;u>o;o++)s=t[o],V(s)?l.push(s):r.push(s);return a.parsed=r,l.length&&(n=l.join(", "),a.parsed.push(n)),a.select=function(){return a.find(void 0)},a.find=function(t){var n,r,o,u,i,s;for(r=S(),i=a.parsed,o=0,u=i.length;u>o;o++)s=i[o],n=t?t.find(s):e(s),r=r.add(n);return r},a.findWithSelf=function(t){var e;return e=a.find(t),a.doesMatch(t)&&(e=e.add(t)),e},a.doesMatch=function(t){var n;return n=e(t),i(a.parsed,function(t){return n.is(t)})},a.seekUp=function(t){var n,r,o;for(o=e(t),n=o,r=void 0;n.length;){if(a.doesMatch(n)){r=n;break}n=n.parent()}return r||S()},a},s=function(e){var n,r,o,u,i,a,s,l,c,p,f,d;return null==e&&(e={}),f=void 0,r=function(){return f={}},r(),s=function(){var n;return n=1<=arguments.length?t.call(arguments,0):[],e.log?(n[0]="["+e.log+"] "+n[0],w.apply(null,n)):void 0},a=function(){return Object.keys(f)},l=function(){return K(e.size)?void 0:I(e.size)?e.size():q(e.size)?e.size:T("Invalid size config: %o",e.size)},o=function(){return K(e.expiry)?void 0:I(e.expiry)?e.expiry():q(e.expiry)?e.expiry:T("Invalid expiry config: %o",e.expiry)},c=function(t){return e.key?e.key(t):t.toString()},De=function(){var t,e,n,r;return r=m(a()),n=l(),n&&r.length>n&&(t=null,e=null,x(r,function(n){var r,o;return r=f[n],o=r.timestamp,!e||e>o?(t=n,e=o):void 0}),t)?delete f[t]:void 0},n=function(t,e){var n;return n=u(t),W(n)?p(e,n):void 0},d=function(){return(new Date).valueOf()},p=function(t,e){var n;return n=c(t),f[n]={timestamp:d(),value:e}},we=function(t){var e;return e=c(t),delete f[e]},i=function(t){var e,n;return e=o(),e?(n=d()-t.timestamp,n<o()):!0},u=function(t,e){var n,r;return null==e&&(e=void 0),r=c(t),(n=f[r])?i(n)?(s("Cache hit for %o",t),n.value):(s("Discarding stale cache entry for %o",t),we(t),e):(s("Cache miss for %o",t),e)},{alias:n,get:u,set:p,remove:we,clear:r,keys:a}},f=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){return A(e,t)},e.reset(),Object.preventExtensions(e),e},ze=function(t){var e,n;return t=je(t),e=t.parentNode,n=$e(t.childNodes),x(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},de=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},D=function(t,n){var r,o,u,i;return r=e(t),o=de(r),u=r.position(),i=o.offset(),r.css({position:"absolute",left:u.left-i.left,top:u.top-i.top+n.scrollTop(),right:"",bottom:""})},a=function(t){var e,n,r;return e=t.toString(),r=new RegExp("\\(([^\\)]*)\\)"),(n=e.match(r))?n[1].split(/\s*,\s*/):T("Could not parse argument names of %o",t)},{argNames:a,offsetParent:de,fixedToAbsolute:D,presentAttr:be,createElement:v,normalizeUrl:pe,normalizeMethod:ce,createElementFromHtml:g,$createElementFromSelector:n,createSelectorFromElement:y,ajax:u,extend:A,copy:m,merge:ie,options:ge,option:ve,error:T,debug:w,warn:Re,each:x,map:re,identity:U,times:Oe,any:i,detect:k,select:Te,compact:p,uniq:Ue,last:ee,isNull:H,isDefined:W,isUndefined:Y,isGiven:_,isMissing:K,isPresent:J,isBlank:M,presence:ye,isObject:B,isFunction:I,isString:V,isElement:F,isJQuery:N,isPromise:G,isDeferred:L,isHash:Q,ifGiven:z,isUnmodifiedKeyEvent:Z,isUnmodifiedMouseEvent:te,nullJquery:fe,unJquery:je,nextFrame:le,measure:oe,temporaryCss:Ae,cssAnimate:b,finishCssAnimate:$,forceCompositing:j,escapePressed:P,copyAttributes:h,findWithSelf:O,contains:d,startsWith:Ee,endsWith:C,isArray:R,toArray:$e,castedAttr:l,locationFromXhr:ne,methodFromXhr:ae,clientSize:c,only:he,trim:De,resolvedPromise:Se,resolvedDeferred:xe,resolvableWhen:ke,setMissingAttrs:Pe,remove:we,memoize:ue,scrollbarWidth:Ce,config:f,cache:s,unwrapElement:ze,multiSelector:se,emptyJQuery:S,evalConsoleTemplate:E}}($),up.error=up.util.error,up.warn=up.util.warn,up.debug=up.util.debug}.call(this),function(){var t=[].slice;up.browser=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h;return m=up.util,p=function(t,n){var r,o,u,i,a,s;return null==n&&(n={}),a=m.option(n.method,"get").toLowerCase(),"get"===a?location.href=t:e.rails?(s=n.target,u=e.rails.csrfToken(),o=e.rails.csrfParam(),r=e("<form method='post' action='"+t+"'></form>"),i="<input name='_method' value='"+a+"' type='hidden' />",m.isDefined(o)&&m.isDefined(u)&&(i+="<input name='"+o+"' value='"+u+"' type='hidden' />"),s&&r.attr("target",s),r.hide().append(i).appendTo("body"),r.submit()):error("Can't fake a "+a.toUpperCase()+" request without Rails UJS")},d=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],m.isDefined(console[r])||(r="log"),o()?console[r].apply(console,e):(n=m.evalConsoleTemplate.apply(m,e),console[r](n))},h=function(){return location.href},u=m.memoize(function(){return m.isDefined(history.pushState)&&"get"===i()}),a=m.memoize(function(){return m.isUndefined(document.addEventListener)}),s=m.memoize(function(){return a()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),n=m.memoize(function(){return"transition"in document.documentElement.style}),r=m.memoize(function(){return"oninput"in document.createElement("input")}),o=m.memoize(function(){return!s()}),l=m.memoize(function(){var t,n,r,o;return o=e.fn.jquery,r=o.split("."),t=parseInt(r[0]),n=parseInt(r[1]),t>=2||1===t&&n>=9}),f=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,m.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},i=m.memoize(function(){return(f("_up_request_method")||"get").toLowerCase()}),c=function(){return!a()&&l()},{url:h,loadPage:p,canPushState:u,canCssAnimation:n,canInputEvent:r,canLogSubstitution:o,isSupported:c,puts:d}}(jQuery)}.call(this),function(){var t=[].slice;up.bus=function(e){var n,r,o,u;return u=up.util,n=function(t,n){var r,o;return null==n&&(n={}),o=e.Event(t,n),r=n.$element||e(document),u.debug("Emitting %o on %o with props %o",t,r,n),r.trigger(o),o},r=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],r=n.apply(null,e),!r.isDefaultPrevented()},o=function(){return up.emit("up:framework:reset")},{emit:n,nobodyPrevents:r,reset:o}}(jQuery),up.reset=up.bus.reset,up.emit=up.bus.emit}.call(this),function(){var t=[].slice;up.magic=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b;return y=up.util,n="up-destroyable",r="up-destroyer",m=[],c=null,b=function(t){return function(n){var r;return r=n.$element||e(this),t.apply(r.get(0),[n,r,s(r)])}},d=function(){var n,r,o,u,i;return r=1<=arguments.length?t.call(arguments,0):[],up.browser.isSupported()?(u=y.copy(r),i=u.length-1,o=u[i],u[i]=b(o),m.push(u),n=e(document),n.on.apply(n,u),function(){return n.off.apply(n,u)}):function(){}},a=[],l=null,i=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(i=e.pop(),n=y.options(e[0],{batch:!1}),a.push({selector:r,callback:i,batch:n.batch})):void 0},o=function(t,e,o){var u;return y.debug("Applying compiler %o on %o",t.selector,o),u=t.callback.apply(o,[e,s(e)]),y.isFunction(u)?(e.addClass(n),e.data(r,u)):void 0},u=function(t){var n,r,u,s;for(y.debug("Compiling fragment %o",t),s=[],r=0,u=a.length;u>r;r++)i=a[r],n=y.findWithSelf(t,i.selector),s.push(n.length?i.batch?o(i,n,n.get()):n.each(function(){return o(i,e(this),this)}):void 0);return s},p=function(t){return y.findWithSelf(t,"."+n).each(function(){var t,n;return t=e(this),(n=t.data(r))()})},s=function(t){var n,r;return n=e(t),r=n.attr("up-data"),y.isString(r)&&""!==y.trim(r)?JSON.parse(r):{}},g=function(){return c=y.copy(m),l=y.copy(a)},v=function(){var t,n,r,o;for(n=0,r=m.length;r>n;n++)t=m[n],y.contains(c,t)||(o=e(document)).off.apply(o,t);return m=y.copy(c),a=y.copy(l)},f=function(t){var n;return n=e(t),up.emit("up:fragment:inserted",{$element:n}),n},h=function(t){return d("keydown","body",function(e){return y.escapePressed(e)?t(e):void 0})},d("ready",function(){return f(document.body)}),d("up:fragment:inserted",function(t){return u(t.$element)}),d("up:fragment:destroy",function(t){return p(t.$element)}),d("up:framework:boot",g),d("up:framework:reset",v),{compiler:i,on:d,hello:f,onEscape:h,data:s}}(jQuery),up.compiler=up.magic.compiler,up.on=up.magic.on,up.hello=up.magic.hello,up.ready=function(){return up.util.error("up.ready no longer exists. Please use up.hello instead.")},up.awaken=function(){return up.util.error("up.awaken no longer exists. Please use up.compiler instead.")}}.call(this),function(){up.history=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),c=void 0,i=void 0,m=function(){return n.reset(),c=void 0,i=void 0},a=function(t){return v.normalizeUrl(t,{hash:!0})},r=function(){return a(up.browser.url())},o=function(t){return a(t)===r()},s=function(t){return i&&(c=i,i=void 0),i=t},d=function(t,e){return u("replace",t,e)},p=function(t,e){return u("push",t,e)},u=function(t,n,u){var i,a;return u=v.options(u,{force:!1}),u.force||!o(n)?up.browser.canPushState()?(i=t+"State",a=e(),v.debug("Changing history to URL %o (%o)",n,t),window.history[i](a,"",n),s(r())):v.error("This browser doesn't support history.pushState"):void 0},e=function(){return{fromUp:!0}},h=function(t){var e,o;return o=r(),v.debug("Restoring state %o (now on "+o+")",t),e=n.popTargets.join(", "),up.replace(e,o,{history:!1,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll})},l=function(t){var e;return v.debug("History state popped to URL %o",r()),s(r()),up.layout.saveScroll({url:c}),e=t.originalEvent.state,(null!=e?e.fromUp:void 0)?h(e):v.debug("Discarding unknown state %o",e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),d(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.compiler("[up-back]",function(t){return v.isPresent(c)?(v.setMissingAttrs(t,{"up-href":c,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",m),{config:n,defaults:function(){return v.error("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:p,replace:d,url:r,previousUrl:function(){return c},normalizeUrl:a}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var SCROLL_PROMISE_KEY,anchoredRight,config,finishScrolling,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealOrRestoreScroll,saveScroll,scroll,scrollTops,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=u.cache({size:30,key:up.history.normalizeUrl}),reset=function(){return config.reset(),lastScrollTops.clear()},SCROLL_PROMISE_KEY="up-scroll-promise",scroll=function(t,e,n){var r,o,i,a,s;return r=$(t),n=u.options(n),i=u.option(n.duration,config.duration),a=u.option(n.easing,config.easing),finishScrolling(r),i>0?(o=$.Deferred(),r.data(SCROLL_PROMISE_KEY,o),o.then(function(){return r.removeData(SCROLL_PROMISE_KEY),r.finish()}),s={scrollTop:e},r.get(0)===document&&(r=$("html, body")),r.animate(s,{duration:i,easing:a,complete:function(){return o.resolve()}}),o):(r.scrollTop(e),u.resolvedDeferred())},finishScrolling=function(t){return $(t).each(function(){var t;return(t=$(this).data(SCROLL_PROMISE_KEY))?t.resolve():void 0})},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||u.error("Fixed element %o must have a CSS attribute %o",n,e),parseInt(r)+n.height()},e=function(){var t,e,o,u;for(o=$(config.fixedTop.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"top"));return u}(),t=function(){var t,e,o,u;for(o=$(config.fixedBottom.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"bottom"));return u}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return u.debug("Revealing %o",t),e=u.options(e),n=$(t),r=e.viewport?$(e.viewport):viewportOf(n),m=u.option(e.snap,config.snap),v=r.is(document),h=v?u.clientSize().height:r.height(),p=r.scrollTop(),s=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+c,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||e.top)&&(s=i-l.top),m>s&&(s=0),s!==p?scroll(r,s,e):u.resolvedDeferred()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t){var e,n;return e=$(t),n=viewportSelector().seekUp(e),n.length||u.error("Could not find viewport for %o",e),n},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().findWithSelf(e)},viewports=function(){return viewportSelector().select()},scrollTops=function(){var t,e,n,r,o,u,i;for(u={},o=config.viewports,e=0,r=o.length;r>e;e++)i=o[e],t=$(i),t.length&&(n=i,i===document&&(n="document"),u[n]=t.scrollTop());return u},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),u.debug("Saving scroll positions for URL %o: %o",n,e),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i,a,s,l,c;null==t&&(t={}),c=up.history.url(),o=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),o=e.add(n)):o=viewports(),l=lastScrollTops.get(c),u.debug("Restoring scroll positions for URL %o (viewports are %o, saved tops are %o)",c,o,l);for(i in l)s=l[i],a="document"===i?document:i,r=o.filter(a),scroll(r,s,{duration:0});return u.resolvedDeferred()},revealOrRestoreScroll=function(t,e){var n;return n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal?reveal(n):u.resolvedDeferred()},up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,scroll:scroll,finishScrolling:finishScrolling,config:config,defaults:function(){return u.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal}.call(this),function(){up.flow=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,d=function(e,n){var r;return r=t(e),v.isPresent(n)&&(n=v.normalizeUrl(n)),r.attr("up-source",n)},m=function(e){var n;return n=t(e).closest("[up-source]"),v.presence(n.attr("up-source"))||up.browser.url()},f=function(e,n,r){var o,u,i;return v.debug("Replace %o with %o (options %o)",e,n,r),r=v.options(r),i=v.presence(e)?e:v.createSelectorFromElement(t(e)),up.browser.canPushState()||r.history===!1?(u={url:n,method:r.method,selector:i,cache:r.cache,preload:r.preload},o=up.proxy.ajax(u),o.done(function(t,e,o){var s,l;return(s=v.locationFromXhr(o))&&(v.debug("Location from server: %o",s),l={url:s,method:v.methodFromXhr(o),selector:i},up.proxy.alias(u,l),n=s),r.history!==!1&&(r.history=n),r.source!==!1&&(r.source=n),r.preload?void 0:a(i,t,r)}),o.fail(v.error),o):(r.preload||up.browser.loadPage(n,v.only(r,"method")),v.resolvedPromise())},a=function(t,e,n){var r,u,i,a,s,p,f,d;for(n=v.options(n,{historyMethod:"push"}),n.source=v.option(n.source,n.history),p=c(e),n.title||(n.title=p.title()),n.saveScroll!==!1&&up.layout.saveScroll(),s=l(t,n),f=[],i=0,a=s.length;a>i;i++)d=s[i],u=o(d.selector),r=p.find(d.selector).first(),f.push(h(u,r,d.pseudoClass,d.transition,n));return f},o=function(t){return u(".up-popup "+t)||u(".up-modal "+t)||u(t)||i(t)},i=function(t){var e;return e="Could not find selector %o in current body HTML","#"===e[0]&&(e+=" (avoid using IDs)"),v.error(e,t)},c=function(e){var n;return n=v.createElementFromHtml(e),{title:function(){var t;return null!=(t=n.querySelector("title"))?t.textContent:void 0},find:function(r){var o;return(o=n.querySelector(r))?t(o):v.error("Could not find selector %o in response %o",r,e)}}},r=function(t,n){return"function"==typeof n.insert&&n.insert(t),n.history&&(n.title&&(document.title=n.title),up.history[n.historyMethod](n.history)),n.source!==!1&&d(t,n.source),e(t),up.hello(t)},h=function(t,e,o,u,i){var a,s;return u||(u="none"),up.motion.finish(t),o?(s="before"===o?"prepend":"append",a=e.contents().wrap('<span class="up-insertion"></span>').parent(),t[s](a),v.copyAttributes(e,t),r(a.children(),i),up.layout.revealOrRestoreScroll(a,i).then(function(){return up.animate(a,u,i)}).then(function(){v.unwrapElement(a)})):n(t,{animation:function(){return e.insertBefore(t),r(e,i),t.is("body")&&"none"!==u&&v.error("Cannot apply transitions to body-elements (%o)",u),up.morph(t,e,u,i)}})},l=function(t,e){var n,r,o,u,i,a,s,l,c,p,f;for(p=e.transition||e.animation||"none",n=/\ *,\ */,r=t.split(n),v.isPresent(p)&&(f=p.split(n)),a=[],o=u=0,i=r.length;i>u;o=++u)s=r[o],l=s.match(/^(.+?)(?:\:(before|after))?$/),c=f[o]||v.last(f),a.push({selector:l[1],pseudoClass:l[2],transition:c});return a},e=function(t){var e,n;return n="[autofocus]:last",e=v.findWithSelf(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},s=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},u=function(e){var n,r,o,u,i,a;for(u=t(e).get(),r=void 0,i=0,a=u.length;a>i;i++)if(o=u[i],n=t(o),s(n)){r=n;break}return r},n=function(e,n){var r,o,u;return r=t(e),up.bus.nobodyPrevents("up:fragment:destroy",{$element:r})?(n=v.options(n,{animation:"none"}),o=up.motion.animateOptions(n),r.addClass("up-destroying"),v.isPresent(n.url)&&up.history.push(n.url),v.isPresent(n.title)&&(document.title=n.title),u=v.presence(n.animation,v.isDeferred)||up.motion.animate(r,n.animation,o),u.then(function(){return up.emit("up:fragment:destroyed",{$element:r}),r.remove()}),u):t.Deferred()},p=function(t,e){var n;return e=v.options(e,{cache:!1}),n=e.url||m(t),f(t,n,e)},up.on("ready",function(){return d(document.body,up.browser.url())}),{replace:f,reload:p,destroy:n,implant:a,first:u}}(jQuery),up.replace=up.flow.replace,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.first=up.flow.first}.call(this),function(){up.motion=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S;return x=up.util,u={},s={},k={},l={},a=x.config({duration:300,delay:0,easing:"ease"}),v=function(){return u=x.copy(s),k=x.copy(l),a.reset()},n=function(e,o,u){var a;return a=t(e),p(a),u=r(u),("none"===o||o===!1)&&m(),x.isFunction(o)?i(o(a,u),o):x.isString(o)?n(a,c(o),u):x.isHash(o)?x.cssAnimate(a,o,u):x.error("Unknown animation type %o",o)},r=function(t,e){var n;return null==e&&(e=null),t=x.options(t),n={},n.easing=x.option(t.easing,null!=e?e.attr("up-easing"):void 0,a.easing),n.duration=Number(x.option(t.duration,null!=e?e.attr("up-duration"):void 0,a.duration)),n.delay=Number(x.option(t.delay,null!=e?e.attr("up-delay"):void 0,a.delay)),n},c=function(t){return u[t]||x.error("Unknown animation %o",t)},e="up-ghosting-promise",S=function(t,n,r,o){var u,i,a,s,l,c,p;return s=void 0,i=void 0,l=void 0,a=void 0,u=up.layout.viewportOf(t),x.temporaryCss(n,{display:"none"},function(){return s=h(t,u),s.$ghost.addClass("up-destroying"),s.$bounds.addClass("up-destroying"),l=u.scrollTop()}),x.temporaryCss(t,{display:"none"},function(){return up.layout.revealOrRestoreScroll(n,r),i=h(n,u),a=u.scrollTop()}),s.moveTop(a-l),t.hide(),p=x.temporaryCss(n,{visibility:"hidden"}),c=o(s.$ghost,i.$ghost),t.data(e,c),n.data(e,c),c.then(function(){return t.removeData(e),n.removeData(e),s.$bounds.remove(),i.$bounds.remove(),p()}),c},p=function(e){return t(e).each(function(){var e;return e=t(this),x.finishCssAnimate(e),f(e)})},f=function(t){var n;return(n=t.data(e))?(x.debug("Canceling existing ghosting on %o",t),"function"==typeof n.resolve?n.resolve():void 0):void 0},i=function(t,e){return x.isDeferred(t)?t:x.error("Did not return a promise with .then and .resolve methods: %o",e)},d=function(e,o,a,s){var l,c,f,m,h,v,b;return c=t(e),l=t(o),h=x.only(s,"reveal","restoreScroll"),h=x.extend(h,r(s)),up.browser.canCssAnimation()?(p(c),p(l),"none"===a||a===!1||(f=u[a])?(m=y(c,l,h),m.then(function(){return n(l,f||"none",s)}),m):(b=x.presence(a,x.isFunction)||k[a])?S(c,l,h,function(t,e){var n;return n=b(t,e,h),i(n,a)}):x.isString(a)&&a.indexOf("/")>=0?(v=a.split("/"),b=function(t,e,r){return g(n(t,v[0],r),n(e,v[1],r))},d(c,l,b,h)):x.error("Unknown transition %o",a)):y(c,l,h)},y=function(t,e,n){return t.hide(),up.layout.revealOrRestoreScroll(e,n)},h=function(e,n){var r,o,u,i,a,s,l,c,p;for(i=x.measure(e,{relative:!0,inner:!0}),u=e.clone(),u.find("script").remove(),u.css({position:"static"===e.css("position")?"static":"relative",top:"",right:"",bottom:"",left:"",width:"100%",height:"100%"}),u.addClass("up-ghost"),r=t('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(i),p=i.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},u.appendTo(r),r.insertBefore(e),c(e.offset().top-u.offset().top),o=up.layout.fixedChildren(u),s=0,l=o.length;l>s;s++)a=o[s],x.fixedToAbsolute(a,n);return{$ghost:u,$bounds:r,moveTop:c}},w=function(t,e){return k[t]=e},o=function(t,e){return u[t]=e},b=function(){return s=x.copy(u),l=x.copy(k)},g=x.resolvableWhen,m=x.resolvedDeferred,o("none",m),o("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),o("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),o("move-to-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css({"margin-top":"0px"}),n(t,{"margin-top":"-"+o+"px"},e)}),o("move-from-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css({"margin-top":"-"+o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css({"margin-top":"0px"}),n(t,{"margin-top":o+"px"},e)}),o("move-from-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css({"margin-top":o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css({"margin-left":"0px"}),n(t,{"margin-left":"-"+o+"px"},e)}),o("move-from-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css({"margin-left":"-"+o+"px"}),n(t,{"margin-left":"0px"},e)}),o("move-to-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css({"margin-left":"0px"}),n(t,{"margin-left":o+"px"},e)}),o("move-from-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css({"margin-left":o+"px"}),n(t,{"margin-left":"0px"},e)}),o("roll-down",function(t,e){var r,o;return r=t.height(),o=x.temporaryCss(t,{height:"0px",overflow:"hidden"}),n(t,{height:r+"px"},e).then(o)}),w("none",m),w("move-left",function(t,e,r){return g(n(t,"move-to-left",r),n(e,"move-from-right",r))}),w("move-right",function(t,e,r){return g(n(t,"move-to-right",r),n(e,"move-from-left",r))}),w("move-up",function(t,e,r){return g(n(t,"move-to-top",r),n(e,"move-from-bottom",r))}),w("move-down",function(t,e,r){return g(n(t,"move-to-bottom",r),n(e,"move-from-top",r))}),w("cross-fade",function(t,e,r){return g(n(t,"fade-out",r),n(e,"fade-in",r))}),up.on("up:framework:boot",b),up.on("up:framework:reset",v),{morph:d,animate:n,animateOptions:r,finish:p,transition:w,animation:o,config:a,defaults:function(){return x.error("up.motion.defaults(...) no longer exists. Set values on he up.motion.config property instead.")},none:m,when:g,prependCopy:h}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate
2
- }.call(this),function(){up.proxy=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,P,E,A,O;return O=up.util,e=void 0,C=void 0,i=void 0,x=void 0,a=void 0,m=O.config({busyDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5}),l=function(t){return k(t),[t.url,t.method,t.data,t.selector].join("|")},s=O.cache({size:function(){return m.cacheSize},expiry:function(){return m.cacheExpiry},key:l,log:"up.proxy"}),h=s.get,E=s.set,T=s.remove,d=s.clear,p=function(){return clearTimeout(C),C=null},c=function(){return clearTimeout(i),i=null},P=function(){return e=null,p(),c(),x=0,m.reset(),a=!1,s.clear()},P(),o=s.alias,k=function(t){return t._normalized||(t.method=O.normalizeMethod(t.method),t.url&&(t.url=O.normalizeUrl(t.url)),t.selector||(t.selector="body"),t._normalized=!0),t},r=function(t){var e,n,r,o,u;return e=t.cache===!0,n=t.cache===!1,u=O.only(t,"url","method","data","selector","_normalized"),r=!0,g(u)||e?(o=h(u))&&!n?r="pending"===o.state():(o=y(u),E(u,o),o.fail(function(){return T(u)})):(d(),o=y(u)),r&&!t.preload&&(w(),o.always(b)),o},n=["GET","OPTIONS","HEAD"],v=function(){return 0===x},u=function(){return x>0},w=function(){var t,e;return e=v(),x+=1,e?(t=function(){return u()?(up.emit("up:proxy:busy"),a=!0):void 0},m.busyDelay>0?i=setTimeout(t,m.busyDelay):t()):void 0},b=function(){return x-=1,v()&&a?(up.emit("up:proxy:idle"),a=!1):void 0},y=function(t){var e;return O.debug("Loading URL %o",t.url),up.emit("up:proxy:load",t),e=O.ajax(t),e.always(function(){return up.emit("up:proxy:receive",t)}),e},g=function(t){return k(t),O.contains(n,t.method)},f=function(t){var n,r;return r=parseInt(O.presentAttr(t,"up-delay"))||m.preloadDelay,t.is(e)?void 0:(e=t,p(),n=function(){return S(t),e=null},A(n,r))},A=function(t,e){return C=setTimeout(t,e)},S=function(e,n){var r,o;return r=t(e),n=O.options(n),o=up.link.followMethod(r,n),g({method:o})?(O.debug("Preloading %o",r),n.preload=!0,up.follow(r,n)):(O.debug("Won't preload %o due to unsafe method %o",r,o),O.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(t,e){return up.link.childClicked(t,e)?void 0:f(e)}),up.on("up:framework:reset",P),{preload:S,ajax:r,get:h,alias:o,clear:d,remove:T,idle:v,busy:u,config:m,defaults:function(){return O.error("up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.")}}}(jQuery)}.call(this),function(){up.link=function($){var childClicked,follow,followMethod,makeFollowable,shouldProcessLinkEvent,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target"),"body"),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),u.castedAttr(n,"up-animation")),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e=u.merge(e,up.motion.animateOptions(e,n)),up.replace(r,o,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},up.on("click","a[up-target], [up-href][up-target]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.on("mousedown","a[up-instant], [up-href][up-instant]",function(t,e){return shouldProcessLinkEvent(t,e)?(t.preventDefault(),follow(e)):void 0}),childClicked=function(t,e){var n,r;return n=$(t.target),r=n.closest("a, [up-href]"),r.length&&e.find(r).length},shouldProcessLinkEvent=function(t,e){return u.isUnmodifiedMouseEvent(t)&&!childClicked(t,e)},makeFollowable=function(t){var e;return e=$(t),u.isMissing(e.attr("up-target"))&&u.isMissing(e.attr("up-follow"))?e.attr("up-follow",""):void 0},up.on("click","a[up-follow], [up-href][up-follow]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.compiler("[up-expand]",function(t){var e,n,r,o,i,a,s,l;for(o=t.find("a, [up-href]").get(0),o||u.error("No link to expand within %o",t),l=/^up-/,a={},a["up-href"]=$(o).attr("href"),s=o.attributes,n=0,r=s.length;r>n;n++)e=s[n],i=e.name,i.match(l)&&(a[i]=e.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}),up.compiler("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),e={"up-preload":"true","up-instant":"true"},n===!0?e["up-follow"]="":e["up-target"]=n,u.setMissingAttrs(t,e),t.removeAttr("up-dash")}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,childClicked:childClicked,followMethod:followMethod}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){up.form=function($){var observe,submit,u;return u=up.util,submit=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m;return n=$(t).closest("form"),e=u.options(e),c=u.option(e.target,n.attr("up-target"),"body"),r=u.option(e.failTarget,n.attr("up-fail-target"),function(){return u.createSelectorFromElement(n)}),i=u.option(e.history,u.castedAttr(n,"up-history"),!0),p=u.option(e.transition,u.castedAttr(n,"up-transition")),o=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),p),a=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),s={},s.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),s.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),s.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),s=u.extend(s,up.motion.animateOptions(e,n)),m=u.option(e.cache,u.castedAttr(n,"up-cache")),d=u.option(e.url,n.attr("action"),up.browser.url()),n.addClass("up-active"),up.browser.canPushState()||i===!1?(l={url:d,method:a,data:n.serialize(),selector:c,cache:m},f=function(t){var e;return d=void 0,u.isGiven(i)&&(i===!1||u.isString(i)?d=i:(e=u.locationFromXhr(t))?d=e:"GET"===l.type&&(d=l.url+"?"+l.data)),u.option(d,!1)},up.proxy.ajax(l).always(function(){return n.removeClass("up-active")}).done(function(t,e,n){var r;return r=u.merge(s,{history:f(n),transition:p}),up.flow.implant(c,t,r)}).fail(function(t){var e,n;return n=t.responseText,e=u.merge(s,{transition:o}),up.flow.implant(r,n,e)})):void n.get(0).submit()},observe=function(fieldOrSelector,options){var $field,callback,callbackPromise,callbackTimer,changeEvents,check,clearTimer,codeOnChange,delay,knownValue,nextCallback,runNextCallback;return $field=$(fieldOrSelector),options=u.options(options),delay=u.option($field.attr("up-delay"),options.delay,0),delay=parseInt(delay),knownValue=null,callback=null,callbackTimer=null,(codeOnChange=$field.attr("up-observe"))?callback=function(value,$field){return eval(codeOnChange)}:options.change?callback=options.change:u.error("up.observe: No change callback given"),callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var t;return nextCallback?(t=nextCallback(),nextCallback=null,t):void 0},check=function(){var t,e;return e=$field.val(),t=u.isNull(knownValue),knownValue===e||(knownValue=e,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($field.get(0),[e,$field])},callbackTimer=setTimeout(function(){return callbackPromise.then(function(){var t;return t=runNextCallback(),callbackPromise=u.isPromise(t)?t:u.resolvedPromise()})},delay))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$field.on(changeEvents,check),check(),clearTimer},up.on("submit","form[up-target]",function(t,e){return t.preventDefault(),submit(e)}),up.compiler("[up-observe]",function(t){return observe(t)}),{submit:submit,observe:observe}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe}.call(this),function(){up.popup=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h;return m=up.util,s=void 0,i=function(){var e;return e=t(".up-popup"),e.attr("up-covered-url")},o=m.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right"}),f=function(){return r(),o.reset()},d=function(t,e,n){var r,o;return o=m.measure(t,{full:!0}),r=function(){switch(n){case"bottom-right":return{right:o.right,top:o.top+o.height};case"bottom-left":return{left:o.left,top:o.bottom+o.height};case"top-right":return{right:o.right,bottom:o.top};case"top-left":return{left:o.left,bottom:o.top};default:return m.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r),c(e)},c=function(t){var e,n,r,o,u,i,a;if(n=m.measure(t,{full:!0}),r=null,o=null,n.right<0&&(r=-n.right),n.bottom<0&&(o=-n.bottom),n.left<0&&(r=n.left),n.top<0&&(o=n.top),r&&((u=parseInt(t.css("left")))?t.css("left",u-r):(i=parseInt(t.css("right")))&&t.css("right",i+r)),o){if(a=parseInt(t.css("top")))return t.css("top",a-o);if(e=parseInt(t.css("bottom")))return t.css("bottom",e+o)}},p=function(){var e;return e=t(".up-popup"),e.attr("up-covered-url",up.browser.url()),e.attr("up-covered-title",document.title)},l=function(){var e;return e=t(".up-popup"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},a=function(t,e,n){var r,o;return o=m.$createElementFromSelector(".up-popup"),n&&o.attr("up-sticky",""),r=m.$createElementFromSelector(e),r.appendTo(o),o.appendTo(document.body),p(),o.hide(),o},h=function(t,e,n,r,o){return e.show(),d(t,e,n),up.animate(e,r,o)},e=function(e,n){var u,i,s,l,c,p,f,d,v;return u=t(e),n=m.options(n),v=m.option(n.url,u.attr("href")),f=m.option(n.target,u.attr("up-popup"),"body"),p=m.option(n.position,u.attr("up-position"),o.position),l=m.option(n.animation,u.attr("up-animation"),o.openAnimation),d=m.option(n.sticky,m.castedAttr(u,"up-sticky")),c=up.browser.canPushState()?m.option(n.history,m.castedAttr(u,"up-history"),!1):!1,s=up.motion.animateOptions(n,u),r(),i=a(u,f,d),up.replace(f,v,{history:c,insert:function(){return h(u,i,p,l,s)}})},r=function(e){var n;return n=t(".up-popup"),n.length?(e=m.options(e,{animation:o.closeAnimation,url:n.attr("up-covered-url"),title:n.attr("up-covered-title")}),s=void 0,up.destroy(n,e)):m.resolvedPromise()},n=function(){return t(".up-popup").is("[up-sticky]")?void 0:(l(),r())},u=function(e){var n;return n=t(e),n.closest(".up-popup").length>0},up.on("click","a[up-popup]",function(t,n){return t.preventDefault(),n.is(".up-current")?r():e(n)}),up.on("click","body",function(e){var n;return n=t(e.target),n.closest(".up-popup").length||n.closest("[up-popup]").length?void 0:r()}),up.on("up:fragment:inserted",function(t,e){var r;return u(e)?(r=e.attr("up-source"))?s=r:void 0:n()}),up.magic.onEscape(function(){return r()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-popup").length?(r(),t.preventDefault()):void 0}),up.on("up:framework:reset",f),{attach:e,close:r,url:function(){return s},coveredUrl:i,config:o,defaults:function(){return m.error("up.popup.defaults(...) no longer exists. Set values on he up.popup.config property instead.")},contains:u,open:function(){return up.error("up.popup.open no longer exists. Please use up.popup.attach instead.")},source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")}}}(jQuery)}.call(this),function(){up.modal=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y;return h=up.util,r=h.config({maxWidth:null,minWidth:null,width:null,height:null,openAnimation:"fade-in",closeAnimation:"fade-out",closeLabel:"\xd7",template:function(t){return'<div class="up-modal">\n <div class="up-modal-dialog">\n <div class="up-modal-close" up-close>'+t.closeLabel+'</div>\n <div class="up-modal-content"></div>\n </div>\n</div>'}}),a=void 0,u=function(){var e;return e=t(".up-modal"),e.attr("up-covered-url")},f=function(){return n(),a=void 0,r.reset()},m=function(){var t;return t=r.template,h.isFunction(t)?t(r):t},p=function(){var e;return e=t(".up-modal"),e.attr("up-covered-url",up.browser.url()),e.attr("up-covered-title",document.title)},s=function(){var e;return e=t(".up-modal"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},i=function(e){var n,r,o,u;return o=t(m()),e.sticky&&o.attr("up-sticky",""),o.attr("up-covered-url",up.browser.url()),o.attr("up-covered-title",document.title),r=o.find(".up-modal-dialog"),h.isPresent(e.width)&&r.css("width",e.width),h.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),h.isPresent(e.height)&&r.css("height",e.height),n=o.find(".up-modal-content"),u=h.$createElementFromSelector(e.selector),u.appendTo(n),o.appendTo(document.body),p(),o.hide(),o},v=[],d=function(){var e,n,r,o;return r=h.scrollbarWidth(),e=parseInt(t("body").css("padding-right")),n=r+e,o=h.temporaryCss(t("body"),{"padding-right":n+"px","overflow-y":"hidden"}),v.push(o),up.layout.anchoredRight().each(function(){var e,n,o,u;return e=t(this),n=parseInt(e.css("right")),o=r+n,u=h.temporaryCss(e,{right:o}),v.push(u)})},g=function(t,e,n){var r;return d(),t.show(),r=up.animate(t,e,n),r.then(function(){return up.emit("up:modal:opened")})},l=function(e,n){return n=h.options(n),n.$link=t(e),c(n)},y=function(t,e){return e=h.options(e),e.url=t,c(e)},c=function(e){var o,u,a,s,l,c,p,f,d,m,v;return e=h.options(e),o=h.option(e.$link,h.nullJquery()),m=h.option(e.url,o.attr("up-href"),o.attr("href")),f=h.option(e.target,o.attr("up-modal"),"body"),v=h.option(e.width,o.attr("up-width"),r.width),p=h.option(e.maxWidth,o.attr("up-max-width"),r.maxWidth),l=h.option(e.height,o.attr("up-height"),r.height),s=h.option(e.animation,o.attr("up-animation"),r.openAnimation),d=h.option(e.sticky,h.castedAttr(o,"up-sticky")),c=up.browser.canPushState()?h.option(e.history,h.castedAttr(o,"up-history"),!0):!1,a=up.motion.animateOptions(e,o),n(),up.bus.nobodyPrevents("up:modal:open",{url:m})?(u=i({selector:f,width:v,maxWidth:p,height:l,sticky:d}),up.replace(f,m,{history:c,insert:function(){return g(u,s,a)}})):t.Deferred()},n=function(e){var n,o;return n=t(".up-modal"),n.length?up.bus.nobodyPrevents("up:modal:close",{$element:n})?(e=h.options(e,{animation:r.closeAnimation,url:n.attr("up-covered-url"),title:n.attr("up-covered-title")}),a=void 0,o=up.destroy(n,e),o.then(function(){for(var t;t=v.pop();)t();return up.emit("up:modal:closed")}),o):t.Deferred():h.resolvedDeferred()},e=function(){return t(".up-modal").is("[up-sticky]")?void 0:(s(),n())},o=function(e){var n;return n=t(e),n.closest(".up-modal").length>0},up.on("click","a[up-modal]",function(t,e){return t.preventDefault(),e.is(".up-current")?n():l(e)}),up.on("click","body",function(e){var r;return r=t(e.target),r.closest(".up-modal-dialog").length||r.closest("[up-modal]").length?void 0:n()}),up.on("up:fragment:inserted",function(t,n){var r;if(o(n)){if(r=n.attr("up-source"))return a=r}else if(!up.popup.contains(n))return e()}),up.magic.onEscape(function(){return n()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-modal").length?(n(),t.preventDefault()):void 0}),up.on("up:framework:reset",f),{visit:y,follow:l,open:function(){return up.error("up.modal.open no longer exists. Please use either up.modal.follow or up.modal.visit.")},close:n,url:function(){return a},coveredUrl:u,config:r,defaults:function(){return h.error("up.modal.defaults(...) no longer exists. Set values on he up.modal.config property instead.")},contains:o,source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")}}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,u;return u=up.util,o=function(t,e,n){var r,o,i;return o=u.measure(t),i=u.measure(e),r=function(){switch(n){case"top":return{left:o.left+.5*(o.width-i.width),top:o.top-i.height};case"bottom":return{left:o.left+.5*(o.width-i.width),top:o.top+o.height};default:return u.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r)},r=function(t){var e;return e=u.$createElementFromSelector(".up-tooltip"),u.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),e},e=function(e,i){var a,s,l,c,p,f,d;return null==i&&(i={}),a=t(e),p=u.option(i.html,a.attr("up-tooltip-html")),d=u.option(i.text,a.attr("up-tooltip"),a.attr("title")),f=u.option(i.position,a.attr("up-position"),"top"),c=u.option(i.animation,u.castedAttr(a,"up-animation"),"fade-in"),l=up.motion.animateOptions(i,a),n(),s=r({text:d,html:p}),o(a,s,f),up.animate(s,c,l)},n=function(e){var n;return n=t(".up-tooltip"),n.length?(e=u.options(e,{animation:"fade-out"}),e=u.merge(e,up.motion.animateOptions(e)),up.destroy(n,e)):void 0},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseover",function(){return e(t)}),t.on("mouseout",function(){return n()})}),up.on("click","body",function(){return n()}),up.on("up:framework:reset",n),up.magic.onEscape(function(){return n()}),{attach:e,close:n,open:function(){return u.error("up.tooltip.open no longer exists. Use up.tooltip.attach instead.")}}}(jQuery)}.call(this),function(){up.navigation=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;return h=up.util,i=h.config({currentClasses:["up-current"]}),p=function(){return i.reset()},a=function(){var t;return t=i.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},e="up-active",n=["a","[up-href]","[up-alias]"],o=n.join(", "),u=function(){var t,e,r;for(r=[],t=0,e=n.length;e>t;t++)m=n[t],r.push(m+"[up-instant]");return r}().join(", "),r="."+e,c=function(t){return h.isPresent(t)?h.normalizeUrl(t,{search:!1,stripTrailingSlash:!0}):void 0},d=function(t){var e,n,r,o,u,i,a,s,l,p;for(s=[],i=["href","up-href","up-alias"],n=0,o=i.length;o>n;n++)if(e=i[n],l=h.presentAttr(t,e))for(p="up-alias"===e?l.split(" "):[l],r=0,u=p.length;u>r;r++)a=p[r],"#"!==a&&(a=c(a),s.push(a));return s},g=function(t){var e,n,r,o;return t=h.compact(t),r=function(t){return"*"===t.substr(-1)?n(t.slice(0,-1)):e(t)},e=function(e){return h.contains(t,e)},n=function(e){return h.detect(t,function(t){return 0===t.indexOf(e)})},o=function(t){return h.detect(t,r)},{matchesAny:o}},l=function(){var e,n;return e=g([c(up.browser.url()),c(up.modal.url()),c(up.modal.coveredUrl()),c(up.popup.url()),c(up.popup.coveredUrl())]),n=a(),h.each(t(o),function(r){var o,u;return o=t(r),u=d(o),e.matchesAny(u)?o.addClass(n):o.removeClass(n)})},f=function(t){return v(),t=s(t),t.addClass(e)},s=function(t){return h.presence(t.parents(o))||t},v=function(){return t(r).removeClass(e)},up.on("click",o,function(t,e){return h.isUnmodifiedMouseEvent(t)&&!e.is("[up-instant]")?f(e):void 0}),up.on("mousedown",u,function(t,e){return h.isUnmodifiedMouseEvent(t)?f(e):void 0}),up.on("up:fragment:inserted",function(){return v(),l()}),up.on("up:fragment:destroyed",function(t,e){return e.is(".up-modal, .up-popup")?l():void 0}),up.on("up:framework:reset",p),{config:i,defaults:function(){return h.error("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")}}}(jQuery)}.call(this),function(){up.browser.isSupported()&&(up.emit("up:framework:boot"),up.emit("up:framework:booted"))}.call(this),function(){}.call(this);
1
+ (function(){window.up={}}).call(this),function(){var t=[].slice;up.util=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,A,P,E,O,$,D,j,U,R,z,M,L,W,F,I,_,Q,K,N,H,q,B,J,G,X,V,Y,Z,te,ee,ne,re,oe,ue,ie,ae,se,le,ce,pe,fe,de,me,he,ve,ge,ye,be,we,ke,xe,Se,Ce,Te,Ae,Pe,Ee,Oe,$e,De,je,Ue,Re;return oe=function(e){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],r?n:(r=!0,n=e.apply(null,o))}},u=function(t){return t=d(t),t.selector&&(t.headers={"X-Up-Selector":t.selector}),e.ajax(t)},G=function(t,e){return(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},ce=function(t,n){var r,o,u;return r=null,X(t)?(r=e("<a>").attr({href:t}).get(0),z(r.hostname)&&(r.href=r.href)):r=De(t),o=r.protocol+"//"+r.hostname,G(r.protocol,r.port)||(o+=":"+r.port),u=r.pathname,"/"!==u[0]&&(u="/"+u),(null!=n?n.stripTrailingSlash:void 0)===!0&&(u=u.replace(/\/$/,"")),o+=u,(null!=n?n.hash:void 0)===!0&&(o+=r.hash),(null!=n?n.search:void 0)!==!1&&(o+=r.search),o},le=function(t){return t?t.toUpperCase():"GET"},n=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;for(v=t.split(/[ >]/),o=null,p=f=0,m=v.length;m>f;p=++f){for(a=v[p],i=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",u=[],c=null,d=0,h=i.length;h>d;d++)switch(s=i[d],s[0]){case".":u.push(s.substr(1));break;case"#":c=s.substr(1);break;default:g=s}l="<"+g,u.length&&(l+=' class="'+u.join(" ")+'"'),c&&(l+=' id="'+c+'"'),l+=">",n=e(l),r&&n.appendTo(r),0===p&&(o=n),r=n}return o},h=function(t,e){var n;return n=document.createElement(t),B(e)&&(n.innerHTML=e),n},b=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["debug",n].concat(t.call(e)))},Re=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["warn",n].concat(t.call(e)))},C=function(){var n,r,o,u;throw r=1<=arguments.length?t.call(arguments,0):[],r[0]="[UP] "+r[0],(u=up.browser).puts.apply(u,["error"].concat(t.call(r))),o=A.apply(null,r),n=ge(e(".up-error"))||e('<div class="up-error"></div>').prependTo("body"),n.addClass("up-error"),n.text(o),new Error(o)},o=/\%[odisf]/g,A=function(){var e,n,r,u;return e=1<=arguments.length?t.call(arguments,0):[],u=e[0],n=0,r=80,u.replace(o,function(){var t,o;return n+=1,t=e[n],o=typeof t,"string"===o?(t=t.replace(/\s+/g," "),t.length>r&&(t=t.substr(0,r)+"\u2026"),t='"'+t+'"'):t="undefined"===o?"undefined":"number"===o||"function"===o?t.toString():JSON.stringify(t),t.length>r&&(t=t.substr(0,r)+" \u2026",("object"===o||"function"===o)&&(t+=" }")),t})},g=function(t){var e,n,r,o,u,i,a;for(b("Creating selector from element %o",t),n=(e=t.attr("class"))?e.split(" "):[],r=t.attr("id"),a=t.prop("tagName").toLowerCase(),r&&(a+="#"+r),o=0,i=n.length;i>o;o++)u=n[o],a+="."+u;return a},v=function(t){var e,n,r,o,u,i,a,s,l,c,p,f;return l=function(t){return"<"+t+"(?: [^>]*)?>"},i=function(t){return"</"+t+">"},e="(?:.|\\n)*?",u=function(t){return"("+t+")"},f=new RegExp(l("head")+e+l("title")+u(e)+i("title")+e+i("body"),"i"),o=new RegExp(l("body")+u(e)+i("body"),"i"),(r=t.match(o))?(s=document.createElement("html"),n=h("body",r[1]),s.appendChild(n),(p=t.match(f))&&(a=h("head"),s.appendChild(a),c=h("title",p[1]),a.appendChild(c)),s):h("div",t)},P=e.extend,$e=e.trim,k=function(t,e){var n,r,o,u,i;for(i=[],n=o=0,u=t.length;u>o;n=++o)r=t[n],i.push(e(r,n));return i},ne=k,j=function(t){return t},Ee=function(t,e){var n,r,o,u;for(u=[],n=r=0,o=t-1;o>=0?o>=r:r>=o;n=o>=0?++r:--r)u.push(e(n));return u},N=function(t){return null===t},V=function(t){return void 0===t},L=function(t){return!V(t)},K=function(t){return V(t)||N(t)},I=function(t){return!K(t)},z=function(t){return K(t)||q(t)&&0===Object.keys(t).length||0===t.length},ge=function(t,e){return null==e&&(e=B),e(t)?t:null},B=function(t){return!z(t)},F=function(t){return"function"==typeof t},X=function(t){return"string"==typeof t},H=function(t){return"number"==typeof t},_=function(t){return"object"==typeof t&&!!t},q=function(t){return _(t)||"function"==typeof t},W=function(t){return!(!t||1!==t.nodeType)},Q=function(t){return t instanceof jQuery},J=function(t){return q(t)&&F(t.then)},M=function(t){return J(t)&&F(t.resolve)},U=function(t){return I(t)?t:void 0},R=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Oe=function(t){return Array.prototype.slice.call(t)},d=function(t){return R(t)?t.slice():P({},t)},De=function(t){return Q(t)?t.get(0):t},ue=function(t,e){return P(d(t),e)},ve=function(t,e){var n,r,o,u;if(o=t?d(t):{},e)for(r in e)n=e[r],u=o[r],I(u)?q(n)&&q(u)&&(o[r]=ve(u,n)):o[r]=n;return o},he=function(){var e,n,r,o,u,i;for(n=1<=arguments.length?t.call(arguments,0):[],u=void 0,r=0,o=n.length;o>r;r++)if(e=n[r],i=e,F(i)&&(i=i()),I(i)){u=i;break}return u},w=function(t,e){var n,r,o,u;for(u=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){u=n;break}return u},i=function(t,e){var n;return n=w(t,e),L(n)},c=function(t){return Ce(t,I)},je=function(t){var e;return e={},Ce(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},Ce=function(t,e){var n;return n=[],k(t,function(t){return e(t)?n.push(t):void 0}),n},ye=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,u;for(u=[],t=0,o=r.length;o>t;t++)n=r[t],u.push(e.attr(n));return u}(),w(o,B)},se=function(t){return setTimeout(t,0)},te=function(t){return t[t.length-1]},l=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Se=oe(function(){var t,n,r;return t=e("<div>").css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),t.appendTo(document.body),n=t.get(0),r=n.offsetWidth-n.clientWidth,t.remove(),r}),de=function(t){var e;return e=void 0,function(){return null!=t&&(e=t()),t=void 0,e}},Pe=function(t,e,n){var r,o;return o=t.css(Object.keys(e)),t.css(e),r=function(){return t.css(o)},n?(n(),r()):de(r)},D=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),z(n)||"none"===n.transform?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},y=function(t,n,o){var u,i,a,s,l,c;return u=e(t),up.browser.canCssAnimation()?(o=ve(o,{duration:300,delay:0,easing:"ease"}),i=e.Deferred(),s={"transition-property":Object.keys(n).join(", "),"transition-duration":o.duration+"ms","transition-delay":o.delay+"ms","transition-timing-function":o.easing},l=D(u),c=Pe(u,s),u.css(n),i.then(l),i.then(c),u.data(r,i),i.then(function(){return u.removeData(r)}),a=setTimeout(function(){return i.resolve()},o.duration+o.delay),i.then(function(){return clearTimeout(a)}),i):(u.css(n),ke())},r="up-animation-promise",O=function(t){return e(t).each(function(){var t;return(t=e(this).data(r))?t.resolve():void 0})},re=function(t,n){var r,o,u,i,a,s;return n=ve(n,{relative:!1,inner:!1,full:!1}),n.relative?n.relative===!0?i=t.position():(r=e(n.relative),a=t.offset(),r.is(document)?i=a:(u=r.offset(),i={left:a.left-u.left,top:a.top-u.top})):i=t.offset(),o={left:i.left,top:i.top},n.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),n.full&&(s=l(),o.right=s.width-(o.left+o.width),o.bottom=s.height-(o.top+o.height)),o},m=function(t,e){var n,r,o,u,i;for(u=t.get(0).attributes,i=[],r=0,o=u.length;o>r;r++)n=u[r],i.push(n.specified?e.attr(n.name,n.value):void 0);return i},E=function(t,e){return t.find(e).addBack(e)},T=function(t){return 27===t.keyCode},Ae=function(t,e){return 0===t.indexOf(e)},S=function(t,e){return t.indexOf(e)===t.length-e.length},f=function(t,e){return t.indexOf(e)>=0},s=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},ee=function(t){return t.getResponseHeader("X-Up-Location")},ie=function(t){return t.getResponseHeader("X-Up-Method")},me=function(){var e,n,r,o,u,i;for(i=arguments[0],o=2<=arguments.length?t.call(arguments,1):[],e={},n=0,u=o.length;u>n;n++)r=o[n],i.hasOwnProperty(r)&&(e[r]=i[r]);return e},Y=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},Z=function(t){var e;return e=V(t.button)||0===t.button,e&&Y(t)},ke=function(){var t;return t=e.Deferred(),t.resolve(),t},xe=function(){return ke().promise()},pe=function(){return{is:function(){return!1},attr:function(){},find:function(){return[]}}},we=function(){var n,r;return n=1<=arguments.length?t.call(arguments,0):[],r=e.when.apply(e,n),r.resolve=function(){return k(n,function(t){return"function"==typeof t.resolve?t.resolve():void 0})},r},Te=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],r.push(K(t.attr(n))?t.attr(n,o):void 0);return r},be=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},x=function(){return e([])},ae=function(t){var n,r,o,u,a,s,l;for(a={},l=[],r=[],o=0,u=t.length;u>o;o++)s=t[o],X(s)?l.push(s):r.push(s);return a.parsed=r,l.length&&(n=l.join(", "),a.parsed.push(n)),a.select=function(){return a.find(void 0)},a.find=function(t){var n,r,o,u,i,s;for(r=x(),i=a.parsed,o=0,u=i.length;u>o;o++)s=i[o],n=t?t.find(s):e(s),r=r.add(n);return r},a.findWithSelf=function(t){var e;return e=a.find(t),a.doesMatch(t)&&(e=e.add(t)),e},a.doesMatch=function(t){var n;return n=e(t),i(a.parsed,function(t){return n.is(t)})},a.seekUp=function(t){var n,r,o;for(o=e(t),n=o,r=void 0;n.length;){if(a.doesMatch(n)){r=n;break}n=n.parent()}return r||x()},a},a=function(e){var n,r,o,u,i,a,s,l,c,p,f,m;return null==e&&(e={}),f=void 0,r=function(){return f={}},r(),s=function(){var n;return n=1<=arguments.length?t.call(arguments,0):[],e.log?(n[0]="["+e.log+"] "+n[0],b.apply(null,n)):void 0},a=function(){return Object.keys(f)},l=function(){return K(e.size)?void 0:F(e.size)?e.size():H(e.size)?e.size:C("Invalid size config: %o",e.size)},o=function(){return K(e.expiry)?void 0:F(e.expiry)?e.expiry():H(e.expiry)?e.expiry:C("Invalid expiry config: %o",e.expiry)},c=function(t){return e.key?e.key(t):t.toString()},$e=function(){var t,e,n,r;return r=d(a()),n=l(),n&&r.length>n&&(t=null,e=null,k(r,function(n){var r,o;return r=f[n],o=r.timestamp,!e||e>o?(t=n,e=o):void 0}),t)?delete f[t]:void 0},n=function(t,e){var n;return n=u(t),L(n)?p(e,n):void 0},m=function(){return(new Date).valueOf()},p=function(t,e){var n;return n=c(t),f[n]={timestamp:m(),value:e}},be=function(t){var e;return e=c(t),delete f[e]},i=function(t){var e,n;return e=o(),e?(n=m()-t.timestamp,n<o()):!0},u=function(t,e){var n,r;return null==e&&(e=void 0),r=c(t),(n=f[r])?i(n)?(s("Cache hit for %o",t),n.value):(s("Discarding stale cache entry for %o",t),be(t),e):(s("Cache miss for %o",t),e)},{alias:n,get:u,set:p,remove:be,clear:r,keys:a}},p=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){return P(e,t)},e.reset(),Object.preventExtensions(e),e},Ue=function(t){var e,n;return t=De(t),e=t.parentNode,n=Oe(t.childNodes),k(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},fe=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},$=function(t,n){var r,o,u,i;return r=e(t),o=fe(r),u=r.position(),i=o.offset(),r.css({position:"absolute",left:u.left-i.left,top:u.top-i.top+n.scrollTop(),right:"",bottom:""})},{offsetParent:fe,fixedToAbsolute:$,presentAttr:ye,createElement:h,normalizeUrl:ce,normalizeMethod:le,createElementFromHtml:v,$createElementFromSelector:n,createSelectorFromElement:g,ajax:u,extend:P,copy:d,merge:ue,options:ve,option:he,error:C,debug:b,warn:Re,each:k,map:ne,identity:j,times:Ee,any:i,detect:w,select:Ce,compact:c,uniq:je,last:te,isNull:N,isDefined:L,isUndefined:V,isGiven:I,isMissing:K,isPresent:B,isBlank:z,presence:ge,isObject:q,isFunction:F,isString:X,isElement:W,isJQuery:Q,isPromise:J,isDeferred:M,isHash:_,ifGiven:U,isUnmodifiedKeyEvent:Y,isUnmodifiedMouseEvent:Z,nullJquery:pe,unJquery:De,nextFrame:se,measure:re,temporaryCss:Pe,cssAnimate:y,finishCssAnimate:O,forceCompositing:D,escapePressed:T,copyAttributes:m,findWithSelf:E,contains:f,startsWith:Ae,endsWith:S,isArray:R,toArray:Oe,castedAttr:s,locationFromXhr:ee,methodFromXhr:ie,clientSize:l,only:me,trim:$e,resolvedPromise:xe,resolvedDeferred:ke,resolvableWhen:we,setMissingAttrs:Te,remove:be,memoize:oe,scrollbarWidth:Se,config:p,cache:a,unwrapElement:Ue,multiSelector:ae,emptyJQuery:x,evalConsoleTemplate:A}}($),up.error=up.util.error,up.warn=up.util.warn,up.debug=up.util.debug}.call(this),function(){var t=[].slice;up.browser=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h;return m=up.util,p=function(t,n){var r,o,u,i,a,s;return null==n&&(n={}),a=m.option(n.method,"get").toLowerCase(),"get"===a?location.href=t:e.rails?(s=n.target,u=e.rails.csrfToken(),o=e.rails.csrfParam(),r=e("<form method='post' action='"+t+"'></form>"),i="<input name='_method' value='"+a+"' type='hidden' />",m.isDefined(o)&&m.isDefined(u)&&(i+="<input name='"+o+"' value='"+u+"' type='hidden' />"),s&&r.attr("target",s),r.hide().append(i).appendTo("body"),r.submit()):error("Can't fake a "+a.toUpperCase()+" request without Rails UJS")},d=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],m.isDefined(console[r])||(r="log"),o()?console[r].apply(console,e):(n=m.evalConsoleTemplate.apply(m,e),console[r](n))},h=function(){return location.href},u=m.memoize(function(){return m.isDefined(history.pushState)&&"get"===i()}),a=m.memoize(function(){return m.isUndefined(document.addEventListener)}),s=m.memoize(function(){return a()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),n=m.memoize(function(){return"transition"in document.documentElement.style}),r=m.memoize(function(){return"oninput"in document.createElement("input")}),o=m.memoize(function(){return!s()}),l=m.memoize(function(){var t,n,r,o;return o=e.fn.jquery,r=o.split("."),t=parseInt(r[0]),n=parseInt(r[1]),t>=2||1===t&&n>=9}),f=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,m.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},i=m.memoize(function(){return(f("_up_request_method")||"get").toLowerCase()}),c=function(){return!a()&&l()},{url:h,loadPage:p,canPushState:u,canCssAnimation:n,canInputEvent:r,canLogSubstitution:o,isSupported:c,puts:d}}(jQuery)}.call(this),function(){var t=[].slice;up.bus=function(e){var n,r,o,u,i,a,s,l,c,p,f;return p=up.util,i=[],n=null,f=function(t){return function(n){var r;return r=n.$element||e(this),t.apply(r.get(0),[n,r,up.syntax.data(r)])}},u=function(){var n,r,o,u,a;return r=1<=arguments.length?t.call(arguments,0):[],up.browser.isSupported()?(u=p.copy(r),a=u.length-1,o=u[a],u[a]=f(o),i.push(u),n=e(document),n.on.apply(n,u),function(){return n.off.apply(n,u)}):function(){}},r=function(t,n){var r,o;return null==n&&(n={}),o=e.Event(t,n),r=n.$element||e(document),p.debug("Emitting %o on %o with props %o",t,r,n),r.trigger(o),o},a=function(){var e,n;return e=1<=arguments.length?t.call(arguments,0):[],n=r.apply(null,e),!n.isDefaultPrevented()},s=function(t){return u("keydown","body",function(e){return p.escapePressed(e)?t(e):void 0})},c=function(){return n=p.copy(i)},l=function(){var t,r,o,u;for(r=0,o=i.length;o>r;r++)t=i[r],p.contains(n,t)||(u=e(document)).off.apply(u,t);return i=p.copy(n)},o=function(){return up.emit("up:framework:reset")},u("up:framework:boot",c),u("up:framework:reset",l),{on:u,emit:r,nobodyPrevents:a,onEscape:s,emitReset:o}}(jQuery),up.on=up.bus.on,up.emit=up.bus.emit,up.reset=up.bus.emitReset}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m;return m=up.util,n="up-destroyable",r="up-destroyer",a=[],l=null,i=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(i=e.pop(),n=m.options(e[0],{batch:!1}),a.push({selector:r,callback:i,batch:n.batch})):void 0},o=function(t,e,o){var u;return m.debug("Applying compiler %o on %o",t.selector,o),u=t.callback.apply(o,[e,s(e)]),m.isFunction(u)?(e.addClass(n),e.data(r,u)):void 0},u=function(t){var n,r,u,s;for(m.debug("Compiling fragment %o",t),s=[],r=0,u=a.length;u>r;r++)i=a[r],n=m.findWithSelf(t,i.selector),s.push(n.length?i.batch?o(i,n,n.get()):n.each(function(){return o(i,e(this),this)}):void 0);return s},c=function(t){return m.findWithSelf(t,"."+n).each(function(){var t,n;return t=e(this),(n=t.data(r))()})},s=function(t){var n,r;return n=e(t),r=n.attr("up-data"),m.isString(r)&&""!==m.trim(r)?JSON.parse(r):{}},d=function(){return l=m.copy(a)},f=function(){return a=m.copy(l)},p=function(t){var n;return n=e(t),up.emit("up:fragment:inserted",{$element:n}),n},up.on("ready",function(){return p(document.body)}),up.on("up:fragment:inserted",function(t){return u(t.$element)}),up.on("up:fragment:destroy",function(t){return c(t.$element)}),up.on("up:framework:boot",d),up.on("up:framework:reset",f),{compiler:i,hello:p,data:s}}(jQuery),up.compiler=up.syntax.compiler,up.hello=up.syntax.hello,up.ready=function(){return up.util.error("up.ready no longer exists. Please use up.hello instead.")},up.awaken=function(){return up.util.error("up.awaken no longer exists. Please use up.compiler instead.")}}.call(this),function(){up.history=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),c=void 0,i=void 0,m=function(){return n.reset(),c=void 0,i=void 0},a=function(t){return v.normalizeUrl(t,{hash:!0})},r=function(){return a(up.browser.url())},o=function(t){return a(t)===r()},s=function(t){return i&&(c=i,i=void 0),i=t},d=function(t,e){return u("replace",t,e)},p=function(t,e){return u("push",t,e)},u=function(t,n,u){var i,a;return u=v.options(u,{force:!1}),u.force||!o(n)?up.browser.canPushState()?(i=t+"State",a=e(),v.debug("Changing history to URL %o (%o)",n,t),window.history[i](a,"",n),s(r())):v.error("This browser doesn't support history.pushState"):void 0},e=function(){return{fromUp:!0}},h=function(t){var e,o;return o=r(),v.debug("Restoring state %o (now on "+o+")",t),e=n.popTargets.join(", "),up.replace(e,o,{history:!1,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll})},l=function(t){var e;return v.debug("History state popped to URL %o",r()),s(r()),up.layout.saveScroll({url:c}),e=t.originalEvent.state,(null!=e?e.fromUp:void 0)?h(e):v.debug("Discarding unknown state %o",e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),d(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.compiler("[up-back]",function(t){return v.isPresent(c)?(v.setMissingAttrs(t,{"up-href":c,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",m),{config:n,defaults:function(){return v.error("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:p,replace:d,url:r,previousUrl:function(){return c},normalizeUrl:a}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var SCROLL_PROMISE_KEY,anchoredRight,config,finishScrolling,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealOrRestoreScroll,saveScroll,scroll,scrollTops,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=u.cache({size:30,key:up.history.normalizeUrl}),reset=function(){return config.reset(),lastScrollTops.clear()},SCROLL_PROMISE_KEY="up-scroll-promise",scroll=function(t,e,n){var r,o,i,a,s;return r=$(t),n=u.options(n),i=u.option(n.duration,config.duration),a=u.option(n.easing,config.easing),finishScrolling(r),i>0?(o=$.Deferred(),r.data(SCROLL_PROMISE_KEY,o),o.then(function(){return r.removeData(SCROLL_PROMISE_KEY),r.finish()}),s={scrollTop:e},r.get(0)===document&&(r=$("html, body")),r.animate(s,{duration:i,easing:a,complete:function(){return o.resolve()}}),o):(r.scrollTop(e),u.resolvedDeferred())},finishScrolling=function(t){return $(t).each(function(){var t;return(t=$(this).data(SCROLL_PROMISE_KEY))?t.resolve():void 0})},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||u.error("Fixed element %o must have a CSS attribute %o",n,e),parseInt(r)+n.height()},e=function(){var t,e,o,u;for(o=$(config.fixedTop.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"top"));return u}(),t=function(){var t,e,o,u;for(o=$(config.fixedBottom.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"bottom"));return u}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return u.debug("Revealing %o",t),e=u.options(e),n=$(t),r=e.viewport?$(e.viewport):viewportOf(n),m=u.option(e.snap,config.snap),v=r.is(document),h=v?u.clientSize().height:r.height(),p=r.scrollTop(),s=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+c,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||e.top)&&(s=i-l.top),m>s&&(s=0),s!==p?scroll(r,s,e):u.resolvedDeferred()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t){var e,n;return e=$(t),n=viewportSelector().seekUp(e),n.length||u.error("Could not find viewport for %o",e),n},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().findWithSelf(e)},viewports=function(){return viewportSelector().select()},scrollTops=function(){var t,e,n,r,o,u,i;for(u={},o=config.viewports,e=0,r=o.length;r>e;e++)i=o[e],t=$(i),t.length&&(n=i,i===document&&(n="document"),u[n]=t.scrollTop());return u},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),u.debug("Saving scroll positions for URL %o: %o",n,e),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i,a,s,l,c;null==t&&(t={}),c=up.history.url(),o=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),o=e.add(n)):o=viewports(),l=lastScrollTops.get(c),u.debug("Restoring scroll positions for URL %o (viewports are %o, saved tops are %o)",c,o,l);for(i in l)s=l[i],a="document"===i?document:i,r=o.filter(a),scroll(r,s,{duration:0});return u.resolvedDeferred()},revealOrRestoreScroll=function(t,e){var n;return n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal?reveal(n):u.resolvedDeferred()},up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,scroll:scroll,finishScrolling:finishScrolling,config:config,defaults:function(){return u.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal}.call(this),function(){up.flow=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,d=function(e,n){var r;return r=t(e),v.isPresent(n)&&(n=v.normalizeUrl(n)),r.attr("up-source",n)},m=function(e){var n;return n=t(e).closest("[up-source]"),v.presence(n.attr("up-source"))||up.browser.url()},f=function(e,n,r){var o,u,i;return v.debug("Replace %o with %o (options %o)",e,n,r),r=v.options(r),i=v.presence(e)?e:v.createSelectorFromElement(t(e)),up.browser.canPushState()||r.history===!1?(u={url:n,method:r.method,selector:i,cache:r.cache,preload:r.preload},o=up.proxy.ajax(u),o.done(function(t,e,o){var s,l;return(s=v.locationFromXhr(o))&&(v.debug("Location from server: %o",s),l={url:s,method:v.methodFromXhr(o),selector:i},up.proxy.alias(u,l),n=s),r.history!==!1&&(r.history=n),r.source!==!1&&(r.source=n),r.preload?void 0:a(i,t,r)}),o.fail(v.error),o):(r.preload||up.browser.loadPage(n,v.only(r,"method")),v.resolvedPromise())},a=function(t,e,n){var r,u,i,a,s,p,f,d;for(n=v.options(n,{historyMethod:"push"}),n.source=v.option(n.source,n.history),p=c(e),n.title||(n.title=p.title()),n.saveScroll!==!1&&up.layout.saveScroll(),s=l(t,n),f=[],i=0,a=s.length;a>i;i++)d=s[i],u=o(d.selector),r=p.find(d.selector).first(),f.push(h(u,r,d.pseudoClass,d.transition,n));return f},o=function(t){return u(".up-popup "+t)||u(".up-modal "+t)||u(t)||i(t)},i=function(t){var e;return e="Could not find selector %o in current body HTML","#"===e[0]&&(e+=" (avoid using IDs)"),v.error(e,t)},c=function(e){var n;return n=v.createElementFromHtml(e),{title:function(){var t;return null!=(t=n.querySelector("title"))?t.textContent:void 0},find:function(r){var o;return(o=n.querySelector(r))?t(o):v.error("Could not find selector %o in response %o",r,e)}}},r=function(t,n){return"function"==typeof n.insert&&n.insert(t),n.history&&(n.title&&(document.title=n.title),up.history[n.historyMethod](n.history)),n.source!==!1&&d(t,n.source),e(t),up.hello(t)},h=function(t,e,o,u,i){var a,s;return u||(u="none"),up.motion.finish(t),o?(s="before"===o?"prepend":"append",a=e.contents().wrap('<span class="up-insertion"></span>').parent(),t[s](a),v.copyAttributes(e,t),r(a.children(),i),up.layout.revealOrRestoreScroll(a,i).then(function(){return up.animate(a,u,i)}).then(function(){v.unwrapElement(a)})):n(t,{animation:function(){return e.insertBefore(t),r(e,i),t.is("body")&&"none"!==u&&v.error("Cannot apply transitions to body-elements (%o)",u),up.morph(t,e,u,i)}})},l=function(t,e){var n,r,o,u,i,a,s,l,c,p,f;for(p=e.transition||e.animation||"none",n=/\ *,\ */,r=t.split(n),v.isPresent(p)&&(f=p.split(n)),a=[],o=u=0,i=r.length;i>u;o=++u)s=r[o],l=s.match(/^(.+?)(?:\:(before|after))?$/),c=f[o]||v.last(f),a.push({selector:l[1],pseudoClass:l[2],transition:c});return a},e=function(t){var e,n;return n="[autofocus]:last",e=v.findWithSelf(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},s=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},u=function(e){var n,r,o,u,i,a;for(u=t(e).get(),r=void 0,i=0,a=u.length;a>i;i++)if(o=u[i],n=t(o),s(n)){r=n;break}return r},n=function(e,n){var r,o,u;return r=t(e),up.bus.nobodyPrevents("up:fragment:destroy",{$element:r})?(n=v.options(n,{animation:"none"}),o=up.motion.animateOptions(n),r.addClass("up-destroying"),v.isPresent(n.url)&&up.history.push(n.url),v.isPresent(n.title)&&(document.title=n.title),u=v.presence(n.animation,v.isDeferred)||up.motion.animate(r,n.animation,o),u.then(function(){return up.emit("up:fragment:destroyed",{$element:r}),r.remove()}),u):t.Deferred()},p=function(t,e){var n;return e=v.options(e,{cache:!1}),n=e.url||m(t),f(t,n,e)},up.on("ready",function(){return d(document.body,up.browser.url())}),{replace:f,reload:p,destroy:n,implant:a,first:u}}(jQuery),up.replace=up.flow.replace,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.first=up.flow.first}.call(this),function(){up.motion=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S;return x=up.util,u={},s={},k={},l={},a=x.config({duration:300,delay:0,easing:"ease"}),v=function(){return u=x.copy(s),k=x.copy(l),a.reset()},n=function(e,o,u){var a;return a=t(e),p(a),u=r(u),("none"===o||o===!1)&&m(),x.isFunction(o)?i(o(a,u),o):x.isString(o)?n(a,c(o),u):x.isHash(o)?x.cssAnimate(a,o,u):x.error("Unknown animation type %o",o)},r=function(t,e){var n;return null==e&&(e=null),t=x.options(t),n={},n.easing=x.option(t.easing,null!=e?e.attr("up-easing"):void 0,a.easing),n.duration=Number(x.option(t.duration,null!=e?e.attr("up-duration"):void 0,a.duration)),n.delay=Number(x.option(t.delay,null!=e?e.attr("up-delay"):void 0,a.delay)),n},c=function(t){return u[t]||x.error("Unknown animation %o",t)},e="up-ghosting-promise",S=function(t,n,r,o){var u,i,a,s,l,c,p;return s=void 0,i=void 0,l=void 0,a=void 0,u=up.layout.viewportOf(t),x.temporaryCss(n,{display:"none"},function(){return s=h(t,u),s.$ghost.addClass("up-destroying"),s.$bounds.addClass("up-destroying"),l=u.scrollTop()}),x.temporaryCss(t,{display:"none"},function(){return up.layout.revealOrRestoreScroll(n,r),i=h(n,u),a=u.scrollTop()}),s.moveTop(a-l),t.hide(),p=x.temporaryCss(n,{opacity:"0"}),c=o(s.$ghost,i.$ghost),t.data(e,c),n.data(e,c),c.then(function(){return t.removeData(e),n.removeData(e),p(),s.$bounds.remove(),i.$bounds.remove()}),c},p=function(e){return t(e).each(function(){var e;return e=t(this),x.finishCssAnimate(e),f(e)})},f=function(t){var n;return(n=t.data(e))?(x.debug("Canceling existing ghosting on %o",t),"function"==typeof n.resolve?n.resolve():void 0):void 0},i=function(t,e){return x.isDeferred(t)?t:x.error("Did not return a promise with .then and .resolve methods: %o",e)},d=function(e,o,a,s){var l,c,f,m,h,v,b;return x.debug("Morphing %o to %o (using %o)",e,o,a),c=t(e),l=t(o),h=x.only(s,"reveal","restoreScroll"),h=x.extend(h,r(s)),up.browser.canCssAnimation()?(p(c),p(l),"none"===a||a===!1||(f=u[a])?(m=y(c,l,h),m.then(function(){return n(l,f||"none",s)}),m):(b=x.presence(a,x.isFunction)||k[a])?S(c,l,h,function(t,e){var n;return n=b(t,e,h),i(n,a)}):x.isString(a)&&a.indexOf("/")>=0?(v=a.split("/"),b=function(t,e,r){return g(n(t,v[0],r),n(e,v[1],r))},d(c,l,b,h)):x.error("Unknown transition %o",a)):y(c,l,h)},y=function(t,e,n){return t.hide(),up.layout.revealOrRestoreScroll(e,n)},h=function(e,n){var r,o,u,i,a,s,l,c,p;for(i=x.measure(e,{relative:!0,inner:!0}),u=e.clone(),u.find("script").remove(),u.css({position:"static"===e.css("position")?"static":"relative",top:"",right:"",bottom:"",left:"",width:"100%",height:"100%"}),u.addClass("up-ghost"),r=t('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(i),p=i.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},u.appendTo(r),r.insertBefore(e),c(e.offset().top-u.offset().top),o=up.layout.fixedChildren(u),s=0,l=o.length;l>s;s++)a=o[s],x.fixedToAbsolute(a,n);return{$ghost:u,$bounds:r,moveTop:c}},w=function(t,e){return k[t]=e},o=function(t,e){return u[t]=e},b=function(){return s=x.copy(u),l=x.copy(k)},g=x.resolvableWhen,m=x.resolvedDeferred,o("none",m),o("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),o("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),o("move-to-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css({"margin-top":"0px"}),n(t,{"margin-top":"-"+o+"px"},e)}),o("move-from-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css({"margin-top":"-"+o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css({"margin-top":"0px"}),n(t,{"margin-top":o+"px"},e)}),o("move-from-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css({"margin-top":o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css({"margin-left":"0px"}),n(t,{"margin-left":"-"+o+"px"},e)}),o("move-from-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css({"margin-left":"-"+o+"px"}),n(t,{"margin-left":"0px"},e)}),o("move-to-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css({"margin-left":"0px"}),n(t,{"margin-left":o+"px"},e)}),o("move-from-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css({"margin-left":o+"px"}),n(t,{"margin-left":"0px"},e)}),o("roll-down",function(t,e){var r,o;return r=t.height(),o=x.temporaryCss(t,{height:"0px",overflow:"hidden"}),n(t,{height:r+"px"},e).then(o)}),w("none",m),w("move-left",function(t,e,r){return g(n(t,"move-to-left",r),n(e,"move-from-right",r))}),w("move-right",function(t,e,r){return g(n(t,"move-to-right",r),n(e,"move-from-left",r))}),w("move-up",function(t,e,r){return g(n(t,"move-to-top",r),n(e,"move-from-bottom",r))}),w("move-down",function(t,e,r){return g(n(t,"move-to-bottom",r),n(e,"move-from-top",r))}),w("cross-fade",function(t,e,r){return g(n(t,"fade-out",r),n(e,"fade-in",r))}),up.on("up:framework:boot",b),up.on("up:framework:reset",v),{morph:d,animate:n,animateOptions:r,finish:p,transition:w,animation:o,config:a,defaults:function(){return x.error("up.motion.defaults(...) no longer exists. Set values on he up.motion.config property instead.")},none:m,when:g,prependCopy:h}
2
+ }(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){up.proxy=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,A,P,E,O;return O=up.util,e=void 0,C=void 0,i=void 0,x=void 0,a=void 0,m=O.config({busyDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5}),l=function(t){return k(t),[t.url,t.method,t.data,t.selector].join("|")},s=O.cache({size:function(){return m.cacheSize},expiry:function(){return m.cacheExpiry},key:l,log:"up.proxy"}),h=s.get,P=s.set,T=s.remove,d=s.clear,p=function(){return clearTimeout(C),C=null},c=function(){return clearTimeout(i),i=null},A=function(){return e=null,p(),c(),x=0,m.reset(),a=!1,s.clear()},A(),o=s.alias,k=function(t){return t._normalized||(t.method=O.normalizeMethod(t.method),t.url&&(t.url=O.normalizeUrl(t.url)),t.selector||(t.selector="body"),t._normalized=!0),t},r=function(t){var e,n,r,o,u;return e=t.cache===!0,n=t.cache===!1,u=O.only(t,"url","method","data","selector","_normalized"),r=!0,g(u)||e?(o=h(u))&&!n?r="pending"===o.state():(o=y(u),P(u,o),o.fail(function(){return T(u)})):(d(),o=y(u)),r&&!t.preload&&(w(),o.always(b)),o},n=["GET","OPTIONS","HEAD"],v=function(){return 0===x},u=function(){return x>0},w=function(){var t,e;return e=v(),x+=1,e?(t=function(){return u()?(up.emit("up:proxy:busy"),a=!0):void 0},m.busyDelay>0?i=setTimeout(t,m.busyDelay):t()):void 0},b=function(){return x-=1,v()&&a?(up.emit("up:proxy:idle"),a=!1):void 0},y=function(t){var e;return O.debug("Loading URL %o",t.url),up.emit("up:proxy:load",t),e=O.ajax(t),e.always(function(){return up.emit("up:proxy:receive",t)}),e},g=function(t){return k(t),O.contains(n,t.method)},f=function(t){var n,r;return r=parseInt(O.presentAttr(t,"up-delay"))||m.preloadDelay,t.is(e)?void 0:(e=t,p(),n=function(){return S(t),e=null},E(n,r))},E=function(t,e){return C=setTimeout(t,e)},S=function(e,n){var r,o;return r=t(e),n=O.options(n),o=up.link.followMethod(r,n),g({method:o})?(O.debug("Preloading %o",r),n.preload=!0,up.follow(r,n)):(O.debug("Won't preload %o due to unsafe method %o",r,o),O.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(t,e){return up.link.childClicked(t,e)?void 0:f(e)}),up.on("up:framework:reset",A),{preload:S,ajax:r,get:h,alias:o,clear:d,remove:T,idle:v,busy:u,config:m,defaults:function(){return O.error("up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.")}}}(jQuery)}.call(this),function(){up.link=function($){var childClicked,follow,followMethod,makeFollowable,shouldProcessLinkEvent,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target"),"body"),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),u.castedAttr(n,"up-animation")),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e=u.merge(e,up.motion.animateOptions(e,n)),up.replace(r,o,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},up.on("click","a[up-target], [up-href][up-target]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.on("mousedown","a[up-instant], [up-href][up-instant]",function(t,e){return shouldProcessLinkEvent(t,e)?(t.preventDefault(),follow(e)):void 0}),childClicked=function(t,e){var n,r;return n=$(t.target),r=n.closest("a, [up-href]"),r.length&&e.find(r).length},shouldProcessLinkEvent=function(t,e){return u.isUnmodifiedMouseEvent(t)&&!childClicked(t,e)},makeFollowable=function(t){var e;return e=$(t),u.isMissing(e.attr("up-target"))&&u.isMissing(e.attr("up-follow"))?e.attr("up-follow",""):void 0},up.on("click","a[up-follow], [up-href][up-follow]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.compiler("[up-expand]",function(t){var e,n,r,o,i,a,s,l;for(o=t.find("a, [up-href]").get(0),o||u.error("No link to expand within %o",t),l=/^up-/,a={},a["up-href"]=$(o).attr("href"),s=o.attributes,n=0,r=s.length;r>n;n++)e=s[n],i=e.name,i.match(l)&&(a[i]=e.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}),up.compiler("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),e={"up-preload":"true","up-instant":"true"},n===!0?e["up-follow"]="":e["up-target"]=n,u.setMissingAttrs(t,e),t.removeAttr("up-dash")}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,childClicked:childClicked,followMethod:followMethod}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){up.form=function($){var observe,submit,u;return u=up.util,submit=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m;return n=$(t).closest("form"),e=u.options(e),c=u.option(e.target,n.attr("up-target"),"body"),r=u.option(e.failTarget,n.attr("up-fail-target"),function(){return u.createSelectorFromElement(n)}),i=u.option(e.history,u.castedAttr(n,"up-history"),!0),p=u.option(e.transition,u.castedAttr(n,"up-transition")),o=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),p),a=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),s={},s.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),s.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),s.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),s=u.extend(s,up.motion.animateOptions(e,n)),m=u.option(e.cache,u.castedAttr(n,"up-cache")),d=u.option(e.url,n.attr("action"),up.browser.url()),n.addClass("up-active"),up.browser.canPushState()||i===!1?(l={url:d,method:a,data:n.serialize(),selector:c,cache:m},f=function(t){var e;return d=void 0,u.isGiven(i)&&(i===!1||u.isString(i)?d=i:(e=u.locationFromXhr(t))?d=e:"GET"===l.type&&(d=l.url+"?"+l.data)),u.option(d,!1)},up.proxy.ajax(l).always(function(){return n.removeClass("up-active")}).done(function(t,e,n){var r;return r=u.merge(s,{history:f(n),transition:p}),up.flow.implant(c,t,r)}).fail(function(t){var e,n;return n=t.responseText,e=u.merge(s,{transition:o}),up.flow.implant(r,n,e)})):void n.get(0).submit()},observe=function(fieldOrSelector,options){var $field,callback,callbackPromise,callbackTimer,changeEvents,check,clearTimer,codeOnChange,delay,knownValue,nextCallback,runNextCallback;return $field=$(fieldOrSelector),options=u.options(options),delay=u.option($field.attr("up-delay"),options.delay,0),delay=parseInt(delay),knownValue=null,callback=null,callbackTimer=null,(codeOnChange=$field.attr("up-observe"))?callback=function(value,$field){return eval(codeOnChange)}:options.change?callback=options.change:u.error("up.observe: No change callback given"),callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var t;return nextCallback?(t=nextCallback(),nextCallback=null,t):void 0},check=function(){var t,e;return e=$field.val(),t=u.isNull(knownValue),knownValue===e||(knownValue=e,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($field.get(0),[e,$field])},callbackTimer=setTimeout(function(){return callbackPromise.then(function(){var t;return t=runNextCallback(),callbackPromise=u.isPromise(t)?t:u.resolvedPromise()})},delay))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$field.on(changeEvents,check),check(),clearTimer},up.on("submit","form[up-target]",function(t,e){return t.preventDefault(),submit(e)}),up.compiler("[up-observe]",function(t){return observe(t)}),{submit:submit,observe:observe}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe}.call(this),function(){up.popup=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h;return m=up.util,s=void 0,i=function(){var e;return e=t(".up-popup"),e.attr("up-covered-url")},o=m.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right"}),f=function(){return r(),o.reset()},d=function(t,e,n){var r,o;return o=m.measure(t,{full:!0}),r=function(){switch(n){case"bottom-right":return{right:o.right,top:o.top+o.height};case"bottom-left":return{left:o.left,top:o.bottom+o.height};case"top-right":return{right:o.right,bottom:o.top};case"top-left":return{left:o.left,bottom:o.top};default:return m.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r),c(e)},c=function(t){var e,n,r,o,u,i,a;if(n=m.measure(t,{full:!0}),r=null,o=null,n.right<0&&(r=-n.right),n.bottom<0&&(o=-n.bottom),n.left<0&&(r=n.left),n.top<0&&(o=n.top),r&&((u=parseInt(t.css("left")))?t.css("left",u-r):(i=parseInt(t.css("right")))&&t.css("right",i+r)),o){if(a=parseInt(t.css("top")))return t.css("top",a-o);if(e=parseInt(t.css("bottom")))return t.css("bottom",e+o)}},p=function(){var e;return e=t(".up-popup"),e.attr("up-covered-url",up.browser.url()),e.attr("up-covered-title",document.title)},l=function(){var e;return e=t(".up-popup"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},a=function(t,e,n){var r,o;return o=m.$createElementFromSelector(".up-popup"),n&&o.attr("up-sticky",""),r=m.$createElementFromSelector(e),r.appendTo(o),o.appendTo(document.body),p(),o.hide(),o},h=function(t,e,n,r,o){return e.show(),d(t,e,n),up.animate(e,r,o)},e=function(e,n){var u,i,s,l,c,p,f,d,v;return u=t(e),n=m.options(n),v=m.option(n.url,u.attr("href")),f=m.option(n.target,u.attr("up-popup"),"body"),p=m.option(n.position,u.attr("up-position"),o.position),l=m.option(n.animation,u.attr("up-animation"),o.openAnimation),d=m.option(n.sticky,m.castedAttr(u,"up-sticky")),c=up.browser.canPushState()?m.option(n.history,m.castedAttr(u,"up-history"),!1):!1,s=up.motion.animateOptions(n,u),r(),i=a(u,f,d),up.replace(f,v,{history:c,insert:function(){return h(u,i,p,l,s)}})},r=function(e){var n;return n=t(".up-popup"),n.length?(e=m.options(e,{animation:o.closeAnimation,url:n.attr("up-covered-url"),title:n.attr("up-covered-title")}),s=void 0,up.destroy(n,e)):m.resolvedPromise()},n=function(){return t(".up-popup").is("[up-sticky]")?void 0:(l(),r())},u=function(e){var n;return n=t(e),n.closest(".up-popup").length>0},up.on("click","a[up-popup]",function(t,n){return t.preventDefault(),n.is(".up-current")?r():e(n)}),up.on("click","body",function(e){var n;return n=t(e.target),n.closest(".up-popup").length||n.closest("[up-popup]").length?void 0:r()}),up.on("up:fragment:inserted",function(t,e){var r;return u(e)?(r=e.attr("up-source"))?s=r:void 0:n()}),up.bus.onEscape(function(){return r()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-popup").length?(r(),t.preventDefault()):void 0}),up.on("up:framework:reset",f),{attach:e,close:r,url:function(){return s},coveredUrl:i,config:o,defaults:function(){return m.error("up.popup.defaults(...) no longer exists. Set values on he up.popup.config property instead.")},contains:u,open:function(){return up.error("up.popup.open no longer exists. Please use up.popup.attach instead.")},source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")}}}(jQuery)}.call(this),function(){up.modal=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y;return h=up.util,r=h.config({maxWidth:null,minWidth:null,width:null,height:null,openAnimation:"fade-in",closeAnimation:"fade-out",closeLabel:"\xd7",template:function(t){return'<div class="up-modal">\n <div class="up-modal-dialog">\n <div class="up-modal-close" up-close>'+t.closeLabel+'</div>\n <div class="up-modal-content"></div>\n </div>\n</div>'}}),a=void 0,u=function(){var e;return e=t(".up-modal"),e.attr("up-covered-url")},f=function(){return n(),a=void 0,r.reset()},m=function(){var t;return t=r.template,h.isFunction(t)?t(r):t},p=function(){var e;return e=t(".up-modal"),e.attr("up-covered-url",up.browser.url()),e.attr("up-covered-title",document.title)},s=function(){var e;return e=t(".up-modal"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},i=function(e){var n,r,o,u;return o=t(m()),e.sticky&&o.attr("up-sticky",""),o.attr("up-covered-url",up.browser.url()),o.attr("up-covered-title",document.title),r=o.find(".up-modal-dialog"),h.isPresent(e.width)&&r.css("width",e.width),h.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),h.isPresent(e.height)&&r.css("height",e.height),n=o.find(".up-modal-content"),u=h.$createElementFromSelector(e.selector),u.appendTo(n),o.appendTo(document.body),p(),o.hide(),o},v=[],d=function(){var e,n,r,o;return r=h.scrollbarWidth(),e=parseInt(t("body").css("padding-right")),n=r+e,o=h.temporaryCss(t("body"),{"padding-right":n+"px","overflow-y":"hidden"}),v.push(o),up.layout.anchoredRight().each(function(){var e,n,o,u;return e=t(this),n=parseInt(e.css("right")),o=r+n,u=h.temporaryCss(e,{right:o}),v.push(u)})},g=function(t,e,n){var r;return d(),t.show(),r=up.animate(t,e,n),r.then(function(){return up.emit("up:modal:opened")})},l=function(e,n){return n=h.options(n),n.$link=t(e),c(n)},y=function(t,e){return e=h.options(e),e.url=t,c(e)},c=function(e){var o,u,a,s,l,c,p,f,d,m,v;return e=h.options(e),o=h.option(e.$link,h.nullJquery()),m=h.option(e.url,o.attr("up-href"),o.attr("href")),f=h.option(e.target,o.attr("up-modal"),"body"),v=h.option(e.width,o.attr("up-width"),r.width),p=h.option(e.maxWidth,o.attr("up-max-width"),r.maxWidth),l=h.option(e.height,o.attr("up-height"),r.height),s=h.option(e.animation,o.attr("up-animation"),r.openAnimation),d=h.option(e.sticky,h.castedAttr(o,"up-sticky")),c=up.browser.canPushState()?h.option(e.history,h.castedAttr(o,"up-history"),!0):!1,a=up.motion.animateOptions(e,o),n(),up.bus.nobodyPrevents("up:modal:open",{url:m})?(u=i({selector:f,width:v,maxWidth:p,height:l,sticky:d}),up.replace(f,m,{history:c,insert:function(){return g(u,s,a)}})):t.Deferred()},n=function(e){var n,o;return n=t(".up-modal"),n.length?up.bus.nobodyPrevents("up:modal:close",{$element:n})?(e=h.options(e,{animation:r.closeAnimation,url:n.attr("up-covered-url"),title:n.attr("up-covered-title")}),a=void 0,o=up.destroy(n,e),o.then(function(){for(var t;t=v.pop();)t();return up.emit("up:modal:closed")}),o):t.Deferred():h.resolvedDeferred()},e=function(){return t(".up-modal").is("[up-sticky]")?void 0:(s(),n())},o=function(e){var n;return n=t(e),n.closest(".up-modal").length>0},up.on("click","a[up-modal]",function(t,e){return t.preventDefault(),e.is(".up-current")?n():l(e)}),up.on("click","body",function(e){var r;return r=t(e.target),r.closest(".up-modal-dialog").length||r.closest("[up-modal]").length?void 0:n()}),up.on("up:fragment:inserted",function(t,n){var r;if(o(n)){if(r=n.attr("up-source"))return a=r}else if(!up.popup.contains(n))return e()}),up.bus.onEscape(function(){return n()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-modal").length?(n(),t.preventDefault()):void 0}),up.on("up:framework:reset",f),{visit:y,follow:l,open:function(){return up.error("up.modal.open no longer exists. Please use either up.modal.follow or up.modal.visit.")},close:n,url:function(){return a},coveredUrl:u,config:r,defaults:function(){return h.error("up.modal.defaults(...) no longer exists. Set values on he up.modal.config property instead.")},contains:o,source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")}}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,u,i,a;return a=up.util,r=a.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out"}),u=function(){return r.reset()},i=function(t,e,n){var r,o,u;return o=a.measure(t),u=a.measure(e),r=function(){switch(n){case"top":return{left:o.left+.5*(o.width-u.width),top:o.top-u.height};case"bottom":return{left:o.left+.5*(o.width-u.width),top:o.top+o.height};default:return a.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r)},o=function(t){var e;return e=a.$createElementFromSelector(".up-tooltip"),a.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),e},e=function(e,u){var s,l,c,p,f,d,m;return null==u&&(u={}),s=t(e),f=a.option(u.html,s.attr("up-tooltip-html")),m=a.option(u.text,s.attr("up-tooltip")),d=a.option(u.position,s.attr("up-position"),r.position),p=a.option(u.animation,a.castedAttr(s,"up-animation"),r.openAnimation),c=up.motion.animateOptions(u,s),n(),l=o({text:m,html:f}),i(s,l,d),up.animate(l,p,c)},n=function(e){var n;return n=t(".up-tooltip"),n.length?(e=a.options(e,{animation:r.closeAnimation}),e=a.merge(e,up.motion.animateOptions(e)),up.destroy(n,e)):void 0},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseover",function(){return e(t)}),t.on("mouseout",function(){return n()})}),up.on("click","body",function(){return n()}),up.on("up:framework:reset",n),up.bus.onEscape(function(){return n()}),up.on("up:framework:reset",u),{attach:e,close:n,open:function(){return a.error("up.tooltip.open no longer exists. Use up.tooltip.attach instead.")}}}(jQuery)}.call(this),function(){up.navigation=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;return h=up.util,i=h.config({currentClasses:["up-current"]}),p=function(){return i.reset()},a=function(){var t;return t=i.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},e="up-active",n=["a","[up-href]","[up-alias]"],o=n.join(", "),u=function(){var t,e,r;for(r=[],t=0,e=n.length;e>t;t++)m=n[t],r.push(m+"[up-instant]");return r}().join(", "),r="."+e,c=function(t){return h.isPresent(t)?h.normalizeUrl(t,{search:!1,stripTrailingSlash:!0}):void 0},d=function(t){var e,n,r,o,u,i,a,s,l,p;for(s=[],i=["href","up-href","up-alias"],n=0,o=i.length;o>n;n++)if(e=i[n],l=h.presentAttr(t,e))for(p="up-alias"===e?l.split(" "):[l],r=0,u=p.length;u>r;r++)a=p[r],"#"!==a&&(a=c(a),s.push(a));return s},g=function(t){var e,n,r,o;return t=h.compact(t),r=function(t){return"*"===t.substr(-1)?n(t.slice(0,-1)):e(t)},e=function(e){return h.contains(t,e)},n=function(e){return h.detect(t,function(t){return 0===t.indexOf(e)})},o=function(t){return h.detect(t,r)},{matchesAny:o}},l=function(){var e,n;return e=g([c(up.browser.url()),c(up.modal.url()),c(up.modal.coveredUrl()),c(up.popup.url()),c(up.popup.coveredUrl())]),n=a(),h.each(t(o),function(r){var o,u;return o=t(r),u=d(o),e.matchesAny(u)?o.addClass(n):o.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},f=function(t){return v(),t=s(t),t.addClass(e)},s=function(t){return h.presence(t.parents(o))||t},v=function(){return t(r).removeClass(e)},up.on("click",o,function(t,e){return h.isUnmodifiedMouseEvent(t)&&!e.is("[up-instant]")?f(e):void 0}),up.on("mousedown",u,function(t,e){return h.isUnmodifiedMouseEvent(t)?f(e):void 0}),up.on("up:fragment:inserted",function(){return v(),l()}),up.on("up:fragment:destroyed",function(t,e){return e.is(".up-modal, .up-popup")?l():void 0}),up.on("up:framework:reset",p),{config:i,defaults:function(){return h.error("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")}}}(jQuery)}.call(this),function(){up.browser.isSupported()&&(up.emit("up:framework:boot"),up.emit("up:framework:booted"))}.call(this),function(){}.call(this);
@@ -70,13 +70,13 @@ up.layout = (($) ->
70
70
 
71
71
  This will scroll a `<div class="main">...</div>` to a Y-position of 100 pixels:
72
72
 
73
- up.scoll('.main', 100);
73
+ up.scroll('.main', 100);
74
74
 
75
75
  \#\#\#\# Animating the scrolling motion
76
76
 
77
77
  The scrolling can (optionally) be animated.
78
78
 
79
- up.scoll('.main', 100, {
79
+ up.scroll('.main', 100, {
80
80
  easing: 'swing',
81
81
  duration: 250
82
82
  });
@@ -195,7 +195,10 @@ up.motion = (($) ->
195
195
  # We will let $new take up space in the element flow, but hide it.
196
196
  # The user will only see the two animated ghosts until the transition
197
197
  # is over.
198
- showNew = u.temporaryCss($new, visibility: 'hidden')
198
+ # Note that we must **not** use `visibility: hidden` to hide the new
199
+ # element. This would delay browser painting until the element is
200
+ # shown again, causing a flicker while the browser is painting.
201
+ showNew = u.temporaryCss($new, opacity: '0')
199
202
 
200
203
  promise = block(oldCopy.$ghost, newCopy.$ghost)
201
204
 
@@ -209,10 +212,10 @@ up.motion = (($) ->
209
212
  promise.then ->
210
213
  $old.removeData(GHOSTING_PROMISE_KEY)
211
214
  $new.removeData(GHOSTING_PROMISE_KEY)
212
- oldCopy.$bounds.remove()
213
- newCopy.$bounds.remove()
214
215
  # Now that the transition is over we show $new again.
215
216
  showNew()
217
+ oldCopy.$bounds.remove()
218
+ newCopy.$bounds.remove()
216
219
 
217
220
  promise
218
221
 
@@ -306,6 +309,9 @@ up.motion = (($) ->
306
309
  A promise for the transition's end.
307
310
  ###
308
311
  morph = (source, target, transitionOrName, options) ->
312
+
313
+ u.debug('Morphing %o to %o (using %o)', source, target, transitionOrName)
314
+
309
315
  $old = $(source)
310
316
  $new = $(target)
311
317
 
@@ -99,7 +99,7 @@ up.navigation = (($) ->
99
99
 
100
100
  if currentUrls.matchesAny(urls)
101
101
  $section.addClass(klass)
102
- else
102
+ else if $section.hasClass(klass) && $section.closest('.up-destroying').length == 0
103
103
  $section.removeClass(klass)
104
104
 
105
105
  ###*
@@ -462,12 +462,14 @@ up.util = (($) ->
462
462
 
463
463
  forceCompositing = ($element) ->
464
464
  oldTransforms = $element.css(['transform', '-webkit-transform'])
465
- if isBlank(oldTransforms)
465
+ if isBlank(oldTransforms) || oldTransforms['transform'] == 'none'
466
466
  memo = -> $element.css(oldTransforms)
467
467
  $element.css
468
468
  'transform': 'translateZ(0)'
469
469
  '-webkit-transform': 'translateZ(0)' # Safari
470
470
  else
471
+ # Since the element already has a transform, it is already
472
+ # drawn using compositing. Do nothing.
471
473
  memo = ->
472
474
  memo
473
475
 
@@ -1,5 +1,5 @@
1
1
  module Upjs
2
2
  module Rails
3
- VERSION = '0.12.3'
3
+ VERSION = '0.12.4'
4
4
  end
5
5
  end
@@ -74,15 +74,22 @@ describe 'up.motion', ->
74
74
  expect($oldGhost.parent().next()).toEqual($old)
75
75
  expect($newGhost.parent().next()).toEqual($new)
76
76
 
77
- # The actual elements are hidden, but $old will take up its original
78
- # space until the animation completes.
77
+ # The old element is removed from the layout flow.
78
+ # It will be removed from the DOM after the animation has ended.
79
79
  expect($old.css('display')).toEqual('none')
80
80
 
81
- expect($new.css(['display', 'visibility'])).toEqual(
81
+ # The new element is invisible due to an opacity of zero,
82
+ # but takes up the space in the layout flow.
83
+ expect($new.css(['display', 'opacity'])).toEqual(
82
84
  display: 'block',
83
- visibility: 'hidden'
85
+ opacity: '0'
84
86
  )
85
87
 
88
+ # We **must not** use `visibility: hidden` to hide the new
89
+ # element. This would delay browser painting until the element is
90
+ # shown again, causing a flicker while the browser is painting.
91
+ expect($new.css('visibility')).not.toEqual('hidden')
92
+
86
93
  # Ghosts will hover over $old and $new using absolute positioning,
87
94
  # matching the coordinates of the original elements.
88
95
  expect($oldBounds.css(['position', 'top', 'left', 'width', 'height'])).toEqual(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch