Created by Anonymous at BootTheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$route['page/(:num)'] = 'blog/index/$1'; | |
$route['blog/page/(:num)'] = 'blog/index/$1'; | |
$route['(:num)/(:num)/(:num)/(:any)'] = 'blog/post/$1/$2/$3/$4'; | |
$route['post/(:any)'] = 'blog/post/$1'; | |
$route['archive/(:any)'] = 'blog/archive/$1'; | |
$route['category/(:any)'] = 'blog/category/$1'; | |
$route['tags/(:any)'] = 'blog/tags/$1'; | |
$route['search'] = 'blog/search'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BackboneModel | |
// ------------------- | |
// it's a Backbone.Model that will be able toe synch with a Meteor.Collection. | |
// as simple as it could be | |
var Model = Meteor.Backbone.Model = Backbone.Model.extend({ | |
idAttribute : '_id', | |
_insert : function ( child , options ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a try to get some functional helpers from allong.es | |
// most of this code is copied from from https://github.com/raganwald/allong.es | |
// helpers | |
var slice = Array.prototype.slice; | |
// to_function | |
function to_function (str) { | |
var expr, leftSection, params, rightSection, sections, v, vars, _i, _len; | |
params = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sessioned = function(prefix){ | |
this.prefix = prefix || Random.hexString(16) | |
} | |
_.extend(Sessioned.prototype,{ | |
get : function(key){ | |
key = this.prefix + '-' + key | |
return Session.get(key) | |
}, | |
set : function(key,value){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
HTTP status code messages | |
*/ | |
function getStatusCodeMsg (code) { | |
var msg = false; | |
switch (code) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Accounts.createUser( | |
{email:"[email protected]", password:"password"} | |
,function(e,r){ | |
if(e){ | |
console.error(e) | |
}else{ | |
var me = Meteor.user(); | |
console.log("created", me); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Router for Pages | |
Session.set("currentPage", null); | |
var SimpleRouter = Backbone.Router.extend({ | |
routes: { | |
"": "index", | |
"signup": "signup" | |
}, | |
index: function () { | |
console.log("router : index") | |
Session.set("currentPage", "index"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Backbone.Marionette.StackRegion extends Backbone.Marionette.Region | |
constructor: -> | |
super | |
@views = [] | |
# Return the top view (currently visible) | |
peek: -> | |
@views[@views.length - 1] if @views.length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp.module('MyApp.SomeBuilder', function(SomeBuilder, App, Backbone, Marionette, $, _){ | |
'use strict'; | |
// Controller | |
// ---------- | |
SomeBuilder.Controller = Marionette.Controller.extend({ | |
initialize: function(options){ | |
this.navbarRegion = options.navbarRegion; | |
this.mainRegion = options.mainRegion; |