PageRenderTime 63ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 1ms

/public/js/hackdashApp.js

https://github.com/14mmm/hackdash
JavaScript | 4843 lines | 3263 code | 972 blank | 608 comment | 509 complexity | c66b06278711345e4df8055e3fd84ce7 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. /*!
  2. * Hackdash - v0.5.1
  3. * Copyright (c) 2014 Hackdash
  4. *
  5. */
  6. (function (modules) {
  7. var resolve, getRequire, require, notFoundError, findFile
  8. , extensions = {".js":[],".json":[],".css":[],".html":[]};
  9. notFoundError = function (path) {
  10. var error = new Error("Could not find module '" + path + "'");
  11. error.code = 'MODULE_NOT_FOUND';
  12. return error;
  13. };
  14. findFile = function (scope, name, extName) {
  15. var i, ext;
  16. if (typeof scope[name + extName] === 'function') return name + extName;
  17. for (i = 0; (ext = extensions[extName][i]); ++i) {
  18. if (typeof scope[name + ext] === 'function') return name + ext;
  19. }
  20. return null;
  21. };
  22. resolve = function (scope, tree, path, fullpath, state) {
  23. var name, dir, exports, module, fn, found, i, ext;
  24. path = path.split('/');
  25. name = path.pop();
  26. if ((name === '.') || (name === '..')) {
  27. path.push(name);
  28. name = '';
  29. }
  30. while ((dir = path.shift()) != null) {
  31. if (!dir || (dir === '.')) continue;
  32. if (dir === '..') {
  33. scope = tree.pop();
  34. } else {
  35. tree.push(scope);
  36. scope = scope[dir];
  37. }
  38. if (!scope) throw notFoundError(fullpath);
  39. }
  40. if (name && (typeof scope[name] !== 'function')) {
  41. found = findFile(scope, name, '.js');
  42. if (!found) found = findFile(scope, name, '.json');
  43. if (!found) found = findFile(scope, name, '.css');
  44. if (!found) found = findFile(scope, name, '.html');
  45. if (found) {
  46. name = found;
  47. } else if ((state !== 2) && (typeof scope[name] === 'object')) {
  48. tree.push(scope);
  49. scope = scope[name];
  50. name = '';
  51. }
  52. }
  53. if (!name) {
  54. if ((state !== 1) && scope[':mainpath:']) {
  55. return resolve(scope, tree, scope[':mainpath:'], fullpath, 1);
  56. }
  57. return resolve(scope, tree, 'index', fullpath, 2);
  58. }
  59. fn = scope[name];
  60. if (!fn) throw notFoundError(fullpath);
  61. if (fn.hasOwnProperty('module')) return fn.module.exports;
  62. exports = {};
  63. fn.module = module = { exports: exports };
  64. fn.call(exports, exports, module, getRequire(scope, tree));
  65. return module.exports;
  66. };
  67. require = function (scope, tree, fullpath) {
  68. var name, path = fullpath, t = fullpath.charAt(0), state = 0;
  69. if (t === '/') {
  70. path = path.slice(1);
  71. scope = modules['/'];
  72. tree = [];
  73. } else if (t !== '.') {
  74. name = path.split('/', 1)[0];
  75. scope = modules[name];
  76. if (!scope) throw notFoundError(fullpath);
  77. tree = [];
  78. path = path.slice(name.length + 1);
  79. if (!path) {
  80. path = scope[':mainpath:'];
  81. if (path) {
  82. state = 1;
  83. } else {
  84. path = 'index';
  85. state = 2;
  86. }
  87. }
  88. }
  89. return resolve(scope, tree, path, fullpath, state);
  90. };
  91. getRequire = function (scope, tree) {
  92. return function (path) { return require(scope, [].concat(tree), path); };
  93. };
  94. return getRequire(modules, []);
  95. })({
  96. "client": {
  97. "app": {
  98. "HackdashApp.js": function (exports, module, require) {
  99. /**
  100. * Landing Application
  101. *
  102. */
  103. var HackdashRouter = require('./HackdashRouter')
  104. , ModalRegion = require('./views/ModalRegion');
  105. module.exports = function(){
  106. var app = module.exports = new Backbone.Marionette.Application();
  107. function initRegions(){
  108. app.addRegions({
  109. header: "header",
  110. main: "#main",
  111. footer: "footer",
  112. modals: ModalRegion
  113. });
  114. }
  115. function initRouter(){
  116. app.router = new HackdashRouter();
  117. Backbone.history.start({ pushState: true });
  118. }
  119. app.addInitializer(initRegions);
  120. app.addInitializer(initRouter);
  121. window.hackdash.app = app;
  122. window.hackdash.app.start();
  123. // Add navigation for BackboneRouter to all links
  124. // unless they have attribute "data-bypass"
  125. $(window.document).on("click", "a:not([data-bypass])", function(evt) {
  126. var href = { prop: $(this).prop("href"), attr: $(this).attr("href") };
  127. var root = window.location.protocol + "//" + window.location.host + (app.root || "");
  128. if (href.prop && href.prop.slice(0, root.length) === root) {
  129. evt.preventDefault();
  130. Backbone.history.navigate(href.attr, { trigger: true });
  131. }
  132. });
  133. };
  134. },
  135. "HackdashRouter.js": function (exports, module, require) {
  136. /*
  137. * Hackdash Router
  138. */
  139. var Dashboard = require("./models/Dashboard")
  140. , Project = require("./models/Project")
  141. , Projects = require("./models/Projects")
  142. , Dashboards = require("./models/Dashboards")
  143. , Collection = require("./models/Collection")
  144. , Collections = require("./models/Collections")
  145. , Profile = require("./models/Profile")
  146. , Header = require("./views/Header")
  147. , Footer = require("./views/Footer")
  148. , HomeLayout = require("./views/Home")
  149. , LoginView = require("./views/Login")
  150. , ProfileView = require("./views/Profile")
  151. , ProjectFullView = require("./views/Project/Full")
  152. , ProjectEditView = require("./views/Project/Edit")
  153. , ProjectsView = require("./views/Project/Layout")
  154. , DashboardsView = require("./views/Dashboard/Collection")
  155. , CollectionsView = require("./views/Collection/Collection");
  156. module.exports = Backbone.Marionette.AppRouter.extend({
  157. routes : {
  158. "" : "index"
  159. , "login" : "showLogin"
  160. , "projects" : "showProjects"
  161. , "projects/create" : "showProjectCreate"
  162. , "projects/:pid/edit" : "showProjectEdit"
  163. , "projects/:pid" : "showProjectFull"
  164. , "dashboards" : "showDashboards"
  165. , "collections" : "showCollections"
  166. , "collections/:cid" : "showCollection"
  167. , "users/profile": "showProfile"
  168. , "users/:user_id" : "showProfile"
  169. },
  170. index: function(){
  171. if (hackdash.subdomain){
  172. this.showDashboard();
  173. }
  174. else {
  175. this.showHome();
  176. }
  177. },
  178. removeHomeLayout: function(){
  179. $('body').removeClass("homepage");
  180. $('header').add('footer').show();
  181. $('#page').addClass('container');
  182. },
  183. showHome: function(){
  184. $('body').addClass("homepage");
  185. $('header').add('footer').hide();
  186. $('#page').removeClass('container');
  187. var app = window.hackdash.app;
  188. app.main.show(new HomeLayout());
  189. },
  190. getSearchQuery: function(){
  191. var query = hackdash.getQueryVariable("q");
  192. var fetchData = {};
  193. if (query && query.length > 0){
  194. fetchData = { data: $.param({ q: query }) };
  195. }
  196. return fetchData;
  197. },
  198. showLogin: function(){
  199. var providers = window.hackdash.providers;
  200. var app = window.hackdash.app;
  201. app.modals.show(new LoginView({
  202. model: new Backbone.Model({ providers: providers.split(',') })
  203. }));
  204. },
  205. showDashboard: function() {
  206. this.removeHomeLayout();
  207. var app = window.hackdash.app;
  208. app.type = "dashboard";
  209. app.dashboard = new Dashboard();
  210. app.projects = new Projects();
  211. app.header.show(new Header({
  212. model: app.dashboard,
  213. collection: app.projects
  214. }));
  215. app.main.show(new ProjectsView({
  216. model: app.dashboard,
  217. collection: app.projects
  218. }));
  219. app.footer.show(new Footer({
  220. model: app.dashboard
  221. }));
  222. var self = this;
  223. app.dashboard.fetch()
  224. .done(function(){
  225. app.projects.fetch(self.getSearchQuery(), { parse: true })
  226. .done(function(){
  227. app.projects.buildShowcase(app.dashboard.get("showcase"));
  228. });
  229. });
  230. },
  231. showProjects: function() {
  232. this.removeHomeLayout();
  233. var app = window.hackdash.app;
  234. app.type = "isearch";
  235. app.projects = new Projects();
  236. app.header.show(new Header({
  237. collection: app.projects
  238. }));
  239. app.main.show(new ProjectsView({
  240. collection: app.projects
  241. }));
  242. app.projects.fetch(this.getSearchQuery());
  243. },
  244. showProjectCreate: function(){
  245. this.removeHomeLayout();
  246. var app = window.hackdash.app;
  247. app.type = "project";
  248. app.dashboard = new Dashboard();
  249. app.project = new Project();
  250. app.header.show(new Header({
  251. model: app.dashboard
  252. }));
  253. app.main.show(new ProjectEditView({
  254. model: app.project
  255. }));
  256. app.dashboard.fetch();
  257. },
  258. showProjectEdit: function(pid){
  259. this.removeHomeLayout();
  260. var app = window.hackdash.app;
  261. app.type = "project";
  262. app.dashboard = new Dashboard();
  263. app.project = new Project({ _id: pid });
  264. app.header.show(new Header({
  265. model: app.dashboard
  266. }));
  267. app.main.show(new ProjectEditView({
  268. model: app.project
  269. }));
  270. app.dashboard.fetch();
  271. app.project.fetch();
  272. },
  273. showProjectFull: function(pid){
  274. this.removeHomeLayout();
  275. var app = window.hackdash.app;
  276. app.type = "project";
  277. app.dashboard = new Dashboard();
  278. app.project = new Project({ _id: pid });
  279. app.header.show(new Header({
  280. model: app.dashboard
  281. }));
  282. app.main.show(new ProjectFullView({
  283. model: app.project
  284. }));
  285. app.dashboard.fetch();
  286. app.project.fetch();
  287. },
  288. showCollections: function() {
  289. this.removeHomeLayout();
  290. var app = window.hackdash.app;
  291. app.type = "collections";
  292. app.collections = new Collections();
  293. app.header.show(new Header({
  294. collection: app.collections
  295. }));
  296. app.main.show(new CollectionsView({
  297. collection: app.collections
  298. }));
  299. app.collections.fetch(this.getSearchQuery());
  300. },
  301. showCollection: function(collectionId) {
  302. this.removeHomeLayout();
  303. var app = window.hackdash.app;
  304. app.type = "collection";
  305. app.collection = new Collection({ _id: collectionId });
  306. app.collection
  307. .fetch({ parse: true })
  308. .done(function(){
  309. app.header.show(new Header({
  310. model: app.collection
  311. }));
  312. app.main.show(new DashboardsView({
  313. hideAdd: true,
  314. collection: app.collection.get("dashboards")
  315. }));
  316. });
  317. },
  318. showProfile: function(userId) {
  319. this.removeHomeLayout();
  320. var app = window.hackdash.app;
  321. app.type = "profile";
  322. if (!userId){
  323. if (hackdash.user){
  324. userId = hackdash.user._id;
  325. }
  326. else {
  327. window.location = "/";
  328. }
  329. }
  330. app.profile = new Profile({
  331. _id: userId
  332. });
  333. app.profile.fetch({ parse: true });
  334. app.header.show(new Header());
  335. app.main.show(new ProfileView({
  336. model: app.profile
  337. }));
  338. },
  339. showDashboards: function() {
  340. this.removeHomeLayout();
  341. var app = window.hackdash.app;
  342. app.type = "dashboards";
  343. app.dashboards = new Dashboards();
  344. app.collections = new Collections();
  345. app.header.show(new Header({
  346. collection: app.dashboards
  347. }));
  348. app.main.show(new DashboardsView({
  349. collection: app.dashboards
  350. }));
  351. app.collections.getMines();
  352. app.dashboards.fetch(this.getSearchQuery());
  353. }
  354. });
  355. },
  356. "Initializer.js": function (exports, module, require) {
  357. module.exports = function(){
  358. window.hackdash = window.hackdash || {};
  359. window.hackdash.getQueryVariable = function(variable){
  360. var query = window.location.search.substring(1);
  361. var vars = query.split("&");
  362. for (var i=0;i<vars.length;i++) {
  363. var pair = vars[i].split("=");
  364. if(pair[0] === variable){return decodeURI(pair[1]);}
  365. }
  366. return(false);
  367. };
  368. if ($.fn.editable){
  369. // Set global mode for InlineEditor (X-Editable)
  370. $.fn.editable.defaults.mode = 'inline';
  371. }
  372. // Init Helpers
  373. require('./helpers/handlebars');
  374. require('./helpers/backboneOverrides');
  375. Placeholders.init({ live: true, hideOnFocus: true });
  376. window.hackdash.apiURL = "/api/v2";
  377. window.hackdash.startApp = require('./HackdashApp');
  378. };
  379. },
  380. "helpers": {
  381. "backboneOverrides.js": function (exports, module, require) {
  382. /*
  383. * Backbone Global Overrides
  384. *
  385. */
  386. // Override Backbone.sync to use the PUT HTTP method for PATCH requests
  387. // when doing Model#save({...}, { patch: true });
  388. var originalSync = Backbone.sync;
  389. Backbone.sync = function(method, model, options) {
  390. if (method === 'patch') {
  391. options.type = 'PUT';
  392. }
  393. return originalSync(method, model, options);
  394. };
  395. },
  396. "handlebars.js": function (exports, module, require) {
  397. /**
  398. * HELPER: Handlebars Template Helpers
  399. *
  400. */
  401. Handlebars.registerHelper('embedCode', function() {
  402. var embedUrl = window.location.protocol + "//" + window.location.host;
  403. var template = _.template('<iframe src="<%= embedUrl %>" width="100%" height="500" frameborder="0" allowtransparency="true" title="Hackdash"></iframe>');
  404. return template({
  405. embedUrl: embedUrl
  406. });
  407. });
  408. Handlebars.registerHelper('firstUpper', function(text) {
  409. return text.charAt(0).toUpperCase() + text.slice(1);
  410. });
  411. Handlebars.registerHelper('markdown', function(md) {
  412. return markdown.toHTML(md);
  413. });
  414. Handlebars.registerHelper('disqus_shortname', function() {
  415. return window.hackdash.disqus_shortname;
  416. });
  417. Handlebars.registerHelper('user', function(prop) {
  418. if (window.hackdash.user){
  419. return window.hackdash.user[prop];
  420. }
  421. });
  422. Handlebars.registerHelper('isLoggedIn', function(options) {
  423. if (window.hackdash.user){
  424. return options.fn(this);
  425. } else {
  426. return options.inverse(this);
  427. }
  428. });
  429. Handlebars.registerHelper('isDashboardView', function(options) {
  430. if (window.hackdash.app.type === "dashboard"){
  431. return options.fn(this);
  432. } else {
  433. return options.inverse(this);
  434. }
  435. });
  436. Handlebars.registerHelper('isSearchView', function(options) {
  437. if (window.hackdash.app.type === "isearch"){
  438. return options.fn(this);
  439. } else {
  440. return options.inverse(this);
  441. }
  442. });
  443. Handlebars.registerHelper('timeAgo', function(date) {
  444. if (date && moment(date).isValid()) {
  445. return moment(date).fromNow();
  446. }
  447. return "-";
  448. });
  449. Handlebars.registerHelper('formatDate', function(date) {
  450. if (date && moment(date).isValid()) {
  451. return moment(date).format("DD/MM/YYYY HH:mm");
  452. }
  453. return "-";
  454. });
  455. Handlebars.registerHelper('formatDateText', function(date) {
  456. if (date && moment(date).isValid()) {
  457. return moment(date).format("DD MMM YYYY, HH:mm");
  458. }
  459. return "";
  460. });
  461. Handlebars.registerHelper('formatDateTime', function(date) {
  462. if (date && moment(date).isValid()) {
  463. return moment(date).format("HH:mm");
  464. }
  465. return "";
  466. });
  467. Handlebars.registerHelper('timeFromSeconds', function(seconds) {
  468. function format(val){
  469. return (val < 10) ? "0" + val : val;
  470. }
  471. if (seconds && seconds > 0){
  472. var t = moment.duration(seconds * 1000),
  473. h = format(t.hours()),
  474. m = format(t.minutes()),
  475. s = format(t.seconds());
  476. return h + ":" + m + ":" + s;
  477. }
  478. return "-";
  479. });
  480. }
  481. },
  482. "index.js": function (exports, module, require) {
  483. jQuery(function() {
  484. require('./Initializer')();
  485. });
  486. },
  487. "models": {
  488. "Admins.js": function (exports, module, require) {
  489. /**
  490. * Collection: Administrators of a Dashboard
  491. *
  492. */
  493. var
  494. Users = require('./Users'),
  495. User = require('./User');
  496. module.exports = Users.extend({
  497. model: User,
  498. idAttribute: "_id",
  499. url: function(){
  500. return hackdash.apiURL + '/admins';
  501. },
  502. addAdmin: function(userId){
  503. $.ajax({
  504. url: this.url() + '/' + userId,
  505. type: "POST",
  506. context: this
  507. }).done(function(user){
  508. this.add(user);
  509. });
  510. },
  511. });
  512. },
  513. "Collection.js": function (exports, module, require) {
  514. /**
  515. * MODEL: Collection (a group of Dashboards)
  516. *
  517. */
  518. var Dashboards = require('./Dashboards');
  519. module.exports = Backbone.Model.extend({
  520. idAttribute: "_id",
  521. urlRoot: function(){
  522. return hackdash.apiURL + '/collections';
  523. },
  524. parse: function(response){
  525. response.dashboards = new Dashboards(response.dashboards || []);
  526. return response;
  527. },
  528. addDashboard: function(dashId){
  529. $.ajax({
  530. url: this.url() + '/dashboards/' + dashId,
  531. type: "POST",
  532. context: this
  533. });
  534. this.get("dashboards").add({ _id: dashId });
  535. },
  536. removeDashboard: function(dashId){
  537. $.ajax({
  538. url: this.url() + '/dashboards/' + dashId,
  539. type: "DELETE",
  540. context: this
  541. });
  542. var result = this.get("dashboards").where({ _id: dashId});
  543. if (result.length > 0){
  544. this.get("dashboards").remove(result[0]);
  545. }
  546. },
  547. });
  548. },
  549. "Collections.js": function (exports, module, require) {
  550. /**
  551. * Collection: Collections (group of Dashboards)
  552. *
  553. */
  554. var
  555. Collection = require('./Collection');
  556. module.exports = Backbone.Collection.extend({
  557. model: Collection,
  558. idAttribute: "_id",
  559. url: function(){
  560. return hackdash.apiURL + '/collections';
  561. },
  562. getMines: function(){
  563. $.ajax({
  564. url: this.url() + '/own',
  565. context: this
  566. }).done(function(collections){
  567. this.reset(collections, { parse: true });
  568. });
  569. }
  570. });
  571. },
  572. "Dashboard.js": function (exports, module, require) {
  573. /**
  574. * MODEL: Project
  575. *
  576. */
  577. var Admins = require("./Admins");
  578. module.exports = Backbone.Model.extend({
  579. defaults: {
  580. admins: null
  581. },
  582. url: function(){
  583. return hackdash.apiURL + "/";
  584. },
  585. idAttribute: "_id",
  586. initialize: function(){
  587. this.set("admins", new Admins());
  588. },
  589. });
  590. },
  591. "Dashboards.js": function (exports, module, require) {
  592. /**
  593. * MODEL: Dashboards
  594. *
  595. */
  596. module.exports = Backbone.Collection.extend({
  597. url: function(){
  598. return hackdash.apiURL + "/dashboards";
  599. },
  600. idAttribute: "_id",
  601. });
  602. },
  603. "Profile.js": function (exports, module, require) {
  604. /**
  605. * MODEL: User
  606. *
  607. */
  608. var Projects = require("./Projects");
  609. module.exports = Backbone.Model.extend({
  610. idAttribute: "_id",
  611. defaults: {
  612. collections: new Backbone.Collection(),
  613. dashboards: new Backbone.Collection(),
  614. projects: new Projects(),
  615. contributions: new Projects(),
  616. likes: new Projects()
  617. },
  618. urlRoot: function(){
  619. return hackdash.apiURL + '/profiles';
  620. },
  621. parse: function(response){
  622. this.get("collections").reset(response.collections);
  623. this.get("dashboards").reset(
  624. _.map(response.admin_in, function(dash){ return { title: dash }; })
  625. );
  626. this.get("projects").reset(response.projects);
  627. this.get("contributions").reset(response.contributions);
  628. this.get("likes").reset(response.likes);
  629. return response;
  630. }
  631. });
  632. },
  633. "Project.js": function (exports, module, require) {
  634. /**
  635. * MODEL: Project
  636. *
  637. */
  638. module.exports = Backbone.Model.extend({
  639. idAttribute: "_id",
  640. defaults: {
  641. active: true
  642. },
  643. urlRoot: function(){
  644. return hackdash.apiURL + '/projects';
  645. },
  646. doAction: function(type, res, done){
  647. $.ajax({
  648. url: this.url() + '/' + res,
  649. type: type,
  650. context: this
  651. }).done(done);
  652. },
  653. updateList: function(type, add){
  654. var list = this.get(type);
  655. var uid = hackdash.user._id;
  656. function exists(){
  657. return _.find(list, function(usr){
  658. return (usr._id === uid);
  659. }) ? true : false;
  660. }
  661. if (add && !exists()){
  662. list.push(hackdash.user);
  663. }
  664. else if (!add && exists()){
  665. var idx = 0;
  666. _.each(list, function(usr, i){
  667. if (usr._id === uid) {
  668. idx = i;
  669. }
  670. });
  671. list.splice(idx, 1);
  672. }
  673. this.set(type, list);
  674. this.trigger("change");
  675. },
  676. join: function(){
  677. this.doAction("POST", "contributors", function(){
  678. this.updateList("contributors", true);
  679. });
  680. },
  681. leave: function(){
  682. this.doAction("DELETE", "contributors", function(){
  683. this.updateList("contributors", false);
  684. });
  685. },
  686. follow: function(){
  687. this.doAction("POST", "followers", function(){
  688. this.updateList("followers", true);
  689. });
  690. },
  691. unfollow: function(){
  692. this.doAction("DELETE", "followers", function(){
  693. this.updateList("followers", false);
  694. });
  695. },
  696. });
  697. },
  698. "Projects.js": function (exports, module, require) {
  699. /**
  700. * Collection: Projectss
  701. *
  702. */
  703. var
  704. Project = require('./Project');
  705. var Projects = module.exports = Backbone.Collection.extend({
  706. model: Project,
  707. idAttribute: "_id",
  708. url: function(){
  709. return hackdash.apiURL + '/projects';
  710. },
  711. parse: function(response){
  712. if (hackdash.app.type !== "dashboard"){
  713. //it is not a dashboard so all projects active
  714. return response;
  715. }
  716. var dashboard = hackdash.app.dashboard;
  717. var showcase = (dashboard && dashboard.get("showcase")) || [];
  718. if (showcase.length === 0){
  719. //no showcase defined: all projects are active
  720. return response;
  721. }
  722. // set active property of a project from showcase mode
  723. // (only projects at showcase array are active ones)
  724. _.each(response, function(project){
  725. if (showcase.indexOf(project._id) >= 0){
  726. project.active = true;
  727. }
  728. else {
  729. project.active = false;
  730. }
  731. });
  732. return response;
  733. },
  734. buildShowcase: function(showcase){
  735. _.each(showcase, function(id, i){
  736. var found = this.where({ _id: id, active: true });
  737. if (found.length > 0){
  738. found[0].set("showcase", i);
  739. }
  740. }, this);
  741. this.trigger("reset");
  742. },
  743. getActives: function(){
  744. return new Projects(
  745. this.filter(function(project){
  746. return project.get("active");
  747. })
  748. );
  749. },
  750. getInactives: function(){
  751. return new Projects(
  752. this.filter(function(project){
  753. return !project.get("active");
  754. })
  755. );
  756. }
  757. });
  758. },
  759. "User.js": function (exports, module, require) {
  760. /**
  761. * MODEL: User
  762. *
  763. */
  764. module.exports = Backbone.Model.extend({
  765. idAttribute: "_id",
  766. });
  767. },
  768. "Users.js": function (exports, module, require) {
  769. /**
  770. * Collection: Users
  771. *
  772. */
  773. var
  774. User = require('./User');
  775. module.exports = Backbone.Collection.extend({
  776. model: User,
  777. idAttribute: "_id",
  778. url: function(){
  779. return hackdash.apiURL + '/users';
  780. },
  781. });
  782. }
  783. },
  784. "views": {
  785. "Collection": {
  786. "Collection.js": function (exports, module, require) {
  787. /**
  788. * VIEW: Collections
  789. *
  790. */
  791. var Collection = require('./index');
  792. module.exports = Backbone.Marionette.CollectionView.extend({
  793. //--------------------------------------
  794. //+ PUBLIC PROPERTIES / CONSTANTS
  795. //--------------------------------------
  796. id: "collections",
  797. className: "row collections",
  798. itemView: Collection,
  799. collectionEvents: {
  800. "remove": "render"
  801. },
  802. //--------------------------------------
  803. //+ INHERITED / OVERRIDES
  804. //--------------------------------------
  805. onRender: function(){
  806. var self = this;
  807. _.defer(function(){
  808. self.updateIsotope();
  809. });
  810. },
  811. //--------------------------------------
  812. //+ PUBLIC METHODS / GETTERS / SETTERS
  813. //--------------------------------------
  814. //--------------------------------------
  815. //+ EVENT HANDLERS
  816. //--------------------------------------
  817. //--------------------------------------
  818. //+ PRIVATE AND PROTECTED METHODS
  819. //--------------------------------------
  820. isotopeInitialized: false,
  821. updateIsotope: function(){
  822. var $collections = this.$el;
  823. if (this.isotopeInitialized){
  824. $collections.isotope("destroy");
  825. }
  826. $collections.isotope({
  827. itemSelector: ".collection"
  828. , animationEngine: "jquery"
  829. , resizable: true
  830. });
  831. this.isotopeInitialized = true;
  832. }
  833. });
  834. },
  835. "List.js": function (exports, module, require) {
  836. /**
  837. * VIEW: User Collections
  838. *
  839. */
  840. var template = require('./templates/list.hbs')
  841. , Collection = require('./ListItem');
  842. module.exports = Backbone.Marionette.CompositeView.extend({
  843. //--------------------------------------
  844. //+ PUBLIC PROPERTIES / CONSTANTS
  845. //--------------------------------------
  846. className: "modal my-collections-modal",
  847. template: template,
  848. itemView: Collection,
  849. itemViewContainer: ".collections",
  850. ui: {
  851. "title": "input[name=title]",
  852. "description": "input[name=description]",
  853. "events": ".events"
  854. },
  855. events: {
  856. "click .close": "close",
  857. "click .btn-add": "add"
  858. },
  859. itemViewOptions: function(){
  860. return {
  861. dashboardId: this.model.get("_id")
  862. };
  863. },
  864. //--------------------------------------
  865. //+ INHERITED / OVERRIDES
  866. //--------------------------------------
  867. //--------------------------------------
  868. //+ PUBLIC METHODS / GETTERS / SETTERS
  869. //--------------------------------------
  870. addedCollection: function(title){
  871. this.showAction("add", title);
  872. },
  873. removedCollection: function(title){
  874. this.showAction("remove", title);
  875. },
  876. //--------------------------------------
  877. //+ EVENT HANDLERS
  878. //--------------------------------------
  879. add: function(){
  880. if (this.ui.title.val()){
  881. this.collection.create({
  882. title: this.ui.title.val(),
  883. description: this.ui.description.val()
  884. }, { wait: true });
  885. this.ui.title.val("");
  886. this.ui.description.val("");
  887. }
  888. },
  889. //--------------------------------------
  890. //+ PRIVATE AND PROTECTED METHODS
  891. //--------------------------------------
  892. timer: null,
  893. showAction: function(type, title){
  894. var msg = (type === 'add' ? ' has been added to ' : ' has been removed from ');
  895. var dash = this.model.get("domain");
  896. this.ui.events.empty();
  897. window.clearTimeout(this.timer);
  898. var li = $('<li><span>' + dash + '</span>' + msg + '<span>' + title + '</span></li>');
  899. li.appendTo(this.ui.events);
  900. var self = this;
  901. this.timer = window.setTimeout(function(){
  902. self.ui.events.empty();
  903. }, 50000);
  904. }
  905. });
  906. },
  907. "ListItem.js": function (exports, module, require) {
  908. /**
  909. * VIEW: A User Collection
  910. *
  911. */
  912. var template = require('./templates/listItem.hbs');
  913. module.exports = Backbone.Marionette.ItemView.extend({
  914. //--------------------------------------
  915. //+ PUBLIC PROPERTIES / CONSTANTS
  916. //--------------------------------------
  917. tagName: "li",
  918. template: template,
  919. //--------------------------------------
  920. //+ INHERITED / OVERRIDES
  921. //--------------------------------------
  922. initialize: function(options){
  923. this.dashboardId = options.dashboardId;
  924. },
  925. onRender: function(){
  926. if (this.hasDashboard()){
  927. this.$el.addClass('active');
  928. }
  929. else {
  930. this.$el.removeClass('active');
  931. }
  932. this.$el.off("click").on("click", this.toggleDashboard.bind(this));
  933. },
  934. serializeData: function(){
  935. return _.extend({
  936. hasDash: this.hasDashboard()
  937. }, this.model.toJSON());
  938. },
  939. //--------------------------------------
  940. //+ PUBLIC METHODS / GETTERS / SETTERS
  941. //--------------------------------------
  942. //--------------------------------------
  943. //+ EVENT HANDLERS
  944. //--------------------------------------
  945. viewCollection: function(){
  946. this.$el.off("click");
  947. hackdash.app.modals.close();
  948. },
  949. toggleDashboard: function(e){
  950. if ($(e.target).hasClass("view-collection")){
  951. this.viewCollection();
  952. return;
  953. }
  954. if (this.hasDashboard()){
  955. this.model.removeDashboard(this.dashboardId);
  956. hackdash.app.modals.currentView.removedCollection(this.model.get("title"));
  957. }
  958. else {
  959. this.model.addDashboard(this.dashboardId);
  960. hackdash.app.modals.currentView.addedCollection(this.model.get("title"));
  961. }
  962. this.render();
  963. },
  964. //--------------------------------------
  965. //+ PRIVATE AND PROTECTED METHODS
  966. //--------------------------------------
  967. hasDashboard: function(){
  968. return this.model.get("dashboards").where({ _id: this.dashboardId}).length > 0;
  969. }
  970. });
  971. },
  972. "index.js": function (exports, module, require) {
  973. /**
  974. * VIEW: Collection
  975. *
  976. */
  977. var template = require('./templates/collection.hbs');
  978. module.exports = Backbone.Marionette.ItemView.extend({
  979. //--------------------------------------
  980. //+ PUBLIC PROPERTIES / CONSTANTS
  981. //--------------------------------------
  982. id: function(){
  983. return this.model.get("_id");
  984. },
  985. className: "collection span4",
  986. template: template,
  987. //--------------------------------------
  988. //+ INHERITED / OVERRIDES
  989. //--------------------------------------
  990. onRender: function(){
  991. var url = "http://" + hackdash.baseURL + "/collections/" + this.model.get("_id");
  992. this.$el.on("click", function(e){
  993. if (!$(e.target).hasClass("add")){
  994. window.location = url;
  995. }
  996. });
  997. },
  998. //--------------------------------------
  999. //+ PUBLIC METHODS / GETTERS / SETTERS
  1000. //--------------------------------------
  1001. //--------------------------------------
  1002. //+ EVENT HANDLERS
  1003. //--------------------------------------
  1004. //--------------------------------------
  1005. //+ PRIVATE AND PROTECTED METHODS
  1006. //--------------------------------------
  1007. });
  1008. },
  1009. "templates": {
  1010. "collection.hbs.js": function (exports, module, require) {
  1011. module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
  1012. this.compilerInfo = [4,'>= 1.0.0'];
  1013. helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  1014. var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing;
  1015. buffer += "<div class=\"well\">\n <div class=\"well-content\">\n <h4>";
  1016. if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  1017. else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1018. buffer += escapeExpression(stack1)
  1019. + "</h4>\n ";
  1020. if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  1021. else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1022. buffer += escapeExpression(stack1)
  1023. + "\n </div>\n <div class=\"row-fluid footer-box\">\n <div class=\"aging activity created_at\">\n <i rel=\"tooltip\" title=\"";
  1024. options = {hash:{},data:data};
  1025. buffer += escapeExpression(((stack1 = helpers.timeAgo || depth0.timeAgo),stack1 ? stack1.call(depth0, depth0.created_at, options) : helperMissing.call(depth0, "timeAgo", depth0.created_at, options)))
  1026. + "\" class=\"tooltips icon-time icon-1\"></i>\n </div>\n </div>\n</div>\n";
  1027. return buffer;
  1028. })
  1029. ;
  1030. },
  1031. "list.hbs.js": function (exports, module, require) {
  1032. module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
  1033. this.compilerInfo = [4,'>= 1.0.0'];
  1034. helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  1035. var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
  1036. buffer += "<div class=\"modal-header\">\n <button type=\"button\" data-dismiss=\"modal\" aria-hidden=\"true\" class=\"close\">Ă—</button>\n <h3>My Collections: adding ";
  1037. if (stack1 = helpers.domain) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  1038. else { stack1 = depth0.domain; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1039. buffer += escapeExpression(stack1)
  1040. + "</h3>\n <ul class=\"events\"></ul>\n</div>\n<div class=\"modal-body\">\n <ul class=\"collections\"></ul>\n</div>\n<div class=\"modal-footer\">\n <div class=\"row-fluid\">\n <div class=\"span12\">\n <div class=\"span10\">\n <input type=\"text\" name=\"title\" placeholder=\"Enter Title\" class=\"input-medium pull-left\" style=\"margin-right: 10px;\">\n <input type=\"text\" name=\"description\" placeholder=\"Enter Description\" class=\"input-medium pull-left\">\n <input type=\"button\" class=\"btn primary btn-success pull-left btn-add\" value=\"Add\">\n </div>\n <div class=\"span2\">\n <input type=\"button\" class=\"btn primary pull-right\" data-dismiss=\"modal\" value=\"Close\">\n </div>\n </div>\n </div>\n</div>";
  1041. return buffer;
  1042. })
  1043. ;
  1044. },
  1045. "listItem.hbs.js": function (exports, module, require) {
  1046. module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
  1047. this.compilerInfo = [4,'>= 1.0.0'];
  1048. helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  1049. var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
  1050. buffer += "<label class=\"pull-left\">\n ";
  1051. if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  1052. else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1053. buffer += escapeExpression(stack1)
  1054. + "\n</label>\n\n<a class=\"pull-right view-collection\" href=\"/collections/";
  1055. if (stack1 = helpers._id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  1056. else { stack1 = depth0._id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1057. buffer += escapeExpression(stack1)
  1058. + "\">View</a>";
  1059. return buffer;
  1060. })
  1061. ;
  1062. }
  1063. }
  1064. },
  1065. "Dashboard": {
  1066. "Collection.js": function (exports, module, require) {
  1067. /**
  1068. * VIEW: Dashboards
  1069. *
  1070. */
  1071. var Dashboard = require('./index');
  1072. module.exports = Backbone.Marionette.CollectionView.extend({
  1073. //--------------------------------------
  1074. //+ PUBLIC PROPERTIES / CONSTANTS
  1075. //--------------------------------------
  1076. id: "dashboards",
  1077. className: "row dashboards",
  1078. itemView: Dashboard,
  1079. itemViewOptions: function(){
  1080. return {
  1081. hideAdd: this.hideAdd
  1082. };
  1083. },
  1084. //--------------------------------------
  1085. //+ INHERITED / OVERRIDES
  1086. //--------------------------------------
  1087. initialize: function(options){
  1088. this.hideAdd = (options && options.hideAdd) || false;
  1089. },
  1090. onRender: function(){
  1091. var self = this;
  1092. _.defer(function(){
  1093. self.updateIsotope();
  1094. });
  1095. },
  1096. //--------------------------------------
  1097. //+ PUBLIC METHODS / GETTERS / SETTERS
  1098. //--------------------------------------
  1099. //--------------------------------------
  1100. //+ EVENT HANDLERS
  1101. //--------------------------------------
  1102. //--------------------------------------
  1103. //+ PRIVATE AND PROTECTED METHODS
  1104. //--------------------------------------
  1105. isotopeInitialized: false,
  1106. updateIsotope: function(){
  1107. var $dashboards = this.$el;
  1108. if (this.isotopeInitialized){
  1109. $dashboards.isotope("destroy");
  1110. }
  1111. $dashboards.isotope({
  1112. itemSelector: ".dashboard"
  1113. , animationEngine: "jquery"
  1114. , resizable: true
  1115. });
  1116. this.isotopeInitialized = true;
  1117. }
  1118. });
  1119. },
  1120. "index.js": function (exports, module, require) {
  1121. /**
  1122. * VIEW: Dashboard
  1123. *
  1124. */
  1125. var template = require('./templates/dashboard.hbs')
  1126. , UserCollectionsView = require('../Collection/List');
  1127. module.exports = Backbone.Marionette.ItemView.extend({
  1128. //--------------------------------------
  1129. //+ PUBLIC PROPERTIES / CONSTANTS
  1130. //--------------------------------------
  1131. id: function(){
  1132. return this.model.get("_id");
  1133. },
  1134. className: "dashboard span4",
  1135. template: template,
  1136. events: {
  1137. "click .demo a": "stopPropagation",
  1138. "click .add a": "onAddToCollection"
  1139. },
  1140. //--------------------------------------
  1141. //+ INHERITED / OVERRIDES
  1142. //--------------------------------------
  1143. initialize: function(options){
  1144. this.hideAdd = (options && options.hideAdd) || false;
  1145. },
  1146. onRender: function(){
  1147. this.$el
  1148. .attr({
  1149. "title": this.model.get("status")
  1150. , "data-name": this.model.get("domain")
  1151. , "data-date": this.model.get("created_at")
  1152. })
  1153. .tooltip({});
  1154. $('.tooltips', this.$el).tooltip({});
  1155. var url = "http://" + this.model.get("domain") + "." + hackdash.baseURL;
  1156. this.$el.on("click", function(e){
  1157. if (!$(e.target).hasClass("add")){
  1158. window.location = url;
  1159. }
  1160. });
  1161. },
  1162. serializeData: function(){
  1163. return _.extend({
  1164. hideAdd: this.hideAdd
  1165. }, this.model.toJSON());
  1166. },
  1167. //--------------------------------------
  1168. //+ PUBLIC METHODS / GETTERS / SETTERS
  1169. //--------------------------------------
  1170. //--------------------------------------
  1171. //+ EVENT HANDLERS
  1172. //--------------------------------------
  1173. stopPropagation: function(e){
  1174. e.stopPropagation();
  1175. },
  1176. onAddToCollection: function(){
  1177. hackdash.app.modals.show(new UserCollectionsView({
  1178. model: this.model,
  1179. collection: hackdash.app.collections
  1180. }));
  1181. },
  1182. //--------------------------------------
  1183. //+ PRIVATE AND PROTECTED METHODS
  1184. //--------------------------------------
  1185. });
  1186. },
  1187. "templates": {
  1188. "dashboard.hbs.js": function (exports, module, require) {
  1189. module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
  1190. this.compilerInfo = [4,'>= 1.0.0'];
  1191. helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  1192. var buffer = "", stack1, stack2, options, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing, helperMissing=helpers.helperMissing;
  1193. function program1(depth0,data) {
  1194. var buffer = "", stack1;
  1195. buffer += "\n <div class=\"pull-right demo\">\n <a href=\"";
  1196. if (stack1 = helpers.link) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  1197. else { stack1 = depth0.link; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1198. buffer += escapeExpression(stack1)
  1199. + "\" target=\"_blank\" class=\"btn btn-link\">Site</a>\n </div>\n ";
  1200. return buffer;
  1201. }
  1202. function program3(depth0,data) {
  1203. var buffer = "", stack1, options;
  1204. buffer += "\n ";
  1205. options = {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data};
  1206. if (stack1 = helpers.isLoggedIn) { stack1 = stack1.call(depth0, options); }
  1207. else { stack1 = depth0.isLoggedIn; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1208. if (!helpers.isLoggedIn) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
  1209. if(stack1 || stack1 === 0) { buffer += stack1; }
  1210. buffer += "\n ";
  1211. return buffer;
  1212. }
  1213. function program4(depth0,data) {
  1214. return "\n <div class=\"pull-right add\">\n <a class=\"btn btn-link add\">Add to Collections</a>\n </div>\n ";
  1215. }
  1216. buffer += "<div class=\"well\">\n <div class=\"well-content\">\n <h4>";
  1217. if (stack1 = helpers.domain) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  1218. else { stack1 = depth0.domain; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1219. buffer += escapeExpression(stack1)
  1220. + "</h4>\n <h4>";
  1221. if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  1222. else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1223. buffer += escapeExpression(stack1)
  1224. + "</h4>\n ";
  1225. if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
  1226. else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
  1227. buffer += escapeExpression(stack1)
  1228. + "\n <br/>\n </div>\n <div class=\"row-fluid footer-box\">\n <div class=\"aging activity created_at\">\n <i rel=\"tooltip\" title=\"";
  1229. options = {hash:{},data:data};
  1230. buffer += escapeExpression(((stack1 = helpers.timeAgo || depth0.timeAgo),stack1 ? stack1.call(depth0, depth0.created_at, options) : helperMissing.call(depth0, "timeAgo", depth0.created_at, options)))
  1231. + "\" class=\"tooltips icon-time icon-1\"></i>\n </div>\n\n ";
  1232. stack2 = helpers['if'].call(depth0, depth0.link, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
  1233. if(stack2 || stack2 === 0) { buffer += stack2; }
  1234. buffer += "\n\n ";
  1235. stack2 = helpers.unless.call(depth0, depth0.hideAdd, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
  1236. if(stack2 || stack2 === 0) { buffer += stack2; }
  1237. buffer += "\n \n </div>\n</div>\n";
  1238. return buffer;
  1239. })
  1240. ;
  1241. }
  1242. }
  1243. },
  1244. "Footer": {
  1245. "AddAdmin.js": function (exports, module, require) {
  1246. /**
  1247. * VIEW: A User Collection
  1248. *
  1249. */
  1250. var template = require('./templates/addAdmin.hbs')
  1251. , Users = require('../../models/Users');
  1252. module.exports = Backbone.Marionette.ItemView.extend({
  1253. //--------------------------------------
  1254. //+ PUBLIC PROPERTIES / CONSTANTS
  1255. //--------------------------------------
  1256. className: "modal add-admins-modal",
  1257. template: template,
  1258. ui: {
  1259. "txtUser": "#txtUser",
  1260. "addOn": ".add-on"
  1261. },
  1262. events: {
  1263. "click #save": "saveAdmin"
  1264. },
  1265. //--------------------------------------
  1266. //+ INHERITED / OVERRIDES
  1267. //--------------------------------------
  1268. initialize: function(){
  1269. this.users = new Users();
  1270. },
  1271. onRender: function(){
  1272. this.initTypehead();
  1273. },
  1274. //--------------------------------------
  1275. //+ PUBLIC METHODS / GETTERS / SETTERS
  1276. //--------------------------------------
  1277. //--------------------------------------
  1278. //+ EVENT HANDLERS
  1279. //--------------------------------------
  1280. saveAdmin: function(){
  1281. var selected = this.users.find(function(user){
  1282. return user.get('selected');
  1283. });
  1284. if (selected){
  1285. this.collection.addAdmin(selected.get("_id"));
  1286. this.close();
  1287. }
  1288. },
  1289. //--------------------------------------
  1290. //+ PRIVATE AND PROTECTED METHODS
  1291. //--------------------------------------
  1292. initTypehead: function(){
  1293. var users = this.users,
  1294. self = this,
  1295. MIN_CHARS_FOR_SERVER_SEARCH = 3;
  1296. this.ui.txtUser.typeahead({
  1297. source: function(query, process){
  1298. if (query.length >= MIN_CHARS_FOR_SERVER_SEARCH){
  1299. users.fetch({
  1300. data: $.param({ q: query }),
  1301. success: function(){
  1302. var usersIds = users.map(function(user){ return user.get('_id').toString(); });
  1303. process(usersIds);
  1304. }
  1305. });
  1306. }
  1307. else {
  1308. process([]);
  1309. }
  1310. },
  1311. matcher: function(){
  1312. return true;
  1313. },
  1314. highlighter: function(uid){
  1315. var user = users.get(uid),
  1316. template = _.template('<img class="avatar" src="<%= picture %>" /> <%= name %>');
  1317. return template({
  1318. picture: user.get('picture'),
  1319. name: user.get('name')
  1320. });
  1321. },
  1322. updater: function(uid) {
  1323. var selectedUser = users.get(uid);
  1324. selectedUser.set('selected', true);
  1325. self.ui.addOn.empty().append('<img class="avatar" src="' + selectedUser.get("picture") + '" />');
  1326. return selectedUser.get('name');
  1327. }
  1328. });
  1329. }
  1330. });
  1331. },
  1332. "Embed.js": function (exports, module, require) {
  1333. /**
  1334. * VIEW: A Embed code
  1335. *
  1336. */
  1337. var template = require('./templates/embed.hbs');
  1338. module.exports = Backbone.Marionette.ItemView.extend({
  1339. //--------------------------------------
  1340. //+ PUBLIC PROPERTIES / CONSTANTS
  1341. //--------------------------------------
  1342. className: "modal",
  1343. template: template,
  1344. ui: {
  1345. embedCode: "textarea"
  1346. },
  1347. //--------------------------------------
  1348. //+ INHERITED / OVERRIDES
  1349. //--------------------------------------
  1350. onRender: function(){
  1351. var self = this;
  1352. _.defer(function(){
  1353. self.ui.embedCode.select();
  1354. });
  1355. },
  1356. //--------------------------------------
  1357. //+ PUBLIC METHODS / GETTERS / SETTERS
  1358. //--------------------------------------
  1359. //--------------------------------------
  1360. //+ EVENT HANDLERS
  1361. //--------------------------------------
  1362. //--------------------------------------
  1363. //+ PRIVATE AND PROTECTED METHODS
  1364. //--------------------------------------
  1365. });
  1366. },
  1367. "User.js": function (exports, module, require) {
  1368. /**
  1369. * VIEW: User
  1370. *
  1371. */
  1372. var template = require('./templates/user.hbs');
  1373. module.exports = Backbone.Marionette.ItemView.extend({
  1374. //--------------------------------------
  1375. //+ PUBLIC PROPERTIES / CON…

Large files files are truncated, but you can click here to view the full file