This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ART.Ellipse2 = new Class({ | |
| Extends: ART.Shape, | |
| initialize: function(width, height){ | |
| this.parent(); | |
| if (width != null && height != null) this.draw(width, height); | |
| }, | |
| draw: function(width, height){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Outer(): | |
| def __init__(self): | |
| self.test = 'LALALA LALA' | |
| class Inner(): | |
| def readOuter(that): | |
| that.blah = self.test | |
| return that.blah | |
| self.inner = Inner() | |
| def what(self): | |
| return self.inner.readOuter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // MooTools 1.3.0 Core Specs on Titanium Desktop 1.2.1 | |
| // Jasmine1.0.0.rc1 revision 1282853377 | |
| // 147 specs, 282 assertions, 40 failures in 5.619s | |
| runshould return 'regexp' for RegExp objects | |
| Expected 'RegExp' to equal 'regexp'. | |
| function () { | |
| expect(typeOf(/_/)).toEqual('regexp'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Slider.implement({ | |
| update: function(step){ | |
| // same as this.set() but doesn't fire any events | |
| if (!((this.range > 0) ^ (step < this.min))) step = this.min; | |
| if (!((this.range > 0) ^ (step > this.max))) step = this.max; | |
| this.step = Math.round(step); | |
| if (this.previousChange != this.step) this.previousChange = this.step; | |
| this.knob.setStyle(this.property, this.toPosition(this.step)); | |
| if (this.previousEnd !== this.step) this.previousEnd = this.step; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEvent('domready', function(){ | |
| /* # Turns ul/li list into an Accordion, using MooTools 1.2.4.4 | |
| <ul> | |
| <li><a href="#">Link A</a></li> | |
| <li><a href="#">Link B</a></li> | |
| <li class="active"> | |
| <a href="#">Link C</a> | |
| <ul> | |
| <li><a href="#">Sub A</a></li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Document.implement({ | |
| id: (function(){ | |
| var types = { | |
| string: function(id, nocash, doc){ | |
| id = doc.getElementById(id); | |
| return (id) ? types.element(id, nocash) : null; | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.implement({ | |
| remove: function(i) { | |
| var iSplat = $splat(i); | |
| return this.filter(function(item, index){ | |
| return !iSplat.contains(index); | |
| }); | |
| } | |
| }); | |
| console.log( ['a', 'b', 'c', 'd'].remove(1) ) // returns ['a', 'c', 'd'] |
NewerOlder