r51162 - in /branches/upstream/libjifty-plugin-wikitoolbar-perl/current: ./ lib/Jifty/Plugin/ lib/Jifty/Plugin/WikiToolbar/ share/web/static/js/ t/Testapp/ t/Testapp/bin/ t/Testapp/etc/ t/Testapp/lib/ t/Testapp/lib/Testapp/ t/Testapp/lib/Testapp/Model/ t/Testapp/t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sun Jan 17 20:34:04 UTC 2010


Author: jawnsy-guest
Date: Sun Jan 17 20:33:56 2010
New Revision: 51162

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=51162
Log:
[svn-upgrade] Integrating new upstream version, libjifty-plugin-wikitoolbar-perl (1.00)

Added:
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/README
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/Makefile.PL
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/bin/
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/bin/jifty   (with props)
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/etc/
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/etc/config.yml
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/Model/
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/Model/Texts.pm
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/View.pm
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/t/
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/t/00-toolbar.t
Modified:
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Changes
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/MANIFEST
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/META.yml
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Makefile.PL
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar.pm
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar/Textarea.pm
    branches/upstream/libjifty-plugin-wikitoolbar-perl/current/share/web/static/js/wikitoolbar.js

Modified: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Changes?rev=51162&op=diff
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Changes (original)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Changes Sun Jan 17 20:33:56 2010
@@ -1,4 +1,9 @@
 Revision history for Perl module Jifty::Plugin::WikiToolbar
+
+1.00 Sun, 17 Jan 2010 12:08:52 +0100
+    - add WikiToolbar type, this is shorter than render_as
+    - use JQuery instead of Behaviour in js
+    - fix multi toolbar on one page
 
 0.9  Tue, 05 May 2009 16:36:50 +0200
     - allow to override rows and cols size

Modified: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/MANIFEST?rev=51162&op=diff
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/MANIFEST (original)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/MANIFEST Sun Jan 17 20:33:56 2010
@@ -15,8 +15,9 @@
 lib/Jifty/Plugin/WikiToolbar/Textarea.pm
 LICENSE
 Makefile.PL
-MANIFEST			This list of files
+MANIFEST
 META.yml
+README
 share/web/static/img/wt/bold.png
 share/web/static/img/wt/box.png
 share/web/static/img/wt/center.png
@@ -40,3 +41,9 @@
 t/001_load.t
 t/pod.t
 t/pod_coverage.t
+t/Testapp/bin/jifty
+t/Testapp/etc/config.yml
+t/Testapp/lib/Testapp/Model/Texts.pm
+t/Testapp/lib/Testapp/View.pm
+t/Testapp/Makefile.PL
+t/Testapp/t/00-toolbar.t

Modified: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/META.yml?rev=51162&op=diff
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/META.yml (original)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/META.yml Sun Jan 17 20:33:56 2010
@@ -19,7 +19,8 @@
     - inc
     - t
 requires:
-  Jifty: 0.70416
+  Jifty: 0.91117
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.9
+  repository: git at github.com:yvesago/jifty-plugin-wikitoolbar.git
+version: 1.00

Modified: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Makefile.PL?rev=51162&op=diff
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Makefile.PL (original)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/Makefile.PL Sun Jan 17 20:33:56 2010
@@ -4,11 +4,13 @@
 all_from       'lib/Jifty/Plugin/WikiToolbar.pm';
 
 build_requires 'Test::More';
-requires('Jifty' => '0.70416');
+requires('Jifty' => '0.91117');
+
+resources repository => 'git at github.com:yvesago/jifty-plugin-wikitoolbar.git';
 
 install_share;
 
-tests('t/*.t');
+tests('t/*.t t/*/t/*.t');
 auto_install;
 WriteAll;
 

Added: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/README?rev=51162&op=file
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/README (added)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/README Sun Jan 17 20:33:56 2010
@@ -1,0 +1,42 @@
+NAME
+    Jifty::Plugin::WikiToolbar - Jifty plugin to add a wiki toolbar to your
+    textarea box
+
+SYNOPSIS
+    In etc/config.yml
+
+       Plugins:
+         - WikiToolbar: {}
+
+    In your Model instead of
+
+       render_as 'textarea';
+
+    use
+
+       is WikiToolbar;
+
+    or you can custom rows size with
+
+     sub Jifty::Plugin::WikiToolbar::Textarea::rows { return 15; };
+
+    To custom the toolbar, copy wikitoolbar.js in your application, at the
+    end of the file put your changes with addButton function.
+
+DESCRIPTION
+    Add a toolbar to your textarea field. Default toolbar provide markdown
+    markup syntax. http://daringfireball.net/projects/markdown/
+
+METHOD
+  init
+    load wikitoolbar.js on startup
+
+AUTHOR
+    Yves Agostini, <yvesago at cpan.org>
+
+LICENSE
+    Copyright 2007-2010, Yves Agostini
+
+    This program is free software and may be modified and distributed under
+    the same terms as Perl itself.
+

Modified: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar.pm?rev=51162&op=diff
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar.pm (original)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar.pm Sun Jan 17 20:33:56 2010
@@ -4,7 +4,7 @@
 package Jifty::Plugin::WikiToolbar;
 use base qw/Jifty::Plugin/;
 
-our $VERSION = '0.9';
+our $VERSION = '1.00';
 
 =head1 NAME
 
@@ -23,11 +23,11 @@
 
 use
 
-  render_as 'Jifty::Plugin::WikiToolbar::Textarea';
+   is WikiToolbar;
 
 or you can custom rows size with
 
- sub Jifty::Plugin::WikiToolbar::Textarea::rows { return 5; };
+ sub Jifty::Plugin::WikiToolbar::Textarea::rows { return 15; };
 
 To custom the toolbar, copy wikitoolbar.js in your application, at the end of the file put your changes with addButton function.
 
@@ -49,7 +49,21 @@
     @{ Jifty->web->javascript_libs },
     "wikitoolbar.js",
     ]);
-}
+};
+
+use Jifty::DBI::Schema;
+
+sub _toolbar {
+        my ($column, $from) = @_;
+        my $name = $column->name;
+        $column->type('text');
+};
+
+Jifty::DBI::Schema->register_types(
+    WikiToolbar =>
+       sub { _init_handler is \&_toolbar, render_as 'Jifty::Plugin::WikiToolbar::Textarea' },
+);
+
 
 =head1 AUTHOR
 
@@ -57,7 +71,7 @@
 
 =head1 LICENSE
 
-Copyright 2007-2009 Yves Agostini. All Rights Reserved.
+Copyright 2007-2010, Yves Agostini
 
 This program is free software and may be modified and distributed under the same terms as Perl itself.
 

Modified: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar/Textarea.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar/Textarea.pm?rev=51162&op=diff
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar/Textarea.pm (original)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/lib/Jifty/Plugin/WikiToolbar/Textarea.pm Sun Jan 17 20:33:56 2010
@@ -1,3 +1,6 @@
+use strict;
+use warnings;
+
 package Jifty::Plugin::WikiToolbar::Textarea;
 use base qw(Jifty::Web::Form::Field::Textarea);
 
@@ -24,16 +27,26 @@
 sub render_widget {
     my $self  = shift;
     my $field;
-    $field .= qq!<div id='toolbar'></div>!;
+    my $element_id = "@{[ $self->element_id ]}";
+        $element_id=~s/://g;
+
     $field .= qq!<textarea!;
     $field .= qq! name="@{[ $self->input_name ]}"!;
-    $field .= qq! id="@{[ $self->element_id ]}"!;
+    $field .= qq! id="$element_id"!;
     $field .= qq! rows="@{[$self->rows || 5 ]}"!;
     $field .= qq! cols="@{[$self->cols || 60]}"!;
     $field .= $self->_widget_class;
     $field .= qq! >!;
     $field .= Jifty->web->escape($self->current_value) if $self->current_value;
-	$field .= qq!</textarea>\n!;
+    $field .= qq!</textarea>\n!;
+    $field .= <<"EOF";
+<script language="javascript">
+    jQuery(document).ready(function() {
+      jQuery('#$element_id').each(function() { addWikiFormattingToolbar(this) });
+    });
+</script>
+EOF
+
     Jifty->web->out($field);
     '';
 }

Modified: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/share/web/static/js/wikitoolbar.js
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/share/web/static/js/wikitoolbar.js?rev=51162&op=diff
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/share/web/static/js/wikitoolbar.js (original)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/share/web/static/js/wikitoolbar.js Sun Jan 17 20:33:56 2010
@@ -1,137 +1,104 @@
-// Wikipedia JavaScript toolbar functions
+(function($){
 
-mwEditButtons = [];
-
-// this function generates the actual toolbar buttons with localized text
-// we use it to avoid creating the toolbar where javascript is not enabled
-function addButton(imageFile, speedTip, tagOpen, tagClose, sampleText) {
-	mwEditButtons[mwEditButtons.length] =
-		{"imageFile": imageFile,
-		 "speedTip": speedTip,
-		 "tagOpen": tagOpen,
-		 "tagClose": tagClose,
-		 "sampleText": sampleText};
-}
-
-// this function generates the actual toolbar buttons with localized text
-// we use it to avoid creating the toolbar where javascript is not enabled
-function mwInsertEditButton(parent, item) {
-    if (typeof item.imageFile == 'undefined') {
-        return;}
-	var image = document.createElement("img");
-	image.width = 16;
-	image.height = 16;
-	image.src = item.imageFile;
-	image.border = 0;
-	image.alt = item.speedTip;
-	image.title = item.speedTip;
-	image.style.cursor = "pointer";
-	image.onclick = function() {
-		insertTags(item.tagOpen, item.tagClose, item.sampleText);
-		return false;
-	}
-	parent.appendChild(image);
-}
-
-// apply tagOpen/tagClose to selection in textarea,
-// use sampleText instead of selection if there is none
-// copied and adapted from phpBB
-function insertTags(tagOpen, tagClose, sampleText) {
-
-   // var txtarea = document.getElementsByTagName('TEXTAREA')[0];
-    // TODO: need a better way to manage multi textarea
-    var txtarea;
-    var txtareas = document.getElementsByTagName('TEXTAREA');
-    for (i = 0; i < txtareas.length; i++) {
-        var textbox = txtareas[i];
-        if( textbox.selectionStart ) {
-            txtarea = textbox;
-        };
+  window.addWikiFormattingToolbar = function(textarea) {
+    if ((document.selection == undefined)
+     && (textarea.setSelectionRange == undefined)) {
+      return;
     }
 
-    if (typeof txtarea == 'undefined') {
-        txtarea = document.getElementsByTagName('TEXTAREA')[0];
+    var toolbar = document.createElement("div");
+    toolbar.className = "wikitoolbar";
+
+    function addButton(src, title, fn) {
+      var image = document.createElement("img");
+      image.width = 16;
+      image.height = 16;
+      image.src = src;
+      image.border = 0;
+      image.alt = title;
+      image.title = title;
+      image.style.cursor = "pointer";
+      image.onclick = function() { try { fn() } catch (e) { } return false };
+      toolbar.appendChild(image);
     }
 
-	// IE
-	if (document.selection && !is_gecko) {
-		var theSelection = document.selection.createRange().text;
-		if (!theSelection)
-			theSelection=sampleText;
-		txtarea.focus();
-		if (theSelection.charAt(theSelection.length - 1) == " ") { // exclude ending space char, if any
-			theSelection = theSelection.substring(0, theSelection.length - 1);
-			document.selection.createRange().text = tagOpen + theSelection + tagClose + " ";
-		} else {
-			document.selection.createRange().text = tagOpen + theSelection + tagClose;
-		}
+    function encloseSelection(prefix, suffix) {
+      textarea.focus();
+      var start, end, sel, scrollPos, subst;
+      if (document.selection != undefined) {
+        sel = document.selection.createRange().text;
+      } else if (textarea.setSelectionRange != undefined) {
+        start = textarea.selectionStart;
+        end = textarea.selectionEnd;
+        scrollPos = textarea.scrollTop;
+        sel = textarea.value.substring(start, end);
+      }
+      if (sel.match(/ $/)) { // exclude ending space char, if any
+        sel = sel.substring(0, sel.length - 1);
+        suffix = suffix + " ";
+      }
+      subst = prefix + sel + suffix;
+      if (document.selection != undefined) {
+        var range = document.selection.createRange().text = subst;
+        textarea.caretPos -= suffix.length;
+      } else if (textarea.setSelectionRange != undefined) {
+        textarea.value = textarea.value.substring(0, start) + subst +
+                         textarea.value.substring(end);
+        if (sel) {
+          textarea.setSelectionRange(start + subst.length, start + subst.length);
+        } else {
+          textarea.setSelectionRange(start + prefix.length, start + prefix.length);
+        }
+        textarea.scrollTop = scrollPos;
+      }
+    }
 
-	// Mozilla
-	} else if(txtarea.selectionStart || txtarea.selectionStart == '0') {
-		var replaced = false;
-		var startPos = txtarea.selectionStart;
-		var endPos = txtarea.selectionEnd;
-		if (endPos-startPos)
-			replaced = true;
-		var scrollTop = txtarea.scrollTop;
-		var myText = (txtarea.value).substring(startPos, endPos);
-		if (!myText)
-			myText=sampleText;
-		if (myText.charAt(myText.length - 1) == " ") { // exclude ending space char, if any
-			subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " ";
-		} else {
-			subst = tagOpen + myText + tagClose;
-		}
-		txtarea.value = txtarea.value.substring(0, startPos) + subst +
-			txtarea.value.substring(endPos, txtarea.value.length);
-		txtarea.focus();
-		//set new selection
-		if (replaced) {
-			var cPos = startPos+(tagOpen.length+myText.length+tagClose.length);
-			txtarea.selectionStart = cPos;
-			txtarea.selectionEnd = cPos;
-		} else {
-			txtarea.selectionStart = startPos+tagOpen.length;
-			txtarea.selectionEnd = startPos+tagOpen.length+myText.length;
-		}
-		txtarea.scrollTop = scrollTop;
+// overide this addButtons to design your own toolbar
+    addButton('/static/img/wt/bold.png', "Bold text: \*\*Example\*\*", function() {
+      encloseSelection('\*\*','\*\*');
+    });
+    addButton('/static/img/wt/italic.png', "Italic text: \_Example\_", function() {
+      encloseSelection("\_", "\_");
+    });
+    addButton('/static/img/wt/empty.png', "", function() {
+      encloseSelection("", "");
+    });
+    addButton('/static/img/wt/h1.png', "Title: Example\n=======", function() {
+      encloseSelection("", "\n=======\n", "Title");
+    });
+    addButton('/static/img/wt/h2.png', "Sub title: Example\n-------", function() {
+      encloseSelection("", "\n-------\n", "Sub title");
+    });
+    addButton('/static/img/wt/h3.png', "Sub sub title: ### Example ###", function() {
+      encloseSelection("### ", " ###\n", "Sub sub title");
+    });
+    addButton('/static/img/wt/empty.png', "", function() {
+      encloseSelection("", "");
+    });
+    addButton('/static/img/wt/link.png', "Link: [Some text](http://www.example.com/)", function() {
+      encloseSelection("[", "](http://...)");
+    });
+    addButton('/static/img/wt/linkextern.png', "URL: <http://www.example.com/>", function() {
+      encloseSelection("<", ">");
+    });
+    addButton('/static/img/wt/empty.png', "", function() {
+      encloseSelection("", "");
+    });
+    addButton('/static/img/wt/ul.png', "List: - element 1", function() {
+      encloseSelection("", "\n- element 1\n- element 2\n- element 3\n\n");
+    });
+    addButton('/static/img/wt/ol.png', "Ordered list: 1. element 1", function() {
+      encloseSelection("", "\n1. element 1\n1. element 2\n1. element 3\n\n");
+    });
 
-	// All other browsers get no toolbar.
-	// There was previously support for a crippled "help"
-	// bar, but that caused more problems than it solved.
-	}
-	// reposition cursor if possible
-	if (txtarea.createTextRange)
-		txtarea.caretPos = document.selection.createRange().duplicate();
-}
+    $(textarea).before(toolbar);
+  }
 
+})(jQuery);
 
+// Add the toolbar to all <textarea> elements on the page with the class
+// 'toolbar'.
+/*jQuery(document).ready(function() {
+  jQuery("textarea.toolbar").each(function() { addWikiFormattingToolbar(this) });
+});*/
 
-var myrules = {
-        '#toolbar' : function(e){
-			mwEditButtons = [];
-// CUSTOM your toolbar HERE
-// addButton : image, help text, first tag before selected text, last tag, default text if nothing is selected
-addButton('/static/img/wt/bold.png','Bold text','\*\*','\*\*','Bold text');
-addButton('/static/img/wt/italic.png','Italic text','\_','\_','Italic text');
-  addButton('/static/img/wt/empty.png','','','','');
-addButton('/static/img/wt/h1.png','Title','','\n=======\n','Title');
-addButton('/static/img/wt/h2.png','Sub title','','\n-------\n','Sub title');
-addButton('/static/img/wt/h3.png','Sub sub title','### ',' ###\n','Sub sub title');
-  addButton('/static/img/wt/empty.png','','','','');
-addButton('/static/img/wt/link.png','Link','[','](http://...... )','Text');
-addButton('/static/img/wt/linkextern.png','URL','<','>','http://.....');
-  addButton('/static/img/wt/empty.png','','','','');
-addButton('/static/img/wt/ul.png','List','\n- element 1\n- element 2\n- element 3\n\n ','','');
-addButton('/static/img/wt/ol.png','Ordered list','\n1. element 1\n1. element 2\n1. element 3\n\n ','','');
-// END
-
-	for(i=0;i<mwEditButtons.length;i++) {
-		mwInsertEditButton(e, mwEditButtons[i]);
-	}
-
-        }
-    };
-    
-Behaviour.register(myrules);
-

Added: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/Makefile.PL?rev=51162&op=file
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/Makefile.PL (added)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/Makefile.PL Sun Jan 17 20:33:56 2010
@@ -1,0 +1,7 @@
+use inc::Module::Install;
+
+name        'Testapp';
+version     '0.01';
+requires    'Jifty' => '0.91117';
+
+WriteAll;

Added: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/bin/jifty
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/bin/jifty?rev=51162&op=file
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/bin/jifty (added)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/bin/jifty Sun Jan 17 20:33:56 2010
@@ -1,0 +1,16 @@
+#!/usr/bin/env perl
+use warnings;
+use strict;
+use UNIVERSAL::require;
+
+BEGIN {
+    Jifty::Util->require or die $UNIVERSAL::require::ERROR;
+    my $root = Jifty::Util->app_root(quiet => 1);
+    unshift @INC, "$root/lib" if ($root);
+}
+
+use Jifty;
+use Jifty::Script;
+
+local $SIG{INT} = sub { warn "Stopped\n"; exit; };
+Jifty::Script->dispatch();

Propchange: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/bin/jifty
------------------------------------------------------------------------------
    svn:executable = *

Added: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/etc/config.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/etc/config.yml?rev=51162&op=file
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/etc/config.yml (added)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/etc/config.yml Sun Jan 17 20:33:56 2010
@@ -1,0 +1,53 @@
+--- 
+framework: 
+  AdminMode: 0
+  ApplicationClass: Testapp
+  ApplicationName: Testapp
+  ApplicationUUID: afb0181e-aa5b-443e-9070-9332f0bb1081
+  ConfigFileVersion: 4
+  Database: 
+    AutoUpgrade: 1
+    CheckSchema: 1
+    Database: testapp
+    Driver: SQLite
+    Host: localhost
+    Password: ''
+    RecordBaseClass: Jifty::DBI::Record::Cachable
+    User: ''
+    Version: 0.0.1
+  DevelMode: 0
+  L10N: 
+    PoDir: share/po
+  LogLevel: INFO
+  Mailer: Sendmail
+  MailerArgs: []
+
+  Plugins: 
+    - CompressedCSSandJS: {}
+    - SkeletonApp: {}
+    - WikiToolbar: {}
+
+  PubSub: 
+    Backend: Memcached
+    Enable: ~
+  SkipAccessControl: 0
+  TemplateClass: Testapp::View
+  View: 
+    Handlers: 
+      - Jifty::View::Static::Handler
+      - Jifty::View::Declare::Handler
+      - Jifty::View::Mason::Handler
+  Web: 
+    BaseURL: http://localhost
+    DataDir: var/mason
+    Globals: []
+
+    MasonConfig: 
+      autoflush: 0
+      default_escape_flags: h
+      error_format: text
+      error_mode: fatal
+    Port: 8888
+    ServeStaticFiles: 1
+    StaticRoot: share/web/static
+    TemplateRoot: share/web/templates

Added: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/Model/Texts.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/Model/Texts.pm?rev=51162&op=file
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/Model/Texts.pm (added)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/Model/Texts.pm Sun Jan 17 20:33:56 2010
@@ -1,0 +1,20 @@
+use strict;
+use warnings;
+
+package Testapp::Model::Texts;
+use Jifty::DBI::Schema;
+
+use Testapp::Record schema {
+    column oldrender =>
+        render_as 'Jifty::Plugin::WikiToolbar::Textarea';
+    column newrender =>
+        is WikiToolbar;
+
+};
+
+# Your model-specific methods go here.
+
+sub Jifty::Plugin::WikiToolbar::Textarea::rows { return 15; };
+
+1;
+

Added: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/View.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/View.pm?rev=51162&op=file
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/View.pm (added)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/lib/Testapp/View.pm Sun Jan 17 20:33:56 2010
@@ -1,0 +1,16 @@
+package Testapp::View;
+use strict;
+use warnings;
+use Jifty::View::Declare -base;
+use Jifty::View::Declare::Helpers;
+ 
+ 
+template '/' => page {
+    with ( name => 'test texts' ),
+    form {
+        my $create = new_action( class => 'CreateTexts',
+                                moniker => 'texts' );
+            render_action( $create );
+    };
+};
+ 

Added: branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/t/00-toolbar.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/t/00-toolbar.t?rev=51162&op=file
==============================================================================
--- branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/t/00-toolbar.t (added)
+++ branches/upstream/libjifty-plugin-wikitoolbar-perl/current/t/Testapp/t/00-toolbar.t Sun Jan 17 20:33:56 2010
@@ -1,0 +1,17 @@
+#!/usr/bin/env perl
+use Jifty::Test tests => 7;
+use strict;
+use warnings;
+use Jifty::Test::WWW::Mechanize;
+ 
+ 
+my $server = Jifty::Test->make_server;
+isa_ok( $server, 'Jifty::Server' );
+my $URL = $server->started_ok;
+my $mech = Jifty::Test::WWW::Mechanize->new;
+$mech->get_ok( $URL . '/' , "get mainpage" );
+$mech->content_contains('rows="15"','rows = 15 for wikitoolbar textarea');
+$mech->content_contains("jQuery('#JAF-oldrender-texts-",'oldrender');
+$mech->content_contains("jQuery('#JAF-newrender-texts-",'newrender');
+$mech->get_ok( $URL . '/static/img/wt/bold.png' , "get share element" );
+#print $mech->content;




More information about the Pkg-perl-cvs-commits mailing list