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).bind('calculator:rendered', function(event, route) { | |
| alert('Только что отрисовалась страница' + route); | |
| }); |
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
| initialize: function(initData) { | |
| Plc | |
| // Создаем источники данных | |
| .set('User', { | |
| view: NO, | |
| initData: initData.User | |
| }) | |
| // Пример использования источника данных как вью-модели | |
| .set('Header', { |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"> | |
| <head> | |
| <title>Ренессанс</title> | |
| <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> | |
| ... | |
| <link href="/" rel="home"> | |
| <link href="@Url.Content("~/Content/static/css/main.css")" type="text/css" rel="stylesheet" /> | |
| ... |
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
| parse: function(response, xhr) { | |
| xhr.userData || (xhr.userData = {}); | |
| var actionName = xhr.userData.action, | |
| actionList = { | |
| do_action: function(data, xhr) { | |
| console.log('sended data', xhr.userData.sendedData); | |
| } | |
| }, | |
| action = actionList[actionName || this.action] || 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
| Calc.requestWraper(this.model, 'send', data, { | |
| action: 'do_action', | |
| options: { | |
| success: function(model, response) { | |
| // code here | |
| }.bind(this) | |
| } | |
| }); |
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
| target.mask(mask.toString(), { | |
| onFocus: this.processPlaceholder.bind(this), | |
| onBlur: this.processPlaceholder.bind(this), | |
| sanity: function(val) { | |
| // Перед началом ввода сбрасываем все ошибки контрола если они есть | |
| Calc.validateControl({ | |
| currentTarget: target[0], | |
| type: 'reset' | |
| }); |
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
| switch (data.name) { | |
| case 'UserName': | |
| break; | |
| case 'Email': | |
| if (!this.validateEmail(data)) { | |
| isValid = NO; | |
| } | |
| break; | |
| case 'Password': | |
| field = $('input[name=' + data.name + ']', form); |
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
| // Метод для проверки валидации контрола. В качестве принимается id валидаторв привязанный при создании | |
| checkValidation: function(event, canShowErrors) { | |
| // Валидаторы по номерам | |
| var validatorsFn = this.validatorsFn, | |
| control = event.currentTarget, | |
| $control = $(control), | |
| value = control.value, | |
| isRadio = control.type == 'radio', | |
| isSelect = control.tagName.toLowerCase() == 'select', | |
| acceptedEvents = { |
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
| Validators: [ | |
| { | |
| Enabled: true, | |
| ErrorMsg: '', | |
| IsValid: true, | |
| Method: 11, | |
| Params: {} | |
| }, | |
| { | |
| Enabled: true, |
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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |