Skip to content

Instantly share code, notes, and snippets.

App.EditusersaclController = Ember.Controller.extend({
availableUsers: [],
allowedUsers: [],
updateUsersList: function () {
this.send('updateListForProperty', 'available');
this.send('updateListForProperty', 'allowed');
},
// Model definition code
Essaissprout.A = SC.Record.extend({
aProp: SC.Record.attr(String),
bLink: SC.Record.toOne('Essaissprout.B', {inverse: 'aLink'})
});
Essaissprout.B = SC.Record.extend({
bProp: SC.Record.attr(String),
aLink: SC.Record.toMany('Essaissprout.A', {inverse: 'bLink'})
newVolunteerButton: SC.ButtonView.extend({
controlSize: SC.HUGE_CONTROL_SIZE,
layout: {width: 250, height: 30},
localize: YES,
title: 'New Volunteer',
action: 'newVolunteer'
}),
/* mainPane and view hierarchy skipped */
manifestationDetailsView: SC.View.extend({
layout: { centerX: 0, width: 200, top: 20, height: 150},
contentBinding: 'Bvc.manifestationController',
render: function (ctx) {
Bisk.FieldSetView = SC.View.extend({
label: '',
classNames: 'fieldset'.w(),
render: function(ctx) {
ctx = ctx.begin()
.addClass('fieldset-label')
.push(this.get('label'))
var myWrapper = function(path, caller, handler) {
if (arguments > 3) {
var additionnal_arguments = arguments.slice(4);
}
// The 'notify()' call could take a variable number of args passed along to the "handler" callback
// My goal was to give it "additionnal_arguments" content ...
MyApp.MainPage.MainPain: SC.MainPane.create({
testView: SC.View.extend( {
render: function(ctx) {
ctx.push('<form id="login-test" action="http://www.logx.ch" method="POST">');
ctx.push('<input name="username" type="text" id="login-name" />');
ctx.push('<input name="password" type="password" id="login-passwd" />');
ctx.push('<input type="submit" />');
ctx.push('</form>');
}
AuthAo.loginController = SC.Controller.create({
setFieldsWithBrowserDefault: function() {
this.set('username', $('#login-name').val());
this.set('password', $('#login-passwd').val());
}
});
Messages.MessagesListController = SC.ArrayController.create(SC.CollectionViewDelegate, {
checkContentStatus: function() {
var cs = this.getPath('content.status');
SC.Logger.log(cs);
if (cs & SC.Record.READY) {
Messages.statechart.sendEvent('reloadMessages');
}
E = [7,8,9]
def L(i, x):
for j in range(E):
if j != i:
res *= (x-j)/(i-j)
return res