Skip to content

Commit

Permalink
Item10281: refining the modal used for action editing, and poking aro…
Browse files Browse the repository at this point in the history
…und the edges of making the editor safe for parallel edits and merges. Merging actions looks to be the only way to do it, and that's awfully complicated :-(

git-svn-id: http://svn.foswiki.org/trunk/ActionTrackerPlugin@10642 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Jan 31, 2011
1 parent da54291 commit 4015f3c
Show file tree
Hide file tree
Showing 12 changed files with 189 additions and 113 deletions.
48 changes: 23 additions & 25 deletions lib/Foswiki/Plugins/ActionTrackerPlugin.pm
@@ -1,20 +1,4 @@
#
# Copyright (C) 2002 Motorola - All rights reserved
# Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk
#
# Extension that adds tags for action tracking
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
#
# See bottom of file for license and copyright information
package Foswiki::Plugins::ActionTrackerPlugin;

use strict;
Expand Down Expand Up @@ -278,12 +262,10 @@ sub afterEditHandler {

my $pretext = $query->param('pretext') || "";

# Fix from RichardBaar 8/10/03 for Mozilla
my $char = chop($pretext);
$pretext .= $char if ( $char ne "\n" );
$pretext .= "\n";

# end of fix from RichardBaar 8/10/03
my $posttext = $query->param('posttext') || "";

# count the previous actions so we get the right action number
Expand All @@ -294,8 +276,8 @@ sub afterEditHandler {
}

my $action =
Foswiki::Plugins::ActionTrackerPlugin::Action::createFromQuery( $_[2],
$_[1], $an, $query );
Foswiki::Plugins::ActionTrackerPlugin::Action::createFromQuery(
$_[2], $_[1], $an, $query );

$action->populateMissingFields();

Expand All @@ -317,7 +299,7 @@ sub beforeSaveHandler {
return unless lazyInit( $web, $topic );

my $query = Foswiki::Func::getCgiQuery();
return unless ($query); # Fix from GarethEdwards 13 Jun 2003
return unless ($query);

if ( $query->param('closeactioneditor') ) {

Expand Down Expand Up @@ -438,11 +420,11 @@ sub lazyInit {
return 1 if $initialised;

Foswiki::Plugins::JQueryPlugin::registerPlugin(
"ActionTracker",
'ActionTracker',
'Foswiki::Plugins::ActionTrackerPlugin::JQuery');
unless( Foswiki::Plugins::JQueryPlugin::createPlugin(
"ActionTracker", $Foswiki::Plugins::SESSION )) {
die "Fucking POOF";
'ActionTracker', $Foswiki::Plugins::SESSION )) {
die 'Failed to register JQuery plugin';
}

require Foswiki::Attrs;
Expand Down Expand Up @@ -565,3 +547,19 @@ sub _updateSingleAction {
}

1;
__END__
Copyright (C) 2002-2003 Motorola UK Ltd - All rights reserved
Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, published at
http://www.gnu.org/copyleft/gpl.html
33 changes: 17 additions & 16 deletions lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm
Expand Up @@ -886,6 +886,7 @@ sub _formatField_edit {
nowysiwyg => 1, # SMELL: could do better!
t => time()
);
$url =~ s/%2c/,/g;
my $attrs = { href => $url, title => 'Edit', class => "atp_edit ui-icon ui-icon-pencil" };

return CGI::a( $attrs, 'edit' );
Expand Down Expand Up @@ -1059,19 +1060,19 @@ sub formatForEdit {
}

1;
__DATA__
#
# Copyright (C) 2002-2003 Motorola UK Ltd - All rights reserved
# Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
#
__END__
Copyright (C) 2002-2003 Motorola UK Ltd - All rights reserved
Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, published at
http://www.gnu.org/copyleft/gpl.html
32 changes: 16 additions & 16 deletions lib/Foswiki/Plugins/ActionTrackerPlugin/ActionNotify.pm
@@ -1,19 +1,4 @@
#
# Copyright (C) Motorola 2002 - All rights reserved
#
# Extension that adds tags for action tracking
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
#
# See bottom of file for copyright and license information

# This module contains the functionality of the bin/actionnotify script
package Foswiki::Plugins::ActionTrackerPlugin::ActionNotify;
Expand Down Expand Up @@ -512,3 +497,18 @@ sub _findChangesInWebs {
}

1;
__END__
Copyright (C) Motorola 2002 - All rights reserved
Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, published at
http://www.gnu.org/copyleft/gpl.html
29 changes: 15 additions & 14 deletions lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm
@@ -1,17 +1,4 @@
#
# Copyright (C) Motorola 2002 - All rights reserved
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
#
# See bottom of file for license and copyright information

# Perl object that represents a set of actions (possibly interleaved
# with blocks of topic text)
Expand Down Expand Up @@ -409,3 +396,17 @@ sub splitOnAction {
}

1;
__END__
Copyright (C) Motorola 2002 - All rights reserved
Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, published at
http://www.gnu.org/copyleft/gpl.html
30 changes: 16 additions & 14 deletions lib/Foswiki/Plugins/ActionTrackerPlugin/AttrDef.pm
@@ -1,17 +1,5 @@
#
# Copyright (C) Motorola 2002 - All rights reserved
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
#
# See bottom of file for license and copyright information

use strict;
use integer;

Expand Down Expand Up @@ -57,3 +45,17 @@ sub isRedefinable {
}

1;
__END__
Copyright (C) Motorola 2002 - All rights reserved
Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, published at
http://www.gnu.org/copyleft/gpl.html
31 changes: 16 additions & 15 deletions lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm
@@ -1,18 +1,5 @@
#
# Copyright (C) Motorola 2002 - All rights reserved
# Copyright (C) 2004-2009 Crawford Currie http://c-dot.co.uk
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
#
# See bottom of file for license and copyright information

# Object that represents a header and fields format
# This is where all formatting should be done; there should
# be no HTML tags anywhere else in the code!
Expand Down Expand Up @@ -450,3 +437,17 @@ sub formatHidden {
}

1;
__END__
Copyright (C) Motorola 2002 - All rights reserved
Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, published at
http://www.gnu.org/copyleft/gpl.html
47 changes: 47 additions & 0 deletions lib/Foswiki/Plugins/ActionTrackerPlugin/JQuery.pm
@@ -0,0 +1,47 @@
# See bottom of file for license and copyright information

package Foswiki::Plugins::ActionTrackerPlugin::JQuery;
use strict;

use Assert;

use Foswiki::Plugins::JQueryPlugin::Plugin;
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );

sub new {
my $class = shift;
my $session = shift || $Foswiki::Plugins::SESSION;
my $src = (DEBUG) ? '_src' : '';

my $this = $class->SUPER::new(
$session,
name => 'ActionTracker',
version => '1.0',
author => 'Crawford Currie',
homepage => 'http://foswiki.org/Extensions/ActionTrackerPlugin',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/ActionTrackerPlugin',
# CSS is added in ActionTracker.pm
css => [ ],
documentation => "$Foswiki::cfg{SystemWebName}.ActionTrackerPlugin",
javascript => ["atp${src}.js"],
dependencies => ['UI'],
);

return $this;
}

1;
__END__
Copyright (C) 2011 Crawford Currie http://c-dot.co.uk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, published at
http://www.gnu.org/copyleft/gpl.html
1 change: 1 addition & 0 deletions lib/Foswiki/Plugins/ActionTrackerPlugin/MANIFEST
Expand Up @@ -10,6 +10,7 @@ pub/System/ActionTrackerPlugin/wikiringlogo20x20.png 0660
tools/actionnotify 0555 Mailer script
templates/actionnotify.tmpl 0440 Page template for notify message
templates/edit.action.tmpl 0440 Action editor page template
templates/login.action.tmpl 0440 Action login page template
templates/actionform.tmpl 0440 Action editor page subtemplate
lib/Foswiki/Plugins/ActionTrackerPlugin.pm 0440 Plugin Perl module
lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm 0440 Perl support module
Expand Down
22 changes: 11 additions & 11 deletions lib/Foswiki/Plugins/ActionTrackerPlugin/Options.pm
Expand Up @@ -45,18 +45,18 @@ sub load {
}

1;
__DATA__
__END__
Copyright (C) 2007 Crawford Currie http://c-dot.co.uk
Copyright (C) 2007-2011 Crawford Currie http://c-dot.co.uk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, published at
http://www.gnu.org/copyleft/gpl.html
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details, published at
http://www.gnu.org/copyleft/gpl.html

0 comments on commit 4015f3c

Please sign in to comment.