Permalink
Browse files

Merge branch 'master' of git://github.com/subtleGradient/mootools-core

  • Loading branch information...
2 parents d14ac12 + c87cd77 commit 7f3a51648ce4573c75afe9d4681000465ed447ac Valerio committed Apr 23, 2008
Showing with 26,456 additions and 0 deletions.
  1. +8 −0 Compatibility/Class/Class.js
  2. +9 −0 Compatibility/Core/Browser.js
  3. +18 −0 Compatibility/Core/Core.js
  4. +1 −0 Compatibility/Element/Element.Event.js
  5. +7 −0 Compatibility/Element/Element.Style.js
  6. +47 −0 Compatibility/Element/Element.js
  7. +9 −0 Compatibility/Fx/Fx.Morph.js
  8. +7 −0 Compatibility/Fx/Fx.Scroll.js
  9. +11 −0 Compatibility/Fx/Fx.Tween.js
  10. +17 −0 Compatibility/Fx/Fx.js
  11. +9 −0 Compatibility/Native/Array.js
  12. +9 −0 Compatibility/Native/Function.js
  13. +2 −0 Compatibility/Native/Hash.js
  14. +24 −0 Compatibility/Request/Request.JSON.js
  15. +37 −0 Compatibility/Request/Request.js
  16. +11 −0 Compatibility/Utilities/Cookie.js
  17. +4 −0 Compatibility/Utilities/JSON.js
  18. +39 −0 Compatibility/Utilities/Selectors.js
  19. +26 −0 Demos/Accordion/demo.css
  20. +36 −0 Demos/Accordion/demo.js
  21. BIN Demos/Accordion/images/biglittledog.jpg
  22. BIN Demos/Accordion/images/phylogenetic_tree.png
  23. +52 −0 Demos/Accordion/index.html
  24. +35 −0 Demos/CustomEvents/demo.css
  25. +48 −0 Demos/CustomEvents/demo.js
  26. +34 −0 Demos/CustomEvents/index.html
  27. +21 −0 Demos/Effects/demo.css
  28. +79 −0 Demos/Effects/demo.js
  29. BIN Demos/Effects/images/biglittledog.jpg
  30. BIN Demos/Effects/images/phylogenetic_tree.png
  31. +54 −0 Demos/Effects/index.html
  32. +26 −0 Demos/Element.Event/demo.css
  33. +44 −0 Demos/Element.Event/demo.js
  34. +29 −0 Demos/Element.Event/index.html
  35. +11 −0 Demos/Fx.Slide/demo.css
  36. +80 −0 Demos/Fx.Slide/demo.js
  37. +49 −0 Demos/Fx.Slide/index.html
  38. +30 −0 Demos/Mouseenter/demo.css
  39. +41 −0 Demos/Mouseenter/demo.js
  40. +41 −0 Demos/Mouseenter/index.html
  41. +12 −0 Demos/Request.JSON/data.json
  42. +35 −0 Demos/Request.JSON/demo.css
  43. +42 −0 Demos/Request.JSON/demo.js
  44. BIN Demos/Request.JSON/images/earth-blue.jpg
  45. BIN Demos/Request.JSON/images/earth-gold.jpg
  46. BIN Demos/Request.JSON/images/edit.jpg
  47. BIN Demos/Request.JSON/images/fire.jpg
  48. BIN Demos/Request.JSON/images/monitor.jpg
  49. BIN Demos/Request.JSON/images/mouse.jpg
  50. BIN Demos/Request.JSON/images/package.jpg
  51. BIN Demos/Request.JSON/images/setting.jpg
  52. BIN Demos/Request.JSON/images/speaker.jpg
  53. BIN Demos/Request.JSON/images/user.jpg
  54. +26 −0 Demos/Request.JSON/index.html
  55. +32 −0 Demos/Slider/demo.css
  56. +40 −0 Demos/Slider/demo.js
  57. BIN Demos/Slider/images/blue.png
  58. BIN Demos/Slider/images/green.png
  59. BIN Demos/Slider/images/red.png
  60. BIN Demos/Slider/images/slider.png
  61. +50 −0 Demos/Slider/index.html
  62. +31 −0 Demos/Sortables/demo.css
  63. +28 −0 Demos/Sortables/demo.js
  64. +32 −0 Demos/Sortables/index.html
  65. +45 −0 Demos/demos.json
  66. +31 −0 Demos/index.html
  67. +8 −0 Demos/license.md
  68. +393 −0 Docs/Class/Class.Extras.md
  69. +125 −0 Docs/Class/Class.md
  70. +38 −0 Docs/Core/Browser.md
  71. +433 −0 Docs/Core/Core.md
  72. +179 −0 Docs/Element/Element.Dimensions.md
  73. +323 −0 Docs/Element/Element.Event.md
  74. +122 −0 Docs/Element/Element.Style.md
  75. +1,740 −0 Docs/Element/Element.md
  76. +12 −0 Docs/Fx/Fx.CSS.md
  77. +214 −0 Docs/Fx/Fx.Morph.md
  78. +147 −0 Docs/Fx/Fx.Transitions.md
  79. +269 −0 Docs/Fx/Fx.Tween.md
  80. +169 −0 Docs/Fx/Fx.md
  81. +610 −0 Docs/Native/Array.md
  82. +180 −0 Docs/Native/Event.md
  83. +296 −0 Docs/Native/Function.md
  84. +610 −0 Docs/Native/Hash.md
  85. +135 −0 Docs/Native/Number.md
  86. +356 −0 Docs/Native/String.md
  87. +138 −0 Docs/Plugins/Accordion.md
  88. +136 −0 Docs/Plugins/Assets.md
  89. +274 −0 Docs/Plugins/Color.md
  90. +152 −0 Docs/Plugins/Drag.Move.md
  91. +192 −0 Docs/Plugins/Drag.md
  92. +111 −0 Docs/Plugins/Fx.Elements.md
  93. +233 −0 Docs/Plugins/Fx.Scroll.md
  94. +269 −0 Docs/Plugins/Fx.Slide.md
  95. +69 −0 Docs/Plugins/Group.md
  96. +114 −0 Docs/Plugins/Hash.Cookie.md
  97. +92 −0 Docs/Plugins/Scroller.md
  98. +135 −0 Docs/Plugins/Slider.md
  99. +44 −0 Docs/Plugins/SmoothScroll.md
  100. +264 −0 Docs/Plugins/Sortables.md
  101. +179 −0 Docs/Plugins/Tips.md
  102. +178 −0 Docs/Request/Request.HTML.md
  103. +40 −0 Docs/Request/Request.JSON.md
  104. +290 −0 Docs/Request/Request.md
  105. +107 −0 Docs/Utilities/Cookie.md
  106. +17 −0 Docs/Utilities/DomReady.md
  107. +57 −0 Docs/Utilities/JSON.md
  108. +299 −0 Docs/Utilities/Selectors.md
  109. +91 −0 Docs/Utilities/Swiff.md
  110. +33 −0 Docs/index.html
  111. +8 −0 Docs/license.md
  112. +82 −0 Source/Class/Class.Extras.js
  113. +89 −0 Source/Class/Class.js
  114. +118 −0 Source/Core/Browser.js
  115. +287 −0 Source/Core/Core.js
  116. +213 −0 Source/Element/Element.Dimensions.js
  117. +143 −0 Source/Element/Element.Event.js
  118. +140 −0 Source/Element/Element.Style.js
  119. +629 −0 Source/Element/Element.js
  120. +136 −0 Source/Fx/Fx.CSS.js
  121. +69 −0 Source/Fx/Fx.Morph.js
  122. +98 −0 Source/Fx/Fx.Transitions.js
  123. +95 −0 Source/Fx/Fx.Tween.js
  124. +127 −0 Source/Fx/Fx.js
  125. +140 −0 Source/Native/Array.js
  126. +114 −0 Source/Native/Event.js
  127. +61 −0 Source/Native/Function.js
  128. +135 −0 Source/Native/Hash.js
  129. +44 −0 Source/Native/Number.js
  130. +85 −0 Source/Native/String.js
  131. +100 −0 Source/Plugins/Accordion.js
  132. +95 −0 Source/Plugins/Assets.js
  133. +141 −0 Source/Plugins/Color.js
  134. +93 −0 Source/Plugins/Drag.Move.js
  135. +144 −0 Source/Plugins/Drag.js
  136. +49 −0 Source/Plugins/Fx.Elements.js
  137. +84 −0 Source/Plugins/Fx.Scroll.js
  138. +139 −0 Source/Plugins/Fx.Slide.js
  139. +40 −0 Source/Plugins/Group.js
  140. +51 −0 Source/Plugins/Hash.Cookie.js
  141. +54 −0 Source/Plugins/Scroller.js
  142. +135 −0 Source/Plugins/Slider.js
  143. +37 −0 Source/Plugins/SmoothScroll.js
  144. +178 −0 Source/Plugins/Sortables.js
  145. +128 −0 Source/Plugins/Tips.js
  146. +89 −0 Source/Request/Request.HTML.js
  147. +27 −0 Source/Request/Request.JSON.js
  148. +207 −0 Source/Request/Request.js
  149. +65 −0 Source/Utilities/Cookie.js
  150. +48 −0 Source/Utilities/DomReady.js
  151. +53 −0 Source/Utilities/JSON.js
  152. +356 −0 Source/Utilities/Selectors.js
  153. +100 −0 Source/Utilities/Swiff.js
  154. +194 −0 Specs/Class/Class.Extras.js
  155. +130 −0 Specs/Class/Class.js
  156. +40 −0 Specs/Core/Browser.js
  157. +424 −0 Specs/Core/Core.js
  158. +73 −0 Specs/Element/Element.Style.js
  159. +1,282 −0 Specs/Element/Element.js
  160. +231 −0 Specs/Native/Array.js
  161. +163 −0 Specs/Native/Function.js
  162. +235 −0 Specs/Native/Hash.js
  163. +167 −0 Specs/Native/Number.js
  164. +175 −0 Specs/Native/String.js
  165. +61 −0 Specs/Plugins/Selectors.Children.js
  166. +62 −0 Specs/Utilities/Color.js
  167. +8 −0 Specs/Utilities/Selectors.js
  168. +17 −0 Specs/Utilities/index.html
  169. +13 −0 Specs/demo.html
  170. +17 −0 Specs/index.html
  171. +34 −0 Tests/FX/Fx.Morph/test1.html
  172. +113 −0 Tests/Plugins/Sortables/test1.html
  173. +63 −0 Tests/Plugins/Sortables/test2.html
  174. +95 −0 Tests/Plugins/Sortables/test3.html
  175. +65 −0 Tests/Utilities/Selectors/test1.html
  176. BIN assets/images/graphs/Back.png
  177. BIN assets/images/graphs/Bounce.png
  178. BIN assets/images/graphs/Circ.png
  179. BIN assets/images/graphs/Cubic.png
  180. BIN assets/images/graphs/Elastic.png
  181. BIN assets/images/graphs/Expo.png
  182. BIN assets/images/graphs/Linear.png
  183. BIN assets/images/graphs/Quad.png
  184. BIN assets/images/graphs/Quart.png
  185. BIN assets/images/graphs/Quint.png
  186. BIN assets/images/graphs/Sine.png
  187. +118 −0 assets/scripts/Builder.js
  188. +1,807 −0 assets/scripts/DiffMatchPatch.js
  189. +1,512 −0 assets/scripts/JSSpec.js
  190. +140 −0 assets/scripts/JSSpecSpecs.js
  191. +80 −0 assets/scripts/demos.js
  192. +143 −0 assets/scripts/docs.js
  193. +1,296 −0 assets/scripts/showdown.js
  194. +256 −0 assets/styles/demos.css
  195. +293 −0 assets/styles/docs.css
  196. +297 −0 assets/styles/specs.css
  197. +77 −0 assets/styles/tests.css
  198. +21 −0 license.txt
  199. +246 −0 scripts.json
@@ -0,0 +1,8 @@
+Class.empty = $empty;
+
+//legacy .extend support
+
+Class.prototype.extend = function(properties){
+ properties.Extends = this;
+ return new Class(properties);
+};
@@ -0,0 +1,9 @@
+window.extend = document.extend = function(properties){
+ for (var property in properties) this[property] = properties[property];
+};
+
+window[Browser.Engine.name] = window[Browser.Engine.name + Browser.Engine.version] = true;
+
+window.ie = window.trident;
+window.ie6 = window.trident4;
+window.ie7 = window.trident5;
@@ -0,0 +1,18 @@
+$A = function(iterable, start, length){
+ if (Browser.Engine.trident && $type(iterable) == 'collection'){
+ start = start || 0;
+ if (start < 0) start = iterable.length + start;
+ length = length || (iterable.length - start);
+ var array = [];
+ for (var i = 0; i < length; i++) array[i] = iterable[start++];
+ return array;
+ }
+ start = (start || 0) + ((start < 0) ? iterable.length : 0);
+ var end = ((!$chk(length)) ? iterable.length : length) + start;
+ return Array.prototype.slice.call(iterable, start, end);
+};
+
+(function(){
+ var natives = [Array, Function, String, RegExp, Number];
+ for (var i = 0, l = natives.length; i < l; i++) natives[i].extend = natives[i].implement;
+})();
@@ -0,0 +1 @@
+Event.keys = Event.Keys;
@@ -0,0 +1,7 @@
+Element.implement({
+
+ setOpacity: function(op){
+ return this.set('opacity', op);
+ }
+
+});
@@ -0,0 +1,47 @@
+Element.extend = Element.implement;
+
+Elements.extend = Elements.implement;
+
+Element.implement({
+
+ getFormElements: function(){
+ return this.getElements('input, textarea, select');
+ },
+
+ replaceWith: function(el){
+ el = $(el);
+ this.parentNode.replaceChild(el, this);
+ return el;
+ },
+
+ removeElements: function(){
+ return this.dispose();
+ }
+
+});
+
+Element.alias({'dispose': 'remove', 'getLast': 'getLastChild'});
+
+Element.implement({
+
+ getText: function(){
+ return this.get('text');
+ },
+
+ setText: function(text){
+ return this.set('text', text);
+ },
+
+ setHTML: function(){
+ return this.set('html', arguments);
+ },
+
+ getHTML: function(){
+ return this.get('html');
+ },
+
+ getTag: function(){
+ return this.get('tag');
+ }
+
+});
@@ -0,0 +1,9 @@
+Fx.Styles = Fx.Morph;
+
+Element.implement({
+
+ effects: function(options){
+ return new Fx.Morph(this, options);
+ }
+
+});
@@ -0,0 +1,7 @@
+Fx.Scroll.implement({
+
+ scrollTo: function(y, x){
+ return this.start(y, x);
+ }
+
+});
@@ -0,0 +1,11 @@
+Fx.Style = function(element, property, options){
+ return new Fx.Tween(element, $extend({property: property}, options));
+};
+
+Element.implement({
+
+ effect: function(property, options){
+ return new Fx.Tween(this, $extend({property: property}, options));
+ }
+
+});
@@ -0,0 +1,17 @@
+Fx.implement({
+
+ custom: function(from, to){
+ return this.start(from, to);
+ },
+
+ clearTimer: function(){
+ return this.cancel();
+ },
+
+ stop: function(){
+ return this.cancel();
+ }
+
+});
+
+Fx.Base = Fx;
@@ -0,0 +1,9 @@
+Array.implement({
+
+ copy: function(start, length){
+ return $A(this, start, length);
+ }
+
+});
+
+Array.alias({erase: 'remove', combine: 'merge'});
@@ -0,0 +1,9 @@
+Function.extend({
+
+ bindAsEventListener: function(bind, args){
+ return this.create({'bind': bind, 'event': true, 'arguments': args});
+ }
+
+});
+
+Function.empty = $empty;
@@ -0,0 +1,2 @@
+Hash.alias({getKeys: 'keys', getValues: 'values', has: 'hasKey', combine: 'merge'});
+var Abstract = Hash;
@@ -0,0 +1,24 @@
+JSON.Remote = new Class({
+
+ options: {
+ key: 'json'
+ },
+
+ Extends: Request.JSON,
+
+ initialize: function(url, options){
+ this.parent(options);
+ this.onComplete = $empty;
+ this.url = url;
+ },
+
+ send: function(data){
+ if (!this.check(data)) return this;
+ return this.parent({url: this.url, data: {json: Json.encode(data)}});
+ },
+
+ failure: function(){
+ this.fireEvent('onFailure', this.xhr);
+ }
+
+});
@@ -0,0 +1,37 @@
+Object.toQueryString = Hash.toQueryString;
+
+var XHR = new Class({
+
+ Extends: Request,
+
+ options: {
+ update: false
+ },
+
+ initialize: function(url, options){
+ this.parent(options);
+ this.url = url;
+ },
+
+ request: function(data){
+ return this.send(this.url, data || this.options.data);
+ },
+
+ send: function(url, data){
+ if (!this.check(url, data)) return this;
+ return this.parent({url: url, data: data});
+ },
+
+ success: function(text, xml){
+ text = this.processScripts(text);
+ if (this.options.update) $(this.options.update).empty().set('html', text);
+ this.onSuccess(text, xml);
+ },
+
+ failure: function(){
+ this.fireEvent('onFailure', this.xhr);
+ }
+
+});
+
+var Ajax = XHR;
@@ -0,0 +1,11 @@
+Cookie.set = function(key, value, options){
+ return new Cookie(key, options).write(value);
+};
+
+Cookie.get = function(key){
+ return new Cookie(key).read();
+};
+
+Cookie.remove = function(key, options){
+ return new Cookie(key, options).dispose();
+};
@@ -0,0 +1,4 @@
+var Json = JSON;
+
+JSON.toString = JSON.encode;
+JSON.evaluate = JSON.decode;
@@ -0,0 +1,39 @@
+Native.implement([Element, Document], {
+
+ getElementsByClassName: function(className){
+ return this.getElements('.' + className);
+ },
+
+ getElementsBySelector: function(selector){
+ return this.getElements(selector);
+ }
+
+});
+
+Elements.implement({
+
+ filterByTag: function(tag){
+ return this.filter(tag);
+ },
+
+ filterByClass: function(className){
+ return this.filter('.' + className);
+ },
+
+ filterById: function(id){
+ return this.filter('#' + id);
+ },
+
+ filterByAttribute: function(name, operator, value){
+ return this.filter('[' + name + (operator || '') + (value || '') + ']');
+ }
+
+});
+
+var $E = function(selector, filter){
+ return ($(filter) || document).getElement(selector);
+};
+
+var $ES = function(selector, filter){
+ return ($(filter) || document).getElements(selector);
+};
@@ -0,0 +1,26 @@
+#accordion {
+ margin:20px 0px;
+}
+
+h3.toggler {
+ color:#222;
+ padding:2px 5px;
+ cursor:pointer;
+ font-size:13px;
+ font-weight:normal;
+ background-color:#eee;
+ border:1px solid #f5f5f5;
+ border-right-color:#ddd;
+ border-bottom-color:#ddd;
+ font-family:'Andale Mono', sans-serif;
+ margin: 0;
+}
+
+div.element p, div.element h4 {
+ margin:0px;
+ padding:4px;
+}
+
+blockquote {
+ padding:5px 20px;
+}
@@ -0,0 +1,36 @@
+window.addEvent('domready', function() {
+
+ //create our Accordion instance
+ var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.element', {
+ opacity: false,
+ onActive: function(toggler, element){
+ toggler.setStyle('color', '#f30');
+ },
+ onBackground: function(toggler, element){
+ toggler.setStyle('color', '#222');
+ }
+ });
+
+ //add click event to the "add section" link
+ $('add_section').addEvent('click', function(event) {
+ event.stop();
+
+ // create toggler
+ var toggler = new Element('h3', {
+ 'class': 'toggler',
+ 'html': 'Common descent'
+ });
+
+ // create content
+ var content = new Element('div', {
+ 'class': 'element',
+ 'html': '<p>A group of organisms is said to have common descent if they have a common ancestor. In biology, the theory of universal common descent proposes that all organisms on Earth are descended from a common ancestor or ancestral gene pool.</p><p>A theory of universal common descent based on evolutionary principles was proposed by Charles Darwin in his book The Origin of Species (1859), and later in The Descent of Man (1871). This theory is now generally accepted by biologists, and the last universal common ancestor (LUCA or LUA), that is, the most recent common ancestor of all currently living organisms, is believed to have appeared about 3.9 billion years ago. The theory of a common ancestor between all organisms is one of the principles of evolution, although for single cell organisms and viruses, single phylogeny is disputed</p>'
+ });
+
+ // position for the new section
+ var position = 0;
+
+ // add the section to our myAccordion using the addSection method
+ myAccordion.addSection(toggler, content, position);
+ });
+});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 7f3a516

Please sign in to comment.