Diff
checker
Texto
Texto
Imagens
Documentos
Excel
Pastas
Legal
Enterprise
Aplicativo para desktop
Preços
Fazer login
Baixar o Diffchecker Desktop
Comparar texto
Encontre a diferença entre dois arquivos de texto
Ferramentas
Histórico
Editor live
Ocultar espaços em branco
Recolher inalteradas
Sem quebra de linha
Layout
Dividido
Unificado
Nível de detalhe
Inteligente
Palavra
Caractere
Estilos de texto
Alterar aparência
Realce de sintaxe
Escolher sintaxe
Ignorar
Transformar texto
Ir à primeira mudança
Editar entrada
Diffchecker Desktop
A maneira mais segura de usar o Diffchecker. Obtenha o aplicativo Diffchecker Desktop: seus diffs nunca saem do seu computador!
Obter Desktop
ShareBuy view before and after Rivets
Criado
há 10 anos
O diff nunca expira
Limpar
Exportar
Compartilhar
Explicar
73 remoções
Linhas
Total
Removido
Caracteres
Total
Removido
Para continuar usando este recurso, atualize para
Diff
checker
Pro
Ver preços
71 linhas
Copiar tudo
31 adições
Linhas
Total
Adicionado
Caracteres
Total
Adicionado
Para continuar usando este recurso, atualize para
Diff
checker
Pro
Ver preços
33 linhas
Copiar tudo
Copiar
Copiado
Copiar
Copiado
var toCurrency = require('../templates/helpers/formatcurrency');
var ShareBuyView = Marionette.ItemView.extend({
var ShareBuyView = Marionette.ItemView.extend({
Copiar
Copiado
Copiar
Copiado
template:
require('../templates/
newbuy.hbs'),
template:
false,
bindings: {
html:
require('../templates/
sharebuy.html'),
'[name=symbol]': {
observe: 'symbol',
events: ['blur']
},
'[name=price]': {
observe: 'price',
onGet: 'numToStr',
onSet: 'strToNum'
},
'[name=quantity]': {
observe: 'quantity',
onGet: 'numToStr',
onSet: 'strToNum'
},
'[name=date]': 'date'
},
initialize: function (options) {
initialize: function (options) {
Copiar
Copiado
Copiar
Copiado
this.state =
new Backbone.Model();
this.state =
{
isNew
:
!this.pristineModel
,
hasSymbol
:
!!this.symbol
}
;
this.state.set('
isNew
',
!this.pristineModel
);
if (this.state.
isNew
&& this.symbol) {
this.state.set('
hasSymbol
',
!!this.symbol
)
;
if (this.state.
get('
isNew
')
&& this.symbol) {
this.model.set('symbol', this.symbol.get('name'));
this.model.set('symbol', this.symbol.get('name'));
}
}
},
},
Copiar
Copiado
Copiar
Copiado
onBeforeRender: function() {
if (this.view) {
this.view.unbind();
this.view = null;
}
this.attachElContent(this.html);
this.view = rivets.bind(this.el, this);
},
onRender: function () {
onRender: function () {
this.updateMeanPrice();
this.updateMeanPrice();
Copiar
Copiado
Copiar
Copiado
this.stickit();
this.stickit(this.state, {
'#remove-buy': {
observe: 'isNew',
onGet: function (value) {
return !value
},
visible: true
},
'[name=symbol]':{
attributes: [
{
name: 'disabled',
observe: 'hasSymbol',
onGet: function (value) {
return value
}
}]
}
})
},
},
Copiar
Copiado
Copiar
Copiado
onDestroy: function() {
if (this.view) {
this.view.unbind();
this.view = null;
}
updateMeanPrice: function() {
updateMeanPrice: function() {
Copiar
Copiado
Copiar
Copiado
this.
$el.find('
.mean
-p
rice
').text(
this.symbol ?
toCurrency(
this.symbol.simulateMeanPrice(this.model)
)
:
'--')
;
this.
state
.mean
P
rice
=
this.symbol ?
this.symbol.simulateMeanPrice(this.model)
:
undefined
;
this.
$el.find('
.current
-m
ean
-p
rice
').text(
this.symbol ?
toCurrency(
this.symbol.meanPrice
) : '--');
this.
state
.current
M
ean
P
rice
=
this.symbol ?
this.symbol.meanPrice
: undefined;
},
}
strToNum: function (val) {
if (val != null) {
return +val;
}
},
numToStr: function (val) {
if (val != null) {
return val.toString();
}
}
});
});
Diferenças salvas
Texto original
Abrir arquivo
var toCurrency = require('../templates/helpers/formatcurrency'); var ShareBuyView = Marionette.ItemView.extend({ template: require('../templates/newbuy.hbs'), bindings: { '[name=symbol]': { observe: 'symbol', events: ['blur'] }, '[name=price]': { observe: 'price', onGet: 'numToStr', onSet: 'strToNum' }, '[name=quantity]': { observe: 'quantity', onGet: 'numToStr', onSet: 'strToNum' }, '[name=date]': 'date' }, initialize: function (options) { this.state = new Backbone.Model(); this.state.set('isNew', !this.pristineModel); this.state.set('hasSymbol', !!this.symbol); if (this.state.get('isNew') && this.symbol) { this.model.set('symbol', this.symbol.get('name')); } }, onRender: function () { this.updateMeanPrice(); this.stickit(); this.stickit(this.state, { '#remove-buy': { observe: 'isNew', onGet: function (value) { return !value }, visible: true }, '[name=symbol]':{ attributes: [ { name: 'disabled', observe: 'hasSymbol', onGet: function (value) { return value } }] } }) }, updateMeanPrice: function() { this.$el.find('.mean-price').text(this.symbol ? toCurrency(this.symbol.simulateMeanPrice(this.model)) : '--'); this.$el.find('.current-mean-price').text(this.symbol ? toCurrency(this.symbol.meanPrice) : '--'); }, strToNum: function (val) { if (val != null) { return +val; } }, numToStr: function (val) { if (val != null) { return val.toString(); } } });
Texto alterado
Abrir arquivo
var ShareBuyView = Marionette.ItemView.extend({ template: false, html: require('../templates/sharebuy.html'), initialize: function (options) { this.state = {isNew: !this.pristineModel, hasSymbol: !!this.symbol}; if (this.state.isNew && this.symbol) { this.model.set('symbol', this.symbol.get('name')); } }, onBeforeRender: function() { if (this.view) { this.view.unbind(); this.view = null; } this.attachElContent(this.html); this.view = rivets.bind(this.el, this); }, onRender: function () { this.updateMeanPrice(); }, onDestroy: function() { if (this.view) { this.view.unbind(); this.view = null; } updateMeanPrice: function() { this.state.meanPrice = this.symbol ? this.symbol.simulateMeanPrice(this.model) : undefined; this.state.currentMeanPrice = this.symbol ? this.symbol.meanPrice : undefined; } });
Encontrar Diferença