Diff
checker
Testo
Testo
Immagini
Documenti
Excel
Cartelle
Legal
Enterprise
Applicazione per desktop
Prezzi
Accedi
Scarica Diffchecker Desktop
Confronta il testo
Trova la differenza tra due file di testo
Strumenti
Cronologia
Editor live
Comprimi invariate
Senza a capo
Layout
Diviso
Unificato
Livello di dettaglio
Intelligente
Parola
Carattere
Evidenziazione sintassi
Scegli sintassi
Ignora
Trasforma testo
Vai alla prima modifica
Modifica input
Diffchecker Desktop
Il modo più sicuro per usare Diffchecker. Ottieni l'app Diffchecker Desktop: i tuoi diff non lasciano mai il tuo computer!
Ottieni Desktop
Untitled diff
Creato
11 anni fa
Il diff non scade mai
Eliminare
Esporta
Condividere
Spiegare
5 rimozioni
Linee
Totale
Rimosso
Caratteri
Totale
Rimosso
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
50 linee
Copia tutti
10 aggiunte
Linee
Totale
Aggiunto
Caratteri
Totale
Aggiunto
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
52 linee
Copia tutti
(function($, undefined) {
(function($, undefined) {
ko.bindingHandlers.timepicker = {
ko.bindingHandlers.timepicker = {
init: function (element, valueAccessor, allBindingsAccessor) {
init: function (element, valueAccessor, allBindingsAccessor) {
//initialize timepicker with some optional options
//initialize timepicker with some optional options
var options = allBindingsAccessor().timepickerOptions || {},
var options = allBindingsAccessor().timepickerOptions || {},
input = $(element).timepicker(options);
input = $(element).timepicker(options);
//handle the field changing
//handle the field changing
ko.utils.registerEventHandler(element, "time-change", function (event, time) {
ko.utils.registerEventHandler(element, "time-change", function (event, time) {
var observable = valueAccessor(),
var observable = valueAccessor(),
Copia
Copiato
Copia
Copiato
current = ko.utils.unwrapObservable(observable)
;
current = ko.utils.unwrapObservable(observable)
,
instance = $(element).timepicker()
;
if ( time === false ) {
if ( time === false ) {
Copia
Copiato
Copia
Copiato
observable( '
enter the value when input is empty here!
' );
observable( '
' );
} else if (current - time !== 0) {
} else if (current - time !== 0) {
Copia
Copiato
Copia
Copiato
observable(
time
);
observable(
instance.format(
time
)
);
}
}
});
});
//handle disposal (if KO removes by the template binding)
//handle disposal (if KO removes by the template binding)
ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
$(element).timepicker("destroy");
$(element).timepicker("destroy");
});
});
},
},
update: function (element, valueAccessor) {
update: function (element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor()),
var value = ko.utils.unwrapObservable(valueAccessor()),
// calling timepicker() on an element already initialized will
// calling timepicker() on an element already initialized will
// return a TimePicker object
// return a TimePicker object
Copia
Copiato
Copia
Copiato
instance = $(element).timepicker()
;
instance = $(element).timepicker()
,
time = $.fn.timepicker.parseTime( value )
;
Copia
Copiato
Copia
Copiato
if (
value
- instance.getTime() !== 0) {
if (
time
- instance.getTime() !== 0) {
instance.setTime(
value
);
instance.setTime(
time
);
}
}
}
}
};
};
var model = {
var model = {
// all Date objects returned by the timepicker have the date
// all Date objects returned by the timepicker have the date
// part set to Dec 31 1899. That date is not important, but
// part set to Dec 31 1899. That date is not important, but
// using the same value every time makes internal calculations
// using the same value every time makes internal calculations
// easier.
// easier.
Copia
Copiato
Copia
Copiato
time: ko.observable(
$.fn.timepicker.parseTime(
'2:20:35 pm'
)
)
time: ko.observable(
'2:20:35 pm'
)
}
}
$(function() {
$(function() {
ko.applyBindings(model);
ko.applyBindings(model);
});
});
})(jQuery);
})(jQuery);
Diff salvati
Testo originale
Apri file
(function($, undefined) { ko.bindingHandlers.timepicker = { init: function (element, valueAccessor, allBindingsAccessor) { //initialize timepicker with some optional options var options = allBindingsAccessor().timepickerOptions || {}, input = $(element).timepicker(options); //handle the field changing ko.utils.registerEventHandler(element, "time-change", function (event, time) { var observable = valueAccessor(), current = ko.utils.unwrapObservable(observable); if ( time === false ) { observable( 'enter the value when input is empty here!' ); } else if (current - time !== 0) { observable(time); } }); //handle disposal (if KO removes by the template binding) ko.utils.domNodeDisposal.addDisposeCallback(element, function () { $(element).timepicker("destroy"); }); }, update: function (element, valueAccessor) { var value = ko.utils.unwrapObservable(valueAccessor()), // calling timepicker() on an element already initialized will // return a TimePicker object instance = $(element).timepicker(); if (value - instance.getTime() !== 0) { instance.setTime(value); } } }; var model = { // all Date objects returned by the timepicker have the date // part set to Dec 31 1899. That date is not important, but // using the same value every time makes internal calculations // easier. time: ko.observable($.fn.timepicker.parseTime('2:20:35 pm')) } $(function() { ko.applyBindings(model); }); })(jQuery);
Testo modificato
Apri file
(function($, undefined) { ko.bindingHandlers.timepicker = { init: function (element, valueAccessor, allBindingsAccessor) { //initialize timepicker with some optional options var options = allBindingsAccessor().timepickerOptions || {}, input = $(element).timepicker(options); //handle the field changing ko.utils.registerEventHandler(element, "time-change", function (event, time) { var observable = valueAccessor(), current = ko.utils.unwrapObservable(observable), instance = $(element).timepicker(); if ( time === false ) { observable( '' ); } else if (current - time !== 0) { observable( instance.format( time ) ); } }); //handle disposal (if KO removes by the template binding) ko.utils.domNodeDisposal.addDisposeCallback(element, function () { $(element).timepicker("destroy"); }); }, update: function (element, valueAccessor) { var value = ko.utils.unwrapObservable(valueAccessor()), // calling timepicker() on an element already initialized will // return a TimePicker object instance = $(element).timepicker(), time = $.fn.timepicker.parseTime( value ); if (time - instance.getTime() !== 0) { instance.setTime( time ); } } }; var model = { // all Date objects returned by the timepicker have the date // part set to Dec 31 1899. That date is not important, but // using the same value every time makes internal calculations // easier. time: ko.observable( '2:20:35 pm' ) } $(function() { ko.applyBindings(model); }); })(jQuery);
Trovare la differenza