written 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/written/app/assets/javascripts/written/core/content.coffee +10 -10
- data/lib/written/app/assets/javascripts/written/core/cursor.coffee +6 -6
- data/lib/written/app/assets/javascripts/written/core/document.coffee +39 -6
- data/lib/written/app/assets/javascripts/written/parsers/block/code.coffee +34 -30
- data/lib/written/app/assets/javascripts/written/parsers/block/heading.coffee +28 -30
- data/lib/written/app/assets/javascripts/written/parsers/block/image.coffee +30 -49
- data/lib/written/app/assets/javascripts/written/parsers/block/olist.coffee +46 -49
- data/lib/written/app/assets/javascripts/written/parsers/block/paragraph.coffee +28 -32
- data/lib/written/app/assets/javascripts/written/parsers/block/quote.coffee +30 -32
- data/lib/written/app/assets/javascripts/written/parsers/block/ulist.coffee +43 -45
- data/lib/written/app/assets/javascripts/written/parsers/inline/code.coffee +28 -30
- data/lib/written/app/assets/javascripts/written/parsers/inline/italic.coffee +21 -25
- data/lib/written/app/assets/javascripts/written/parsers/inline/link.coffee +21 -25
- data/lib/written/app/assets/javascripts/written/parsers/inline/strong.coffee +21 -25
- data/lib/written/app/assets/javascripts/written/parsers/parsers.coffee +87 -19
- data/lib/written/app/assets/javascripts/written.coffee +0 -1
- data/lib/written/version.rb +1 -1
- data/test/server/app/assets/javascripts/application.coffee +5 -15
- metadata +2 -18
- data/lib/written/app/assets/javascripts/written/core/extensions/text.coffee +0 -2
- data/lib/written/app/assets/javascripts/written/core/stringify.coffee +0 -15
- data/lib/written/app/assets/javascripts/written/parsers/block.coffee +0 -69
- data/lib/written/app/assets/javascripts/written/parsers/inline/list.coffee +0 -27
- data/lib/written/app/assets/javascripts/written/parsers/inline.coffee +0 -81
- data/lib/written/app/assets/javascripts/written/polyfills/CustomElements/CustomElements.js +0 -32
- data/lib/written/app/assets/javascripts/written/polyfills/CustomElements/base.js +0 -40
- data/lib/written/app/assets/javascripts/written/polyfills/CustomElements/boot.js +0 -124
- data/lib/written/app/assets/javascripts/written/polyfills/CustomElements/observe.js +0 -318
- data/lib/written/app/assets/javascripts/written/polyfills/CustomElements/register.js +0 -369
- data/lib/written/app/assets/javascripts/written/polyfills/CustomElements/traverse.js +0 -86
- data/lib/written/app/assets/javascripts/written/polyfills/CustomElements/upgrade.js +0 -130
- data/lib/written/app/assets/javascripts/written/polyfills/MutationObserver/MutationObserver.js +0 -575
- data/lib/written/app/assets/javascripts/written/polyfills/WeakMap/WeakMap.js +0 -49
- data/lib/written/app/assets/javascripts/written/polyfills/base.coffee +0 -10
- data/lib/written/app/assets/javascripts/written/polyfills/dom.js +0 -104
@@ -1,104 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license
|
3
|
-
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
4
|
-
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
5
|
-
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
6
|
-
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
7
|
-
* Code distributed by Google as part of the polymer project is also
|
8
|
-
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
|
-
*/
|
10
|
-
|
11
|
-
(function(scope) {
|
12
|
-
|
13
|
-
'use strict';
|
14
|
-
|
15
|
-
// polyfill performance.now
|
16
|
-
|
17
|
-
if (!window.performance) {
|
18
|
-
var start = Date.now();
|
19
|
-
// only at millisecond precision
|
20
|
-
window.performance = {now: function(){ return Date.now() - start; }};
|
21
|
-
}
|
22
|
-
|
23
|
-
// polyfill for requestAnimationFrame
|
24
|
-
|
25
|
-
if (!window.requestAnimationFrame) {
|
26
|
-
window.requestAnimationFrame = (function() {
|
27
|
-
var nativeRaf = window.webkitRequestAnimationFrame ||
|
28
|
-
window.mozRequestAnimationFrame;
|
29
|
-
|
30
|
-
return nativeRaf ?
|
31
|
-
function(callback) {
|
32
|
-
return nativeRaf(function() {
|
33
|
-
callback(performance.now());
|
34
|
-
});
|
35
|
-
} :
|
36
|
-
function( callback ){
|
37
|
-
return window.setTimeout(callback, 1000 / 60);
|
38
|
-
};
|
39
|
-
})();
|
40
|
-
}
|
41
|
-
|
42
|
-
if (!window.cancelAnimationFrame) {
|
43
|
-
window.cancelAnimationFrame = (function() {
|
44
|
-
return window.webkitCancelAnimationFrame ||
|
45
|
-
window.mozCancelAnimationFrame ||
|
46
|
-
function(id) {
|
47
|
-
clearTimeout(id);
|
48
|
-
};
|
49
|
-
})();
|
50
|
-
}
|
51
|
-
|
52
|
-
// defaultPrevented is broken in IE.
|
53
|
-
// https://connect.microsoft.com/IE/feedback/details/790389/event-defaultprevented-returns-false-after-preventdefault-was-called
|
54
|
-
var workingDefaultPrevented = (function() {
|
55
|
-
var e = document.createEvent('Event');
|
56
|
-
e.initEvent('foo', true, true);
|
57
|
-
e.preventDefault();
|
58
|
-
return e.defaultPrevented;
|
59
|
-
})();
|
60
|
-
|
61
|
-
if (!workingDefaultPrevented) {
|
62
|
-
var origPreventDefault = Event.prototype.preventDefault;
|
63
|
-
Event.prototype.preventDefault = function() {
|
64
|
-
if (!this.cancelable) {
|
65
|
-
return;
|
66
|
-
}
|
67
|
-
|
68
|
-
origPreventDefault.call(this);
|
69
|
-
|
70
|
-
Object.defineProperty(this, 'defaultPrevented', {
|
71
|
-
get: function() {
|
72
|
-
return true;
|
73
|
-
},
|
74
|
-
configurable: true
|
75
|
-
});
|
76
|
-
};
|
77
|
-
}
|
78
|
-
|
79
|
-
var isIE = /Trident/.test(navigator.userAgent);
|
80
|
-
|
81
|
-
// CustomEvent constructor shim
|
82
|
-
if (!window.CustomEvent || isIE && (typeof window.CustomEvent !== 'function')) {
|
83
|
-
window.CustomEvent = function(inType, params) {
|
84
|
-
params = params || {};
|
85
|
-
var e = document.createEvent('CustomEvent');
|
86
|
-
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
87
|
-
return e;
|
88
|
-
};
|
89
|
-
window.CustomEvent.prototype = window.Event.prototype;
|
90
|
-
}
|
91
|
-
|
92
|
-
// Event constructor shim
|
93
|
-
if (!window.Event || isIE && (typeof window.Event !== 'function')) {
|
94
|
-
var origEvent = window.Event;
|
95
|
-
window.Event = function(inType, params) {
|
96
|
-
params = params || {};
|
97
|
-
var e = document.createEvent('Event');
|
98
|
-
e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));
|
99
|
-
return e;
|
100
|
-
};
|
101
|
-
window.Event.prototype = origEvent.prototype;
|
102
|
-
}
|
103
|
-
|
104
|
-
})(window.WebComponents);
|