#structure
/global
/components
global holds components shared by other components, components are privately scoped components.
#structure per component
/foobar
| (function(name, global, factory) { | |
| //amd | |
| if (typeof global.define === 'function' && global.define.amd) | |
| global.define([], function() { return factory; }); | |
| //common js | |
| else if (typeof global.module === 'object' && global.module.exports) { | |
| global.module.exports = factory; | |
#structure
/global
/components
global holds components shared by other components, components are privately scoped components.
#structure per component
/foobar
| { | |
| "color_scheme": "Packages/Colorsublime-Themes/Solarized (dark).tmTheme", | |
| "font_size": 11, | |
| "ignored_packages": | |
| [ | |
| "Vintage" | |
| ], | |
| "margin": -5 | |
| } |
| // https://jsfiddle.net/dlizik/x40fv8rk/ | |
| function treewalk(obj, bucket, pathStr, delim) { | |
| var i, p, last = pathStr.slice(0, pathStr.length - 1); | |
| if (Array.isArray(obj)) { | |
| if (obj.length === 0) | |
| bucket[last] = obj; | |
| else { |
| module.exports = ["$http", "$q", function($http, $q) { | |
| /** | |
| * @param opts {object} - hash of options | |
| * url | |
| * method | |
| * params | |
| * body | |
| * | |
| * @returns promise |
| /* | |
| var a = { | |
| b: { | |
| c: { | |
| d: false | |
| } | |
| } | |
| }; |
| //camelCase("foo", "bar", "fizz", "buzz") -> fooBarFizzBuzz | |
| //camelCase("bar", "foo", "bat" true) -> BarFooBat | |
| function camelCase() { | |
| var i, curr, str = ""; | |
| var args = Array.prototype.slice.call(arguments); | |
| var toggle = args.slice(args.length - 1, args.length)[0]; | |
| var strings = typeof toggle === "boolean" ? args.slice(0, args.length - 1) : args; | |
| for (i = 0; i < strings.length; i++) { | |
| if ( (i === 0 && typeof toggle === "boolean") || (i > 0) ) |
| var modal = (function(base) { | |
| "use strict"; | |
| var className = "itemContainer__item"; | |
| var containerClassName = "itemContainer"; | |
| var containerId = "bmk-itemContainer"; | |
| var classSelector = "." + className; | |
| var container = elem({ | |
| className: containerClassName, | |
| id: containerId |
| /** creates overlay and iframe module via bookmarklet */ | |
| (function() { | |
| var args = Array.prototype.slice.call(arguments); | |
| var iframeId = args.filter(function(a){return a.el === "IFRAME"})[0].id; | |
| var overlayId = args.filter(function(a){return a.el === "div"})[0].id; | |
| args.forEach(function(obj) { | |
| var el = document.createElement(obj.el); |