Permalink
Browse files

Added spindle layer

Renamed paste.layer to paste.main for consistency
Refactored initialization to use spindle as base dojo provider
Fixed all links
Created spindle build profile
  • Loading branch information...
1 parent ed2d5c0 commit 3668b83d2000d9d73167ef2f68fd6393d8a11440 @weierophinney committed Dec 3, 2008
View
6 application/layouts/scripts/_layout.phtml
@@ -1,6 +0,0 @@
-<? $this->borderContainer()->captureStart('layout', array('design' => 'headline')) ?>
-<?= $this->render('_headline.phtml') ?>
-<?= $this->render('_mainPane.phtml') ?>
-<?= $this->render('_navPane.phtml') ?>
-<?= $this->render('_footer.phtml') ?>
-<?= $this->borderContainer()->captureEnd('layout') ?>
View
9 application/layouts/scripts/layout.phtml
@@ -1,5 +1,4 @@
<?
-$content = $this->render('_layout.phtml');
if (Zend_Controller_Front::getInstance()->getRequest()->getParam('nojs', false)) {
$this->dojo()->disable();
$content = preg_replace('#href="([^"]*)"#s', 'href="$1?nojs=true"', $content);
@@ -16,6 +15,10 @@ if (Zend_Controller_Front::getInstance()->getRequest()->getParam('nojs', false))
<?= $this->headScript() ?>
</head>
<body class="tundra">
- <?= $content ?>
-</body>
+ <? $this->borderContainer()->captureStart('layout', array('design' => 'headline')) ?>
+ <?= $this->render('_headline.phtml') ?>
+ <?= $this->render('_mainPane.phtml') ?>
+ <?= $this->render('_navPane.phtml') ?>
+ <?= $this->render('_footer.phtml') ?>
+ <?= $this->borderContainer()->captureEnd('layout') ?></body>
</html>
View
4 application/modules/spindle/controllers/PasteController.php
@@ -36,7 +36,9 @@ public function preDispatch()
$this->view->headTitle()->prepend('Pastebin');
$this->view->dojo()->setDjConfigOption('preventBackButtonFix', false)
- ->addLayer('/js/paste/layer.js');
+ ->registerModulePath('../paste', 'paste')
+ ->addStylesheetModule('paste.styles')
+ ->requireModule('paste.main');
}
/**
View
6 application/modules/spindle/views/scripts/paste/_nav.phtml
@@ -1,7 +1,7 @@
<ul id="paste-nav">
<? if (!isset($this->message)): ?>
- <li><a href="<?= $this->baseUrl() . '/paste/followup/id/' . $this->id ?>">Followup</a></li>
+ <li><a href="<?= $this->baseUrl() . '/spindle/paste/followup/id/' . $this->id ?>">Followup</a></li>
<? endif ?>
- <li><a href="<?= $this->baseUrl() . '/paste/new' ?>">New Paste</a></li>
- <li><a href="<?= $this->baseUrl() . '/paste' ?>">About</a></li>
+ <li><a href="<?= $this->baseUrl() . '/spindle/paste/new' ?>">New Paste</a></li>
+ <li><a href="<?= $this->baseUrl() . '/spindle/paste' ?>">About</a></li>
</ul>
View
2 application/modules/spindle/views/scripts/paste/content/about.phtml
@@ -22,6 +22,6 @@
</p>
<p class="new-paste">
- <a href="<?= $this->baseUrl() ?>/paste/new">Create a new paste.</a>
+ <a href="<?= $this->baseUrl() ?>/spindle/paste/new">Create a new paste.</a>
</p>
View
6 application/modules/spindle/views/scripts/paste/content/display.phtml
@@ -8,7 +8,7 @@
<? if ('text' != $paste['type']): ?>
(<a id="format-toggle" href="#" onClick="paste.unformattedShow();">unformatted</a>)
<? endif ?>
- <span class="permalink">[<a href="<?= $this->baseUrl() ?>/paste/display/id/<?= $paste['id'] ?>">Permalink</a>]</span>
+ <span class="permalink">[<a href="<?= $this->baseUrl() ?>/spindle/paste/display/id/<?= $paste['id'] ?>">Permalink</a>]</span>
</h3>
<div id="pastecode" class="highlight">
<pre><code class="<?= $paste['type'] ?>"><?= $this->escape($paste['code']) ?></code></pre>
@@ -24,14 +24,14 @@
</p>
<? if (!empty($paste['parent'])): ?>
<p class="parent">
- <a href="<?= $this->baseUrl() ?>/paste/display/id/<?= $paste['parent'] ?>">Parent paste (<?= $paste['parent'] ?>)</a>
+ <a href="<?= $this->baseUrl() ?>/spindle/paste/display/id/<?= $paste['parent'] ?>">Parent paste (<?= $paste['parent'] ?>)</a>
</p>
<? endif ?>
<? if (!empty($paste['children'])): ?>
<p class="children">Child pastes:</p>
<ul class="children">
<? foreach ($paste['children'] as $child): ?>
- <li><a href="<?= $this->baseUrl() ?>/paste/display/id/<?= $child ?>"><?= $child ?></a></li>
+ <li><a href="<?= $this->baseUrl() ?>/spindle/paste/display/id/<?= $child ?>"><?= $child ?></a></li>
<? endforeach ?>
</ul>
<? endif ?>
View
2 application/modules/spindle/views/scripts/paste/content/followup.phtml
@@ -16,7 +16,7 @@ $followup = array_intersect_key($paste, $followupKeys);
$followup['parent'] = $this->id;
$form = $this->model->getForm();
-$form->setAction($this->baseUrl() . '/paste/save-followup/id/' . $this->id)
+$form->setAction($this->baseUrl() . '/spindle/paste/save-followup/id/' . $this->id)
->setMethod('post')
->setName('followupform')
->setElementsBelongTo('followupform')
View
2 application/modules/spindle/views/scripts/paste/content/new-paste.phtml
@@ -1,5 +1,5 @@
<?
$form = $this->model->getForm();
-$form->setAction($this->baseUrl() . '/paste/save')
+$form->setAction($this->baseUrl() . '/spindle/paste/save')
->setMethod('post');
echo $form;
View
5 library/My/Plugin/Initialize.php
@@ -169,8 +169,9 @@ public function initView($doLayout = true)
$view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8');
$view->dojo()->setDjConfigOption('isDebug', $this->config->view->dojo->isDebug)
->setLocalPath('/js/dojo/dojo.js')
- ->registerModulePath('../paste', 'paste')
- ->addStylesheetModule('paste.styles')
+ ->registerModulePath('../spindle', 'spindle')
+ ->addStylesheetModule('spindle.themes.spindle')
+ ->requireModule('spindle.main')
->disable();
Zend_Registry::set('view', $view);
View
16 misc/README.txt
@@ -1,11 +1,11 @@
Miscellaneous support files
-- paste.profile.js
- This is a build profile for the pastebin application.
+- spindle.profile.js
+ This is a build profile for the spindle application.
- To create a custom build, first copy the public/js-src/paste directory to your
- Dojo source build. Then, place the paste.profile.js file in the
- util/buildscripts/profiles/ directory of your Dojo source distribution. From
- the util/buildscripts directory, execute the line provided in the header of
- the profile to create a custom build. You can then use this custom build in
- place of the shipped JS source.
+ To create a custom build, first copy the public/js-src/spindle and
+ public/js-src/paste directories to your Dojo source build. Then, place the
+ spindle.profile.js file in the util/buildscripts/profiles/ directory of your
+ Dojo source distribution. From the util/buildscripts directory, execute the
+ line provided in the header of the profile to create a custom build. You can
+ then use this custom build in place of the shipped JS source.
View
24 misc/paste.profile.js
@@ -1,24 +0,0 @@
-/* ./build.sh profile="paste" */
-dependencies = {
- action: "release",
- version: "1.2.1-paste",
- releaseName: "paste",
- loader: "default",
- cssOptimize: "comments.keepLines",
- optimize: "shrinksafe",
- layerOptimize: "shrinksafe",
- copyTests: false,
- layers: [
- {
- name: "../paste/layer.js",
- dependencies: [
- "paste.layer",
- ]
- },
- ],
- prefixes: [
- [ "dijit", "../dijit" ],
- [ "dojox", "../dojox" ],
- [ "paste", "../paste" ],
- ]
-}
View
33 misc/spindle.profile.js
@@ -0,0 +1,33 @@
+/* ./build.sh profile="spindle" */
+dependencies = {
+ action: "release",
+ version: "1.3.0-spindle",
+ releaseName: "spindle",
+ loader: "default",
+ cssOptimize: "comments.keepLines",
+ optimize: "shrinksafe",
+ layerOptimize: "shrinksafe",
+ copyTests: false,
+ layers: [
+ {
+ name: "../spindle/main.js",
+ layerDependencies: [],
+ dependencies: [
+ "spindle.main",
+ ]
+ },
+ {
+ name: "../paste/main.js",
+ layerDependencies: ["../spindle/main.js"],
+ dependencies: [
+ "paste.main",
+ ]
+ },
+ ],
+ prefixes: [
+ [ "dijit", "../dijit" ],
+ [ "dojox", "../dojox" ],
+ [ "spindle", "../spindle" ],
+ [ "paste", "../paste" ],
+ ]
+}
View
2 public/js-src/paste/TabHandler.js
@@ -1,6 +1,6 @@
dojo.provide("paste.TabHandler");
-dojo.require("paste.layer");
+dojo.require("paste.main");
dojo.require("dijit.layout.ContentPane");
dojo.declare("paste.TabHandler", null, {
View
7 public/js-src/paste/layer.js → public/js-src/paste/main.js
@@ -1,6 +1,8 @@
-dojo.provide("paste.layer");
+dojo.provide("paste.main");
(function() {
+ dojo.require("spindle.main");
+
dojo.require("paste._base");
dojo.require("paste.highlight.php");
dojo.require("paste.TabHandler");
@@ -10,11 +12,8 @@ dojo.provide("paste.layer");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.SimpleTextarea");
dojo.require("dijit.form.ValidationTextBox");
- dojo.require("dijit.layout.BorderContainer");
- dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");
dojo.require("dojo.back");
- dojo.require("dojo.parser");
dojo.require("dojox.data.QueryReadStore");
dojo.require("dojox.dtl.Context");
dojo.require("dojox.grid.DataGrid");
View
64 public/js-src/paste/styles/styles.css
@@ -1,25 +1,8 @@
-@import "../../dijit/themes/tundra/tundra.css";
@import "../../dojox/grid/resources/Grid.css";
@import "../../dojox/grid/resources/tundraGrid.css";
@import "highlight/highlight.css";
@import "highlight/autumn.css";
-body, html {
- width: 100%;
- height: 100%;
- margin: 0;
- padding: 0;
-}
-
-#layout {
- width: 100%;
- height: 100%;
-}
-
-#navPane {
- width: 200px;
-}
-
#pasteform .paste-tab, #pastebin {
margin-left: 1em;
margin-top: 1em;
@@ -72,44 +55,6 @@ form textarea.summaryTextarea {
width: 80%;
}
-#headline {
- height: 2.5em;
- background-color: #CCCCCC;
-}
-
-#headline h1 {
- font-height: 1.2em;
- margin: 0;
- padding: 0 0 0 0.5em;
-}
-
-#headline a {
- text-decoration: none;
- color: black;
-}
-
-#headline a:hover {
- text-decoration: underline;
-}
-
-#navPane {
- width: 225px;
- margin-left: 1em;
- margin-top: 1em;
- padding-left: 1em;
-}
-
-#footer {
- visibility: collapse;
- height: 1.5em;
- background-color: #CCCCCC;
-}
-
-#footer p {
- margin: 0;
- padding: 0 0 0 0.5em;
-}
-
div#pastecode {
padding: 1em;
border: 1px solid black;
@@ -118,12 +63,3 @@ div#pastecode {
background-color: #FFFFF1;
}
-dl.error {
- background-color: #FFA4A4;
- border: 1px solid #FF0000;
- padding: 0.5em;
-}
-
-dl.error dt {
- font-weight: bold;
-}
View
7 public/js-src/spindle/main.js
@@ -0,0 +1,7 @@
+dojo.provide("spindle.main");
+
+(function() {
+ dojo.require("dijit.layout.BorderContainer");
+ dojo.require("dijit.layout.ContentPane");
+ dojo.require("dojo.parser");
+})();
View
65 public/js-src/spindle/themes/spindle/spindle.css
@@ -0,0 +1,65 @@
+@import "../../../dijit/themes/tundra/tundra.css";
+
+body, html {
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+}
+
+#layout {
+ width: 100%;
+ height: 100%;
+}
+
+#navPane {
+ width: 200px;
+}
+
+#headline {
+ height: 2.5em;
+ background-color: #CCCCCC;
+}
+
+#headline h1 {
+ font-height: 1.2em;
+ margin: 0;
+ padding: 0 0 0 0.5em;
+}
+
+#headline a {
+ text-decoration: none;
+ color: black;
+}
+
+#headline a:hover {
+ text-decoration: underline;
+}
+
+#navPane {
+ width: 225px;
+ margin-left: 1em;
+ margin-top: 1em;
+ padding-left: 1em;
+}
+
+#footer {
+ visibility: collapse;
+ height: 1.5em;
+ background-color: #CCCCCC;
+}
+
+#footer p {
+ margin: 0;
+ padding: 0 0 0 0.5em;
+}
+
+dl.error {
+ background-color: #FFA4A4;
+ border: 1px solid #FF0000;
+ padding: 0.5em;
+}
+
+dl.error dt {
+ font-weight: bold;
+}

0 comments on commit 3668b83

Please sign in to comment.