Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$question = $(this.templates.textQuestion({question: question}));
}
if(question.type === 'counter') {
$question = $(this.templates.counterQuestion({question: question}));
}
// Listen for changes to the question ...................................
// TODO: make it less verbose
// Listen for changes to the question text
var editQuestionProxy = $.proxy(this.editQuestionFactory(question), this);
$question.find('> div input').keyup(editQuestionProxy);
// Listen for a request to remove a question
// TODO: confirm delete
var deleteQuestionProxy = $.proxy(this.deleteQuestion($question, parent, questionIndex), this);
$question.find('> div .remove').click(deleteQuestionProxy);
// Listen for a request to add a question
var createQuestionProxy = $.proxy(this.createQuestionFactory(parent, questionIndex), this);
$question.find('.add-sub-question').click(createQuestionProxy);
// // Add a sub-question
// var $addSubQuestion = $answer.find('.add-sub-question');
// var addSubQuestionProxy = $.proxy(this.addSubQuestionFactory(question, index), this);
// $addSubQuestion.click(addSubQuestionProxy);
// // Listen for a request to add a photo question
// var createPhotoQuestionProxy = $.proxy(this.createPhotoQuestion(parent, questionIndex), this);
// $question.find('.add-photo-question').click(createPhotoQuestionProxy);
this.isDirty = false;
this.$el.addClass('attributeWidget');
this.$el.append(''+
'<div class="attributeSelector">'+
'<h2>Attributes</h2>'+
'<ul></ul>'+
'</div>'+
'<div class="attsContainer">'+
'</div>'+
schemaHelpEl);
if (this.$parent !== undefined) {
// add listeners for other form elements
$('[data-mapping]', this.$parent).each($.proxy(function(index, el) {
var formEl = $(el);
var type = formEl.data('type');
var mapping = formEl.data('mapping');
// check the mapping to make sure it's an attribute
// TODO if the data-type is hidden then the attribute should not be modifiable in this widget
if (mapping.indexOf('custom.') === -1 && mapping.indexOf('prop.') === -1) {
var changeEl;
if (type === 'radio') {
changeEl = $('input', formEl);
} else if (type === 'textbox' || type === 'select') {
changeEl = formEl;
}
if (changeEl !== undefined) {
changeEl.change($.proxy(function(mapping, e) {
var dataObj = {};
dataObj[mapping] = $(e.target).val();
Notify.prototype.bind = function() {
this.$el.hover(
$.proxy(this.mouseover, this),
$.proxy(this.hide, this)
);
var $close = this.$el.find('.transit-notify-close');
$close.click($.proxy(this.close, this));
// Prevent trigger transit event.
$close.mouseup(stopPropagation);
};
return $(this).text() === pageSize.toString();
}).attr('selected', true);
this.options.dataOptions.pageSize = parseInt(this.$pagesize.val(), 10);
}
// Shim until v3 -- account for older search class:
if (this.$searchcontrol.length <= 0) {
this.$searchcontrol = this.$element.find('.search');
}
this.columns = this.options.dataSource.columns();
this.$nextpagebtn.on('click', $.proxy(this.next, this));
this.$prevpagebtn.on('click', $.proxy(this.previous, this));
this.$searchcontrol.on('searched cleared', $.proxy(this.searchChanged, this));
this.$filtercontrol.on('changed', $.proxy(this.filterChanged, this));
this.$colheader.on('click', 'th', $.proxy(this.headerClicked, this));
if (this.$pagesize.hasClass('select')) {
this.$pagesize.on('changed', $.proxy(this.pagesizeChanged, this));
} else {
this.$pagesize.on('change', $.proxy(this.pagesizeChanged, this));
}
this.$pageinput.on('change', $.proxy(this.pageChanged, this));
this.renderColumns();
if (this.options.stretchHeight) this.initStretchHeight();
this.renderData();
};
this.$element = $(element);
this.options = $.extend({}, $.fn.wizard.defaults, options);
this.currentStep = 1;
this.numSteps = this.$element.find('li').length;
this.$prevBtn = this.$element.find('button.btn-prev');
this.$nextBtn = this.$element.find('button.btn-next');
kids = this.$nextBtn.children().detach();
this.nextText = $.trim(this.$nextBtn.text());
this.$nextBtn.append(kids);
// handle events
this.$prevBtn.on('click', $.proxy(this.previous, this));
this.$nextBtn.on('click', $.proxy(this.next, this));
this.$element.on('click', 'li.complete', $.proxy(this.stepclicked, this));
};
return 'bar';
},
_bar: function () {
return this._foo();
},
foo: function () {
return this._bar();
}
});
var cat = new Cat('Tom');
expect(cat._foo).toThrow();
expect(cat._bar).toThrow();
expect($.proxy(cat.foo, cat)).not.toThrow();
});
setupListeners () {
if (this.config.checkOnFocus) {
this.editable.on('focus', $.proxy(this, 'onFocus'))
this.editable.on('blur', $.proxy(this, 'onBlur'))
}
if (this.config.checkOnChange || this.config.removeOnCorrection) {
this.editable.on('change', $.proxy(this, 'onChange'))
}
if (this.config.checkOnInit) {
this.editable.on('init', $.proxy(this, 'onInit'))
}
}
marker = this.createMarker(jsonCode, map)
$geocodeReset.show()
} catch (e) {
$input.show()
$(document.getElementById(fieldId)).hide()
return false
}
} else {
marker = this.createMarker(jsonCode, map)
}
marker.on('dragend', $.proxy(this.setMarkerEvent, this, marker, $input, $geocodeReset, map))
map.on('click', $.proxy(this.setMarkerEvent, this, marker, $input, $geocodeReset, map))
$geocodeInput.on('keypress', $.proxy(this.requestGeocode, this, marker, $input, $geocodeReset, map))
$geocodeReset.on('click', $.proxy(this.resetMarker, this, marker, $input, $geocodeReset, map))
window.Rozier.$window.on('resize', $.proxy(this.resetMap, this, map, marker, mapOptions))
window.Rozier.$window.on('pageshowend', $.proxy(this.resetMap, this, map, marker, mapOptions))
this.resetMap(map, marker, mapOptions, null)
}
initialize: function initialize(options) {
options = options || {};
initialize.super$.call(this, '<div class="elessar-rangebar">');
this.options = $.extend({}, RangeBar.defaults, options);
this.options.min = this.options.valueParse(this.options.min);
this.options.max = this.options.valueParse(this.options.max);
if(this.options.barClass) this.$el.addClass(this.options.barClass);
if(this.options.vertical) this.$el.addClass('elessar-vertical');
this.ranges = [];
this.on('mousemove.elessar touchmove.elessar', $.proxy(this.mousemove, this));
this.on('mouseleave.elessar touchleave.elessar', $.proxy(this.removePhantom, this));
if(options.values) this.setVal(options.values);
for(var i = 0; i < options.bgLabels; ++i) {
this.addLabel(i / options.bgLabels);
}
var self = this;
if(options.indicator) {
var indicator = this.indicator = new Indicator({
parent: this,
vertical: this.options.vertical,
indicatorClass: options.indicatorClass
});
indicator.val(this.abnormalise(options.indicator(this, indicator, function() {
indicator.val(self.abnormalise(options.indicator(self, indicator)));</div>
initialize: function (options, main) {
options = this.setOptions(options);
main = this.main = lib.g(options.main) || $('.' + options.main)[0];
this.imgs = options.imgs || $('img', main).toArray();
Lazy.add(main, $.proxy(privates.load, this), options.offset);
}
}).implement(lib.configurable);