Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
teknopaul committed Jul 30, 2011
0 parents commit 980daf6
Show file tree
Hide file tree
Showing 177 changed files with 16,627 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .project
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>portawiki</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
6 changes: 6 additions & 0 deletions bin/portawiki
@@ -0,0 +1,6 @@
#!/bin/bash

cd `dirname $0`
cd ../server
node start

15 changes: 15 additions & 0 deletions build/build.sh
@@ -0,0 +1,15 @@
cd `dirname $0`
cd ..

tar cvfz portawiki-1.0.tar.gz bin client conf/*.new conf.d server

mv build/install.sh portawiki-1.0.bin
cat portawiki-1.0.tar.gz >> portawiki-1.0.bin

#truncate -s -1 portawiki-1.0.bin

chmod u+x portawiki-1.0.bin

echo built `pwd`/portawiki-1.0.bin

cd conf
33 changes: 33 additions & 0 deletions build/install.sh
@@ -0,0 +1,33 @@
#!/bin/bash
cd `dirname $0`

tail -n +34 $0 > tmp.tar.gz

gunzip tmp.tar.gz && tar xvf tmp.tar
if [ $? -ne 0 ] ; then
echo extract failed
exit $?
else
mkdir content data
fi
if [ ! -d ./conf ] ; then
exit 1
fi

if [ ! -f conf/config.xml ] ; then
mv conf/config.xml.new conf/config.xml
fi

if [ ! -f conf/ssi-environment.xml ] ; then
mv conf/ssi-environment.xml.new conf/ssi-environment.xml
else
rm conf/ssi-environment.xml.new
fi

if [ ! -f conf/users.xml ] ; then
mv conf/users.xml.new conf/users.xml
else
rm conf/users.xml.new
fi
exit 0
##END34
51 changes: 51 additions & 0 deletions client/app/edit.html
@@ -0,0 +1,51 @@
<html id="pw-page">

<head>

<title>PortaWiki - Editor</title>

<!--#include virtual="/app/inc.html" -->

<script type="text/javascript" src="js/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
theme : "advanced",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
theme_advanced_blockformats : "p,div,h1,h2,h3,h4,h5,h6,blockquote,dt,dd,samp",

// Usable CSS for the HTML
content_css : "/app/skin/public.css",
mode : "textareas"
});

var editor = new pw.Editor();
jQuery(function(){
editor.init();
});
</script>

</head>

<body id="pw-body">

<!--#include virtual="/app/skin/layout-top-edit.html" -->

<h1 id="pw-title">&nbsp;</h1>

<form id="pw-editor-form">
<textarea class="pw-html-editor" name="content"></textarea><br/>
<input type="submit" value="Save" id="pw-save"></input>
<input type="submit" value="Save + View" id="pw-save-and-view"></input>
</form>


<!--#include virtual="/app/skin/layout-bottom.html" -->

</body>

</html>

Binary file added client/app/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions client/app/inc.html
@@ -0,0 +1,11 @@
<link rel="SHORTCUT_ICON" href="/app/facicon.png" />
<link href="/app/style.css" rel="stylesheet" type="text/css" />
<link href="/app/skin/public.css" rel="stylesheet" type="text/css" />
<script src="/app/js/jquery-1.4.2.js"></script>
<script src="/app/js/jquery.closure.js"></script>
<script src="/app/js/jquery.htmlbuffer.js"></script>
<script src="/app/js/popups.js"></script>
<script src="/app/js/porta-wiki.js"></script>
<script src="/app/js/page-name-validator.js"></script>
<script src="/app/js/breadcrumb-trail.js"></script>

36 changes: 36 additions & 0 deletions client/app/js/breadcrumb-trail.js
@@ -0,0 +1,36 @@
if(typeof pw=='undefined') {
/**
* @namespace pw namespace object
*/
var pw = new Object();
}
if(typeof require != 'undefined') {
pw.validatePageName = require("./page-name-validator").validatePageName;
}


/**
* Takes /view/a/b/c/file.html and returns an HTML representation of
* a > b > c
*/
pw.breadcrumbTrailHtml = function(pathname) {
var dotIdx = pathname.indexOf('.');
if ( dotIdx > -1 ) {
pathname = pathname.substring(0, dotIdx);
}
pathname = pw.validatePageName(pathname, false);
var segments = pathname.split('/');
var pathSoFar = "/view";
var html = '<div class="pw-breadcrumb-trail"><span>Path &raquo; <a href="/view/">root</a>';
for(var i = 2; i < segments.length - 1; i++) {
html += ' &raquo; ';
pathSoFar += '/' + segments[i];
html += '<a href="' + pathSoFar+ '/">' + segments[i].replace(/_/g, ' ') + '</a>';
}
html += '</span></div>';
return html;
};



// console.log(pw.breadcrumbTrailHtml("/view/a/b/c/file.html"));

0 comments on commit 980daf6

Please sign in to comment.