Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var renderedElement = crel('input'),
updateEventNames = (this.updateEventName || "change").split(' ');
this._removeHandlers.push(this.gaffa.events.on(this.updateEventName || "change", renderedElement, setValue));
this.renderedElement = renderedElement;
};
Textbox.prototype.value = new Gaffa.Property(updateValue);
Textbox.prototype.subType = new Gaffa.Property(updateSubType);
Textbox.prototype.placeholder = new Gaffa.Property(updatePlaceholder);
Textbox.prototype.disabled = new Gaffa.Property(updateDisabled);
Textbox.prototype.required = new Gaffa.Property(updateRequired);
module.exports = Textbox;
Textbox.prototype.render = function(){
var renderedElement = crel('input'),
updateEventNames = (this.updateEventName || "change").split(' ');
this._removeHandlers.push(this.gaffa.events.on(this.updateEventName || "change", renderedElement, setValue));
this.renderedElement = renderedElement;
};
Textbox.prototype.value = new Gaffa.Property(updateValue);
Textbox.prototype.subType = new Gaffa.Property(updateSubType);
Textbox.prototype.placeholder = new Gaffa.Property(updatePlaceholder);
Textbox.prototype.disabled = new Gaffa.Property(updateDisabled);
Textbox.prototype.required = new Gaffa.Property(updateRequired);
module.exports = Textbox;
var Gaffa = require('gaffa'),
actionType = "switch";
function Switch(){}
Switch = Gaffa.createSpec(Switch, Gaffa.Action);
Switch.prototype.type = actionType;
Switch.prototype['switch'] = new Gaffa.Property();
Switch.prototype.trigger = function(parent, scope, event) {
if(this['switch'].value != null){
this.triggerActions(this['switch'].value, scope, event);
}
};
module.exports = Switch;
this._removeHandlers.push(this.gaffa.events.on(this.updateEventName || "change", renderedElement, setValue));
this.renderedElement = renderedElement;
};
Textbox.prototype.value = new Gaffa.Property(updateValue);
Textbox.prototype.subType = new Gaffa.Property(updateSubType);
Textbox.prototype.placeholder = new Gaffa.Property(updatePlaceholder);
Textbox.prototype.disabled = new Gaffa.Property(updateDisabled);
Textbox.prototype.required = new Gaffa.Property(updateRequired);
module.exports = Textbox;
option.setAttribute('type', 'radio');
option.setAttribute('name', groupName);
option.setAttribute('value', currentValue);
option.setAttribute('id', groupName + currentValue);
label.innerHTML = gaffa.utils.getProp(value, i + gaffa.pathSeparator + property.textPath);
label.setAttribute('for', groupName + currentValue);
element.append($(container).append(option, label));
}
}
}
}
Radio.prototype.groupName = new Gaffa.Property(updateOptions);
Radio.prototype.options = new Gaffa.Property(updateOptions);
Radio.prototype.value = new Gaffa.Property(function (viewModel, value) {
var options = $(this.renderedElement).find('input');
options.each(function(){
var option = $(this);
if(value === option.attr('value')){
option.attr("checked", "checked");
}
});
});
module.exports = Radio;
var Gaffa = require('gaffa'),
actionType = "fromJson";
function FromJson(){}
FromJson = Gaffa.createSpec(FromJson, Gaffa.Action);
FromJson.prototype.type = actionType;
FromJson.prototype.trigger = function(){
this.target.set(JSON.parse(this.source.value), this);
};
FromJson.prototype.target = new Gaffa.Property();
FromJson.prototype.source = new Gaffa.Property();
module.exports = FromJson;
var Gaffa = require('gaffa'),
actionType = "toJson";
function ToJson(){}
ToJson = Gaffa.createSpec(ToJson, Gaffa.Action);
ToJson.prototype.type = actionType;
ToJson.prototype.trigger = function(){
this.target.set(JSON.stringify(this.source.value), this);
};
ToJson.prototype.target = new Gaffa.Property();
ToJson.prototype.source = new Gaffa.Property();
module.exports = ToJson;
break;
case "set":
window[action.storageType.value + 'Storage'].setItem(action.target.value, JSON.stringify(data));
break;
}
};
BrowserStorage.prototype.storageType = new Gaffa.Property({
value: 'local'
});
BrowserStorage.prototype.method = new Gaffa.Property({
value: 'get'
});
BrowserStorage.prototype.target = new Gaffa.Property();
BrowserStorage.prototype.source = new Gaffa.Property();
module.exports = BrowserStorage;
toObject = [];
this.target.set(toObject);
}
if(Array.isArray(toObject)){
var fromObj = this.source.value;
if(!(this.clone && this.clone.value === false)){
fromObj = this.gaffa.clone(fromObj);
}
var pushToBinding = this.gaffa.gedi.paths.append(this.target.binding, this.gaffa.gedi.paths.create(toObject.length.toString()));
this.gaffa.model.set(pushToBinding, fromObj, this, this.cleans.value ? false : null);
}else{
throw "Attempted to push to model property that was not an array, null, or undefined";
}
};
Push.prototype.target = new Gaffa.Property();
Push.prototype.source = new Gaffa.Property();
Push.prototype.cleans = new Gaffa.Property();
Push.prototype.clone = new Gaffa.Property({
value: true
});
module.exports = Push;
var Gaffa = require('gaffa'),
actionType = "set";
function Set(){}
Set = Gaffa.createSpec(Set, Gaffa.Action);
Set.prototype.type = actionType;
Set.prototype.trigger = function(){
var fromObj = this.source.value;
if(!(this.clone && this.clone.value === false)){
fromObj = this.gaffa.clone(fromObj);
}
this.target.set(fromObj, this.cleans.value ? false : null);
};
Set.prototype.target = new Gaffa.Property();
Set.prototype.source = new Gaffa.Property();
Set.prototype.clone = new Gaffa.Property();
Set.prototype.cleans = new Gaffa.Property();
module.exports = Set;