Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated for docpad v2.0.1

  • Loading branch information...
commit fa0495450a4c50b71e0c2977fd273720421b191e 1 parent d6026d6
Benjamin Lupton balupton authored
61 out/_docpad/plugins/admin/scripts/script.js
View
@@ -0,0 +1,61 @@
+(function() {
+ $(function() {
+ var $, editMode;
+ editMode = false;
+ if (window.jQuery == null) {
+ if (console.log != null) {
+ console.log('DocPad Administratio plugin requires jQuery...');
+ }
+ return;
+ }
+ $ = window.jQuery;
+ $('[contenteditable]').live('focus', function() {
+ var $this;
+ $this = $(this);
+ $this.data('before', $this.html());
+ return $this;
+ }).live('blur paste', function() {
+ var $this, before;
+ $this = $(this);
+ before = $this.data('before');
+ if ($this.data('before') !== $this.html()) {
+ $this.data('before', $this.html());
+ $this.trigger('change');
+ }
+ return $this;
+ });
+ $(document).bind('keypress', function(event) {
+ if (event.which === 180 && event.shiftKey && (event.ctrlKey || event.altKey)) {
+ editMode = !editMode;
+ if (console.log != null) {
+ console.log('DocPad edit mode ' + (editMode ? 'enabled' : 'disabled'));
+ }
+ }
+ return $('[property]').attr('contenteditable', editMode);
+ });
+ return $('[property]').live('change', function() {
+ var $article, $field, data, key, url, value;
+ $field = $(this);
+ $article = $field.parents('[typeof="sioc:Post"]:first');
+ if (!$article.length) {
+ return;
+ }
+ url = $article.attr('about');
+ key = $field.attr('property');
+ value = $field.html();
+ data = {};
+ data[key] = value;
+ return $.ajax({
+ url: url,
+ type: 'POST',
+ data: data,
+ success: function(data, textStatus, jqXHR) {
+ return console.log('success:', arguments);
+ },
+ error: function(jqXHR, textStatus, errorThrown) {
+ return console.log('error:', arguments);
+ }
+ });
+ });
+ });
+}).call(this);
2  out/atom.xml
View
@@ -3,7 +3,7 @@
<title>Benjamin Lupton</title>
<link href="http://balupton.com/atom.xml" rel="self"/>
<link href="http://balupton.com"/>
- <updated>2011-11-08T09:59:00Z</updated>
+ <updated>2011-11-08T10:19:34Z</updated>
<id>http://balupton.com</id>
<author>
<name>Benjamin Lupton</name>
2  out/index.html
View
@@ -28,7 +28,7 @@
<body>
<!-- Scripts -->
<script src="/vendor/jquery-1.6.4.min.js"></script>
-
+ <script src="/_docpad/plugins/admin/scripts/script.js"></script>
<script src="/scripts/script.js"></script>
<!-- Markup -->
46 out/markups/ccss-to-css.css
View
@@ -1,19 +1,27 @@
-form input {
- padding: 5px;
- border: 1px solid;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
-}
-#id .className img {
- opacity: 0.5;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
- -webkit-box-shadow: 5px;
- -moz-box-shadow: 5px;
- box-shadow: 5px;
-}
-#id .className img:hover {
- opacity: 1;
-}
+borderRadius = (str) ->
+ WebkitBorderRadius: str
+ MozBorderRadius: str
+ borderRadius: str
+
+boxShadow = (str) ->
+ WebkitBoxShadow: str
+ MozBoxShadow: str
+ boxShadow: str
+
+module.exports =
+ form:
+ input:
+ padding: '5px'
+ border: '1px solid'
+ mixin: borderRadius '5px'
+ '#id .className': do ->
+ opaque = 1
+ translucent = opaque / 2
+ img:
+ mixin: [
+ borderRadius '5px'
+ boxShadow '5px'
+ ]
+ opacity: translucent
+ 'img:hover':
+ opacity: opaque
2  out/nifty/client-side-editing.html
View
@@ -28,7 +28,7 @@
<body>
<!-- Scripts -->
<script src="/vendor/jquery-1.6.4.min.js"></script>
-
+ <script src="/_docpad/plugins/admin/scripts/script.js"></script>
<script src="/scripts/script.js"></script>
<!-- Markup -->
2  out/nifty/coffee-parser.html
View
@@ -28,7 +28,7 @@
<body>
<!-- Scripts -->
<script src="/vendor/jquery-1.6.4.min.js"></script>
-
+ <script src="/_docpad/plugins/admin/scripts/script.js"></script>
<script src="/scripts/script.js"></script>
<!-- Markup -->
6 out/pages/getting-started.html
View
@@ -28,7 +28,7 @@
<body>
<!-- Scripts -->
<script src="/vendor/jquery-1.6.4.min.js"></script>
-
+ <script src="/_docpad/plugins/admin/scripts/script.js"></script>
<script src="/scripts/script.js"></script>
<!-- Markup -->
@@ -161,8 +161,6 @@
<ul>
-
-
<li typeof="sioc:Page" about="/nifty/client-side-editing.html" class="">
<a href="/nifty/client-side-editing.html" property="dc:title">Client-Side Editing</a>
</li>
@@ -179,6 +177,8 @@
+
+
<li typeof="sioc:Page" about="/nifty/coffee-parser.html" class="">
<a href="/nifty/coffee-parser.html" property="dc:title">Coffee Parser Example</a>
</li>
Please sign in to comment.
Something went wrong with that request. Please try again.