forked from thatcher/jquery-claypool
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first push for integrating both client and server projects into singl…
…e project for maintainence. it includes the server-side code for the new site and push two will be to add a list of client-side examples.
- Loading branch information
thatcher
committed
Sep 13, 2009
1 parent
43733e0
commit 9cdf856
Showing
302 changed files
with
55,000 additions
and
9,670 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Example @VERSION - | ||
* | ||
* Copyright (c) 2008-2009 ClaypoolJS | ||
* | ||
*/ | ||
// - BOOT THE APP - | ||
jQuery.noConflict(); | ||
(function($){ | ||
|
||
//A static logger for any initialization routines we might add here | ||
var log = $.logger("Example"); | ||
|
||
//The environments are described in environments.js | ||
try{ | ||
$.env('defaults', "dev.server"); | ||
//$.env('defaults', "appengine.server"); | ||
|
||
}catch(e){ | ||
log.error("Environmental selection is invalid!").exception(e); | ||
} | ||
|
||
$(document).ready(function(){ | ||
log.info("Initializing Application"); | ||
$.boot(function(){ | ||
//you can do additional initialization here | ||
log.info("Successfully Initialized Application"); | ||
//preload all application data | ||
$.$('#docsModel').get(); | ||
$.$('#releasesModel').get(); | ||
$.$('#newsModel').get(); | ||
$.$('#eventsModel').get(); | ||
}); | ||
}); | ||
|
||
})(jQuery); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var Site = { | ||
/** | ||
* Site Claypool @VERSION - | ||
* | ||
* Copyright (c) 2008-2009 ClaypoolJS | ||
* | ||
*/ | ||
// - NAMESPACE DECLARATIONS - | ||
// It's good form to go ahead and declare the additional namespaces you might be using | ||
// here. We define just a couple standards. Additional nested namespaces are very | ||
// useful for isolating application log message based on the categories defined by | ||
// the namespace. | ||
Models:{}, | ||
Views:{}, | ||
Controllers:{}, | ||
Services:{} | ||
}; | ||
(function($){ | ||
|
||
//Scanning is a simple convention over configuration | ||
//pattern. All functions on the namespace can be accessed | ||
//via $.$, which will create the instance the first time | ||
//eg $.$('#fooModel') will return a new MyApp.Models.Foo | ||
$.scan([ | ||
"Site.Models", | ||
"Site.Views", | ||
"Site.Services" | ||
]); | ||
|
||
})(jQuery, Site); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* | ||
* Copyright (c) 2008-2009 ClaypoolJS | ||
* | ||
*/ | ||
(function($){ | ||
|
||
//-------------------------------------------------------------------------------------// | ||
// - ENVIRONMENTAL CONFIGURATION - | ||
//______________________________________________________________________________________// | ||
$.env({ | ||
defaults:{ | ||
root:'/', | ||
data:'/data/', | ||
context_dir:cwd, | ||
app_dir:'/WEB-INF/jsx/', | ||
templates:'file:'+cwd+'/templates/', | ||
rest: { | ||
SERVICE: "Any", | ||
URL: "/rest", | ||
AJAX: "jQuery" | ||
} | ||
}, | ||
//-------------------------------------------------------------------------------------// | ||
// - DEVELOPMENT CONFIGURATION - | ||
//______________________________________________________________________________________// | ||
dev:{ | ||
server:{ | ||
monitorTemplates:'true', | ||
db: { | ||
DRIVER : "org.sqlite.JDBC", | ||
PROVIDER:"JDBC", | ||
DIALECT:"SQLite", | ||
HOST:"jdbc:sqlite:claypool.db", | ||
NAME:"example", | ||
USER:"sa", | ||
PASS:"" | ||
} | ||
} | ||
}, | ||
//-------------------------------------------------------------------------------------// | ||
// - PRODUCTION CONFIGURATION - | ||
//______________________________________________________________________________________// | ||
prod:{ | ||
server:{ | ||
db: { | ||
DRIVER : "com.mysql.jdbc.Driver", | ||
PROVIDER:"JDBC", | ||
DIALECT:"MySQL", | ||
HOST:"jdbc:mysql://127.0.0.1:3306/claypool", | ||
USER:"example", | ||
PASS:"example" | ||
} | ||
} | ||
}, | ||
//-------------------------------------------------------------------------------------// | ||
// - APPENGINE CONFIGURATION - | ||
//______________________________________________________________________________________// | ||
appengine:{ | ||
server:{ | ||
templates:'http://jquery-claypool.appspot.com/templates/' | ||
} | ||
} | ||
}); | ||
|
||
})(jQuery); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* | ||
* Copyright (c) 2008-2009 ClaypoolJS | ||
* | ||
*/ | ||
(function($){ | ||
|
||
//No filters at this time | ||
|
||
})(jQuery); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* ClaypoolSite @VERSION - | ||
* | ||
* Copyright (c) 2008-2009 ClaypoolJS | ||
* | ||
*/ | ||
|
||
(function($){ | ||
|
||
$.logging([ | ||
{ category:"Site", level:"INFO" }, | ||
{ category:"Site.Models", level:"INFO" }, | ||
{ category:"Site.Views", level:"INFO" }, | ||
{ category:"Site.Controllers", level:"INFO" }, | ||
{ category:"Site.Service", level:"INFO" }, | ||
{ category:"Claypool", level:"WARN" }, | ||
{ category:"Claypool.Application", level:"WARN" }, | ||
{ category:"Claypool.Server", level:"INFO" }, | ||
{ category:"Claypool.MVC", level:"INFO" }, | ||
{ category:"Claypool.IoC", level:"INFO" }, | ||
{ category:"Claypool.AOP", level:"WARN" }, | ||
{ category:"jQuery.E4X", level:"INFO" }, | ||
{ category:"root", level:"WARN" } | ||
]); | ||
|
||
})(jQuery); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @author thatcher | ||
*/ | ||
|
||
(function($){ | ||
|
||
$.mvc({ | ||
"hijax:server" : [{ | ||
id:"#envjs-server-routes", | ||
hijaxMap: | ||
[{ urls :"/jsx/$", controller:"#homeService"}, | ||
{ urls :"/docs$", controller:"#docsService"}, | ||
{ urls :"/doc/<:id(.*):>", controller:"#docsService"}, | ||
{ urls :"/support", controller:"#supportService"}, | ||
{ urls :"/error$", controller:"#errorService"}, | ||
{ urls :"/events$", controller:"#eventsService"}, | ||
{ urls :"/event/<:id(.*):>", controller:"#eventsService"}, | ||
{ urls :"/home$", controller:"#homeService"}, | ||
{ urls :"/news$", controller:"#newsService"}, | ||
{ urls :"/news/<:id(.*):>", controller:"#newsService"}, | ||
{ urls :"/releases$", controller:"#releasesService"}, | ||
{ urls :"/release/<:id(.*):>", controller:"#releasesService"}] | ||
}] | ||
}); | ||
|
||
})(jQuery); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* @author thatcher | ||
*/ | ||
(function($, $M, _){ | ||
|
||
var data,// the data | ||
log; | ||
|
||
$M.Docs = function(options){ | ||
$.extend(true, this, options); | ||
log = $.logger('Site.Models.Docs'); | ||
}; | ||
|
||
$.extend($M.Docs.prototype,{ | ||
get: function(){ | ||
var url = $.env('data')+'docs/metadata.json'; | ||
if(!data){ | ||
$.ajax({ | ||
type:'GET', | ||
url:url, | ||
datatype:'json', | ||
async:false, | ||
success: function(json){ | ||
log.debug('Loaded data %s',json); | ||
data = _.json2js(json)._; | ||
}, | ||
error:function(xhr, status, e){ | ||
log.error('failed to load data %s', url). | ||
exception(e); | ||
} | ||
}); | ||
} | ||
|
||
return data; | ||
} | ||
}); | ||
|
||
})(jQuery, Site.Models, jsPath); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* @author thatcher | ||
*/ | ||
(function($, $M, _){ | ||
|
||
var data, | ||
log; | ||
|
||
$M.Events = function(options){ | ||
$.extend(true, this, options); | ||
log = $.logger('Site.Models.Events'); | ||
}; | ||
|
||
$.extend($M.Events.prototype,{ | ||
get: function(){ | ||
var url = $.env('data')+'events/metadata.json'; | ||
if(!data){ | ||
$.ajax({ | ||
type:'GET', | ||
url:url, | ||
datatype:'json', | ||
async:false, | ||
success: function(json){ | ||
log.debug('Loaded data %s',json); | ||
data = _.json2js(json)._; | ||
}, | ||
error:function(xhr, status, e){ | ||
log.error('failed to load data %s',url). | ||
exception(e); | ||
} | ||
}); | ||
} | ||
return data; | ||
} | ||
}); | ||
|
||
})(jQuery, Site.Models, jsPath ); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* @author thatcher | ||
*/ | ||
(function($, $M, _){ | ||
|
||
var data, | ||
log; | ||
|
||
$M.News = function(options){ | ||
$.extend(true, this, options); | ||
log = $.logger('Site.Models.News'); | ||
}; | ||
|
||
$.extend($M.News.prototype,{ | ||
get: function(){ | ||
var url = $.env('data')+'news/metadata.json'; | ||
if(!data){ | ||
$.ajax({ | ||
type:'GET', | ||
url:url, | ||
datatype:'json', | ||
async:false, | ||
success: function(json){ | ||
log.debug('Loaded data %s',json); | ||
data = _.json2js(json)._; | ||
}, | ||
error:function(xhr, status, e){ | ||
log.error('failed to load data %s',url). | ||
exception(e); | ||
} | ||
}); | ||
} | ||
return data; | ||
} | ||
}); | ||
|
||
})(jQuery, Site.Models, jsPath); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* @author thatcher | ||
*/ | ||
(function($, $M, _){ | ||
|
||
var data, | ||
log; | ||
|
||
$M.Releases = function(options){ | ||
$.extend(true, this, options); | ||
log = $.logger('Site.Models.Releases'); | ||
}; | ||
|
||
$.extend($M.Releases.prototype,{ | ||
get: function(){ | ||
var url = $.env('data')+'releases/metadata.json'; | ||
if(!data){ | ||
$.ajax({ | ||
type:'GET', | ||
url:url, | ||
datatype:'json', | ||
async:false, | ||
success: function(json){ | ||
log.debug('Loaded data %s',json); | ||
data = _.json2js(json)._; | ||
}, | ||
error:function(xhr, status, e){ | ||
log.error('failed to load data %s',url). | ||
exception(e); | ||
} | ||
}); | ||
} | ||
return data; | ||
} | ||
}); | ||
|
||
})(jQuery, Site.Models, jsPath ); |
Oops, something went wrong.