Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved the wiki example to persevere-example-wiki

  • Loading branch information...
commit 23e52396d3431b67798ac57a646feabd2a3ed15a 1 parent f23777e
@kriszyp kriszyp authored
Showing with 1 addition and 1,557 deletions.
  1. +1 −1  example/README.md
  2. +0 −50 example/bin/activate
  3. +0 −50 example/bin/activate.bash
  4. +0 −3  example/bin/activate.cmd
  5. +0 −36 example/bin/sea
  6. +0 −25 example/bin/sea.cmd
  7. +0 −1  example/data/README.md
  8. +0 −42 example/jackconfig.js
  9. +0 −18 example/lib/access.js
  10. +0 −8 example/lib/app.js
  11. +0 −91 example/lib/edit.js
  12. +0 −26 example/lib/facet/page-change.js
  13. +0 −36 example/lib/facet/page.js
  14. +0 −9 example/lib/jsgi/redirect-root.js
  15. +0 −50 example/lib/media/wiki-html.js
  16. +0 −39 example/lib/model/page-change.js
  17. +0 −13 example/lib/model/page-sql.js
  18. +0 −102 example/lib/model/page.js
  19. +0 −16 example/local.json
  20. +0 −16 example/package.json
  21. +0 −47 example/public/admin.html
  22. +0 −128 example/public/css/common.css
  23. +0 −21 example/public/css/edit.css
  24. +0 −33 example/public/edit.html
  25. BIN  example/public/images/bodyBg.png
  26. +0 −32 example/public/js/admin.js
  27. +0 −5 example/public/js/bootstrap.js
  28. +0 −92 example/public/js/edit.js
  29. +0 −493 example/public/js/json.js
  30. +0 −16 example/public/js/min-lib.js
  31. +0 −58 example/start-node.js
View
2  example/README.md
@@ -1 +1 @@
-This is an example Wiki built with Pintura.
+This is example Wiki has been moved to (http://github.com/kriszyp/persevere-example-wiki/)[http://github.com/kriszyp/persevere-example-wiki/].
View
50 example/bin/activate
@@ -1,50 +0,0 @@
-
-if [ -z "${BASH_ARGV[0]}" ]; then
-
- # as a last recourse, use the present working directory
- PACKAGE_HOME=$(pwd)
-
-else
-
- # get the absolute path of the executable
- SELF_PATH=$(
- cd -P -- "$(dirname -- "${BASH_ARGV[0]}")" \
- && pwd -P
- ) && SELF_PATH=$SELF_PATH/$(basename -- "${BASH_ARGV[0]}")
-
- # resolve symlinks
- while [ -h "$SELF_PATH" ]; do
- DIR=$(dirname -- "$SELF_PATH")
- SYM=$(readlink -- "$SELF_PATH")
- SELF_PATH=$(cd -- "$DIR" && cd -- $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
- done
-
- PACKAGE_HOME=$(dirname -- "$(dirname -- "$SELF_PATH")")
-
-fi
-
-export PACKAGE_HOME
-
-# which -s narwhal doesn't work (os x 10.5, kriskowal)
-if [ -f "$PACKAGE_HOME"/bin/narwhal ]; then
- NARWHAL="$PACKAGE_HOME"/bin/narwhal
-elif [ -f "$PACKAGE_HOME"/packages/narwhal/bin/narwhal ]; then
- NARWHAL="$PACKAGE_HOME"/packages/narwhal/bin/narwhal
-else
- env narwhal -e '' >/dev/null 2>&1
- if [ "$?" -ne 127 ]; then
- NARWHAL=narwhal
- else
- echo "ERROR: narwhal is not in your PATH nor in $PACKAGE_HOME/bin." >&2
- fi
-fi
-
-if [ -f "$PACKAGE_HOME"/narwhal.conf ]; then
- source "$PACKAGE_HOME"/narwhal.conf
- export NARWHAL_DEFAULT_ENGINE
-fi
-
-if [ "$NARWHAL" ]; then
- export PATH="$("$NARWHAL" --package "$PACKAGE_HOME" --path :)"
-fi
-
View
50 example/bin/activate.bash
@@ -1,50 +0,0 @@
-
-if [ -z "${BASH_ARGV[0]}" ]; then
-
- # as a last recourse, use the present working directory
- PACKAGE_HOME=$(pwd)
-
-else
-
- # get the absolute path of the executable
- SELF_PATH=$(
- cd -P -- "$(dirname -- "${BASH_ARGV[0]}")" \
- && pwd -P
- ) && SELF_PATH=$SELF_PATH/$(basename -- "${BASH_ARGV[0]}")
-
- # resolve symlinks
- while [ -h "$SELF_PATH" ]; do
- DIR=$(dirname -- "$SELF_PATH")
- SYM=$(readlink -- "$SELF_PATH")
- SELF_PATH=$(cd -- "$DIR" && cd -- $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
- done
-
- PACKAGE_HOME=$(dirname -- "$(dirname -- "$SELF_PATH")")
-
-fi
-
-export PACKAGE_HOME
-
-# which -s narwhal doesn't work (os x 10.5, kriskowal)
-if [ -f "$PACKAGE_HOME"/bin/narwhal ]; then
- NARWHAL="$PACKAGE_HOME"/bin/narwhal
-elif [ -f "$PACKAGE_HOME"/packages/narwhal/bin/narwhal ]; then
- NARWHAL="$PACKAGE_HOME"/packages/narwhal/bin/narwhal
-else
- env narwhal -e '' >/dev/null 2>&1
- if [ "$?" -ne 127 ]; then
- NARWHAL=narwhal
- else
- echo "ERROR: narwhal is not in your PATH nor in $PACKAGE_HOME/bin." >&2
- fi
-fi
-
-if [ -f "$PACKAGE_HOME"/narwhal.conf ]; then
- source "$PACKAGE_HOME"/narwhal.conf
- export NARWHAL_DEFAULT_ENGINE
-fi
-
-if [ "$NARWHAL" ]; then
- export PATH="$("$NARWHAL" --package "$PACKAGE_HOME" --path :)"
-fi
-
View
3  example/bin/activate.cmd
@@ -1,3 +0,0 @@
-@echo off
-
-set PATH=%~dp0;%PATH%
View
36 example/bin/sea
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-# this script is intended to work both in narwhal/bin and in
-# any project's bin dir; it's copied by tusk --init.
-
-# get the absolute path of the executable
-SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
-
-# resolve symlinks
-while [ -h "$SELF_PATH" ]; do
- DIR=$(dirname -- "$SELF_PATH")
- SYM=$(readlink -- "$SELF_PATH")
- SELF_PATH=$(cd -- "$DIR" && cd -- $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
-done
-
-export PACKAGE_HOME=$(dirname -- "$(dirname -- "$SELF_PATH")")
-
-source "$PACKAGE_HOME/bin/activate.bash"
-
-export OLDSEA="$SEA"
-export SEA="$PACKAGE_HOME"
-export SEALVL="$((SEALVL + 1))"
-
-if [ "$#" -lt 1 ]; then
- echo PATH="$PATH" >&2
- echo SEA="$SEA" >&2
- echo SEALVL="$SEALVL" >&2
- "$SHELL"
-else
- "$SHELL" -c "$*"
-fi
-if [ "$OLDSEA" != "" ]; then
- echo SEA="$OLDSEA" >&2
-fi
-echo SEALVL="$((SEALVL - 1))" >&2
-
View
25 example/bin/sea.cmd
@@ -1,25 +0,0 @@
-@echo off
-setlocal
-
-set SHELL=cmd.exe
-
-set PACKAGE_HOME=%~dp0\..
-
-call %PACKAGE_HOME%\bin\activate.cmd
-
-set OLDSEA=%SEA%
-set SEA=%PACKAGE_HOME%
-set /a SEALVL=%SEALVL% + 1
-
-if "%1" == "" (
- echo SEALVL=%SEALVL%
- echo SEA=%SEA%
- echo PATH=%PATH%
- %SHELL%
-) else (
- %SHELL% %*
-)
-
-set /a SEALVL=%SEALVL% - 1
-echo SEALVL=%SEALVL%
-echo SEA=%OLDSEA%
View
1  example/data/README.md
@@ -1 +0,0 @@
-This is the default location for data files
View
42 example/jackconfig.js
@@ -1,42 +0,0 @@
-/**
- * The starting point for Pintura running as a Jack app.
- */
-
-var pintura = require("pintura");
-require("app");
-
-// setup the Jack application
-exports.app =
- // this will provide module wrapping for the server side CommonJS libraries for the client
- transporter.Transporter({},
- // make the root url redirect to /Page/Root
- require("jsgi/redirect-root").RedirectRoot(
- // main Pintura handler
- pintura.app
- )
- );
-
-// now setup the development environment, handle static files before reloading the app
-// for better performance
-var File = require("file"),
- transporter = require("jsgi/transporter");
-exports.development = function(app, options){
- return require("jack/cascade").Cascade([
- // 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("jack/static").Static(null, {urls:[""],root:"public"}),
- // the typical reloader scenario
- (!options || options.reload) ? require("jack/reloader").Reloader(File.join(File.cwd(), "jackconfig"), "app") :
- exports.app
- ]);
-};
-
-// we start the REPL (the interactive JS console) because it is really helpful
-new (require("worker").SharedWorker)("narwhal/repl");
-
View
18 example/lib/access.js
@@ -1,18 +0,0 @@
-/**
- * Defines the capabilities of different users
- */
-var pageFacets = require("facet/page"),
- pageChangeFacets = require("facet/page-change"),
- admins = require("settings").admins,
- Register = require("security").Register,
- security = require("pintura").config.security;
-
-security.getAllowedFacets = function(user, request){
- if(user){
- if(admins.indexOf(user.name)>-1){
- return [pageFacets.AdminFacet, pageChangeFacets.AdminFacet];
- }
- return [pageFacets.UserFacet, pageChangeFacets.PublicFacet];
- }
- return [pageFacets.PublicFacet, pageChangeFacets.PublicFacet, Register];
-};
View
8 example/lib/app.js
@@ -1,8 +0,0 @@
-/**
- * This is an example Wiki web application written on Pintura
- */
-
-// registers the HTML representation handler that generates HTML from wiki content
-require("media/wiki-html");
-// Defines the capabilities of the users
-require("access");
View
91 example/lib/edit.js
@@ -1,91 +0,0 @@
-require("require");
-require("json");
-var pageName = location.search.match(/page=([^&]+)/);
-pageName = pageName && pageName[1];
-document.title = "Editing " + pageName;
-var request = require("jsgi-client").request;
-var escapeHTML = require("html").escapeHTML;
-document.getElementById("main-header").innerHTML = escapeHTML("Editing " + pageName);
-request({
- uri: "Page/" + pageName,
- headers: {
- "accept": "application/javascript, application/json"
- }
-}).then(function(response){
- if(!response.headers.username){
- login();
- }
- var page = eval("(" + response.body.join("") + ")");
- if(typeof page !== "object"){
- page = {
- id: pageName,
- content: ""
- };
- }
- var contentArea = document.getElementById("content-area");
- contentArea.value = page.content;
-
- document.getElementById("save-button").onclick = function(){
- page.content = contentArea.value;
- request({
- uri: "/Page/" + pageName,
- method: "PUT",
- body: JSON.stringify(page),
- headers: {
- "accept": "application/javascript, application/json",
- "content-type": "application/json"
- }
- }).then(function(){
- // redirect to the page once it is saved
- location = "/Page/" + pageName;
- }, errorHandler);
- };
-
-}, errorHandler);
-
-function login(){
- document.getElementById("login-form").style.display="block";
- document.getElementById("sign-in").onclick = function(){
- userRpc("authenticate").then(function(){
- document.getElementById("login-form").style.display="none";
- alert("Logged in");
- }, errorHandler);
- };
- document.getElementById("register").onclick = function(){
- userRpc("createUser").then(function(){
- alert("Registered");
- }, errorHandler);
- };
-}
-
-function userRpc(method, params){
- return request({
- uri: "Class/User",
- method: "POST",
- body: JSON.stringify({
- id:"call-id",
- method: method,
- params: [
- document.getElementById("user").value,
- document.getElementById("password").value
- ]
- }),
- headers: {
- "accept": "application/javascript, application/json",
- "content-type": "application/json"
- }
- }).then(function(response){
- response = eval('(' + response.body.join("") + ')');
- if(response.error){
- throw response.error;
- }
- return response.result;
- });
-
-}
-
-function errorHandler(error){
- alert(error);
-}
-
-
View
26 example/lib/facet/page-change.js
@@ -1,26 +0,0 @@
-/**
- * These are the page facets for the Wiki example application (in progress)
- */
-
-var PageChange = require("model/page-change").PageChange,
- Permissive = require("facet").Permissive,
- Restrictive = require("facet").Restrictive;
-
-
-// These are the different facets that are available for accessing this data
-// This facet uses the Restrictive constructor, so any modifying action must be explicilty
-// be enabled (by defining a handler)
-exports.PublicFacet = Restrictive(PageChange, {
- prototype: {
- },
- quality:0.5
-
-});
-// note that general users can't change page history
-
-// This facet is for administrators and grants full access to data
-exports.AdminFacet = Permissive(PageChange, {
- properties: {
- },
- quality: 1
-});
View
36 example/lib/facet/page.js
@@ -1,36 +0,0 @@
-/**
- * These are the page facets for the Wiki example application (in progress)
- */
-
-var Page = require("model/page").Page,
- Permissive = require("facet").Permissive,
- Restrictive = require("facet").Restrictive;
-
-
-// These are the different facets that are available for accessing this data
-// This facet uses the Restrictive constructor, so any modifying action must be explicilty
-// be enabled (by defining a handler)
-exports.PublicFacet = Restrictive(Page, {
- query: function(query, options){
- query = "?status=published" + (query.match(/^\?\w/) ? "&" : "") + query.substring(1);
- return Page.query(query, options);
- },
- prototype: {
- },
- quality:0.5
-
-});
-
-// This facet has for authenticated users and grants read and write capabilities
-exports.UserFacet = Permissive(Page, {
- properties: {
- },
- quality: 1
-});
-
-// This facet is for administrators and grants full access to data
-exports.AdminFacet = Permissive(Page, {
- properties: {
- },
- quality: 1
-});
View
9 example/lib/jsgi/redirect-root.js
@@ -1,9 +0,0 @@
-var redirector = require("jack/redirect").Redirect("/Page/Example");
-exports.RedirectRoot = function(app){
- return function(request){
- if(request.pathInfo == "/"){
- return redirector(request);
- }
- return app(request);
- };
-};
View
50 example/lib/media/wiki-html.js
@@ -1,50 +0,0 @@
-/**
-* Media handler for generating HTML from Wiki markup-based pages
-*/
-
-var Media = require("../media").Media,
- escapeHTML = require("html").escape,
- wikiToHtml = require("wiky").toHtml;
-
-
-Media({
- mediaType:"text/html",
- getQuality: function(object){
- return 1;
- },
- serialize: function(object, request, response){
- var pageName = escapeHTML(request.pathInfo.substring(1));
- var action;
- if(response.status === 404){
- action = "create";
-
- object = "This page does not exist yet";
- }
- else if(response.status === 200){
- action = "edit";
- }
- return {
- forEach:function(write){
- write('<html><title>' + pageName + '</title>\n');
- write('<style type="text/css">@import "/css/common.css";</style>\n');
- write('<body><div id="headerContainer"><span class="pageName">' + pageName + '<span></div>\n');
- write('<div id="content">\n');
- if(typeof object === "object"){
- write('' + wikiToHtml(object.content));
- }
- else{
- write("<p>" + object + "</p>\n");
- }
- if(action){
- write('<p><a href="/edit.html?page=' + pageName + '">' + action + ' this page</a></p>\n');
- }
- write('</div></body></html>\n');
- }
- };
- }
-});
-
-var rules = require("wiky").rules,
- store = require("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
39 example/lib/model/page-change.js
@@ -1,39 +0,0 @@
-/**
- * This class is used for tracking all the changes of a page
- */
-
-var Model = require("model").Model,
- DefaultStore = require("stores").DefaultStore,
- auth = require("jsgi/auth");
-
-// This class contains
-var pageChangeStore = require("stores").DefaultStore("PageChange");
-/* We can switch to the SQL based back-end with:
-pageChangeStore = SQLStore({
- table: "PageChange",
- idColumn: "id"
- indexedProperties:{
- id: true,
- pageId: true
- }
-});
-*/
-
-// now we create a class, all central model logic is defined here
-exports.PageChange = Model("PageChange", pageChangeStore, {
- properties: {
- content: String,
- pageId: {
- type: "integer",
- description:"This is the id for the current page from the Page model"
- }
- },
- links:[
- {
- rel: "current",
- href: "../Page/{pageId}"
- }
- ]
-});
-
-// The facets for accessing the page class are defined in facet/page
View
13 example/lib/model/page-sql.js
@@ -1,13 +0,0 @@
-/**
- * This provides the definition of the SQL store if used
- */
-
-var SQLStore = require("store/sql").SQLStore;
-
-exports.pageStore = SQLStore({
- table: "Page",
- starterStatements: [
- "CREATE TABLE Page (id INT NOT NULL AUTO_INCREMENT, title VARCHAR(100), status VARCHAR(10), content VARCHAR(100000), PRIMARY KEY(id))",
- ],
- idColumn: "id"
-});
View
102 example/lib/model/page.js
@@ -1,102 +0,0 @@
-/**
- * This is a page model for the Wiki example application (in progress)
- */
-
-var Model = require("model").Model,
- DefaultStore = require("stores").DefaultStore,
- auth = require("jsgi/auth"),
- Notifying = require("store/notifying").Notifying,
- PageChange = require("./page-change").PageChange;
-
-// Pintura consists of three primary layers: the store, the class (which acts as the
-// model), and the facet. Here we define the store and create the class for the store
-// First we create the store for interacting directly with the storage endpoint
-var pageStore = require("stores").DefaultStore("Page");
-/* We can switch to the SQL based back-end with:
-pageStore = require("./page-sql").pageStore;
-*/
-
-
-/* To add full-text indexing (only supported in Rhino)
-pageStore = require("store/full-text").FullText(pageStore, "Page");
-*/
-
-// to add events
-pageStore = Notifying(pageStore, "Page");
-
-// now we create a class, all central model logic is defined here
-exports.Page = Model("Page", pageStore, {
-/* We can create handlers for any of the actions, they will go directly to the store otherwise
- query: function(query, options){
- var sqlCondition = this.getWhereClause(query, options);
-
- if(sqlCondition){
- return pageStore.executeQuery(
- "SELECT id, title FROM Page WHERE " + sqlCondition, options);
- }
- },
-*/
-/*
- "delete": function(id){
- // any logic that we want on deletes
- // now call the store to actually do the delete
- pageStore["delete"](id);
- },
-*/
-
- construct: function(page, directives){
- // set initial properties on object instantiation
- if(auth.currentUser){
- page.createdBy = auth.currentUser.username;
- }
- page.status = "published";
- return page.save(directives);
- },
-
- put: function(page, options){ // handle puts to add to history and define attribution
- if(auth.currentUser){
- // set the current user name as the lastModifiedBy property
- page.lastModifiedBy = auth.currentUser.username;
- }
- page.status = "published";
- // do the default action of saving to the store
- var pageId = pageStore.put(page, options) || page.id;
- // create a new change entry in the history log
- new PageChange({
- content: page.content,
- pageId: pageId
- });
- return pageId;
- },
-
- properties: { // schema definitions for property types (these are optional)
- status: String,
- content: String
- },
-
- prototype: { // define the methods available on the model object instances
- // these are used by atom
- getTitle: function(item){
- return item.name;
- },
- getSummary: function(item){
- return item.description;
- },
- getUpdated: function(item){
- return item.uploaded;
- }
-
- },
- links: [ // define the link relations with other objects
- {
- rel: "history", // link to the list of changes for a page
- href: "../PageChange/?pageId={id}"
- }
- ]
-
- // this is flag to indicate that if Perstore should check to see an object exists when a PUT occurs, and call construct if it doesn't. The default is false
- // noConstructPut: false,
-});
-
-// The facets for accessing the page class are defined in facet/page
-
View
16 example/local.json
@@ -1,16 +0,0 @@
-{
- "database": {
- "connection":"jdbc:mysql://localhost/wiki?user=root&password=&useUnicode=true&characterEncoding=utf-8&autoReconnect=true",
- "type": "mysql",
- "host": "localhost",
- "port": 27017,
- "name": "wiki"
- },
- "mail": {
- "host":"mail.site.com",
- "defaultFrom": "app@site.com"
- },
- "bypassSecurity": true,
- "admins":["admin"],
- "dataFolder": "data"
-}
View
16 example/package.json
@@ -1,16 +0,0 @@
-{
- "name": "",
- "author": "",
- "dependencies": ["persevere"],
- "contributors": [],
- "mappings": {
- "mappings":{
- "perstore/": "http://github.com/kriszyp/perstore/zipball/master!/lib/",
- "commonjs-utils/": "http://github.com/kriszyp/commonjs-utils/zipball/master!/lib/"
- "pintura/": "http://github.com/kriszyp/pintura/zipball/master!/lib/"
- "wiky/": "http://github.com/kriskowal/wiky/zipball/master!/lib/",
- "model": "http://github.com/kriszyp/perstore/zipball/master!/lib/model",
- "facet": "http://github.com/kriszyp/perstore/zipball/master!/lib/facet",
- "media": "http://github.com/kriszyp/pintura/zipball/master!/lib/media"
- }
-}
View
47 example/public/admin.html
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <title>dojox.grid.DataGrid with Persevere</title>
-
- <style type="text/css">
- @import "../js/dojo/resources/dojo.css";
- @import "../js/dojox/grid/resources/Grid.css";
- @import "../js/dojox/grid/resources/tundraGrid.css";
- @import "../js/dijit/themes/tundra/tundra.css";
- body {
- padding:2em !important;
- font-size: 0.9em;
- font-family: Geneva, Arial, Helvetica, sans-serif;
- }
- .login-link {
- float: right;
- }
- </style>
- <script djConfig="isDebug:true, parseOnLoad: true" src="../js/dojo/dojo.js" type="text/javascript"></script>
- <script src="../js/admin.js" type="text/javascript"></script>
-</head>
-<body class="tundra">
-
- <div dojoType="persevere.LoginLink" mustLogin="true" jsid="loginLink" class="login-link"></div>
- <h1>Example Wiki Adminstration</h1>
-
- <table rowSelector="20px" rowsPerPage="20" query="''" height="200px" store="pageStore" id="grid" jsid="grid" dojoType="dojox.grid.DataGrid">
- <thead>
- <tr>
- <th field="id">Page</th>
- <th editable="true" field="status">Status</th>
- <th editable="true" field="createdBy">Created By</th>
- <th editable="true" field="lastModifiedBy">Last Modified By</th>
- </tr>
- </thead>
- </table>
- <div id="controls">
- <button onclick="pageStore.save({onError:function(e){console.log('the error', e)}})">Save</button>
- <button onclick="pageStore.revert()">Revert</button>
- <button onclick="addItem()">Add</button>
- <button onclick="remove()">Remove</button>&nbsp;&nbsp;&nbsp;
- </div>
-
-
-</body>
-</html>
View
128 example/public/css/common.css
@@ -1,128 +0,0 @@
-/* ---------- reset ----------*/
-html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
- font-weight: inherit;
- font-style: inherit;
- list-style: none;
- font-size: 100%;
- font-family: inherit;
- vertical-align: baseline;
-}
-
-html, body {
- height: 100%;
- width: 100%;
- margin: 0;
- padding: 0;
- font-family: "Trebuchet MS", Verdana, Helvetica, sans-serif;
- color: #111;
- background-color:#e8eeef;
-}
-p{
-padding-top:5px;
-padding-bottom:5px;
-}
-
-h1 {
- font-weight:bold;
- font-size:1.2em;
- margin-bottom:1em;
-}
-
-/* ---------- header ----------*/
-#headerContainer {
- background-color: #ddd;
- width: 100%;
- height: 46px;
- border-top: 5px solid #ccc;
- border-bottom: 5px solid #ccc;
- font-size: 30px;
- padding:10px;
-}
-#headerContainer span {
- margin-left: 40px;
-}
-
-#headerContainer h1 {
- font-size:20px;
- display: block;
- float: right;
-}
-
-/* ---------- navigation ----------*/
-#mainNav {
- position: absolute;
- right: 0px;
- font-size: 14px;
- margin: 35px 126px 0 0;
- background-color: #ddd;
-}
-
-#headerContainer #subNav {
- margin-top:76px;
-}
-
-.pageName {
- color: #0093C8;
-}
-
-
-
-/* ---------- content ----------*/
-
-#content {
- background: #eef2f3 url("../images/bodyBg.png") repeat-x top left;
- width: 640px;
- min-height: 250px;
- height:auto !important;
- height: 250px;
- padding: 40px;
- margin: 25px;
- -moz-border-radius: 15px;
- -webkit-border-radius: 15px;
-}
-
-#content h2 {
- background: #E6E6FF;
- height: 16px;
- color: #7D3333;
- font-size: 16px;
- font-weight: normal;
- padding: 8px;
- font-family: "Myriad Pro", "Trebuchet MS", Verdana, Helvetica, sans-serif;
- -moz-border-radius: 7px;
- -webkit-border-radius: 7px;
- border: 1px solid #E1E1E1;
-
- margin: 10px;
- width:300px;
-
-}
-
-#content h3 {
- height: 16px;
- margin: 15px;
- color: #515152;
- font-size: 14px;
- font-weight: bold;
- font-family: Arial, Verdana, Helvetica, sans-serif;
-}
-
-
-#status {
- position:absolute;
- top:0px;
- left:0px;
- z-index:10;
- background:url('spinner.gif') white no-repeat;
- border:1px solid black;
- padding:5px;
- padding-left:25px;
- font-family:arial;
- font-size: 80%;
-}
-
View
21 example/public/css/edit.css
@@ -1,21 +0,0 @@
-#login-form, #upload-form {
- display: none;
- position: absolute;
- top: 200px;
- left: 200px;
- border: solid 2px;
- background-color: #bbb;
- -moz-border-radius: 7px;
- -webkit-border-radius: 7px;
- padding: 20px;
-}
-
-#user-name {
- float: right;
-}
-
-#content-area {
- display: block;
- width: 640px;
- height: 480px;
-}
View
33 example/public/edit.html
@@ -1,33 +0,0 @@
-<html>
- <head>
- <title>Editing content</title>
- <style type="text/css">
- @import "css/edit.css";
- @import "css/common.css";
- </style>
- </head>
- <body>
- <div id="headerContainer">
- <div id="main-header">Editing page</div>
- </div>
- <div id="content">
- <div id="user-name"></div>
- <textarea id="content-area"></textarea>
- <button id="save-button">Save</button>
- </div>
-
-
- <div id="login-form">
- <label>Name:</label><input id="user" type="text" /><br />
- <label>Password:</label><input id="password" type="password" /><br />
- <button id="sign-in">Sign in</button>
- <button id="register">Register</button>
- </div>
- <form id="upload-form" method="POST" enctype="multipart/form-data" target="upload-target" action="/Page/Example">
- <label>Image to upload:</label><input type="file" name="image"/><br />
- <button>Upload</input>
- <iframe name="upload-target" style="display:none"></iframe>
- </form>
- <script src="lib/edit.js"></script>
- </body>
-</html>
View
BIN  example/public/images/bodyBg.png
Deleted file not rendered
View
32 example/public/js/admin.js
@@ -1,32 +0,0 @@
-var path = location.pathname.match(/(.*\/)[^\/]*$/)[1];
-if(location.toString().match(/file:/)){
- alert("You can't run this demo from the file system, you must run it with Persevere");
-}
-dojo.require("dojo.cookie");
-dojo.require("dojox.data.JsonRestStore");
-dojo.require("dojox.grid.DataGrid");
-dojo.require("persevere.LoginLink");
-
-if(path.lastIndexOf("example/") > -1){
- path = path.substring(0,path.lastIndexOf("example/"));
-}
-
-pageStore = new dojox.data.JsonRestStore({target: "Page/"});
-if(!pageStore){
- console.log("Customer table doesn't exist, creating it now");
- dojo.xhr("POST",{url:"/Class/",sync: true, putData:'{"id":"Customer","extends":{"$ref":"Object"}}'},true);
- pageStore = new dojox.data.PersevereStore({target:"/Customer/"}); // and get the Customer store
- // create a new item for starting data
- pageStore.newItem({firstName:"John", lastName:"Doe"});
- pageStore.save();
-}
-
-addItem = function() {
- pageStore.newItem({firstName: "firstName", lastName: "lastName",created:dojo.date.stamp.toISOString(new Date,{zulu:true})});
-}
-remove = function() {
- var items = grid.selection.getSelected();
- for (var i = 0; i < items.length; i++){
- pageStore.deleteItem(items[i]);
- }
-}
View
5 example/public/js/bootstrap.js
@@ -1,5 +0,0 @@
-global = window; // pull all the CommonJS stuff into the global
-var exports = {};
-require = function(){
- return exports;
-};
View
92 example/public/js/edit.js
@@ -1,92 +0,0 @@
-require("require");
-require("json");
-var pageName = location.search.match(/page=([^&]+)/);
-pageName = pageName && pageName[1];
-document.title = "Editing " + pageName;
-var request = require("jsgi-client").request;
-var escapeHTML = require("html").escapeHTML;
-document.getElementById("main-header").innerHTML = escapeHTML("Editing " + pageName);
-debugger;
-request({
- uri: "Page/" + pageName,
- headers: {
- "accept": "application/javascript, application/json"
- }
-}).then(function(response){
- if(!response.headers.username){
- login();
- }
- var page = eval("(" + response.body.join("") + ")");
- if(typeof page !== "object"){
- page = {
- id: pageName,
- content: ""
- };
- }
- var contentArea = document.getElementById("content-area");
- contentArea.value = page.content;
-
- document.getElementById("save-button").onclick = function(){
- page.content = contentArea.value;
- request({
- uri: "/Page/" + pageName,
- method: "PUT",
- body: JSON.stringify(page),
- headers: {
- "accept": "application/javascript, application/json",
- "content-type": "application/json"
- }
- }).then(function(){
- // redirect to the page once it is saved
- location = "/Page/" + pageName;
- }, errorHandler);
- };
-
-}, errorHandler);
-
-function login(){
- document.getElementById("login-form").style.display="block";
- document.getElementById("sign-in").onclick = function(){
- userRpc("authenticate").then(function(){
- document.getElementById("login-form").style.display="none";
- alert("Logged in");
- }, errorHandler);
- };
- document.getElementById("register").onclick = function(){
- userRpc("createUser").then(function(){
- alert("Registered");
- }, errorHandler);
- };
-}
-
-function userRpc(method, params){
- return request({
- uri: "Class/User",
- method: "POST",
- body: JSON.stringify({
- id:"call-id",
- method: method,
- params: [
- document.getElementById("user").value,
- document.getElementById("password").value
- ]
- }),
- headers: {
- "accept": "application/javascript, application/json",
- "content-type": "application/json"
- }
- }).then(function(response){
- response = eval('(' + response.body.join("") + ')');
- if(response.error){
- throw response.error;
- }
- return response.result;
- });
-
-}
-
-function errorHandler(error){
- alert(error);
-}
-
-
View
493 example/public/js/json.js
@@ -1,493 +0,0 @@
-/*
- http://www.JSON.org/json2.js
- 2008-11-19
-
- Public Domain.
-
- NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
- See http://www.JSON.org/js.html
-
- This file creates a global JSON object containing two methods: stringify
- and parse.
-
- JSON.stringify(value, replacer, space)
- value any JavaScript value, usually an object or array.
-
- replacer an optional parameter that determines how object
- values are stringified for objects. It can be a
- function or an array of strings.
-
- space an optional parameter that specifies the indentation
- of nested structures. If it is omitted, the text will
- be packed without extra whitespace. If it is a number,
- it will specify the number of spaces to indent at each
- level. If it is a string (such as '\t' or '&nbsp;'),
- it contains the characters used to indent at each level.
-
- This method produces a JSON text from a JavaScript value.
-
- When an object value is found, if the object contains a toJSON
- method, its toJSON method will be called and the result will be
- stringified. A toJSON method does not serialize: it returns the
- value represented by the name/value pair that should be serialized,
- or undefined if nothing should be serialized. The toJSON method
- will be passed the key associated with the value, and this will be
- bound to the object holding the key.
-
- For example, this would serialize Dates as ISO strings.
-
- Date.prototype.toJSON = function (key) {
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- return this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z';
- };
-
- You can provide an optional replacer method. It will be passed the
- key and value of each member, with this bound to the containing
- object. The value that is returned from your method will be
- serialized. If your method returns undefined, then the member will
- be excluded from the serialization.
-
- If the replacer parameter is an array of strings, then it will be
- used to select the members to be serialized. It filters the results
- such that only members with keys listed in the replacer array are
- stringified.
-
- Values that do not have JSON representations, such as undefined or
- functions, will not be serialized. Such values in objects will be
- dropped; in arrays they will be replaced with null. You can use
- a replacer function to replace those with JSON values.
- JSON.stringify(undefined) returns undefined.
-
- The optional space parameter produces a stringification of the
- value that is filled with line breaks and indentation to make it
- easier to read.
-
- If the space parameter is a non-empty string, then that string will
- be used for indentation. If the space parameter is a number, then
- the indentation will be that many spaces.
-
- Example:
-
- text = JSON.stringify(['e', {pluribus: 'unum'}]);
- // text is '["e",{"pluribus":"unum"}]'
-
-
- text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
- // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
- text = JSON.stringify([new Date()], function (key, value) {
- return this[key] instanceof Date ?
- 'Date(' + this[key] + ')' : value;
- });
- // text is '["Date(---current time---)"]'
-
-
- JSON.parse(text, reviver)
- This method parses a JSON text to produce an object or array.
- It can throw a SyntaxError exception.
-
- The optional reviver parameter is a function that can filter and
- transform the results. It receives each of the keys and values,
- and its return value is used instead of the original value.
- If it returns what it received, then the structure is not modified.
- If it returns undefined then the member is deleted.
-
- Example:
-
- // Parse the text. Values that look like ISO date strings will
- // be converted to Date objects.
-
- myData = JSON.parse(text, function (key, value) {
- var a;
- if (typeof value === 'string') {
- a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
- if (a) {
- return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
- +a[5], +a[6]));
- }
- }
- return value;
- });
-
- myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
- var d;
- if (typeof value === 'string' &&
- value.slice(0, 5) === 'Date(' &&
- value.slice(-1) === ')') {
- d = new Date(value.slice(5, -1));
- if (d) {
- return d;
- }
- }
- return value;
- });
-
-
- This is a reference implementation. You are free to copy, modify, or
- redistribute.
-
- This code should be minified before deployment.
- See http://javascript.crockford.com/jsmin.html
-
- USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
- NOT CONTROL.
-*/
-
-/*jslint evil: true */
-
-/*global JSON */
-
-/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
- call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
- getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
- lastIndex, length, parse, prototype, push, replace, slice, stringify,
- test, toJSON, toString, valueOf
-*/
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-if(global.JSON){
- exports.parse = JSON.parse;
- exports.stringify = JSON.stringify;
-}
-else{
- global.JSON = typeof exports == "undefined" ? {} : exports;
-}
-
-(function () {
-
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- if (typeof Date.prototype.toJSON !== 'function') {
-
- Date.prototype.toJSON = function (key) {
-
- return this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z';
- };
-
- String.prototype.toJSON =
- Number.prototype.toJSON =
- Boolean.prototype.toJSON = function (key) {
- return this.valueOf();
- };
- }
-
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap,
- indent,
- meta = { // table of character substitutions
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"' : '\\"',
- '\\': '\\\\'
- },
- rep;
-
-
- function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
- escapable.lastIndex = 0;
- return escapable.test(string) ?
- '"' + string.replace(escapable, function (a) {
- var c = meta[a];
- return typeof c === 'string' ? c :
- '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' :
- '"' + string + '"';
- }
-
-
- function str(key, holder) {
-
-// Produce a string from holder[key].
-
- var i, // The loop counter.
- k, // The member key.
- v, // The member value.
- length,
- mind = gap,
- partial,
- value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
- if (value && typeof value === 'object' &&
- typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
- if (typeof rep === 'function') {
- value = rep.call(holder, key, value);
- }
-
-// What happens next depends on the value's type.
-
- switch (typeof value) {
- case 'string':
- return quote(value);
-
- case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
- return isFinite(value) ? String(value) : 'null';
-
- case 'boolean':
- case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
- return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
- case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
- if (!value) {
- return 'null';
- }
-
-// Make an array to hold the partial results of stringifying this object value.
-
- gap += indent;
- partial = [];
-
-// Is the value an array?
-
- if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || 'null';
- }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
- v = partial.length === 0 ? '[]' :
- gap ? '[\n' + gap +
- partial.join(',\n' + gap) + '\n' +
- mind + ']' :
- '[' + partial.join(',') + ']';
- gap = mind;
- return v;
- }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
- if (rep && typeof rep === 'object') {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- k = rep[i];
- if (typeof k === 'string') {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
- for (k in value) {
- if (Object.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
- v = partial.length === 0 ? '{}' :
- gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
- mind + '}' : '{' + partial.join(',') + '}';
- gap = mind;
- return v;
- }
- }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
- if (typeof JSON.stringify !== 'function') {
- JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
- var i;
- gap = '';
- indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
- if (typeof space === 'number') {
- for (i = 0; i < space; i += 1) {
- indent += ' ';
- }
-
-// If the space parameter is a string, it will be used as the indent string.
-
- } else if (typeof space === 'string') {
- indent = space;
- }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
- rep = replacer;
- if (replacer && typeof replacer !== 'function' &&
- (typeof replacer !== 'object' ||
- typeof replacer.length !== 'number')) {
- throw new Error('JSON.stringify');
- }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
- return str('', {'': value});
- };
- }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
- if (typeof JSON.parse !== 'function') {
- JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
- var j;
-
- function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
- var k, v, value = holder[key];
- if (value && typeof value === 'object') {
- for (k in value) {
- if (Object.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- } else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function (a) {
- return '\\u' +
- ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
- if (/^[\],:{}\s]*$/.
-test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
-replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
-replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
- j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
- return typeof reviver === 'function' ?
- walk({'': j}, '') : j;
- }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
- throw new SyntaxError('JSON.parse');
- };
- }
-})();
-
-/**
- * Serialize an object to a JSON string.
- */
-JSON.encode = JSON.stringify;
-
-/**
- * Deserialize an object from a JSON string.
- */
-JSON.decode = JSON.parse;
-
View
16 example/public/js/min-lib.js
@@ -1,16 +0,0 @@
-var xhr = function(jsgiObject){
-}; var page = location.search.match(/page=\/([^&])/);
- page = page && page[1];
- var xhr = XMLHttpRequest();
- xhr.open("GET", "Page/" + page, true);
- xhr.onreadystatechange = function(){
- if(xhr.readyState == 4){
- var page = eval("(" + xhr.responseText + ")");
- var contentArea = document.getElementById("content-area");
- contentArea.value = page.content;
- document.getElementById("save-button").onclick = function(){
- contentArea.value
- };
- }
- };
- xhr.send(null);
View
58 example/start-node.js
@@ -1,58 +0,0 @@
-/**
- * The starting point for Pintura running in Node.
- */
-
-// first we add all the necessary paths to require.paths
-var packagesRoot = "../../../";
-var packagePaths = [""] // start with the current directory
- .concat([ // now add alll the packages
- "packages/pintura/",
- "packages/pintura/engines/node/",
- "packages/pintura/engines/default/",
- "packages/perstore/",
- "packages/perstore/engines/node/",
- "packages/perstore/engines/default/",
- "packages/commonjs-utils/",
- "packages/jack/",
- "packages/jsgi-node/",
- "packages/wiky/",
- "engines/default/",
- ""
- ].map(function(path){ // for each package, start in the right directory
- return packagesRoot + path;
- }));
-
-require.paths.unshift.apply(require.paths, packagePaths.slice(0, -2).map(addLib));
-require.paths.push.apply(require.paths, packagePaths.slice(-2).map(addLib));
-function addLib(path){
- return path + "lib";
-}
-require("node-commonjs");
-require.reloadable(function(){
- var pintura = require("pintura");
- require("app");
-});
-
-require("jsgi-node").start(
- require("jsgi/cascade").Cascade([
- // cascade from static to pintura REST handling
- // the main place for static files accessible from the web
- require("jsgi/static").Static({urls:[""],roots:["public"]}),
- // this will provide access to the server side JS libraries from the client
- require("jsgi/transporter").Transporter({paths: [packagesRoot + "engines/browser/lib"].concat(require.paths.map(function(path){
- return path.replace(/[\\\/]engines[\\\/](\w*)/,function(t, engine){
- return "/engines/" + (engine === "default" ? "default" : "browser");
- })
- }))}),
- // make the root url redirect to /Page/Root
- require("jsgi/redirect-root").RedirectRoot(
- // main pintura app
- function(request){
- return pintura.app(request);
- }
- )
-]));
-
-// having a REPL is really helpful
-require("repl").start();
-
Please sign in to comment.
Something went wrong with that request. Please try again.