Changeset 12642
- Timestamp:
- 09/28/11 14:08:13 (20 months ago)
- Location:
- trunk/TopicInteractionPlugin
- Files:
-
- 11 edited
-
lib/Foswiki/Plugins/TopicInteractionPlugin/Action/ChangeProperties.pm (modified) (2 diffs)
-
lib/Foswiki/Plugins/TopicInteractionPlugin/Action/DownloadAttachment.pm (modified) (1 diff)
-
lib/Foswiki/Plugins/TopicInteractionPlugin/Action/UploadAttachment.pm (modified) (1 diff)
-
lib/Foswiki/Plugins/TopicInteractionPlugin/Attachments.pm (modified) (4 diffs)
-
lib/Foswiki/Plugins/TopicInteractionPlugin/Config.spec (modified) (1 diff)
-
lib/Foswiki/Plugins/TopicInteractionPlugin/DEPENDENCIES (modified) (1 diff)
-
lib/Foswiki/Plugins/TopicInteractionPlugin/Uploader.pm (modified) (2 diffs)
-
pub/System/TopicInteractionPlugin/metadata.uncompressed.css (modified) (3 diffs)
-
pub/System/TopicInteractionPlugin/metadata.uncompressed.js (modified) (7 diffs)
-
templates/metadata.tmpl (modified) (7 diffs)
-
templates/view.topicinteraction.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Action/ChangeProperties.pm
r11309 r12642 63 63 ); 64 64 } 65 $error =Foswiki::Func::saveAttachment(65 Foswiki::Func::saveAttachment( 66 66 $web, $topic, $newFileName, { 67 67 name => $newFileName, … … 72 72 createlink => $fileCreateLink, 73 73 }); 74 75 74 } 76 75 } catch Error::Simple with { -
trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Action/DownloadAttachment.pm
r11309 r12642 73 73 my ($web, $topic, $fileNames) = @_; 74 74 75 $web =~ s/\//\./; # added for subweb support 75 76 my ($meta, $text) = Foswiki::Func::readTopic( $web, $topic ); 76 77 my %attachments = map {$_->{name} => $_} $meta->find('FILEATTACHMENT'); -
trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Action/UploadAttachment.pm
r11309 r12642 120 120 my $maxSize = Foswiki::Func::getPreferencesValue('ATTACHFILESIZELIMIT'); 121 121 $maxSize = 0 unless ($maxSize =~ /([0-9]+)/o); 122 $maxSize =~ s/[^\d]//g; 122 123 123 124 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 154 154 $index = 0; 155 155 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/; 157 157 158 158 foreach my $attachment (@selectedAttachments) { … … 168 168 my $icon = '%ICON{"' . $info->{name} . '" alt="else"}%'; 169 169 170 my $encName = Foswiki::urlEncode($info->{name});170 my $encName = urlEncode($info->{name}); 171 171 172 172 # actions … … 234 234 $text =~ s/\$web\b/$thisWeb/g; 235 235 $text =~ s/\$topic\b/$thisTopic/g; 236 $text =~ s/\$encode\((.*?)\)/ Foswiki::urlEncode($1)/ges;236 $text =~ s/\$encode\((.*?)\)/urlEncode($1)/ges; 237 237 238 238 push @result, $text if $text; … … 253 253 254 254 return Foswiki::Func::decodeFormatTokens($result); 255 } 256 257 ############################################################################## 258 # slightly different version as Foswiki::urlEncode: also encodes single quotes 259 sub urlEncode { 260 my $text = shift; 261 262 $text =~ s/([^0-9a-zA-Z-_.:~!*\/])/'%'.sprintf('%02x',ord($1))/ge; 263 264 return $text; 255 265 } 256 266 -
trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Config.spec
r10383 r12642 11 11 # Specify a regular expression matching fileextensions to be webdav enabled in the attachments list of a topic. 12 12 # 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/; 14 14 15 15 1; -
trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/DEPENDENCIES
r11309 r12642 1 Foswiki::Plugins::FlexFormPlugin,>=2.40,perl,Required. 1 2 Foswiki::Plugins::JQueryPlugin,>=3740,perl,Required. 2 3 Foswiki::Plugins::FlexPaperPlugin,>=1.1,perl,Optional. -
trunk/TopicInteractionPlugin/lib/Foswiki/Plugins/TopicInteractionPlugin/Uploader.pm
r11309 r12642 33 33 =begin TML 34 34 35 ---++ ClassMethod new( $class, $session,... )35 ---++ ClassMethod new( $class, ... ) 36 36 37 37 Constructor … … 41 41 sub new { 42 42 my $class = shift; 43 my $session = shift || $Foswiki::Plugins::SESSION;44 43 45 44 my $this = bless($class->SUPER::new( 46 $session,47 45 name => 'Uploader', 48 46 version => '1.0.0', -
trunk/TopicInteractionPlugin/pub/System/TopicInteractionPlugin/metadata.uncompressed.css
r10383 r12642 51 51 52 52 /* SMELL: from foswikiFormSteps */ 53 /* 53 54 border-top:1px solid #EDE3CE; 54 55 border-bottom:1px solid #EDE3CE; 55 56 background:#FEF8EB; 57 */ 56 58 } 57 59 .foswikiAttachmentsOptions a { … … 158 160 } 159 161 .foswikiAttachmentSelected .foswikiAttachmentInfo { 160 color:# 6D5657;162 color:#764546; 161 163 } 162 164 .foswikiAttachmentSelected .foswikiAttachmentInfo .foswikiGrayText { 163 color:# A88486;165 color:#764546; 164 166 } 165 167 .foswikiAttachmentSelected .foswikiAttachmentInfo a { 166 color:# EA5D65;168 color:#764546; 167 169 } 168 170 .foswikiAttachmentSelected .foswikiAttachmentInfo a:hover { … … 219 221 float:left; 220 222 } 221 .foswikiAttachments UnselectAll {223 .foswikiAttachmentsClearAll { 222 224 display:none; 223 225 } -
trunk/TopicInteractionPlugin/pub/System/TopicInteractionPlugin/metadata.uncompressed.js
r11309 r12642 167 167 } 168 168 if (opts.selection.length) { 169 $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachments UnselectAll").show();169 $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachmentsClearAll").show(); 170 170 $this.find(".foswikiAttachmentsSelected").text(opts.selection.length); 171 171 } else { 172 $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachments UnselectAll").hide();173 } 174 } else { 175 $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachments UnselectAll").hide();172 $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachmentsClearAll").hide(); 173 } 174 } else { 175 $this.find(".foswikiAttachmentsBulkAction, .foswikiAttachmentsClearAll").hide(); 176 176 } 177 177 } … … 194 194 195 195 /* remove an id from the selection *************************************/ 196 function unselect(id) {196 function clear(id) { 197 197 if (opts.selection) { 198 198 for (var i = 0; i < opts.selection.length; i++) { … … 366 366 select(id); 367 367 } else { 368 unselect(id);368 clear(id); 369 369 } 370 370 } … … 397 397 }); 398 398 399 // add unselectall behaviour400 $this.find(".foswikiAttachments UnselectAll").click(function() {399 // add clear all behaviour 400 $this.find(".foswikiAttachmentsClearAll").click(function() { 401 401 clearSelection(); 402 402 $this.find(".foswikiAttachmentsSelectAll").show(); … … 429 429 height = parseInt($(window).height() * 0.6, 10); 430 430 width = parseInt($(window).width() * 0.6, 10); 431 432 } 433 434 431 } 432 435 433 // pdf previewer 436 434 previewUrl = foswiki.getPreference("SCRIPTURL")+ … … 591 589 $.unblockUI(); 592 590 $attachment.slideUp(function() { 593 unselect(attachmentOpts.filename);591 clear(attachmentOpts.filename); 594 592 loadAttachments(); 595 593 }); … … 653 651 $.unblockUI(); 654 652 $attachment.slideUp(function() { 655 unselect(attachmentOpts.filename);653 clear(attachmentOpts.filename); 656 654 loadAttachments(); 657 655 }); -
trunk/TopicInteractionPlugin/templates/metadata.tmpl
r11309 r12642 57 57 %TMPL:DEF{"metadata::javascript"}%<!-- --> 58 58 %TMPL:P{"metadata::lightbox"}%<!-- --> 59 %JQREQUIRE{"tooltip, easing, ui, u ploader, twisty, media"}%<!-- -->59 %JQREQUIRE{"tooltip, easing, ui, ui::autocomplete, uploader, twisty, media"}%<!-- --> 60 60 %IF{"context FlexPaperPluginEnabled" then="$percntFLEXPAPERINIT$percnt"}%<!-- --> 61 61 %ADDTOZONE{"script" 62 62 id="NATSKIN::METADATA::JS" 63 requires="JQUERYPLUGIN::LIVEQUERY, JQUERYPLUGIN:: AUTOCOMPLETE, JQUERYPLUGIN::UPLOAD"63 requires="JQUERYPLUGIN::LIVEQUERY, JQUERYPLUGIN::UI, JQUERYPLUGIN::UPLOAD" 64 64 text="<script src='%PUBURLPATH%/%SYSTEMWEB%/TopicInteractionPlugin/metadata.js'></script>" 65 65 }%<!-- -->%TMPL:END% … … 87 87 %TAB{"%MAKETEXT{"Comments [_1]" args="<span class='foswikiCommentsCount'>%METACOMMENTS{limit="1" format="($count)" singular="$count" plural="$count"}%</span>"}%" 88 88 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"}%" 90 90 }%<div class='foswikiFormSteps foswikiAttachmentsProcess'>%ICON{"processing"}%</div> 91 91 %ENDTAB% … … 137 137 \"%MAKETEXT{"Attachments [_1]" args="<span class='foswikiAttachmentsCount'>($count)</span>"}%\" 138 138 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"}%\" 140 140 }$percnt 141 141 <div class='foswikiFormSteps foswikiAttachmentsProcess'>$percntICON{\"processing\"}$percnt</div> … … 325 325 <div class="foswikiAttachmentsSelect"> 326 326 %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"}%"}% 328 328 %CLEAR% 329 329 </div> … … 362 362 %TMPL:DEF{"attachments::previewer"}%<!-- --> 363 363 <div id="foswikiAttachmentPreviewer" class="foswikiDialog foswikiFormSteps" style="display:none"> 364 <h2 class="foswikiDialogTitle foswikiAttachmentName"></h2>364 <h2 class="foswikiDialogTitle jqSimpleModalDraggable foswikiAttachmentName"></h2> 365 365 <div class="foswikiFormStep foswikiPreviewContainer"> 366 366 %ICON{"processing"}% … … 394 394 %{ ################################################################################ }% 395 395 %TMPL:DEF{"attachments::editor"}%<!-- --> 396 <div id="foswikiAttachmentEditor" class="foswikiDialog " style="display:none">396 <div id="foswikiAttachmentEditor" class="foswikiDialog foswikiFormSteps" style="display:none"> 397 397 <form name="attach" action="%SCRIPTURL{"rest"}%/TopicInteractionPlugin/changeproperties" method="post"> 398 398 <input type="hidden" name="origfilename" value="" /> 399 399 <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% 424 422 </div> 425 423 </form> … … 429 427 %{ ################################################################################ }% 430 428 %TMPL:DEF{"attachments::moveattachment"}%<!-- --> 431 <div id="foswikiAttachmentMove" class="foswikiDialog " style="display:none">429 <div id="foswikiAttachmentMove" class="foswikiDialog foswikiFormSteps" style="display:none"> 432 430 <form name="move" action="%SCRIPTURL{"rest"}%/TopicInteractionPlugin/move" method="post"> 433 431 <input type="hidden" name="filename" value="" /> 434 432 <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% 456 452 </div> 457 453 </form> -
trunk/TopicInteractionPlugin/templates/view.topicinteraction.tmpl
r10385 r12642 3 3 %TMPL:DEF{"attachments"}%%TMPL:END% 4 4 %TMPL:DEF{"topicaction"}%<!-- --> 5 %JQREQUIRE{" autocomplete, simplemodal"}%<!-- -->5 %JQREQUIRE{"ui, simplemodal"}%<!-- --> 6 6 %ADDTOZONE{"head" 7 7 id="METADATA::PATTERN:CSS"
Note: See TracChangeset
for help on using the changeset viewer.
