This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// receives: { name: [ { minimumLength: 5 } ] } | |
// fetches field's validations and uses validators | |
// todo: maybe find a way to do so without as many for? | |
function validateField(fieldValidations) { | |
for (fieldName in fieldValidations) { | |
for (validatorIndex in fieldValidations[fieldName]) { | |
for (validator in fieldValidations[fieldName][validatorIndex]) { | |
useValidator(validator, fieldValidations[fieldName][validatorIndex][validator]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ db: | |
{ databaseName: 'thinair', | |
serverConfig: | |
{ host: 'my.fantastic.host.com', | |
port: 27017, | |
options: [Object], | |
internalMaster: true, | |
connected: true, | |
poolSize: 4, | |
ssl: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var helpers = require('../helpers'); | |
if (helpers.is_post(req)) { | |
this.Projects.byCode(req.params.project_code, function(project) { | |
if (!project) { | |
require('../helpers').flash(req, 'error', 'Unable to find project.'); | |
res.redirect('/projects'); | |
} | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Utilisation de OrderQtyUoMCode (25 => kg) | |
.AddColumnTemplate(New ViewTemplateColumn("OrderQty", Languages.Translate(Rsx.DBColumnRsx, "WeightOrder"), 25, iIndex.NextValue, False, False, ViewTemplateColumn.ColumnFormat.Numeric, DataFormat.GetNumericMask(6, 4, True)) With {.ColumnEdit = New SixIRepositoryTextBoxNumeric(6, 4, True)}) | |
.AddColumnTemplate(New ViewTemplateColumn("OrderQtyUoMCode", Languages.Translate(Rsx.DBColumnRsx, "WeightUoM"), 25, iIndex.NextValue, False, False)) | |
.AddColumnTemplate(New ViewTemplateColumnMultiField(ViewTemplateColumnMultiField.ColumnMergeType.ValueWithUoM, " ", {"OrderQty", "OrderQtyUoMCode"}.ToList) With {.Caption = Translate(Rsx.DBColumnRsx, "WeightOrder"), .IsVisible = True, .ShowInColumnChooser = True, .VisibleIndex = iIndex.NextValue, .Width = 25, .ColumnNameSortGroup = "WeightOrder", .Alignment = ViewTemplateColumn.ColumnAlignement.AlignFar}) | |
' Donne par exemple: 952.56kg | |
' -------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function xhr(options, callback) { | |
var xhr = new XMLHttpRequest(), | |
method = options.method || 'get'; | |
xhr.onreadystatechange = function() { | |
if (this.readyState === 4) { | |
callback(this.response || this.responseText || this.responseXML); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// getByCode is now availaible from the client! | |
socket.on('getByCode', function (code, callback) { | |
getByCode(code, function(project){ | |
callback(project); | |
}) | |
}); | |
// gets a project by its code | |
getByCode: function(code, callback) { | |
this.baseFindOne({ code: code }, function(project) { | |
return callback(project ? project : null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
io: null, | |
initialize: function(server) { | |
this.io = require('socket.io').listen(server); | |
this.io.sockets.on('connection', function(socket) { | |
// how to inject stuff here? | |
}); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
io: null, | |
socket: null, | |
initialize: function(server) { | |
console.log("initialized!"); | |
this.io = require('socket.io').listen(server); | |
var that = this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
io: null, | |
socket: null, | |
createReactiveMethod: null, | |
initialize: function(server) { | |
console.log("initialized!"); | |
this.io = require('socket.io').listen(server); | |
var that = this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Model = function(name) { | |
this.ModelName = name; | |
this.Model = Parse.Object.extend(this.ModelName); | |
this.ModelInstance = new this.Model(); | |
this.getList = function(callback){ | |
var query = new Parse.Query(this.Model); | |
query.find({ | |
success: function(results) { | |
callback(results); |
OlderNewer