Skip to content

Instantly share code, notes, and snippets.

View JohnDMathis's full-sized avatar

John Mathis JohnDMathis

  • Leankit
  • Waco, Texas
View GitHub Profile
@JohnDMathis
JohnDMathis / backbone_save_success
Created August 8, 2012 15:49
Backbone save success never fires
//This is my 'Save' handler in a view...
saveRequested: function () {
this.model.save({
success: function () {
put('saved'); <-- never gets here, even when response is 200/OK
this.close();
},
error: function () {
put('error');
}
@JohnDMathis
JohnDMathis / marionette_preloadTemplates.js
Created September 13, 2012 05:07
Preload Marionettejs Templates
Backbone.Marionette.TemplateCache.preloadTemplate = function (templateId, context) {
// preload a single template
var loader = $.Deferred();
var that = this;
var msg;
var err;
if (!templateId || templateId.length == 0) {
err = new Error('No templateId was specified - please provide a valid template id or filename.');
err.name = "NoTemplateSpecified";
throw err;
@JohnDMathis
JohnDMathis / PreloadedMarionetteTemplatesWithJasmine
Created November 30, 2012 00:58
Preload Marionette templates as needed, before any tests are run
// Preload Marionette templates as needed, before any tests are run
// ---------------------------
// jasmine SpecRunner.html:
// [cut]
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine-html.js"></script>
<script type="text/javascript">
@JohnDMathis
JohnDMathis / GalleryModels.cs
Created December 6, 2012 17:39
Gallery Models
public class GallerySet
{
public GalleryLayout Layout { get; set; }
public List<GalleryItem> Items { get; set; }
}
public class GalleryItem
{
public int Id { get; set; }
public int ChannelId { get; set; }
public GalleryItemType Type { get; set; }
@JohnDMathis
JohnDMathis / gist:5259401
Created March 28, 2013 00:17
It would be very helpful to be able to use request/response with context ("this") properly filled and available in the response function. Is this possible? In the example below, "this" is a reference to the instance 'someView'.
App.views.SomeView=Marionette.ItemView.extend({
initialize:function(){
this.fud = "-quux";
App.reqres.setHandler("foo", function(bar){
return bar + this.fud;
}, this);
}
});
var someView = new App.views.SomeView();
@JohnDMathis
JohnDMathis / ModuleHelper - simple
Created April 25, 2013 21:55
Loads template files dynamically for a Marionette's Module.
Marionette.ModuleHelper = (function(Marionette, _) {
"use strict";
var moduleHelper = { };
moduleHelper.templatePath = 'templates/';
moduleHelper.templateExt = ".html";
moduleHelper.templatePrefix = "";
@JohnDMathis
JohnDMathis / ModuleHelper - 2.js
Created May 1, 2013 00:11
Loads template files dynamically, using module-specific Ids.
Marionette.ModuleHelper = (function(Marionette, _) {
"use strict";
var moduleHelper = { };
moduleHelper.templatePath = 'templates/';
moduleHelper.templateExt = ".html";
moduleHelper.templatePrefix = "";
@JohnDMathis
JohnDMathis / ModuleHelper - 3.js
Created May 8, 2013 05:26
ModuleHelper is a Marionette plug-in that facilitates dynamic loading of template files for modules.
// use handlebars instead of underscore templates
Marionette.TemplateCache.prototype.compileTemplate = function (rawTemplate) {
return Handlebars.compile(rawTemplate);
};
// workaround for a handlebars issue
// compiled templates get an extra text node generated
@JohnDMathis
JohnDMathis / test.js
Last active August 29, 2015 14:14
simple stateful module
var state = {
foo: 'bam'
};
function getState() {
return this;
}
function setBoo() {
this.foo = "boo";

Connections TEST PLAN

Need to check all scenarios for display of connections menu and "move to > taskboard" menu item.

  • Have a user with full permissions and a user with "No access".
  • Make sure you have a "manager" user, and a "reader" user
  • Make sure you have the following cards:
    • One parent card with 2 connected boards
    • One with a taskboard with a task card on it
  • One with neither taskboard or connected boards