Changeset 12642


Ignore:
Timestamp:
09/28/11 14:08:13 (20 months ago)
Author:
MichaelDaum
Message:

Item9916: compatibility with latest JQueryPlugin

Location:
trunk/TopicInteractionPlugin
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Action/ChangeProperties.pm

    r11309 r12642  
    6363        ); 
    6464      } 
    65       $error = Foswiki::Func::saveAttachment( 
     65      Foswiki::Func::saveAttachment( 
    6666        $web, $topic, $newFileName, { 
    6767          name        => $newFileName, 
     
    7272          createlink  => $fileCreateLink, 
    7373        }); 
    74  
    7574    } 
    7675  } catch Error::Simple with { 
  • trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Action/DownloadAttachment.pm

    r11309 r12642  
    7373  my ($web, $topic, $fileNames) = @_; 
    7474 
     75  $web =~ s/\//\./; # added for subweb support 
    7576  my ($meta, $text) = Foswiki::Func::readTopic( $web, $topic ); 
    7677  my %attachments = map {$_->{name} => $_} $meta->find('FILEATTACHMENT'); 
  • trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Action/UploadAttachment.pm

    r11309 r12642  
    120120    my $maxSize = Foswiki::Func::getPreferencesValue('ATTACHFILESIZELIMIT'); 
    121121    $maxSize = 0 unless ($maxSize =~ /([0-9]+)/o); 
     122    $maxSize =~ s/[^\d]//g; 
    122123 
    123124    Foswiki::Plugins::TopicInteractionPlugin::Core::writeDebug("fileSize=$fileSize, maxSize=$maxSize, fileDate=$fileDate, fileComment=$fileComment, fileHide=$fileHide, fileCreateLink=$fileCreateLink"); 
  • trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Attachments.pm

    r11309 r12642  
    154154  $index = 0; 
    155155  my $webDAVLinkPluginEnabled = Foswiki::Func::getContext()->{WebDAVLinkPluginEnabled}; 
    156   my $webDAVFilter = $Foswiki::cfg{TopicInteractionPlugin}{WebDAVFilter} || qr/((xlt|ppt|pps|pot|doc|dot)(x|m)?)|odc|odb|odf|odg|otg|odi|odp|otp|ods|ots|odt|odm|ott|oth|mpp/; 
     156  my $webDAVFilter = $Foswiki::cfg{TopicInteractionPlugin}{WebDAVFilter} || qr/((xlt|xls|ppt|pps|pot|doc|dot)(x|m)?)|odc|odb|odf|odg|otg|odi|odp|otp|ods|ots|odt|odm|ott|oth|mpp/; 
    157157 
    158158  foreach my $attachment (@selectedAttachments) { 
     
    168168    my $icon = '%ICON{"' . $info->{name} . '" alt="else"}%'; 
    169169 
    170     my $encName = Foswiki::urlEncode($info->{name}); 
     170    my $encName = urlEncode($info->{name}); 
    171171 
    172172    # actions 
     
    234234    $text =~ s/\$web\b/$thisWeb/g; 
    235235    $text =~ s/\$topic\b/$thisTopic/g; 
    236     $text =~ s/\$encode\((.*?)\)/Foswiki::urlEncode($1)/ges; 
     236    $text =~ s/\$encode\((.*?)\)/urlEncode($1)/ges; 
    237237 
    238238    push @result, $text if $text; 
     
    253253 
    254254  return Foswiki::Func::decodeFormatTokens($result); 
     255} 
     256 
     257############################################################################## 
     258# slightly different version as Foswiki::urlEncode: also encodes single quotes 
     259sub urlEncode { 
     260  my $text = shift; 
     261 
     262  $text =~ s/([^0-9a-zA-Z-_.:~!*\/])/'%'.sprintf('%02x',ord($1))/ge; 
     263 
     264  return $text; 
    255265} 
    256266 
  • trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Config.spec

    r10383 r12642  
    1111# Specify a regular expression matching fileextensions to be webdav enabled in the attachments list of a topic.  
    1212# This configuration setting will only take effect when the WebDAVLinkPlugin is enabled too. 
    13 $Foswiki::cfg{TopicInteractionPlugin}{WebDAVFilter} = qr/((xlt|ppt|pps|pot|doc|dot)(x|m)?)|odc|odb|odf|odg|otg|odi|odp|otp|ods|ots|odt|odm|ott|oth|mpp/; 
     13$Foswiki::cfg{TopicInteractionPlugin}{WebDAVFilter} = qr/((xlt|xls|ppt|pps|pot|doc|dot)(x|m)?)|odc|odb|odf|odg|otg|odi|odp|otp|ods|ots|odt|odm|ott|oth|mpp/; 
    1414 
    15151; 
  • trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/DEPENDENCIES

    r11309 r12642  
     1Foswiki::Plugins::FlexFormPlugin,>=2.40,perl,Required. 
    12Foswiki::Plugins::JQueryPlugin,>=3740,perl,Required. 
    23Foswiki::Plugins::FlexPaperPlugin,>=1.1,perl,Optional. 
  • trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Uploader.pm

    r11309 r12642  
    3333=begin TML 
    3434 
    35 ---++ ClassMethod new( $class, $session, ... ) 
     35---++ ClassMethod new( $class, ... ) 
    3636 
    3737Constructor 
     
    4141sub new { 
    4242  my $class = shift; 
    43   my $session = shift || $Foswiki::Plugins::SESSION; 
    4443 
    4544  my $this = bless($class->SUPER::new(  
    46     $session, 
    4745    name => 'Uploader', 
    4846    version => '1.0.0', 
  • trunk/TopicInteractionPlugin/pub/System/TopicInteractionPlugin/metadata.uncompressed.css

    r10383 r12642  
    5151 
    5252  /* SMELL: from foswikiFormSteps */ 
     53  /* 
    5354  border-top:1px solid #EDE3CE; 
    5455  border-bottom:1px solid #EDE3CE; 
    5556  background:#FEF8EB; 
     57  */ 
    5658} 
    5759.foswikiAttachmentsOptions a { 
     
    158160} 
    159161.foswikiAttachmentSelected .foswikiAttachmentInfo { 
    160   color:#6D5657; 
     162  color:#764546; 
    161163} 
    162164.foswikiAttachmentSelected .foswikiAttachmentInfo .foswikiGrayText { 
    163   color:#A88486; 
     165  color:#764546; 
    164166} 
    165167.foswikiAttachmentSelected .foswikiAttachmentInfo a { 
    166   color:#EA5D65; 
     168  color:#764546; 
    167169} 
    168170.foswikiAttachmentSelected .foswikiAttachmentInfo a:hover { 
     
    219221  float:left; 
    220222} 
    221 .foswikiAttachmentsUnselectAll { 
     223.foswikiAttachmentsClearAll { 
    222224  display:none; 
    223225} 
  • trunk/TopicInteractionPlugin/pub/System/TopicInteractionPlugin/metadata.uncompressed.js

    r11309 r12642  
    167167        } 
    168168        if (opts.selection.length) { 
    169           $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachmentsUnselectAll").show(); 
     169          $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachmentsClearAll").show(); 
    170170          $this.find(".foswikiAttachmentsSelected").text(opts.selection.length); 
    171171        } else { 
    172           $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachmentsUnselectAll").hide(); 
    173         } 
    174       } else { 
    175         $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachmentsUnselectAll").hide(); 
     172          $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachmentsClearAll").hide(); 
     173        } 
     174      } else { 
     175        $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachmentsClearAll").hide(); 
    176176      } 
    177177    } 
     
    194194 
    195195    /* remove an id from the selection *************************************/ 
    196     function unselect(id) { 
     196    function clear(id) { 
    197197      if (opts.selection) { 
    198198        for (var i = 0; i < opts.selection.length; i++) { 
     
    366366            select(id); 
    367367          } else { 
    368             unselect(id); 
     368            clear(id); 
    369369          } 
    370370        } 
     
    397397    }); 
    398398 
    399     // add unselect all behaviour 
    400     $this.find(".foswikiAttachmentsUnselectAll").click(function() { 
     399    // add clear all behaviour 
     400    $this.find(".foswikiAttachmentsClearAll").click(function() { 
    401401      clearSelection(); 
    402402      $this.find(".foswikiAttachmentsSelectAll").show(); 
     
    429429        height = parseInt($(window).height() * 0.6, 10); 
    430430        width = parseInt($(window).width() * 0.6, 10); 
    431  
    432       } 
    433  
    434        
     431      } 
     432 
    435433      // pdf previewer 
    436434      previewUrl = foswiki.getPreference("SCRIPTURL")+ 
     
    591589              $.unblockUI(); 
    592590              $attachment.slideUp(function() { 
    593                 unselect(attachmentOpts.filename); 
     591                clear(attachmentOpts.filename); 
    594592                loadAttachments(); 
    595593              }); 
     
    653651              $.unblockUI(); 
    654652              $attachment.slideUp(function() { 
    655                 unselect(attachmentOpts.filename); 
     653                clear(attachmentOpts.filename); 
    656654                loadAttachments(); 
    657655              }); 
  • trunk/TopicInteractionPlugin/templates/metadata.tmpl

    r11309 r12642  
    5757%TMPL:DEF{"metadata::javascript"}%<!-- --> 
    5858%TMPL:P{"metadata::lightbox"}%<!-- --> 
    59 %JQREQUIRE{"tooltip, easing, ui, uploader, twisty, media"}%<!-- --> 
     59%JQREQUIRE{"tooltip, easing, ui, ui::autocomplete, uploader, twisty, media"}%<!-- --> 
    6060%IF{"context FlexPaperPluginEnabled" then="$percntFLEXPAPERINIT$percnt"}%<!-- --> 
    6161%ADDTOZONE{"script"  
    6262  id="NATSKIN::METADATA::JS"  
    63   requires="JQUERYPLUGIN::LIVEQUERY, JQUERYPLUGIN::AUTOCOMPLETE, JQUERYPLUGIN::UPLOAD"  
     63  requires="JQUERYPLUGIN::LIVEQUERY, JQUERYPLUGIN::UI, JQUERYPLUGIN::UPLOAD"  
    6464  text="<script src='%PUBURLPATH%/%SYSTEMWEB%/TopicInteractionPlugin/metadata.js'></script>" 
    6565}%<!-- -->%TMPL:END% 
     
    8787%TAB{"%MAKETEXT{"Comments [_1]" args="<span class='foswikiCommentsCount'>%METACOMMENTS{limit="1" format="($count)" singular="$count" plural="$count"}%</span>"}%"  
    8888  id="comments"  
    89   url="%SCRIPTURL{"rest"}%/RenderPlugin/template?name=metacomments;expand=metacomments;topic=%WEB%.%TOPIC%;render=on" 
     89  url="%SCRIPTURL{"rest"}%/RenderPlugin/template?name=metacomments;expand=metacomments;topic=%WEB%.%TOPIC%;render=on;%GMTIME{"$epoch"}%" 
    9090}%<div class='foswikiFormSteps foswikiAttachmentsProcess'>%ICON{"processing"}%</div> 
    9191%ENDTAB% 
     
    137137    \"%MAKETEXT{"Attachments [_1]" args="<span class='foswikiAttachmentsCount'>($count)</span>"}%\"  
    138138    id=\"attachments\"  
    139     url=\"%SCRIPTURL{"rest"}%/RenderPlugin/template?name=metadata;expand=attachments;topic=%WEB%.%TOPIC%;render=on\" 
     139    url=\"%SCRIPTURL{"rest"}%/RenderPlugin/template?name=metadata;expand=attachments;topic=%WEB%.%TOPIC%;render=on;%GMTIME{"$epoch"}%\" 
    140140  }$percnt 
    141141  <div class='foswikiFormSteps foswikiAttachmentsProcess'>$percntICON{\"processing\"}$percnt</div> 
     
    325325  <div class="foswikiAttachmentsSelect"> 
    326326    %BUTTON{"%MAKETEXT{"Select all"}%" icon="add" class="simple foswikiRight foswikiAttachmentsSelectAll" title="%MAKETEXT{"select all attachments on this topic"}%"}% 
    327     %BUTTON{"%MAKETEXT{"Unselect all"}%" icon="delete" class="simple foswikiRight foswikiAttachmentsUnselectAll" title="%MAKETEXT{"unselect all previously select attachments"}%"}% 
     327    %BUTTON{"%MAKETEXT{"Clear all"}%" icon="delete" class="simple foswikiRight foswikiAttachmentsClearAll" title="%MAKETEXT{"unselect all previously select attachments"}%"}% 
    328328    %CLEAR% 
    329329  </div> 
     
    362362%TMPL:DEF{"attachments::previewer"}%<!-- --> 
    363363<div id="foswikiAttachmentPreviewer" class="foswikiDialog foswikiFormSteps" style="display:none"> 
    364   <h2 class="foswikiDialogTitle foswikiAttachmentName"></h2> 
     364  <h2 class="foswikiDialogTitle jqSimpleModalDraggable foswikiAttachmentName"></h2> 
    365365  <div class="foswikiFormStep foswikiPreviewContainer"> 
    366366    %ICON{"processing"}% 
     
    394394%{ ################################################################################ }% 
    395395%TMPL:DEF{"attachments::editor"}%<!-- --> 
    396 <div id="foswikiAttachmentEditor" class="foswikiDialog" style="display:none"> 
     396<div id="foswikiAttachmentEditor" class="foswikiDialog foswikiFormSteps" style="display:none"> 
    397397<form name="attach" action="%SCRIPTURL{"rest"}%/TopicInteractionPlugin/changeproperties" method="post"> 
    398398<input type="hidden" name="origfilename" value="" /> 
    399399<input type="hidden" name="topic" value="%WEB%.%TOPIC%" /> 
    400 <div class="foswikiFormSteps"> 
    401   <h2 class="foswikiDialogTitle">%MAKETEXT{"Edit attachment"}%</h2> 
    402   <div class="foswikiFormStep"> 
    403     <h3>%MAKETEXT{"File name"}%:</h3> 
    404     <div class="foswikiThumbnailContainer foswikiRight"></div> 
    405     <input type="text" class="foswikiInputField" size="50" name="filename" value="" /> 
    406   </div> 
    407   <div class="foswikiFormStep"> 
    408     <h3>%MAKETEXT{"Comment"}%:</h3> 
    409     <input type="text" class="foswikiInputField" size="50" name="filecomment" value="" /> 
    410   </div> 
    411   <div class="foswikiFormStep foswikiFormOptions"> 
    412     <h3>%MAKETEXT{"Options"}%:</h3> 
    413     <label> 
    414       <input type="checkbox" class="foswikiCheckbox" name="hidefile" /> 
    415       %MAKETEXT{"Hide attachment in normal topic view."}% 
    416     </label> 
    417   </div> 
    418   <hr /> 
    419   <div class="foswikiFormStep foswikiFormButtons foswikiFormLast"> 
    420     %BUTTON{"%MAKETEXT{"Save"}%" icon="disk" class="jqSimpleModalOK"}% 
    421     %BUTTON{"%MAKETEXT{"Cancel"}%" icon="cross" class="jqSimpleModalCancel"}% 
    422     %CLEAR% 
    423   </div> 
     400<h2 class="foswikiDialogTitle jqSimpleModalDraggable">%MAKETEXT{"Edit attachment"}%</h2> 
     401<div class="foswikiFormStep"> 
     402  <h3>%MAKETEXT{"File name"}%:</h3> 
     403  <div class="foswikiThumbnailContainer foswikiRight"></div> 
     404  <input type="text" class="foswikiInputField" size="50" name="filename" value="" /> 
     405</div> 
     406<div class="foswikiFormStep"> 
     407  <h3>%MAKETEXT{"Comment"}%:</h3> 
     408  <input type="text" class="foswikiInputField" size="50" name="filecomment" value="" /> 
     409</div> 
     410<div class="foswikiFormStep foswikiFormOptions"> 
     411  <h3>%MAKETEXT{"Options"}%:</h3> 
     412  <label> 
     413    <input type="checkbox" class="foswikiCheckbox" name="hidefile" /> 
     414    %MAKETEXT{"Hide attachment in normal topic view."}% 
     415  </label> 
     416</div> 
     417<hr /> 
     418<div class="foswikiFormStep foswikiFormButtons foswikiFormLast"> 
     419  %BUTTON{"%MAKETEXT{"Save"}%" icon="disk" class="jqSimpleModalOK"}% 
     420  %BUTTON{"%MAKETEXT{"Cancel"}%" icon="cross" class="jqSimpleModalCancel"}% 
     421  %CLEAR% 
    424422</div> 
    425423</form> 
     
    429427%{ ################################################################################ }% 
    430428%TMPL:DEF{"attachments::moveattachment"}%<!-- --> 
    431 <div id="foswikiAttachmentMove" class="foswikiDialog" style="display:none"> 
     429<div id="foswikiAttachmentMove" class="foswikiDialog foswikiFormSteps" style="display:none"> 
    432430<form name="move" action="%SCRIPTURL{"rest"}%/TopicInteractionPlugin/move" method="post"> 
    433431<input type="hidden" name="filename" value="" /> 
    434432<input type="hidden" name="topic" value="%WEB%.%TOPIC%" /> 
    435 <div class="foswikiFormSteps"> 
    436   <h2 class="foswikiDialogTitle foswikiMoveOne">%MAKETEXT{"Move this attachment to a different topic"}%</h2> 
    437   <h2 class="foswikiDialogTitle foswikiMoveMultiple">%MAKETEXT{"Move [_1] attachment(s) to a different topic" args="<span class='foswikiAttachmentsCount'></span>"}%</h2> 
    438   <div class="foswikiFormStep"> 
    439     <h3>%MAKETEXT{"To web"}%</h3> 
    440     <div class="foswikiThumbnailContainer foswikiRight"></div> 
    441     <input type="text" class="foswikiInputField" name="newweb" size="50" value="%WEB%" autocomplete="%SCRIPTURL{"view"}%/%SYSTEMWEB%/JQueryAjaxHelper?section=web&skin=text" /> 
    442   </div> 
    443   <div class="foswikiFormStep"> 
    444     <h3>%MAKETEXT{"To topic:"}%</h3> 
    445     <input type="text" class="foswikiInputField {extraParams:{baseweb:function() {return jQuery('#foswikiAttachmentMove input[name=newweb]').val()}}}" name="newtopic" size="50" value="%TOPIC%" autocomplete="%SCRIPTURL{"view"}%/%SYSTEMWEB%/JQueryAjaxHelper?section=topic&skin=text" /> 
    446     <div class="foswikiFormDescription"> 
    447       %MAKETEXT{"The new topic chosen must already exist."}% 
    448     </div> 
    449   </div> 
    450   <hr /> 
    451   <div class="foswikiFormStep foswikiFormLast foswikiFormButtons"> 
    452     %BUTTON{"%MAKETEXT{"Move"}%" icon="page_white_go" class="jqSimpleModalOK"}% 
    453     %BUTTON{"%MAKETEXT{"Cancel"}%" icon="cross" class="jqSimpleModalCancel"}% 
    454     %CLEAR% 
    455   </div> 
     433<h2 class="foswikiDialogTitle foswikiMoveOne jqSimpleModalDraggable">%MAKETEXT{"Move this attachment to a different topic"}%</h2> 
     434<h2 class="foswikiDialogTitle foswikiMoveMultiple jqSimpleModalDraggable">%MAKETEXT{"Move [_1] attachment(s) to a different topic" args="<span class='foswikiAttachmentsCount'></span>"}%</h2> 
     435<div class="foswikiFormStep"> 
     436  <h3>%MAKETEXT{"To web"}%</h3> 
     437  <div class="foswikiThumbnailContainer foswikiRight"></div> 
     438  <input type="text" class="foswikiInputField jqUIAutocomplete" name="newweb" size="50" value="%WEB%" autocomplete="%SCRIPTURL{"view"}%/%SYSTEMWEB%/JQueryAjaxHelper?section=web&skin=text" /> 
     439</div> 
     440<div class="foswikiFormStep"> 
     441  <h3>%MAKETEXT{"To topic:"}%</h3> 
     442  <input type="text" class="foswikiInputField jqUIAutocomplete {extraParams:{baseweb:function() {return jQuery('#foswikiAttachmentMove input[name=newweb]').val()}}}" name="newtopic" size="50" value="%TOPIC%" autocomplete="%SCRIPTURL{"view"}%/%SYSTEMWEB%/JQueryAjaxHelper?section=topic&skin=text" /> 
     443  <div class="foswikiFormDescription"> 
     444    %MAKETEXT{"The new topic chosen must already exist."}% 
     445  </div> 
     446</div> 
     447<hr /> 
     448<div class="foswikiFormStep foswikiFormLast foswikiFormButtons"> 
     449  %BUTTON{"%MAKETEXT{"Move"}%" icon="page_white_go" class="jqSimpleModalOK"}% 
     450  %BUTTON{"%MAKETEXT{"Cancel"}%" icon="cross" class="jqSimpleModalCancel"}% 
     451  %CLEAR% 
    456452</div> 
    457453</form> 
  • trunk/TopicInteractionPlugin/templates/view.topicinteraction.tmpl

    r10385 r12642  
    33%TMPL:DEF{"attachments"}%%TMPL:END% 
    44%TMPL:DEF{"topicaction"}%<!-- --> 
    5 %JQREQUIRE{"autocomplete, simplemodal"}%<!-- --> 
     5%JQREQUIRE{"ui, simplemodal"}%<!-- --> 
    66%ADDTOZONE{"head" 
    77  id="METADATA::PATTERN:CSS" 
Note: See TracChangeset for help on using the changeset viewer.