Skip to content

Commit

Permalink
Item13662: always init new cells with spaces.
Browse files Browse the repository at this point in the history
Item13711: move row edit to end column to avoid confusing TablePlugin

Item13714: fix row offsets

Item13715: Item13717: don't reprocess lines that contain macros

Item13720: fix column offset
  • Loading branch information
Crawford Currie committed Sep 28, 2015
1 parent f6384ff commit aeb5dd1
Show file tree
Hide file tree
Showing 14 changed files with 1,073 additions and 712 deletions.
32 changes: 16 additions & 16 deletions EditRowPlugin/data/System/EditRowPlugin.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1441729129" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1443432065" format="1.1" version="1"}%
---+!! !EditRowPlugin
<!--
One line description, required for extensions repository catalog.
Expand Down Expand Up @@ -79,7 +79,7 @@ Parameters:
then the <button type="button" class="erp-edittable"></button> (edit table) button will be replaced with a
<button type="button" class="erp-addrow""></button> (add row) button. Defaults to the value of the
[[%SYSTEMWEB%.Macros][preference]] =EDITROWPLUGIN_DISABLE=, or =none= if it isn't set.
* ==buttons== - set to =left= (the default) or =right= to position edit controls in the first or last columns in the table. =buttons="right"= may be required if you are using other plugins that expect a certain column order.
* ==buttons== - set to =left= or =right= (the default) to position edit controls in the first or last columns in the table. =buttons="right"= may be required if you are using other plugins that expect a certain column order, such as %SYSTEMWEB%.TablePlugin.
* ==quietsave== - Quiet Save button is shown if ="on"=. Defaults to the
value of the [[%SYSTEMWEB%.Macros][preference]] =QUIETSAVE=, or =off= if it
isn't set.
Expand Down Expand Up @@ -316,17 +316,17 @@ Another great Foswiki extension from the <a style="text-decoration:none" href="h
%META:FIELD{name="License" title="License" value="[[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]]"}%
%META:FIELD{name="Home" title="Home" value="http://foswiki.org/Extensions/EditRowPlugin"}%
%META:FIELD{name="Support" title="Support" value="http://foswiki.org/Support/EditRowPlugin"}%
%META:FILEATTACHMENT{name="icons.png" attr="h" comment="" date="1441729129" size="2457" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="example3.png" attr="h" comment="" date="1441729129" size="15337" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="example4.png" attr="h" comment="" date="1441729129" size="22834" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="erp.css" attr="h" comment="" date="1441729129" size="1454" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="screenshot2.png" attr="h" comment="" date="1441729129" size="12013" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="TableSort.uncompressed.js" attr="h" comment="" date="1441729129" size="6803" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="erp.js" attr="h" comment="" date="1441729129" size="11898" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="erp.uncompressed.css" attr="h" comment="" date="1441729129" size="2130" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="example5.png" attr="h" comment="" date="1441729129" size="9132" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="erp.uncompressed.js" attr="h" comment="" date="1441729129" size="26625" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="screenshot1.png" attr="h" comment="" date="1441729129" size="19461" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="TableSort.js" attr="h" comment="" date="1441729129" size="3626" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" date="1441729129" size="1343" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="clock.gif" attr="h" comment="" date="1441729129" size="1418" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="icons.png" attr="h" comment="" date="1443432065" size="2457" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="example3.png" attr="h" comment="" date="1443432065" size="15337" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="example4.png" attr="h" comment="" date="1443432065" size="22834" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="erp.css" attr="h" comment="" date="1443432065" size="1454" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="screenshot2.png" attr="h" comment="" date="1443432065" size="12013" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="TableSort.uncompressed.js" attr="h" comment="" date="1443432065" size="6803" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="erp.js" attr="h" comment="" date="1443432065" size="11898" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="erp.uncompressed.css" attr="h" comment="" date="1443432065" size="2130" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="example5.png" attr="h" comment="" date="1443432065" size="9132" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="erp.uncompressed.js" attr="h" comment="" date="1443432065" size="26625" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="screenshot1.png" attr="h" comment="" date="1443432065" size="19461" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="TableSort.js" attr="h" comment="" date="1443432065" size="3626" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" date="1443432065" size="1343" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="clock.gif" attr="h" comment="" date="1443432065" size="1418" user="ProjectContributor" version="1"}%
5 changes: 2 additions & 3 deletions EditRowPlugin/lib/Foswiki/Plugins/EditRowPlugin/Table.pm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ sub new {
}
$attrs->{js} ||= 'preferred';

$attrs->{buttons} ||= "left";
$attrs->{buttons} ||= "right";

$this->{attrs} = $attrs;

Expand Down Expand Up @@ -675,8 +675,7 @@ sub deleteRowCmd {
my $row =
$urps->{erp_row} >= 0
? $urps->{erp_row}
: $this->totalRows() + $urps->{erp_row};

: $this->totalRows() + $urps->{erp_row} - 1;
return unless $this->deleteRow($row);

return if $urps->{erp_row} < 0; # full table edit?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ sub parse {
my @result;
foreach my $t ( @{ $this->{result} } ) {
if ( UNIVERSAL::isa( $t, 'Foswiki::Tables::Table' ) ) {

$t->{meta} = $meta;
if ( defined( $t->{attrs}->{header} ) ) {

Expand Down
10 changes: 10 additions & 0 deletions EditRowPlugin/lib/Foswiki/Plugins/EditRowPlugin/View.pm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ sub process {
$table = $_;
$table->{editable} = 0 if $editIsDisabled;
$table->{attrs}->{js} = 'ignored' if $jsIsDisabled;

# spit out macros eaten by early_line, but not processed by
# this plugin, so other plugins can detect and process
# them (e.g. %TABLE)
foreach my $spec ( @{ $table->{specs} } ) {
next
if $spec->{tag} eq $Foswiki::cfg{Plugins}{EditRowPlugin}{Macro};
$line .= $spec->{raw};
}

if ( $table->{editable}
&& $active_topic eq $urps->{erp_topic}
&& $table->getID() eq $urps->{erp_table} )
Expand Down
Loading

0 comments on commit aeb5dd1

Please sign in to comment.