Skip to content

Instantly share code, notes, and snippets.

View slorber's full-sized avatar
🏠
Working from home

Sébastien Lorber slorber

🏠
Working from home
View GitHub Profile
onEditorKeyUp: function(e) {
var intercepted = this.interceptKeyUpDownEventsForSuggestionView(e,false);
if ( !intercepted ) {
this.handleModifiedSuggestionsUnwrapping();
this.startAutosaveTimerIfWordKey(e);
// /!\ The suggestion dropdown must absolutely be bound to keyup (and not keydown)
// because the currently typed char is not yet inserted in the editor!
this.maybeShowSuggestionsDropdownView();
}
var browserify = require('browserify');
var gulp = require('gulp');
var gutil = require('gulp-util');
var handleErrors = require('../util/handleErrors');
var source = require('vinyl-source-stream');
var wrench = require('wrench');
var path = require('path');
var fs = require('fs');
var Stamples = React.createClass({
mixins: [ScrollbarNearBottomMixin],
NumberOfItemsParPage: 10,
propTypes: {
appState: React.PropTypes.object.isRequired,
updateAppState: React.PropTypes.func.isRequired
{
"_readableState":{
"highWaterMark":16384,
"buffer":[
],
"length":0,
"pipes":null,
"pipesCount":0,
"flowing":false,
var Spaces = React.createClass({
propTypes: {
appState: React.PropTypes.object.isRequired,
updateAppState: React.PropTypes.func.isRequired
},
// TODO temporary to fluidify the carousel swipes, probably not so good
shouldComponentUpdate: function(nextProps,nextState) {
'use strict';
var React = require("react/addons");
var Q = require("q");
var Main = require("components/layout/main");
var CurrentUserService = require("services/currentUserService");
var ApiRequestSessionHolder = require("repositories/utils/apiRequestSessionHolder");
var AppState = function() { };
AppState.prototype = {
updateAppState: function(updateFunction) {
console.debug("before updating:",this);
console.debug("before updating:",this.prototype.constructor);
console.debug("before updating:",this.constructor);
console.debug("before updating:",new this.constructor());
console.debug("before updating:",new this.prototype.constructor());
var AppState = function() { };
AppState.prototype = {
updateAppState: function(updateFunction) {
console.debug("before updating:",this);
console.debug("before updating:",this.constructor);
console.debug("before updating:",new this.constructor());
console.debug("before updating:",new this.prototype.constructor());
Preconditions.checkMandatoryParameter(updateFunction,"updateFunction is required");
'use strict';
var React = require("react/addons");
var DeepFreeze = require("common/deepFreeze");
var AtomUtils = require("state/atom/atomUtils");
var AtomCursor = require("state/atom/atomCursor");
function noop() { } // Convenient but probably not performant: TODO ?
function setupAsyncValueSwapping(atom,path,asyncValue,promise) {
var deferred = Q.defer();
promise
.then(function asyncCompletionSuccess(data) {
var swapped = atom.compareAndSwapPathValue(path,asyncValue,asyncValue.toSuccess(data));
if ( swapped ) {
deferred.resolve(data);
} else {
deferred.reject(new Error("Async value completion for path "+path+" but swap=false"));