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 / queryStringToObject.js
Created October 20, 2016 04:47
Convert a query string to object
// convert queryString to params
var params = {};
window.location.search.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function(a, key, b, val) {
var num = Number(val);
if( !_.isNaN(num) && _.isNumber(num) ){
val = num;
} else {
if(val==="true") {

Purchase Dialog

pages

form 1 -- main

UI elements
	* title
	* body text
	* 3 read-only fields with labels
	* numeric entry for license count
  • 5 external links

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
@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";
@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 / 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 - 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 / 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 / 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 / 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">