Skip to content

Commit

Permalink
Item165:
Browse files Browse the repository at this point in the history
   * added automaxexpand for TABPANES
   * added jquery.shake plugin
   * reworked BUTTON tag



git-svn-id: http://svn.foswiki.org/trunk@596 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Nov 13, 2008
1 parent f98d7f5 commit 0c4f98e
Show file tree
Hide file tree
Showing 44 changed files with 230 additions and 121 deletions.
26 changes: 14 additions & 12 deletions JQueryPlugin/data/Sandbox/JQueryPluginExamples.txt
@@ -1,18 +1,18 @@
%META:TOPICINFO{author="ProjectContributor" date="1224177924" format="1.1" reprev="1.4" version="$Rev$"}%
%META:TOPICINFO{author="ProjectContributor" date="1226589672" format="1.1" reprev="1.5" version="$Rev$"}%
---+!! %TOPIC%

Demo of the <nop>TWikiWidgets implemented by the %SYSTEMWEB%.JQueryPlugin

%TOC%

---++ Buttons
%BUTTON{bg="bluish" text="bluish"}%
%BUTTON{bg="pinkish" text="pinkish"}%
%BUTTON{bg="greenish" text="greenish"}%
%BUTTON{style="background-color:orange;color:white;" text="orange"}%
%BUTTON{"%MAKETEXT{"OK"}%" icon="tick" onclick="alert($(this).text());"}%
%BUTTON{"%MAKETEXT{"Cancel"}%" icon="cross"}%
%BUTTON{"%MAKETEXT{"Info"}%" icon="information"}%
%BUTTON{"%MAKETEXT{"Add"}%" icon="add"}%
%BUTTON{"%MAKETEXT{"Delete"}%" icon="delete"}%
%CLEAR%


---++ Toggles
%TOGGLE{target="#lorem_area" text="$percntX$percnt Slide" effect="slide"}%

Expand Down Expand Up @@ -308,13 +308,15 @@ $(".pics").cycle({fx:'scrollLeft'});
</script>

---++ Code highlightning
%JQSCRIPT{"jquery.chili"}%
<verbatim class="html">
<script type="text/javascript" src="SOMEWHERE_ELSE/jquery.js"></script>
<script type="text/javaScript" src="SOMEWHERE/jquery.chili-2.2.js"></script>
<script type="text/javascript">
ChiliBook.recipeFolder = "SOMEWHERE/";
</script>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<font size="24px">Hello World</font>
</body>
</html>
</verbatim>

%META:FILEATTACHMENT{name="beach1.jpg" attachment="beach1.jpg" attr="" comment="" date="1224090781" path="beach1.jpg" size="20327" stream="IO::File=GLOB(0x8e9d47c)" tmpFilename="/var/tmp/CGItemp27605" user="ProjectContributor" version="1"}%
Expand Down
19 changes: 10 additions & 9 deletions JQueryPlugin/data/TWiki/JQueryPlugin.txt
@@ -1,7 +1,7 @@
%META:TOPICINFO{author="ProjectContributor" date="1224177960" format="1.1" reprev="1.1" version="$Rev$"}%
---+!! %TOPIC%
<!--
* Set SHORTDESCRIPTION = jQuery <nop>JavaScript library for TWiki
* Set SHORTDESCRIPTION = jQuery <nop>JavaScript library for <nop>NextWiki
-->
%SHORTDESCRIPTION%

Expand All @@ -25,7 +25,7 @@ HTML documents, handle events, perform animations, and add Ajax interactions to
your web pages."
</blockquote>

See the Sandbox.JQueryPluginExamples page for a demo of a couple of widgets used by TWiki.
See the Sandbox.JQueryPluginExamples page for a demo of a couple of widgets used by <nop>NextWiki.

---++ Included libraries
1 [[http://docs.jquery.com][jquery]]: the core
Expand All @@ -50,6 +50,7 @@ See the Sandbox.JQueryPluginExamples page for a demo of a couple of widgets used
1 [[http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/][jquery.tooltip]]: create customizable tooltips
1 [[http://bassistance.de/jquery-plugins/jquery-plugin-treeview/][jquery.treeview]] create a leightweight and unobtrusive expanding and collapsing treeview control
1 [[http://bassistance.de/jquery-plugins/jquery-plugin-validation/][jquery.validate]]: client-side form validation
1 [[http://zeroedandnoughted.wordpress.com/2008/05/01/jquery-plugin-to-emulate-shake-on-login-failure-in-osx-login-box/][jquery.shake]]: osx login box animation
1 ui.accordion
1 ui.datepicker
1 ui.dialog
Expand Down Expand Up @@ -78,13 +79,11 @@ See the Sandbox.JQueryPluginExamples page for a demo of a couple of widgets used


---++ Themes

The following themes are provided:
* =flora= theme
* =ogray= theme (outdated)

---++ Examples

* Sandbox.PluginTestJQueryPlugin.txt
* Sandbox.JQueryPluginExamples.txt

Expand All @@ -95,11 +94,14 @@ The following themes are provided:
%$MANIFEST%

---++ Plugin Info
| Plugin Author(s): | TWiki:Main/MichaelDaum |
| Plugin Author(s): | Michael Daum |
| Copyright: | 2007-2008 Michael Daum http://michaeldaumconsulting.com |
| License: | GPL |
| Plugin Version: | v0.92 |
| Plugin Version: | v1.00 |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 13 Nov 2008: | added automaxexpand for TABPANES ;\
added jquery.shake plugin; \
reworked BUTTON tag |
| 15 Oct 2008: | added jquery.autocomplete, jquery.cycle |
| 20 Jul 2008: | added jquery.form, jquery.maskedinput, jquery.validate |
| 15 Jul 2008: | updated to ui-1.5.2; added async treeview; added async options to tabpane |
Expand All @@ -115,9 +117,8 @@ The following themes are provided:
| 10 Oct 2007: | upgraded to jQuery-1.1.4; compressed js and css |
| 12 Jul 2007: | initial package containing jQuery-1.1.3.1 |
| Dependencies: | %$DEPENDENCIES% |
| Plugin Home: | http://twiki.org/cgi-bin/view/Plugins/JQueryPlugin |
| Feedback: | http://twiki.org/cgi-bin/view/Plugins/JQueryPluginDev |
| Appraisal: | http://twiki.org/cgi-bin/view/Plugins/JQueryPluginAppraisal |
| Plugin Home: | http://nextwiki.org/Extensions/%TOPIC% |
| Feedback: | http://nextwiki.org/Extensions/%TOPIC%Dev |


<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add
Expand Down
8 changes: 3 additions & 5 deletions JQueryPlugin/lib/TWiki/Plugins/JQueryPlugin.pm
@@ -1,5 +1,3 @@
# Plugin for TWiki Enterprise Collaboration Platform, http://TWiki.org/
#
# Copyright (c) 2007-2008 Michael Daum, http://michaeldaumconsulting.com
#
# and TWiki Contributors. All Rights Reserved. TWiki Contributors
Expand Down Expand Up @@ -28,8 +26,8 @@ use vars qw(
);

$VERSION = '$Rev$';
$RELEASE = '0.92';
$SHORTDESCRIPTION = 'jQuery <nop>JavaScript library for TWiki';
$RELEASE = '1.00';
$SHORTDESCRIPTION = 'jQuery <nop>JavaScript library for NextWiki';
$NO_PREFS_IN_TOPIC = 1;

$header = <<'HERE';
Expand Down Expand Up @@ -131,7 +129,7 @@ sub handleEndTabPane {

###############################################################################
sub handleClear {
return '<br clear="all" />';
return "<span class='twikiClear'></span>";
}

###############################################################################
Expand Down
73 changes: 69 additions & 4 deletions JQueryPlugin/lib/TWiki/Plugins/JQueryPlugin/Core.pm
@@ -1,6 +1,4 @@
# Plugin for TWiki Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 2006-2007 Michael Daum http://wikiring.de
# Copyright (C) 2006-2008 Michael Daum, http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -32,15 +30,18 @@ sub handleTabPane {

my $tpId = 'jqTabPane'.($tabPaneCounter++);
my $select = $params->{select} || '';
my $autoMaxExpand = $params->{automaxexpand} || 'off';

$select =~ s/[^\d]//go;
$select ||= 1;

$autoMaxExpand = ($autoMaxExpand eq 'on')?'true':'false';


TWiki::Func::addToHEAD($tpId, <<"EOS");
<script type="text/javascript">
jQuery(function(\$) {
\$("#$tpId").tabpane({select:$select});
\$("#$tpId").tabpane({select:$select, autoMaxExpand:$autoMaxExpand});
});
</script>
EOS
Expand Down Expand Up @@ -120,6 +121,70 @@ sub handleToggle {
sub handleButton {
my ($session, $params, $theTopic, $theWeb) = @_;

my $theText = $params->{_DEFAULT} || $params->{text} || 'Button';
my $theHref = $params->{href} || 'javascript:void(0);';
my $theOnClick = $params->{onclick};
my $theOnMouseOver = $params->{onmouseover};
my $theOnMouseOut = $params->{onmouseout};
my $theOnFocus = $params->{onfocus};
my $theTitle = $params->{title};
my $theIconName = $params->{icon} || '';
my $theAccessKey = $params->{accesskey};
my $theId = $params->{id};
my $theBg = $params->{bg} || '';
my $theClass = $params->{class} || '';
my $theTarget = $params->{target};

my $theIcon;
$theIcon = getIconUrlPath($theWeb, $theTopic, $theIconName) if $theIconName;
if ($theIcon) {
$theText =
"<span class='jqButtonIcon' style='background-image:url($theIcon)'>$theText</span>";
}
$theText = "<span> $theText </span>";

if ($theTarget) {
my $url;

if ($theTarget =~ /$TWiki::regex{webNameRegex}\.$TWiki::regex{wikiWordRegex}/) {
my ($web, $topic) = TWiki::Func::normalizeWebTopicName($theWeb, $theTarget);
$url = TWiki::Func::getViewUrl($web, $topic);
} else {
$url = $theTarget;
}
$theOnClick .= ";window.location.href='$url';";
}

my $result = "<a class='jqButton $theBg $theClass' href='$theHref'";
$result .= " accesskey='$theAccessKey' " if defined $theAccessKey;
$result .= " id='$theId' " if defined $theId;
$result .= " title='$theTitle' " if defined $theTitle;
$result .= " onclick=\"$theOnClick\" " if defined $theOnClick;
$result .= " onmouseover=\"$theOnMouseOver\" " if defined $theOnMouseOver;
$result .= " onmouseout=\"$theOnMouseOut\" " if defined $theOnMouseOut;
$result .= " onfocus=\"$theOnFocus\" " if defined $theOnFocus;

$result .= ">$theText</a>";

return $result;
}

###############################################################################
sub getIconUrlPath {
my ($web, $topic, $iconName) = @_;

return '' unless $iconName;

my $iconWeb = TWiki::Func::getTwikiWebname();
$iconName =~ s/^.*\.(.*?)$/$1/;

return TWiki::Func::getPubUrlPath().'/'.$iconWeb.'/JQueryPlugin/'.$iconName.'.png';
}

###############################################################################
sub handleButtonOLD {
my ($session, $params, $theTopic, $theWeb) = @_;

my $theText = $params->{_DEFAULT} || $params->{text} || 'Button';
my $theBackground = $params->{bg} || '';
my $theForeground = $params->{fg} || '';
Expand Down
23 changes: 22 additions & 1 deletion JQueryPlugin/lib/TWiki/Plugins/JQueryPlugin/MANIFEST
Expand Up @@ -8,7 +8,18 @@ lib/TWiki/Plugins/JQueryPlugin.pm 0644
pub/Sandbox/JQueryPluginExamples/beach1.jpg 0644
pub/Sandbox/JQueryPluginExamples/beach2.jpg 0644
pub/Sandbox/JQueryPluginExamples/beach3.jpg 0644
pub/TWiki/JQueryPlugin/button1.png 0644
pub/TWiki/JQueryPlugin/accept.png 0644
pub/TWiki/JQueryPlugin/add.png 0644
pub/TWiki/JQueryPlugin/application_form_add.png 0644
pub/TWiki/JQueryPlugin/application_form.png 0644
pub/TWiki/JQueryPlugin/btn_cyan_left.gif 0644
pub/TWiki/JQueryPlugin/btn_cyan_right.gif 0644
pub/TWiki/JQueryPlugin/btn_green_left.gif 0644
pub/TWiki/JQueryPlugin/btn_green_right.gif 0644
pub/TWiki/JQueryPlugin/btn_left.gif 0644
pub/TWiki/JQueryPlugin/btn_red_left.gif 0644
pub/TWiki/JQueryPlugin/btn_red_right.gif 0644
pub/TWiki/JQueryPlugin/btn_right.gif 0644
pub/TWiki/JQueryPlugin/chili/cplusplus.js 0644
pub/TWiki/JQueryPlugin/chili/csharp.js 0644
pub/TWiki/JQueryPlugin/chili/css.js 0644
Expand All @@ -22,7 +33,10 @@ pub/TWiki/JQueryPlugin/chili/php-f.js 0644
pub/TWiki/JQueryPlugin/chili/php.js 0644
pub/TWiki/JQueryPlugin/chili/recipes.js 0644
pub/TWiki/JQueryPlugin/chili/tml.js 0644
pub/TWiki/JQueryPlugin/cross.png 0644
pub/TWiki/JQueryPlugin/delete.gif 0644
pub/TWiki/JQueryPlugin/delete.png 0644
pub/TWiki/JQueryPlugin/disk.png 0644
pub/TWiki/JQueryPlugin/effects.blind.js 0644
pub/TWiki/JQueryPlugin/effects.blind.js.gz 0644
pub/TWiki/JQueryPlugin/effects.blind.uncompressed.js 0644
Expand Down Expand Up @@ -62,6 +76,7 @@ pub/TWiki/JQueryPlugin/effects.slide.uncompressed.js 0644
pub/TWiki/JQueryPlugin/effects.transfer.js 0644
pub/TWiki/JQueryPlugin/effects.transfer.js.gz 0644
pub/TWiki/JQueryPlugin/effects.transfer.uncompressed.js 0644
pub/TWiki/JQueryPlugin/eye.png 0644
pub/TWiki/JQueryPlugin/i18n/ui.datepicker-am.js 0644
pub/TWiki/JQueryPlugin/i18n/ui.datepicker-ar.js 0644
pub/TWiki/JQueryPlugin/i18n/ui.datepicker-bg.js 0644
Expand Down Expand Up @@ -115,6 +130,7 @@ pub/TWiki/JQueryPlugin/images/treeview-gray.gif 0644
pub/TWiki/JQueryPlugin/images/treeview-gray-line.gif 0644
pub/TWiki/JQueryPlugin/images/treeview-red.gif 0644
pub/TWiki/JQueryPlugin/images/treeview-red-line.gif 0644
pub/TWiki/JQueryPlugin/information.png 0644
pub/TWiki/JQueryPlugin/jquery-all.css 0644
pub/TWiki/JQueryPlugin/jquery-all.css.gz 0644
pub/TWiki/JQueryPlugin/jquery-all.js 0644
Expand Down Expand Up @@ -165,6 +181,8 @@ pub/TWiki/JQueryPlugin/jquery.rating.js 0644
pub/TWiki/JQueryPlugin/jquery.rating.js.gz 0644
pub/TWiki/JQueryPlugin/jquery.rating.uncompressed.css 0644
pub/TWiki/JQueryPlugin/jquery.rating.uncompressed.js 0644
pub/TWiki/JQueryPlugin/jquery.shake.js.gz 0644
pub/TWiki/JQueryPlugin/jquery.shake.uncompressed.js 0644
pub/TWiki/JQueryPlugin/jquery.shrinkurls.js 0644
pub/TWiki/JQueryPlugin/jquery.shrinkurls.uncompressed.js 0644
pub/TWiki/JQueryPlugin/jquery.spinner.js 0644
Expand Down Expand Up @@ -312,6 +330,9 @@ pub/TWiki/JQueryPlugin/themes/ogray/ogray.tabs.css 0644
pub/TWiki/JQueryPlugin/themes/ogray/ogray.toasterLite.css 0644
pub/TWiki/JQueryPlugin/themes/ogray/ogray.toolbar.css 0644
pub/TWiki/JQueryPlugin/themes/ui.datepicker.css 0644
pub/TWiki/JQueryPlugin/tick.png 0644
pub/TWiki/JQueryPlugin/tooltip-bubble.png 0644
pub/TWiki/JQueryPlugin/tooltip-bubble-reverse.png 0644
pub/TWiki/JQueryPlugin/ui.accordion.js 0644
pub/TWiki/JQueryPlugin/ui.accordion.js.gz 0644
pub/TWiki/JQueryPlugin/ui.accordion.uncompressed.js 0644
Expand Down
14 changes: 0 additions & 14 deletions JQueryPlugin/lib/TWiki/Plugins/JQueryPlugin/build.pl
Expand Up @@ -7,20 +7,6 @@ BEGIN
# Create the build object
$build = new TWiki::Contrib::Build('JQueryPlugin');

# (Optional) Set the details of the repository for uploads.
# This can be any web on any accessible TWiki installation.
# These defaults will be used when expanding tokens in .txt
# files, but be warned, they can be overridden at upload time!

# name of web to upload to
$build->{UPLOADTARGETWEB} = 'Plugins';
# Full URL of pub directory
$build->{UPLOADTARGETPUB} = 'http://twiki.org/p/pub';
# Full URL of bin directory
$build->{UPLOADTARGETSCRIPT} = 'http://twiki.org/cgi-bin';
# Script extension
$build->{UPLOADTARGETSUFFIX} = '';

# Build the target on the command line, or the default target
$build->build($build->{target});

1 change: 1 addition & 0 deletions JQueryPlugin/pub/TWiki/JQueryPlugin/Makefile
Expand Up @@ -23,6 +23,7 @@ TARGET= \
jquery.maskedinput.js.gz \
jquery.rating.css.gz \
jquery.rating.js.gz \
jquery.shake.js.gz \
jquery.spinner.js.gz \
jquery.superfish.css.gz \
jquery.superfish.js.gz \
Expand Down
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/accept.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/btn_left.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/btn_red_left.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/btn_right.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed JQueryPlugin/pub/TWiki/JQueryPlugin/button1.png
Binary file not shown.
2 changes: 1 addition & 1 deletion JQueryPlugin/pub/TWiki/JQueryPlugin/chili/html.js
Expand Up @@ -61,7 +61,7 @@ WEBSITE: http://noteslog.com/chili/
// like "</div>"
, tag_end: {
_match: /<\/\w+\s*>|\/>/
, _style: "color: navy;"
, _style: "color: navy; font-weight: bold;"
}
, entity: {
_match: /&\w+?;/
Expand Down
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/cross.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/delete.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/disk.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/eye.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JQueryPlugin/pub/TWiki/JQueryPlugin/information.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions JQueryPlugin/pub/TWiki/JQueryPlugin/jquery-all.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified JQueryPlugin/pub/TWiki/JQueryPlugin/jquery-all.css.gz
Binary file not shown.

0 comments on commit 0c4f98e

Please sign in to comment.