Permalink
Browse files

Fix references for root folders

  • Loading branch information...
1 parent a9e58f8 commit 6c1ebbb118d57a9cee01578401a811ffe06d675d @kriszyp kriszyp committed Oct 1, 2011
Showing with 38 additions and 26 deletions.
  1. +2 −1 lib/app.js
  2. +1 −1 lib/facet/page-change.js
  3. +1 −1 lib/facet/page.js
  4. +5 −5 lib/index.js
  5. +2 −2 lib/jsgi/redirect-root.js
  6. +10 −4 lib/media/wiki-html.js
  7. +8 −3 lib/model/page.js
  8. +9 −9 package.json
View
3 lib/app.js
@@ -14,7 +14,7 @@ var pageFacets = require("./facet/page"),
User = pinturaConfig.security.getAuthenticationFacet();
// registers the HTML representation handler that generates HTML from wiki content
-require("media/wiki-html");
+require("./media/wiki-html");
// Defines the data model for the given user by request
pinturaConfig.getDataModel = function(request){
var user = request.remoteUser;
@@ -30,6 +30,7 @@ pinturaConfig.getDataModel = function(request){
var ClassModel = Model(Notifying(require("perstore/stores").DefaultStore()),{});
var fullModel = {
Page: require("./model/page").Page,
+ PageSuper: require("./model/page").PageSuper,
PageChange: require("./model/page-change").PageChange,
User: User,
File: File,
View
2 lib/facet/page-change.js
@@ -2,7 +2,7 @@
* These are the page facets for the Wiki example application (in progress)
*/
-var PageChange = require("model/page-change").PageChange,
+var PageChange = require("../model/page-change").PageChange,
Permissive = require("perstore/facet").Permissive,
Restrictive = require("perstore/facet").Restrictive;
View
2 lib/facet/page.js
@@ -2,7 +2,7 @@
* These are the page facets for the Wiki example application (in progress)
*/
-var Page = require("model/page").Page,
+var Page = require("../model/page").Page,
Permissive = require("perstore/facet").Permissive,
Restrictive = require("perstore/facet").Restrictive;
View
10 lib/index.js
@@ -6,16 +6,16 @@ var pinturaApp,
Static = require("pintura/jsgi/static").Static,
start = require("pintura/start-node").start,
multiNode = require("multi-node/multi-node");
-
-require.reloadable(function(){
+function setPinturaApp(){
pinturaApp = require("pintura/pintura").app;
- require("app");
-});
+ require("./app");
+}
+require.reloadable ? require.reloadable(setPinturaApp) : setPinturaApp();
start(
// uncomment this to enable compression with node-compress
//require("pintura/jsgi/compress").Compress(
// make the root url redirect to /Page/Root
- require("./jsgi/redirect-root").RedirectRoot(
+ require("./jsgi/redirect-root").RedirectRoot(require("jack/lib/jack/redirect").Redirect,
require("pintura/jsgi/cascade").Cascade([
// cascade from static to pintura REST handling
// the main place for static files accessible from the web
View
4 lib/jsgi/redirect-root.js
@@ -1,5 +1,5 @@
-var redirector = require("jack/redirect").Redirect("/Page/Example");
-exports.RedirectRoot = function(app){
+exports.RedirectRoot = function(Redirect, app){
+ var redirector = Redirect("/Page/Example");
return function(request){
if(request.pathInfo == "/"){
return redirector(request);
View
14 lib/media/wiki-html.js
@@ -3,8 +3,14 @@
*/
var Media = require("pintura/media").Media,
- escapeHTML = require("narwhal/html").escape,
- wikiToHtml = require("wiky/wiky").toHtml
+ wikiToHtml = require("wiky/lib/wiky").toHtml,
+ escapeHTML = function(string) {
+ return String(string)
+ .replace(/&/g, "&")
+ .replace(/</g, "&lt;")
+ .replace(/>/g, "&gt;");
+ };
+
require("pintura/media/html").setupMediaHandler({
defaultQuality:1,
@@ -17,7 +23,7 @@ require("pintura/media/html").setupMediaHandler({
}
});
-var rules = require("wiky/wiky").rules,
- store = require("wiky/wiky").store;
+var rules = require("wiky/lib/wiky").rules,
+ store = require("wiky/lib/wiky").store;
// add a rule for [[target page]] style links
rules.wikiinlines.push({ rex:/\[\[([^\]]*)\]\]/g, tmplt:function($0,$1,$2){return store("<a href=\""+$1+"\">"+$1+"</a>");}});
View
11 lib/model/page.js
@@ -7,6 +7,7 @@ var Model = require("perstore/model").Model,
Notifying = require("perstore/store/notifying").Notifying,
PageChange = require("./page-change").PageChange,
promiseModule = require("promised-io/promise"),
+ Inherited = require("perstore/store/inherited").Inherited,
when = promiseModule.when;
// Pintura consists of three primary layers: the store, the class (which acts as the
@@ -18,7 +19,7 @@ var pageStore = DefaultStore();
pageStore = require(*remove this* "./page-sql").pageStore;
*/
-/*
+/*R
// mongodb:
pageStore = require(*remove this* './page-mongo').pageStore;
*/
@@ -28,7 +29,10 @@ pageStore = require("store/full-text").FullText(pageStore, "Page");
*/
// to add events
-pageStore = Notifying(pageStore);
+originalPageStore = pageStore;
+pageStore = Notifying(Inherited(pageStore));
+exports.PageSuper = PageSuper = Model(Inherited(originalPageStore));
+
// now we create a class, all central model logic is defined here (make Page be a global for convenience)
Page = exports.Page = Model(pageStore, {
@@ -56,14 +60,15 @@ Page = exports.Page = Model(pageStore, {
}),
*/
-
+ "extends": PageSuper,
construct: function(page, directives){
// set initial properties on object instantiation
page.createdBy = promiseModule.currentContext.currentUser;
page.status = "published";
return page;
},
put: function(page, options){ // handle puts to add to history and define attribution
+ print("put called");
page.lastModifiedBy = promiseModule.currentContext.currentUser;
page.status = "published";
// do the default action of saving to the store
View
18 package.json
@@ -4,20 +4,20 @@
"contributors": [],
"mappings":{
- "perstore": "http://github.com/kriszyp/perstore/zipball/v0.2.4",
- "commonjs-utils": "http://github.com/kriszyp/commonjs-utils/zipball/v0.2.2",
- "pintura": "http://github.com/kriszyp/pintura/zipball/v0.2.6",
- "promised-io": "http://github.com/kriszyp/promised-io/zipball/v0.2.3",
+ "perstore": "http://github.com/kriszyp/perstore/zipball/v0.2.4!/",
+ "commonjs-utils": "http://github.com/kriszyp/commonjs-utils/zipball/v0.2.2!/",
+ "pintura": "http://github.com/kriszyp/pintura/zipball/v0.2.6!/",
+ "promised-io": "jar:http://github.com/kriszyp/promised-io/zipball/v0.2.3!/",
"templify": "http://github.com/dmachi/templify/zipball/master",
- "patr": "http://github.com/kriszyp/patr/zipball/v0.2.5",
- "rql": "http://github.com/kriszyp/rql/zipball/v0.2.2",
+ "patr": "jar:http://github.com/kriszyp/patr/zipball/v0.2.5!/",
+ "rql": "jar:http://github.com/kriszyp/rql/zipball/v0.2.2!/",
"persevere-client": "jar:http://github.com/kriszyp/persevere/zipball/master!/public/",
"wiky": "http://github.com/kriskowal/wiky/zipball/master",
"narwhal": "http://github.com/kriszyp/narwhal/zipball/master",
- "jack": "jar:http://github.com/kriszyp/jack/zipball/master!/lib/jack/",
+ "jack": "jar:http://github.com/kriszyp/jack/zipball/master!/",
"transporter": "http://github.com/kriszyp/transporter/zipball/v0.2.2",
"jsgi-node": "jar:http://github.com/kriszyp/jsgi-node/zipball/v0.2.5!/lib/jsgi-node.js",
- "multi-node": "http://github.com/kriszyp/multi-node/zipball/v0.2.2",
- "tunguska": "http://github.com/kriszyp/tunguska/zipball/v0.2.3"
+ "multi-node": "http://github.com/kriszyp/multi-node/zipball/v0.2.2!/",
+ "tunguska": "http://github.com/kriszyp/tunguska/zipball/v0.2.3!/"
}
}

0 comments on commit 6c1ebbb

Please sign in to comment.