Skip to content

Commit

Permalink
Item8251: added support for ImagePlugin + some css fixes
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@4699 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Aug 20, 2009
1 parent 1301a9b commit ccb9dc5
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 12 deletions.
1 change: 1 addition & 0 deletions NatEditPlugin/data/System/NatEditPlugin.txt
Expand Up @@ -87,6 +87,7 @@ Sponsored by [[http://www.trivadis.com][Trivadis AG]]
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | |
| 20 Aug 2009 | added support for !ImagePlugin when inserting attachments |
| 03 Jul 2009 | IE fixes, !PatternSkin related fixes |
| 23 Jun 2009 | converted to foswiki, lots of feature enhancements |
| 03 Feb 2009 | fixed preview+save on Foswiki/<nop>PatternSkin; \
Expand Down
2 changes: 1 addition & 1 deletion NatEditPlugin/lib/Foswiki/Plugins/NatEditPlugin.pm
Expand Up @@ -22,7 +22,7 @@ use vars qw(
);

$VERSION = '$Rev$';
$RELEASE = 'v4.02';
$RELEASE = 'v4.10';

$NO_PREFS_IN_TOPIC = 1;
$SHORTDESCRIPTION = 'A Wikiwyg Editor';
Expand Down
Expand Up @@ -21,6 +21,8 @@
}
});

$inserter.find("#natEditInsertAttachmentFile").val("");

$("#natEditInsertAttachmentWeb").autocomplete(
foswiki.scriptUrlPath+"/view/"+foswiki.systemWebName+"/JQueryAjaxHelper?section=web;contenttype=text/plain;skin=text", {
matchCase: true
Expand All @@ -41,7 +43,7 @@
}
});

$("#natEditInsertAttachmentFile").keyup(function(e) {
$inserter.find("#natEditInsertAttachmentFile").keyup(function(e) {
var fileName = $(this).val();
var foundFileName;
var $foundLabel;
Expand Down Expand Up @@ -139,20 +141,30 @@
var web = $("#natEditInsertAttachmentWeb").val();
var topic = $("#natEditInsertAttachmentTopic").val();
var fileName = $("#natEditInsertAttachmentFile").val();

if (!fileName) {
return;
}
var url;

var linktext = $("#natEditInsertAttachmentText").val();
var url = "%PUBURL%/"+web+"/"+topic+"/"+fileName;
if (web == foswiki.web && topic == foswiki.topic) {
url = "%ATTACHURL%/"+fileName;
} else {
url = "%PUBURL%/"+web+"/"+topic+"/"+fileName;
}
var linktext = $("#natEditInsertAttachmentText").val();
if (linktext) {
markup = "[["+url+"]["+linktext+"]]";

if (foswiki.ImagePluginEnabled && fileName.match(/jpe?g|gif|png|bmp/i) && !linktext) {
if (web == foswiki.web && topic == foswiki.topic) {
markup = '%IMAGE{"'+fileName+'"';
} else {
markup = '%IMAGE{"'+web+"/"+topic+"/"+fileName+'"';
}
markup += "}%";
} else {
markup = "[["+url+"]]";
if (linktext) {
markup = "[["+url+"]["+linktext+"]]";
} else {
markup = "[["+url+"]]";
}
}
nateditor.remove();
nateditor.insertTag(['', markup, '']);
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion NatEditPlugin/pub/System/NatEditPlugin/styles.css

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

Binary file modified NatEditPlugin/pub/System/NatEditPlugin/styles.css.gz
Binary file not shown.
20 changes: 18 additions & 2 deletions NatEditPlugin/pub/System/NatEditPlugin/styles.uncompressed.css
Expand Up @@ -135,7 +135,7 @@ ul.natEditHelpTools {
margin:0px 10px 10px 0px;
padding:5px;
width:70px;
height:85px;
height:82px;
overflow:hidden;
}
#natEditInsertAttachment .imgContainer {
Expand All @@ -152,7 +152,7 @@ ul.natEditHelpTools {
}
#natEditInsertAttachments {
overflow:auto;
height:205px;
height:200px;
}
#natEditInsertAttachments label span {
text-align:center;
Expand All @@ -161,3 +161,19 @@ ul.natEditHelpTools {
#natEditInsertAttachments input {
display:none;
}
#natEditInsertAttachment .jqTabContents {
position:relative;
}
#natEditInsertAttachment hr {
margin-top:5px;
margin-bottom:5px;
}
#natEditInsertAttachment .uploadContainer {
overflow:auto;
height:350px;
}
#natEditInsertAttachment .foswikiFormButtons {
position:absolute;
bottom:0px;
width:100%;
}

0 comments on commit ccb9dc5

Please sign in to comment.