This file contains 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
var chat = { | |
// Create this closure to contain the cached modules | |
module: function() { | |
// Internal module cache. | |
var modules = {}; | |
// Create a new module reference scaffold or load an | |
// existing module. | |
return function(name) { | |
// If this module has already been created, return it. |
This file contains 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
var MyApp = {}; | |
MyApp.Router = Backbone.Router.extend({ | |
routes: { | |
// general routes for cross-app functionality | |
"" : "showGeneralHomepage", | |
"cart" : "showShoppingCart", | |
"account" : "showMyAccount", | |
// module-specific subroutes: |
This file contains 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
var MyApp = {}; | |
MyApp.Router = Backbone.Router.extend({ | |
routes: { | |
// general routes for cross-app functionality | |
"" : "showGeneralHomepage", | |
"cart" : "showShoppingCart", | |
"account" : "showMyAccount", | |
// module-specific subroutes: |
This file contains 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
# All of your views should inherit from the BaseView. As a result you get the | |
# globalEvents functionality for free. The globalEvents hash is similar to that | |
# of the built-in Backbone events hash. It automatically binds event names to | |
# instance methods. | |
# | |
# class TestView extends ModularView | |
# | |
# globalEvents: | |
# "PhoneRang": "answerPhone" | |
# |
This file contains 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
//This is the Backbone controller that manages the content of the app | |
var Content = Backbone.View.extend({ | |
initialize:function(options){ | |
Backbone.history.on('route',function(source, path){ | |
this.render(path); | |
}, this); | |
}, | |
//This object defines the content for each of the routes in the application | |
content:{ | |
"":_.template(document.getElementById("root").innerHTML), |
This file contains 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
/* The API controller | |
Exports 3 methods: | |
* post - Creates a new thread | |
* list - Returns a list of threads | |
* show - Displays a thread and its posts | |
*/ | |
var Thread = require('../models/thread.js'); | |
var Post = require('../models/post.js'); |
This file contains 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 | |
define('CONS_KEY', 'Application consumer key'); | |
define('CONS_SECRET', 'Application consumer secret'); | |
require_once __DIR__.'/silex.phar'; | |
$app = new Silex\Application(); | |
// register the session extension | |
$app->register(new Silex\Extension\SessionExtension()); |
This file contains 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 | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
require_once __DIR__.'/../vendor/autoload.php'; | |
$app = new Silex\Application(); | |
$app['debug'] = true; |
This file contains 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
var mysql = require('mysql'); | |
var client = mysql.createConnection({ | |
host: 'localhost', | |
user: 'omeka', | |
password: 'omeka', | |
port: 8889, | |
database: 'neatline' | |
}); | |
This file contains 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
var mysql = require('mysql'); | |
var randy = require('randy'); | |
var _ = require('underscore'); | |
// Query base. | |
var sql = 'INSERT INTO omeka_neatline_records (' + | |
'exhibit_id,'+ | |
'title,'+ | |
'description,'+ | |
'map_active,'+ |
OlderNewer