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
| var createPerson = function(name) { | |
| var _name = name; | |
| return { | |
| getName: function() { | |
| return _name; | |
| } | |
| }; | |
| }; |
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
| (function(module, undefined) { | |
| // Anything declared at this level is only accessible within this | |
| // function. Efectively, they will be the module's private variables. | |
| var _answer = 42; | |
| // The module's public interface is then defined by declaring variables on | |
| // the module variable that was passed in. | |
| module.getAnswer = function(question) { |
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
| (function(m) { | |
| m.doStuff = function() { | |
| // TODO: Stuff | |
| }; | |
| })(window.deeply.nested.module); | |
| window.deeply.nested.module.doStuff(); |
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
| (function($) { | |
| $.fn.enable = function() { | |
| // Enable each selected element by removing its 'disabled' attribute. | |
| return this.each(function() { | |
| $(this).removeAttr('disabled'); | |
| }); | |
| }; | |
| $.fn.disable = function() { |
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
| $.fn.disable = function() { | |
| return this.filter(':input').each(function() { | |
| $(this).attr('disabled', 'disabled'); | |
| }); | |
| }; |
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
| <head> | |
| <link rel="stylesheet" href="base.css" /> | |
| <link rel="stylesheet" href="mobile.css" media="max-width: 320px" /> | |
| <!-- OR --> | |
| <style type="text/css"> | |
| /* base styles go here */ | |
| @media (max-width: 320px) |
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
| <!-- Common styles --> | |
| <link rel="stylesheet" href="base.css" /> | |
| <!-- For tiny (most likely mobile) browsers --> | |
| <link rel="stylesheet" href="small.css" media="max-width: 320px" /> | |
| <!-- For small desktop or large mobile browsers --> | |
| <link rel="stylesheet" href="medium.css" | |
| media="min-width: 321px and max-width: 799px" /> |
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
| <meta name="viewport" content="width=device-width" /> |
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
| #wrapper | |
| { | |
| -webkit-transition: width 0.2s ease-in-out; | |
| -moz-transition: width 0.2s ease-in-out; | |
| -o-transition: width 0.2s ease-in-out; | |
| transition: width 0.2s ease-in-out; | |
| } |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Templates Yay</title> | |
| </head> | |
| <body> | |
| <div id="music"></div> | |
| <script id="musicTemplate" type="text/x-jquery-tmpl"> |