Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit dc1968a1e9966efbfa72561485f80fb9a8795bf3 @byrnereese byrnereese committed Mar 26, 2010
@@ -0,0 +1,17 @@
+# version control
+\bCVS
+(^|/)\.
+
+# CPAN chain files
+^MANIFEST
+^Makefile
+^META.yml$
+^blib/
+\#$
+~$
+.bak$
+
+# packages
+\.zip$
+\.tar\.gz$
+
@@ -0,0 +1,7 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ NAME => 'Theme Exporter',
+ VERSION => '0.1',
+ DISTNAME => 'ThemeExport',
+);
@@ -0,0 +1,124 @@
+This plugin provides the ability to export a blog's templates as a theme.
+Users can export a blog's templates in one of two ways:
+
+* via the command line using the export-ts tool
+* via the administrative interface
+
+It should also be mentioned that this plugin also provides a simple API
+for managing and configuring your own theme export if you so wish. Consult
+the POD documentation for MT::Theme::Exporter, found in this plugin's
+lib directory.
+
+# Prerequisites
+
+* Movable Type 4.x
+* The perl module Archive::Zip installed
+
+# Installation
+
+To install this plugin follow the instructions found here:
+
+[http://tinyurl.com/easy-plugin-install](The Ultimate Guide to Installing Movable Type Plugins)
+
+# Usage
+
+## Web Interface
+
+From the Design menu select "Templates." In the sidebar under "Page Actions"
+you will see a link called "Export Theme." Click this to spawn a dialog and
+export a blog's templates as a theme. Then fill in the details in the dialog
+that appears and when you are finished, click the Download link.
+
+## `export-ts` Command Line Tool
+
+A tool to export a blog's templates as a template set.
+
+Basic Usage:
+
+ cd /PATH/TO/MT/
+ perl ./tools/export-ts --blog=1 --id="MyTemplateSet"
+
+### Options
+
+The following options are available:
+
+#### blog
+
+(required) The Blog ID(s) to export templates from. When more than one blog ID
+is specified in a comma delimited list, the tool will output a theme for each
+blog.
+
+#### id
+
+The ID to be used for the creation of the resulting plugin. This is also used to determine the output directory for related files.
+
+#### name
+
+The name to be used for the creation of the resulting plugin. This is also used to determine the output directory for related files.
+
+#### version
+
+The version string to be used for the creation of the resulting plugin.
+
+#### static
+
+The path to the directory containing your mt-static files for this template set. It must be a relative path from your mt-static folder.
+
+#### key
+
+The MT::PluginData key of the resulting template set.
+
+#### verbose
+
+Show verbose messages.
+
+#### dryrun
+
+When set to true, the tool will not actually do anything. Rather it will output logging
+messages indicating what it would have done.
+
+#### zip
+
+When set to true, the tool will create a zip file of the resulting theme for you
+automatically.
+
+### Example
+
+From the command line, one would type:
+
+ cd /PATH/TO/MT/
+ chmod a+x tools/export-ts
+ perl ./tools/export-ts --blog=1 --id=MySet --name="My Template Set" \
+ --version=3 --out="template-sets"
+
+This would result in the following directories being created:
+
+ /PATH/TO/MT/template-sets/
+ MySet-3.0/
+ plugins/
+ MySet/
+ config.yaml
+ templates/*
+ mt-static/
+ plugins/
+ MySet/*
+
+You should then be able to zip up the MySet directory or simply install as you
+would install any other plugin.
+
+Once installed you can use the "refresh blog templates" action in the sidebar of
+the the Manage Templates screen (Design > Templates). Once templates are
+refreshed, rebuild the blog.
+
+# About Endevver
+
+Endevver LLC is the premiere consulting company for Movable Type. To see a full
+list of our services and plugins please visit [http://endevver.com][our web site].
+
+# License
+
+This plugin is licensed under the same terms as Perl itself.
+
+# Support
+
+For help with this plugin please visit http://endevver.tenderapp.com
@@ -0,0 +1,78 @@
+.page {
+ display: none;
+}
+.page.first {
+ display: block;
+}
+
+#steps {
+ margin-bottom: 10px;
+}
+#steps li {
+ float: left;
+ background: none;
+ color: black;
+ margin-right: 20px;
+ padding: 5px 12px 5px 7px;
+}
+#steps li.active {
+ background-color: #336699;
+ color: white;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+}
+#steps li span {
+ color: white;
+ background-color: #336699;
+ padding: 1px 5px;
+ margin-right: 5px;
+ border-radius: 7px;
+ -moz-border-radius: 7px;
+ -webkit-border-radius: 7px;
+}
+#steps li.active span {
+ background-color: white;
+ color: #336699;
+ padding: 0px 4px;
+}
+#steps li,
+#steps li span,
+#steps li label { cursor: pointer; }
+
+#export-pane {
+ display: none;
+ float: none;
+}
+#export-pane .progress {
+ float: none;
+ position: relative;
+}
+#export-pane .progress p.working {
+ background-repeat: no-repeat;
+ background-position: 0 0;
+ background-image: url(../../images/indicator.white.gif);
+ padding-top: 2px;
+ padding-left: 20px;
+ height: 16px;
+}
+#export-pane .progress a {
+ font-size: 1.3em;
+ padding-top: 8px;
+ background-repeat: no-repeat;
+ background-position: 0 0;
+ background-image: url(download.gif);
+ padding-left: 38px;
+ height: 33px;
+ display: block;
+}
+#export-pane #export-log {
+ background: white;
+ border: 1px solid black;
+ color: #222;
+ font-family: monospace;
+ width: 588px;
+ height: 310px;
+ padding: 5px 10px;
+ overflow: auto;
+}
@@ -0,0 +1,49 @@
+var page = 1;
+var response_pos = 0;
+function setPage(p) {
+ page = p;
+ $('#steps li').removeClass('active');
+ $('.page').hide();
+ $('#page-' + p).show();
+ var step = $('#steps li.page-' + p);
+ step.addClass('active');
+}
+function interactive_export( c ) {
+ var responseText;
+ try {
+ responseText = c.responseText;
+ } catch ( e ) {
+ return;
+ }
+ if (!responseText) return;
+ var text = responseText.substr(response_pos);
+ text = text.replace(/\s*JSON:(.|\n)*/, '');
+ // strip any partial lines. we'll grab 'em next time
+ if (!text.match(/\n$/))
+ text = text.replace(/(\r?\n)[^\r\n]*$/, '$1');
+ response_pos += text.length;
+ if (!text.length) return;
+
+ text = text.replace(/\r?\n$/, '');
+
+ var lines = text.split(/\r?\n/);
+ var last_line;
+ for (var i = 0; i < lines.length; i++) {
+ var line = lines[i];
+ var h = $('#export-log ul').append('<li>' + line + '</li>').height();
+ $('#export-log').scrollTo( 'max' , { 'axis' : 'y' });
+ }
+ if (last_line) {
+ alert("Last line: " + last_line);
+ //current_task.innerHTML = last_line;
+ }
+
+}
+$(document).ready( function() {
+ $('#steps li').click( function() {
+ var p = $(this).attr('pageid');
+ if (p != page) {
+ setPage(p);
+ }
+ });
+});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,11 @@
+/**
+ * jQuery.ScrollTo - Easy element scrolling using jQuery.
+ * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
+ * Dual licensed under MIT and GPL.
+ * Date: 5/25/2009
+ * @author Ariel Flesler
+ * @version 1.4.2
+ *
+ * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
+ */
+;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
@@ -0,0 +1,22 @@
+id: ThemeExport
+name: 'Theme Exporter'
+description: "A plugin that provides a simple user interface for exporting a blog's templates into an easily distributable theme."
+version: 0.1
+
+applications:
+ cms:
+ methods:
+ theme_export_start: $ThemeExport::ThemeExport::Plugin::export_start
+ theme_export: $ThemeExport::ThemeExport::Plugin::export
+
+page_actions:
+ list_templates:
+ export:
+ label: Export Theme
+ order: 101
+ dialog: 'theme_export_start'
+ theme_dashboard:
+ export:
+ label: Export Theme
+ order: 101
+ dialog: 'theme_export_start'
Oops, something went wrong.

0 comments on commit dc1968a

Please sign in to comment.