summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpouzenc <lpouzenc@gmail.com>2013-11-28 13:11:58 +0100
committerlpouzenc <lpouzenc@gmail.com>2013-11-28 13:11:58 +0100
commita77d63fd3ce1e93a554b62e6f63646f1fb568ecb (patch)
treebaf11cfbae3efa6c2773667565f01e08902ce90d
downloadplaintextcms-master.tar.gz
plaintextcms-master.tar.bz2
plaintextcms-master.zip
Import initialHEADmaster
-rw-r--r--TODO3
-rw-r--r--content/fr/accueil/.props.ini.swpbin0 -> 12288 bytes
-rw-r--r--content/fr/accueil/div-content.html27
-rw-r--r--content/fr/accueil/div-teaser.html3
-rw-r--r--content/fr/accueil/props.ini4
-rw-r--r--edit-res.html125
-rw-r--r--editable.php34
-rw-r--r--internal/editor-bind-code.html71
-rw-r--r--internal/utils.php39
-rw-r--r--site_conf.ini1
-rw-r--r--templates/default/images/background.pngbin0 -> 251 bytes
-rw-r--r--templates/default/images/external-link-ltr-icon.pngbin0 -> 279 bytes
-rw-r--r--templates/default/layout-article.php17
-rw-r--r--templates/default/screen.css79
14 files changed, 403 insertions, 0 deletions
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..a483213
--- /dev/null
+++ b/TODO
@@ -0,0 +1,3 @@
+
+S'intéresser à http://pico.dev7studios.com/docs.html
+
diff --git a/content/fr/accueil/.props.ini.swp b/content/fr/accueil/.props.ini.swp
new file mode 100644
index 0000000..18de228
--- /dev/null
+++ b/content/fr/accueil/.props.ini.swp
Binary files differ
diff --git a/content/fr/accueil/div-content.html b/content/fr/accueil/div-content.html
new file mode 100644
index 0000000..2aea644
--- /dev/null
+++ b/content/fr/accueil/div-content.html
@@ -0,0 +1,27 @@
+<h2>Etymology</h2>
+<p>The word <a href="http://en.wikipedia.org/wiki/Aloha-invalid" target="_blank">aloha</a> derives from the Proto-Polynesian root <i>*qalofa</i>. It has cognates in other Polynesian languages, such as Samoan alofa
+and Māori aroha, also meaning "love."</p>
+<table>
+<caption>with a caption.</caption>
+<tr><td>This</td><td>is</td></tr>
+<tr><td>a</td><td>table.</td></tr>
+</table>
+<p>A folk etymology claims that it derives from a compound of the <a href="http://en.wikipedia.org/wiki/Hawaii" target="_blank">Hawaiian</a> words alo meaning "presence", "front", "face", or "share"; and
+ha, meaning "breath of life" or "essence of life." Although alo does indeed mean "presence" etc., the word for breath is spelled with a macron
+or kahakō over the a (hā) whereas the word aloha does not have a long a.</p>
+<h2>Usage</h2>
+<p>Before contact with the West, the words used for greeting were welina and anoai. Today, "aloha kakahiaka" is the phrase for "good
+morning." "Aloha ʻauinalā" means "good afternoon" and "aloha ahiahi" means "good evening." "Aloha kākou" is a common form of "welcome to all."</p>
+<p>In modern Hawaiʻi, numerous businesses have aloha in their names, with more than 3 pages of listings in the Oʻahu phone book alone.</p>
+<h2>Trends</h2>
+<p>Recent trends are popularizing the term elsewhere in the United States. Popular entertainer, Broadway star and Hollywood actress Bette
+Midler, born in Honolulu, uses the greeting frequently in national appearances. The word was also used frequently in the hit television drama
+Hawaii Five-O. In the influential 1982 film comedy Fast Times at Ridgemont High, the eccentric teacher Mr. Hand makes use of the greeting. The
+Aloha Spirit is a major concept in Lilo and Stitch, a very popular Disney series of movies and TV shows, set in Hawaiʻi. The drama series Lost,
+shot in Hawaiʻi, has a thank you note at the end of the credits saying "We thank the people of Hawaiʻi and their Aloha Spirit". Aloha is a term
+also used in the Nickelodeon program Rocket Power.</p>
+<ul>
+ <li>Arguably the most famous historical Hawaiian song, "Aloha ʻOe" was written by the last queen of Hawaii, Liliʻuokalani.</li>
+ <li>The term inspired the name of the ALOHA Protocol introduced in the 1970s by the University of Hawaii.</li>
+ <li>In Hawaii someone can be said to have or show aloha in the way they treat others; whether family, friend, neighbor or stranger.</li>
+</ul>
diff --git a/content/fr/accueil/div-teaser.html b/content/fr/accueil/div-teaser.html
new file mode 100644
index 0000000..414f783
--- /dev/null
+++ b/content/fr/accueil/div-teaser.html
@@ -0,0 +1,3 @@
+<p><b>Aloha</b> in the Hawaiian language means affection, love, peace, compassion and mercy. Since the middle of the 19th century, it also
+has come to be used as an English greeting to say <i>goodbye</i> and <i>hello</i>. Currently, it is mostly used in the sense of hello; however,
+it is used as the above.</p>
diff --git a/content/fr/accueil/props.ini b/content/fr/accueil/props.ini
new file mode 100644
index 0000000..3f6c4b6
--- /dev/null
+++ b/content/fr/accueil/props.ini
@@ -0,0 +1,4 @@
+title = Aloha, World!
+template = default
+layout = article
+
diff --git a/edit-res.html b/edit-res.html
new file mode 100644
index 0000000..50912f4
--- /dev/null
+++ b/edit-res.html
@@ -0,0 +1,125 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Aloha, World!</title>
+<link rel="stylesheet" href="templates/default/screen.css" />
+</head>
+
+<body>
+<div id="main">
+<div id="tree-div"></div>
+<h1 id="title">Aloha, World!</h1>
+<div id="bodyContent">
+<div id="teaser" class="shorttext">
+<p><b>Aloha</b> in the Hawaiian language means affection, love, peace, compassion and mercy. Since the middle of the 19th century, it also
+has come to be used as an English greeting to say <i>goodbye</i> and <i>hello</i>. Currently, it is mostly used in the sense of hello; however,
+it is used as the above.</p>
+</div>
+<div id="content" class="article">
+<h2>Etymology</h2>
+<p>The word <a href="http://en.wikipedia.org/wiki/Aloha-invalid" target="_blank">aloha</a> derives from the Proto-Polynesian root <i>*qalofa</i>. It has cognates in other Polynesian languages, such as Samoan alofa
+and Māori aroha, also meaning "love."</p>
+<table>
+<caption>with a caption.</caption>
+<tr><td>This</td><td>is</td></tr>
+<tr><td>a</td><td>table.</td></tr>
+</table>
+<p>A folk etymology claims that it derives from a compound of the <a href="http://en.wikipedia.org/wiki/Hawaii" target="_blank">Hawaiian</a> words alo meaning "presence", "front", "face", or "share"; and
+ha, meaning "breath of life" or "essence of life." Although alo does indeed mean "presence" etc., the word for breath is spelled with a macron
+or kahakō over the a (hā) whereas the word aloha does not have a long a.</p>
+<h2>Usage</h2>
+<p>Before contact with the West, the words used for greeting were welina and anoai. Today, "aloha kakahiaka" is the phrase for "good
+morning." "Aloha ʻauinalā" means "good afternoon" and "aloha ahiahi" means "good evening." "Aloha kākou" is a common form of "welcome to all."</p>
+<p>In modern Hawaiʻi, numerous businesses have aloha in their names, with more than 3 pages of listings in the Oʻahu phone book alone.</p>
+<h2>Trends</h2>
+<p>Recent trends are popularizing the term elsewhere in the United States. Popular entertainer, Broadway star and Hollywood actress Bette
+Midler, born in Honolulu, uses the greeting frequently in national appearances. The word was also used frequently in the hit television drama
+Hawaii Five-O. In the influential 1982 film comedy Fast Times at Ridgemont High, the eccentric teacher Mr. Hand makes use of the greeting. The
+Aloha Spirit is a major concept in Lilo and Stitch, a very popular Disney series of movies and TV shows, set in Hawaiʻi. The drama series Lost,
+shot in Hawaiʻi, has a thank you note at the end of the credits saying "We thank the people of Hawaiʻi and their Aloha Spirit". Aloha is a term
+also used in the Nickelodeon program Rocket Power.</p>
+<ul>
+ <li>Arguably the most famous historical Hawaiian song, "Aloha ʻOe" was written by the last queen of Hawaii, Liliʻuokalani.</li>
+ <li>The term inspired the name of the ALOHA Protocol introduced in the 1970s by the University of Hawaii.</li>
+ <li>In Hawaii someone can be said to have or show aloha in the way they treat others; whether family, friend, neighbor or stranger.</li>
+</ul>
+</div>
+</div>
+</div>
+
+
+<link href="http://cdn.aloha-editor.org/latest/css/aloha.css" type="text/css" rel="stylesheet" />
+<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/vendor/jquery-1.7.1.js"></script>
+<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/require.js"></script>
+<script>
+ var Aloha = window.Aloha || ( window.Aloha = {} );
+
+ Aloha.settings = {
+ locale: 'fr',
+ plugins: {
+ format: {
+ config : [ 'b', 'i','sub','sup'],
+ editables : {
+ // no formatting allowed for title
+ '#title' : [ ],
+ // formatting for all editable DIVs
+ 'div' : [ 'b', 'i', 'del', 'sub', 'sup' ],
+ // content is a DIV and has class .article so it gets both buttons
+ '.article' : [ 'b', 'i', 'p', 'title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'removeFormat']
+ }
+ },
+ list: {
+ // all elements with no specific configuration get an UL, just for fun :)
+ config : [ 'ul' ],
+ editables : {
+ // Even if this is configured it is not set because OL and UL are not allowed in H1.
+ '#title' : [ 'ol' ],
+ // all divs get OL
+ 'div' : [ 'ol' ],
+ // content is a DIV. It would get only OL but with class .article it also gets UL.
+ '.article' : [ 'ul' ]
+ }
+ },
+ link: {
+ config : [ 'a' ],
+ editables : {
+ // No links in the title.
+ '#title' : [ ]
+ }
+ }
+ },
+ sidebar: {
+ disabled: false
+ }
+ };
+</script>
+
+<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/aloha.js"
+ data-aloha-plugins="common/ui,
+ common/format,
+ common/table,
+ common/list,
+ common/link,
+ common/highlighteditables,
+ common/block,
+ common/undo,
+ common/image,
+ common/contenthandler,
+ common/paste,
+ common/commands,
+ common/abbr"></script>
+
+<script type="text/javascript">
+Aloha.ready(function() {
+ // mark the editable parts
+ $('#title').aloha();
+ $('#teaser').aloha();
+ $('#content').aloha();
+});
+
+</script>
+
+</body>
+</html>
+
diff --git a/editable.php b/editable.php
new file mode 100644
index 0000000..245f688
--- /dev/null
+++ b/editable.php
@@ -0,0 +1,34 @@
+<?php
+ require_once('internal/utils.php');
+
+ $site_conf = sanitize_ini("site_conf.ini", SANITIZE_SITE_CONF);
+ if ( ! is_array($site_conf) ) die("Error parsing site_conf.ini");
+
+ // Never put \. in this regex !
+ $page=sanitize($_GET, 'page', '/[^a-z0-9\/]+/', $site_conf['default_page']);
+ if ( ! is_dir($page) die("Error : page does not exists ($page)");
+
+ $page_props = sanitize_ini("$page/props.ini", SANITIZE_PAGE_PROPS);
+ if ( ! is_array($page_props) ) die("Error parsing page properties ($page/props.ini)");
+
+ $tpl_relpath = "templates/" . $page_props['template'] . '/';
+?>
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title><?=$page_props['title']?></title>
+<link rel="stylesheet" href="<?=$tpl_relpath?>screen.css" />
+</head>
+
+<body>
+<?php
+ set_include_path( $tpl_relpath . PATH_SEPARATOR . $page );
+ include('layout-' . $page_props['layout'] . '.php');
+ restore_include_path();
+
+ include('internal/editor-bind-code.html');
+?>
+</body>
+</html>
+
diff --git a/internal/editor-bind-code.html b/internal/editor-bind-code.html
new file mode 100644
index 0000000..915d55c
--- /dev/null
+++ b/internal/editor-bind-code.html
@@ -0,0 +1,71 @@
+<!-- Editor deffered loading -->
+<link href="http://cdn.aloha-editor.org/latest/css/aloha.css" type="text/css" rel="stylesheet" />
+<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/vendor/jquery-1.7.1.js"></script>
+<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/require.js"></script>
+<script>
+ var Aloha = window.Aloha || ( window.Aloha = {} );
+
+ Aloha.settings = {
+ locale: 'fr',
+ plugins: {
+ format: {
+ config : [ 'b', 'i','sub','sup'],
+ editables : {
+ // no formatting allowed for title
+ '#title' : [ ],
+ // formatting for all editable DIVs
+ 'div' : [ 'b', 'i', 'del', 'sub', 'sup' ],
+ // content is a DIV and has class .article so it gets both buttons
+ '.article' : [ 'b', 'i', 'p', 'title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'removeFormat']
+ }
+ },
+ list: {
+ // all elements with no specific configuration get an UL, just for fun :)
+ config : [ 'ul' ],
+ editables : {
+ // Even if this is configured it is not set because OL and UL are not allowed in H1.
+ '#title' : [ 'ol' ],
+ // all divs get OL
+ 'div' : [ 'ol' ],
+ // content is a DIV. It would get only OL but with class .article it also gets UL.
+ '.article' : [ 'ul' ]
+ }
+ },
+ link: {
+ config : [ 'a' ],
+ editables : {
+ // No links in the title.
+ '#title' : [ ]
+ }
+ }
+ },
+ sidebar: {
+ disabled: false
+ }
+ };
+</script>
+
+<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/aloha.js"
+ data-aloha-plugins="common/ui,
+ common/format,
+ common/table,
+ common/list,
+ common/link,
+ common/highlighteditables,
+ common/block,
+ common/undo,
+ common/image,
+ common/contenthandler,
+ common/paste,
+ common/commands,
+ common/abbr"></script>
+
+<script type="text/javascript">
+Aloha.ready(function() {
+ // mark the editable parts
+ $('#title').aloha();
+ $('#teaser').aloha();
+ $('#content').aloha();
+});
+
+</script>
diff --git a/internal/utils.php b/internal/utils.php
new file mode 100644
index 0000000..c9f8320
--- /dev/null
+++ b/internal/utils.php
@@ -0,0 +1,39 @@
+<?php
+ function sanitize($arg_array, $arg_key, $replace_chars_re, $default_value) {
+ if ( ! array_key_exists($arg_key, $arg_array) ) return $default_value;
+ return preg_replace($replace_chars_re, '_', $arg_array[$arg_key]);
+ }
+
+ function sanitize_ini($ini_path, $array_entry_props) {
+ $arr = parse_ini_file("$ini_path");
+ if ( is_array($arr) ) {
+ foreach ( $arr as $k => $v ) {
+ if ( array_key_exists($k, $array_entry_props)
+ && array_key_exists('replace_chars_re', $array_entry_props[$k])
+ &&| array_key_exists('default_value', $array_entry_props[$k])
+ ) {
+ $arr[$k] = sanitize($arr, $k,
+ $array_entry_props[$k]['replace_chars_re'],
+ $array_entry_props[$k]['default_value'] );
+ } else {
+ unset($arr[$k]);
+ }
+ }
+ }
+ return $arr;
+ }
+
+ define('SANITIZE_SITE_CONF', array(
+ 'default_page' => array( 'replace_chars_re' => '/[^a-z0-9\/]+/', 'default_value' => 'en/index' ),
+ )
+ );
+
+ define('SANITIZE_PAGE_PROPS', array(
+ 'title' => array( 'replace_chars_re' => '/[^.]+/', 'default_value' => '(missing title in props.ini)' ),
+ 'template' => array( 'replace_chars_re' => '/[^a-z0-9]+/', 'default_value' => 'default' ),
+ 'layout' => array( 'replace_chars_re' => '/[^a-z0-9]+/', 'default_value' => 'article' ),
+ )
+ );
+
+?>
+
diff --git a/site_conf.ini b/site_conf.ini
new file mode 100644
index 0000000..6a2203c
--- /dev/null
+++ b/site_conf.ini
@@ -0,0 +1 @@
+default_page = fr/accueil
diff --git a/templates/default/images/background.png b/templates/default/images/background.png
new file mode 100644
index 0000000..64ece57
--- /dev/null
+++ b/templates/default/images/background.png
Binary files differ
diff --git a/templates/default/images/external-link-ltr-icon.png b/templates/default/images/external-link-ltr-icon.png
new file mode 100644
index 0000000..4b710b0
--- /dev/null
+++ b/templates/default/images/external-link-ltr-icon.png
Binary files differ
diff --git a/templates/default/layout-article.php b/templates/default/layout-article.php
new file mode 100644
index 0000000..522bb86
--- /dev/null
+++ b/templates/default/layout-article.php
@@ -0,0 +1,17 @@
+<div id="main">
+<div id="tree-div"></div>
+<h1 id="title"><?=$page_props['title']?></h1>
+<div id="bodyContent">
+
+<div id="teaser" class="shorttext">
+<?php include("div-teaser.html"); ?>
+</div>
+
+<div id="content" class="article">
+<?php include("div-article.html"); ?>
+</div>
+
+</div>
+</div>
+</div>
+
diff --git a/templates/default/screen.css b/templates/default/screen.css
new file mode 100644
index 0000000..cec5b0a
--- /dev/null
+++ b/templates/default/screen.css
@@ -0,0 +1,79 @@
+body {
+ font-family: sans-serif;
+}
+
+body {
+ background-image: url("images/background.png");
+}
+
+#bodyContent {
+ font-size:0.8em;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-family: sans-serif;
+ color: #1c94c4;
+ border-bottom:1px solid #AAAAAA;
+ padding-bottom:0.17em;
+ padding-top:0.5em;
+}
+
+h1 { font-size: 188%; }
+h2 { font-size: 150%; }
+h3 { font-size: 132%; }
+h4 { font-size: 116%; }
+h5 { font-size: 100%; }
+h6 { font-size: 80%; }
+
+#main {
+ width: 50%;
+ position: absolute;
+ top: 10%;
+ left: 25%;
+ padding: 30px;
+ background-color: white;
+ border-radius: 10px;
+ color: #444444;
+ -moz-border-radius: 10px;
+ box-shadow: 5px 5px rgba(0,0,0,0.3);
+ -webkit-box-shadow: 5px 5px rgba(0,0,0,0.3);
+ -moz-box-shadow: 5px 5px rgba(0,0,0,0.3);
+}
+
+a.aloha {
+ background: url(images/external-link-ltr-icon.png) no-repeat 100% 50%;
+ padding: 0px 13px 0px 0px;
+}
+
+/* Abbreviation styling */
+abbr, acronym
+{
+ border-bottom: .1em dotted;
+ cursor: help;
+}
+
+/* A basic table styling */
+table
+{
+ padding: 0;
+ margin: 0;
+ border-collapse: collapse;
+ border: 1px solid #333;
+ color: #000;
+}
+
+table caption
+{
+ caption-side: bottom;
+ font-size: 0.8em;
+ font-style: italic;
+ text-align: right;
+ padding: 0.5em 0;
+}
+
+table th, table td
+{
+ border: 1px solid #666;
+ padding: 0.5em;
+ text-align: left;
+} \ No newline at end of file