Created
January 24, 2012 18:28
-
-
Save gabrielmoreira/1671739 to your computer and use it in GitHub Desktop.
POST: Sofrimento e aprendizado - Arquitetura de aplicações javascript
This file contains 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 Modal(target, options) { | |
this.target = target ; | |
this.options = options; | |
} | |
Modal.prototype.show = function() { | |
} | |
$.fn.modal = function(options) { | |
... // instanciar e armazenar o plugin --> new Modal($(this), options) | |
} |
This file contains 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 Classe() {} | |
Classe.prototype.metodo = function() {} | |
new Classe(); |
This file contains 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 Classe() { | |
$.proxyAll(this); | |
} | |
Classe.prototype.metodo = function() {} | |
new Classe(); |
This file contains 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
$.proxyAll = function(object, scope) { | |
scope = scope || object; | |
$.each(object, function(key, value) { | |
if ($.type(value) === 'function') { | |
object[key] = $.proxy(value, scope); | |
} | |
}); | |
}; |
This file contains 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
.valor { background-color: green } | |
.stateComErro .valor {background-color: red} |
This file contains 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
<TR class="stateComErro"> | |
<TD></TD> | |
<TD class="valor"></TD> | |
</TR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment