Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjustments for the rewrite to use root packages and run on Ringo
- Loading branch information
Showing
11 changed files
with
122 additions
and
51 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
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 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 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 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 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 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 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 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,60 @@ | ||
/** | ||
* The starting point for Pintura running as a Jack app. | ||
*/ | ||
|
||
var Transporter, pinturaApp; | ||
//require("nodules").useLocal().ensure(["pintura/pintura", "lib/app", "tunguska/jack-connector", "narwhal/lib/narwhal/repl", "transporter/jsgi/transporter"], function(require){ | ||
Transporter = require("transporter/jsgi/transporter").Transporter; | ||
//require.reloadable(function(){ | ||
// this will provide access to the server side JS libraries from the client | ||
pinturaApp = //Transporter({loader: require("nodules").forEngine("browser").useLocal().getModuleSource}, | ||
// the main app | ||
require("pintura/pintura").app; | ||
require("./app"); | ||
//}); | ||
// require("tunguska/jack-connector").observe("worker", pinturaApp.addConnection); | ||
// we start the REPL (the interactive JS console) because it is really helpful | ||
|
||
if(require.main == module){ | ||
var server = new (require("ringo/httpserver").Server)({appName: "app", appModule: module.id}); | ||
server.getContext("/public").serveStatic("public"); | ||
server.getContext("/packages").serveStatic("C:/packages"); | ||
server.start(); | ||
} | ||
|
||
//}); | ||
|
||
|
||
var perseverePath;/*, | ||
Static = require("jack/lib/jack/static").Static, | ||
Directory = require("jack/lib/jack/dir").Directory;*/ | ||
|
||
var path = require.paths[0].match(/(.*?)[\/\\]packages[\/\\]/); | ||
if(path){ | ||
perseverePath = path[1] + "/packages/persevere/public"; | ||
} | ||
|
||
// now setup the development environment, handle static files before reloading the app | ||
// for better performance | ||
//exports.app = exports.development = function(app, options){ | ||
// make the root url redirect to /Page/Root | ||
//require("./jsgi/redirect-root").RedirectRoot(require("jack/lib/jack/redirect").Redirect, | ||
exports.app = | ||
// cascade from static to pintura REST handling | ||
/* // this will provide module wrapping for the Dojo modules for the client | ||
transporter.Transporter({ | ||
urlPrefix:"/js/", | ||
paths:["../../persevere/public/js/"], | ||
converter: transporter.Dojo | ||
}),*/ | ||
// the main place for static files accessible from the web | ||
//require('ringo/middleware/static').middleware(module.resolve('public')), | ||
//Directory("public", Static(null, {urls:[""], root: "public"})), | ||
//Static(null, {urls:["/explorer"], root: perseverePath + "/explorer"}), | ||
// main Pintura handler | ||
function(request){ | ||
print("request" + request); | ||
return pinturaApp(request); | ||
} | ||
; | ||
|
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<html> | ||
<title>{{pageName}}</title> | ||
<link rel="stylesheet" href="/css/common.css" /> | ||
<link rel="stylesheet" href="/css/wikiContent.css" /> | ||
<script src="/lib/transporter/receiver.js"></script> | ||
<script src="/lib/monitor.js"></script> | ||
<link rel="stylesheet" href="/public/css/common.css" /> | ||
<link rel="stylesheet" href="/public/css/wikiContent.css" /> | ||
<script src="/packages/requirejs/require.js"></script> | ||
<script src="/packages/example/monitor.js"></script> | ||
<body> | ||
<div id="headerContainer"><span class="pageName">{{pageName}}<span></div> | ||
<div id="content"> | ||
<p>{{content}}</p> | ||
</div> | ||
<div id="action"> | ||
<a href="/edit.html?page={{pageName}}">Edit this page</a> | ||
<a href="/public/edit.html?page={{pageName}}">Edit this page</a> | ||
</div> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<html> | ||
<title>{{pageName}}</title> | ||
<link rel="stylesheet" href="/css/common.css" /> | ||
<link rel="stylesheet" href="/css/wikiContent.css" /> | ||
<script src="/lib/transporter/receiver.js"></script> | ||
<script src="/lib/monitor.js"></script> | ||
<link rel="stylesheet" href="/public/css/common.css" /> | ||
<link rel="stylesheet" href="/public/css/wikiContent.css" /> | ||
<script src="/packages/requirejs/require.js"></script> | ||
<script src="/packages/example/monitor.js"></script> | ||
<body> | ||
<div id="headerContainer"><span class="pageName">{{pageName}}<span></div> | ||
<div id="content"> | ||
<p>This page does not yet exist. Click below to create the page.</p> | ||
</div> | ||
<div id="action"> | ||
<a href="/edit.html?page={{pageName}}">Create this page</a> | ||
<a href="/public/edit.html?page={{pageName}}">Create this page</a> | ||
</div> | ||
</body> | ||
</html> |