Merge branch 'master' of git@github.com:plainblack/webgui

This commit is contained in:
daviddelikat 2009-10-19 22:09:13 -05:00
commit 9805541a6e
168 changed files with 8536 additions and 3809 deletions

View file

@ -4,6 +4,7 @@
- fixed #11060: Some tables have latin1 as the default character set
- fixed #11089: No message body in Notification
- fixed #2569: robots.txt issues
- refixed #2569: robots.txt issues
- fixed #11104: Wrong name for request tracker post form template
- fixed #11077: Untested result in WebGUI::Storage->getFiles
- fixed #11080: Asset Manage Crumb Trail flyout menu
@ -18,6 +19,16 @@
- fixed #10914: Shop: No email notifications sent when the cart has net value 0
- fixed #11126: WebGUI database has varchar fields
- fixed #10989: DataForm List: No pagination
- fixed #11128: Thing breaks w/ default value for date field
- fixed #10888: Issues with adding points to Maps
- fixed #10993: Editor drops last letter if s
- fixed #11139: referencing an item in the clipboard
- fixed #11146: Upgrade Error 7.7.21 to 7.7.22
- fixed #11147: fail safe template is missing embedded style
- fixed #11137: Customers see failed orders
- fixed #11156: Syndicated Content doesn't show all headlines in feed
- fixed #11138: RichEdit, upload image does not commit a version tag
- fixed ExpireIncompleteSurveyResponses Workflow: process responses for deleted users
7.8.1
- mark $session->datetime->time as deprecated and remove its use from core code

Binary file not shown.

View file

@ -95,7 +95,8 @@ sub correctWikiAttachmentPermissions {
PAGE: while (my $wikiPage = $pageIterator->()) {
my $wiki = $wikiPage->getWiki;
next PAGE unless $wiki && $wiki->get('allowAttachments') && $wikiPage->getChildCount;
foreach my $attachment (@{ $wikiPage->getLineage(['children'])}) {
ATTACHMENT: foreach my $attachment (@{ $wikiPage->getLineage(['children'], { returnObjects => 1, })}) {
next ATTACHMENT unless $attachment;
$attachment->update({ groupIdEdit => $wiki->get('groupToEditPages') });
}
}

View file

@ -326,7 +326,7 @@ sub checkView {
return "chunked";
}
elsif ($var->isAdminOn && $self->get("state") =~ /^clipboard/) { # show em clipboard
my $queryFrag = "func=manageTrash";
my $queryFrag = "func=manageClipboard";
if ($self->session->form->process('revision')) {
$queryFrag .= ";revision=".$self->session->form->process('revision');
}

View file

@ -94,25 +94,28 @@ sub definition {
hoverHelp => $i18n->get("startZoom description"),
},
templateIdEditPoint => {
tab => "display",
fieldType => "template",
namespace => "MapPoint/Edit",
label => $i18n->get("templateIdEditPoint label"),
hoverHelp => $i18n->get("templateIdEditPoint description"),
tab => "display",
fieldType => "template",
defaultValue => "oHh0UqAJeY7u2n--WD-BAA",
namespace => "MapPoint/Edit",
label => $i18n->get("templateIdEditPoint label"),
hoverHelp => $i18n->get("templateIdEditPoint description"),
},
templateIdView => {
tab => "display",
fieldType => "template",
namespace => "Map/View",
label => $i18n->get("templateIdView label"),
hoverHelp => $i18n->get("templateIdView description"),
tab => "display",
fieldType => "template",
defaultValue => "9j0_Z1j3Jd0QBbY2akb6qw",
namespace => "Map/View",
label => $i18n->get("templateIdView label"),
hoverHelp => $i18n->get("templateIdView description"),
},
templateIdViewPoint => {
tab => "display",
fieldType => "template",
namespace => "MapPoint/View",
label => $i18n->get("templateIdViewPoint label"),
hoverHelp => $i18n->get("templateIdViewPoint description"),
tab => "display",
fieldType => "template",
defaultValue => "u9vfx33XDk5la1-QC5FK7g",
namespace => "MapPoint/View",
label => $i18n->get("templateIdViewPoint label"),
hoverHelp => $i18n->get("templateIdViewPoint description"),
},
workflowIdPoint => {
tab => "security",
@ -309,6 +312,8 @@ sub loadMapApiTags {
my $style = $self->session->style;
my $url = $self->session->url;
$style->setLink($url->extras('yui/build/container/assets/skins/sam/container.css'),{type=>'text/css',rel=>'stylesheet'});
$style->setLink($url->extras('yui/build/button/assets/skins/sam/button.css'),{type=>'text/css',rel=>'stylesheet'});
$style->setScript("http://www.google.com/jsapi?key=" . $self->get('mapApiKey'),{type=>"text/javascript"});
$style->setRawHeadTags(<<'ENDHTML');
<script type="text/javascript">
@ -318,6 +323,10 @@ ENDHTML
$style->setScript('http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/release/src/markermanager.js', {type=>"text/javascript"});
$style->setScript($url->extras('yui/build/yahoo-dom-event/yahoo-dom-event.js'),{type=>'text/javascript'});
$style->setScript($url->extras('yui/build/connection/connection-min.js'),{type=>'text/javascript'});
$style->setScript($url->extras('yui/build/dragdrop/dragdrop-min.js'),{type=>'text/javascript'});
$style->setScript($url->extras('yui/build/element/element-min.js'),{type=>'text/javascript'});
$style->setScript($url->extras('yui/build/button/button-min.js'),{type=>'text/javascript'});
$style->setScript($url->extras('yui/build/container/container-min.js'),{type=>'text/javascript'});
$style->setScript($url->extras('yui/build/json/json-min.js'),{type=>'text/javascript'});
$style->setScript($url->extras('yui-webgui/build/map/map.js'),{type=>'text/javascript'});
@ -373,7 +382,7 @@ sub view {
;
# The script to load the map into the container
$mapHtml .= sprintf <<'ENDHTML', $self->getId, $self->getUrl, $self->get('startLatitude'), $self->get('startLongitude'), $self->get('startZoom');
$mapHtml .= sprintf <<'ENDHTML', $self->getId, $self->getUrl, $self->get('startLatitude'), $self->get('startLongitude'), $self->get('startZoom'), $session->url->extras;
<script type="text/javascript">
google.setOnLoadCallback( function() {
var mapId = "%s";
@ -381,6 +390,7 @@ sub view {
var map = new GMap2( document.getElementById("map_" + mapId) );
map.setCenter(new GLatLng(%s, %s), %s);
map.setUIToDefault();
map.extrasUrl = "%s";
var markermanager = new MarkerManager(map, {trackMarkers: true});
ENDHTML
@ -404,7 +414,7 @@ ENDHTML
}
$mapHtml .= <<'ENDHTML';
markermanager.addMarkers( WebGUI.Map.preparePoints(map, markermanager, mapUrl, points), 1 );
markermanager.addMarkers( WebGUI.Map.preparePoints(map, markermanager, mapUrl, points), 0 );
ENDHTML
}

View file

@ -60,6 +60,13 @@ sub definition {
label => $i18n->get('Survey Exit URL'),
hoverHelp => $i18n->get('Survey Exit URL help'),
},
maxResponsesPerUser => {
fieldType => 'integer',
tab => 'properties',
defaultValue => 1,
label => $i18n->get('Max user responses'),
hoverHelp => $i18n->get('Max user responses help'),
},
timeLimit => {
fieldType => 'integer',
defaultValue => 0,
@ -236,13 +243,6 @@ sub definition {
label => $i18n->get('Group to view reports'),
hoverHelp => $i18n->get('Group to view reports help'),
},
maxResponsesPerUser => {
fieldType => 'integer',
tab => 'security',
defaultValue => 1,
label => $i18n->get('Max user responses'),
hoverHelp => $i18n->get('Max user responses help'),
},
# Other
surveyJSON => {
@ -2300,6 +2300,9 @@ END_SQL
}
$var->{response_loop} = \@responseloop;
$paginator->appendTemplateVars($var);
# Clean up
$self->clearTempReportTable;
my $out = $self->processTemplate( $var, $self->get('gradebookTemplateId') );
return $self->processStyle($out);
@ -2390,6 +2393,9 @@ sub www_viewStatisticalOverview {
$var->{question_loop} = \@questionloop;
$paginator->appendTemplateVars($var);
# Clean up
$self->clearTempReportTable;
my $out = $self->processTemplate( $var, $self->get('overviewTemplateId') );
return $self->processStyle($out);
@ -2445,6 +2451,9 @@ sub export {
$content = $self->session->db->$method( $opts{sql}, $opts{sqlParams} );
}
# Clean up
$self->clearTempReportTable;
my $filename = $self->session->url->escape( $self->get("title") . "_$opts{name}.$format" );
$self->session->http->setFilename($filename,"text/$format");
return $content;
@ -2585,6 +2594,21 @@ END_HTML
#-------------------------------------------------------------------
=head2 clearTempReportTable
Clears the Survey_tempReport table
Typically called after L<loadTempReportTable> has been used
=cut
sub clearTempReportTable {
my $self = shift;
$self->session->db->write( 'delete from Survey_tempReport where assetId = ?', [ $self->getId() ] );
}
#-------------------------------------------------------------------
=head2 loadTempReportTable
Loads the responses from the survey into the Survey_tempReport table, so that other or custom reports can be ran against this data.
@ -2607,7 +2631,7 @@ sub loadTempReportTable {
my %opts = validate(@_, { ignoreRevisionDate => 0 });
# Remove old temp report data
$self->session->db->write( 'delete from Survey_tempReport where assetId = ?', [ $self->getId() ] );
$self->clearTempReportTable;
# Build the sql that will select all responses
my $sql = 'select * from Survey_response where assetId = ?';

View file

@ -133,7 +133,7 @@ sub generateFeed {
my $limit = shift || $self->get('maxHeadlines');
my $feed = XML::FeedPP::Atom->new();
my $log = $self->session->log;
# build one feed out of many
my $newlyCached = 0;
foreach my $url (split(/\s+/, $self->get('rssUrl'))) {
@ -154,35 +154,45 @@ sub generateFeed {
utf8::downgrade($value, 1);
eval {
my $singleFeed = XML::FeedPP->new($value, utf8_flag => 1, -type => 'string');
$feed->merge($singleFeed);
$feed->merge_channel($singleFeed);
$feed->merge_item($singleFeed);
};
if ($@) {
$log->error("Syndicated Content asset (".$self->getId.") has a bad feed URL (".$url."). Failed with ".$@);
}
}
# build a new feed that matches the term the user is interested in
if ($self->get('hasTerms') ne '') {
my @terms = split /,\s*/, $self->get('hasTerms'); # get the list of terms
my $termRegex = join("|", map quotemeta($_), @terms); # turn the terms into a regex string
my @items = $feed->match_item(title => qr/$termRegex/msi);
push @items, $feed->match_item(description => qr/$termRegex/msi);
$feed->clear_item;
$feed->uniq_item;
foreach my $item (@items) {
$feed->add_item($item);
}
$feed->clear_item;
ITEM: foreach my $item (@items) {
$feed->add_item($item);
}
}
my %seen = {};
my @items = $feed->get_item;
$feed->clear_item;
ITEM: foreach my $item (@items) {
my $key = join "\n", $item->link, $item->pubDate, $item->description, $item->title;
next ITEM if $seen{$key}++;
$feed->add_item($item);
}
# sort them by date and remove any duplicate from the OR based term matching above
$feed->normalize();
$feed->sort_item();
# limit the feed to the maximum number of headlines (or the feed generator limit).
$feed->limit_item($limit);
# mark this asset as updated
$self->update({}) if ($newlyCached);
return $feed;
}

View file

@ -41,12 +41,13 @@ always taken from the field hashref.
sub addField {
my $self = shift;
my $field = shift;
my $isImport = shift;
my $self = shift;
my $field = shift;
my $isImport = shift;
my $dbDataType = shift || $self->_getDbDataType($field->{fieldType});
my $db = $self->session->db;
my $error = $self->session->errorHandler;
my $session = $self->session;
my $db = $session->db;
my $error = $session->errorHandler;
my ($oldFieldId, $newFieldId,$useAssetId,$useSequence);
$error->info("Adding Field, label: ".$field->{label}.", fieldId: ".$field->{fieldId}.",thingId: ".$field->{thingId});
@ -970,14 +971,14 @@ sub getFormPlugin {
my $i18n = WebGUI::International->new($session,"Asset_Thingy");
$param{name} = "field_".$data->{fieldId};
my $name = $param{name};
my $name = $param{name};
$name =~ s/\^.*?\;//xgs ; # remove macro's from user input
$param{value} = $data->{value} || $data->{defaultValue};
$param{size} = $data->{size};
$param{height} = $data->{height};
$param{width} = $data->{width};
$param{extras} = $data->{extras};
$param{vertical} = $data->{vertical};
$param{value} = $data->{value} || $data->{defaultValue};
$param{size} = $data->{size};
$param{height} = $data->{height};
$param{width} = $data->{width};
$param{extras} = $data->{extras};
$param{vertical} = $data->{vertical};
$param{fieldType} = $data->{fieldType};
if ($data->{fieldType} eq "Checkbox") {
@ -1034,14 +1035,14 @@ sub getFormPlugin {
}
if ($data->{fieldType} =~ m/^otherThing/x){
my $otherThingId = $data->{fieldType};
$otherThingId =~ s/^otherThing_(.*)/$1/x;
$param{fieldType} = "SelectList";
$class = 'WebGUI::Form::'. $param{fieldType};
my $otherThingId = $data->{fieldType};
$otherThingId =~ s/^otherThing_(.*)/$1/x;
$param{fieldType} = "SelectList";
$class = 'WebGUI::Form::'. $param{fieldType};
my $options = ();
my $tableName = 'Thingy_'.$otherThingId;
my $fieldName = 'field_'.$data->{fieldInOtherThingId};
my $tableName = 'Thingy_'.$otherThingId;
my $fieldName = 'field_'.$data->{fieldInOtherThingId};
my $errorMessage = $self->badOtherThing($tableName, $fieldName);
return $errorMessage if $errorMessage;
@ -1060,10 +1061,10 @@ sub getFormPlugin {
.$dbh->quote_identifier($fieldName)
.' from '.$dbh->quote_identifier($tableName)
.' where thingDataId = ?',[$value]);
$param{size} = 1;
$param{size} = 1;
$param{multiple} = 0;
$param{options} = $options;
$param{value} = $data->{value} || $data->{defaultValue};
$param{options} = $options;
$param{value} = $data->{value} || $data->{defaultValue};
}
my $formElement = eval { WebGUI::Pluggable::instanciate($class, "new", [$session, \%param ])};
@ -2220,53 +2221,53 @@ Processes and saves a field. Returns the edited/added fieldId and the inner html
sub www_editFieldSave {
my $self = shift;
my $self = shift;
my $session = $self->session;
return $session->privilege->insufficient() unless $self->canEdit;
my ($fieldId, $fieldTypeChanged, $newFieldId, $formClass, $dbDataType, $thingyTableName, $columnName);
my (%properties,$listItemHTML,$formElement);
my $i18n = WebGUI::International->new($self->session, "Asset_Thingy");
my $label = $session->form->process("label");
my $thingId = $self->session->form->process("thingId");
my $error = $self->session->errorHandler;
my $i18n = WebGUI::International->new($session, "Asset_Thingy");
my $label = $session->form->process("label");
my $thingId = $session->form->process("thingId");
my $log = $session->log;
my $defaultValue = $session->form->process("defaultValue");
my $fieldType = $session->form->process("fieldType") || "ReadOnly";
my $fieldType = $session->form->process("fieldType") || "ReadOnly";
if ($fieldType =~ m/^otherThing/){
$defaultValue = $session->form->process("defaultFieldInThing");
}
$fieldId = $self->session->form->process("fieldId");
$fieldId = $session->form->process("fieldId");
%properties = (
fieldId=>$fieldId,
thingId=>$thingId,
label=>$label,
fieldType=>$fieldType,
defaultValue=>$defaultValue,
possibleValues=>$self->session->form->process("possibleValues"),
pretext=>$self->session->form->process("pretext"),
subtext=>$self->session->form->process("subtext"),
status=>$self->session->form->process("status"),
size=>$self->session->form->process("size"),
width=>$self->session->form->process("width"),
height=>$self->session->form->process("height"),
vertical=>$self->session->form->process("vertical"),
extras=>$self->session->form->process("extras"),
display=>$self->session->form->process("display") || 1,
viewScreenTitle=>$self->session->form->process("viewScreenTitle") || 0,
fieldInOtherThingId=>$session->form->process("fieldInOtherThingId") || "",
fieldId => $fieldId,
thingId => $thingId,
label => $label,
fieldType => $fieldType,
defaultValue => $defaultValue,
possibleValues => $session->form->process("possibleValues"),
pretext => $session->form->process("pretext"),
subtext => $session->form->process("subtext"),
status => $session->form->process("status"),
size => $session->form->process("size"),
width => $session->form->process("width"),
height => $session->form->process("height"),
vertical => $session->form->process("vertical"),
extras => $session->form->process("extras"),
display => $session->form->process("display") || 1,
viewScreenTitle => $session->form->process("viewScreenTitle") || 0,
fieldInOtherThingId => $session->form->process("fieldInOtherThingId") || "",
);
# Get the field's data type
$dbDataType = $self->_getDbDataType($properties{fieldType});
if ($fieldId eq "new") {
$properties{dateCreated} = time();
$properties{createdBy} = $self->session->user->userId;
$properties{createdBy} = $session->user->userId;
$newFieldId = $self->addField(\%properties,0,$dbDataType);
}
else{
$properties{dateUpdated} = time();
$properties{updatedBy} = $self->session->user->userId;
$properties{updatedBy} = $session->user->userId;
# Check if column has to be altered for existing fields.
$self->_updateFieldType($fieldType,$fieldId,$thingId,$self->get('assetId'),$dbDataType);
$newFieldId = $self->setCollateral("Thingy_fields","fieldId",\%properties,1,1,"thingId",$thingId);
@ -2290,13 +2291,13 @@ sub www_editFieldSave {
$listItemHTML = "<table>\n<tr>\n<td style='width:100px;' valign='top' class='formDescription'>".$label."</td>\n"
."<td style='width:370px;'>".$formElement."</td>\n"
."<td style='width:120px;' valign='top'> <input onClick=\"editListItem('".$self->session->url->page()
."<td style='width:120px;' valign='top'> <input onClick=\"editListItem('".$session->url->page()
."?func=editField;fieldId=".$newFieldId.";thingId=".$properties{thingId}."','".$newFieldId."')\" value='".$i18n->get('Edit','Icon')."' type='button'>"
."<input onClick=\"deleteListItem('".$self->session->url->page()."','".$newFieldId
."<input onClick=\"deleteListItem('".$session->url->page()."','".$newFieldId
."','".$properties{thingId}."')\" value='".$i18n->get('Delete','Icon')."' type='button'></td>\n</tr>\n</table>";
# Make sure we send debug information along with the field.
$session->log->preventDebugOutput;
$log->preventDebugOutput;
$session->output->print($newFieldId.$listItemHTML);
return "chunked";

View file

@ -594,23 +594,27 @@ sub _splitMysql
@hash{ qw( year month day hour minute second ) }
= $string =~ m{
(\d+) # Year
^
\D*
(\d+) # Month
\D*
(\d+) # Day
(?: \D*
(\d+) # Hours
\D*
(\d+) # Minutes
\D*
(\d+) # Seconds
(\d{1,4}) # Year
\D+
(\d{1,2}) # Month
\D+
(\d{1,2}) # Day
(?: \D+
(\d{1,2}) # Hours
\D+
(\d{1,2}) # Minutes
\D+
(\d{1,2}) # Seconds
)?
\D*
$
}x;
foreach my $unit (qw/hour minute second/) {
$hash{$unit} = 0 if ($hash{$unit} eq '');
}
$hash{ hour } ||= 0;
$hash{ minute } ||= 0;
$hash{ second } ||= 0;
return %hash;
}

View file

@ -217,13 +217,14 @@ sub toHtml {
$value = $self->set("value",'');
}
else {
$value = WebGUI::DateTime->new($session, $self->getOriginalValue)->toMysqlDate;
$value = eval { WebGUI::DateTime->new($session, $self->getOriginalValue)->toMysqlDate; };
$value = WebGUI::DateTime->new($session,0)->toMysqlDate if $value eq '';
}
my $style = $session->style;
my $url = $session->url;
$style->setLink($url->extras('yui/build/calendar/assets/skins/sam/calendar.css'), { rel=>"stylesheet", type=>"text/css", media=>"all" });
$style->setScript($url->extras('/yui/build/utilities/utilities.js'), { type => 'text/javascript' });
$style->setScript($url->extras('yui/build/utilities/utilities.js'), { type => 'text/javascript' });
$style->setScript($url->extras('yui/build/json/json-min.js'), { type => 'text/javascript' });
$style->setScript($url->extras('yui/build/yahoo/yahoo-min.js'), { type => 'text/javascript' });
$style->setScript($url->extras('yui/build/dom/dom-min.js'), { type => 'text/javascript' });

View file

@ -220,9 +220,9 @@ Renders a date picker control.
sub toHtml {
my $self = shift;
my $session = $self->session;
my $value = WebGUI::DateTime->new($session, $self->getOriginalValue)
->set_time_zone($self->get("timeZone"))
->strftime("%Y-%m-%d %H:%M:%S");
my $value = eval { WebGUI::DateTime->new($session, $self->getOriginalValue); };
$value = WebGUI::DateTime->new($session,0) if $value eq '';
$value = $value->set_time_zone($self->get("timeZone"))->strftime("%Y-%m-%d %H:%M:%S");
my $style = $session->style;
my $url = $session->url;

View file

@ -386,8 +386,8 @@ sub www_addFolderSave {
title => $filename,
menuTitle => $filename,
url => $base->getUrl.'/'.$filename,
groupIdEdit => $session->form->process('groupIdEdit') || $base->get('groupIdEdit'),
groupIdView => $session->form->process('groupIdView') || $base->get('groupIdView'),
groupIdEdit => $base->get('groupIdEdit'),
groupIdView => $base->get('groupIdView'),
ownerUserId => $session->user->userId,
startDate => $base->get('startDate'),
endDate => $base->get('endDate'),
@ -410,6 +410,7 @@ sub www_addFolderSave {
className => 'WebGUI::Asset::Wobject::Folder',
#filename => $filename,
});
WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, { allowComments => 0 });
$session->http->setRedirect($base->getUrl('op=formHelper;class=HTMLArea;sub=imageTree'));
return undef;
}
@ -495,6 +496,7 @@ sub www_addImageSave {
$child->update({url => $child->fixUrl});
$child->applyConstraints;
}
WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, { allowComments => 0 });
$session->http->setRedirect($base->getUrl('op=formHelper;class=HTMLArea;sub=imageTree'));
return undef;
}

View file

@ -265,7 +265,8 @@ The status of this item. The default is 'NotShipped'. Other statuses include: Ca
sub update {
my ($self, $newProperties) = @_;
my $id = id $self;
my $session = $self->transaction->session;
my $transaction = $self->transaction;
my $session = $transaction->session;
my $taxDriver = WebGUI::Shop::Tax->getDriver( $session );
if (exists $newProperties->{item}) {
@ -296,7 +297,7 @@ sub update {
$newProperties->{ taxConfiguration } =
to_json( $taxDriver->getTransactionTaxData( $sku, $address ) || '{}' );
unless ($sku->isShippingRequired) {
if (!$sku->isShippingRequired && $transaction->get('isSuccessful')) {
$newProperties->{orderStatus} = 'Shipped';
}
}
@ -310,7 +311,7 @@ sub update {
if (exists $newProperties->{options} && ref($newProperties->{options}) eq "HASH") {
$properties{$id}{options} = JSON->new->encode($newProperties->{options});
}
$properties{$id}{lastUpdated} = WebGUI::DateTime->new($self->transaction->session,time())->toDatabase;
$properties{$id}{lastUpdated} = WebGUI::DateTime->new($session,time())->toDatabase;
$self->transaction->session->db->setRow("transactionItem","itemId",$properties{$id});
}

View file

@ -159,6 +159,7 @@ Factored out into a separate subroutine for the sake of testability.
sub getSql {
# Use a left outer join on userProfileData so that we still get back responses for users that have been deleted
return <<END_SQL;
select
r.Survey_responseId, r.username, r.userId, r.startDate,
@ -166,7 +167,7 @@ select
s.timeLimit, s.doAfterTimeLimit,
ad.title, ad.url
from
Survey_response r, Survey s, assetData ad, userProfileData upd
Survey_response r left outer join userProfileData upd on r.userId = upd.userId, Survey s, assetData ad
where
r.isComplete = 0
and s.timeLimit > 0
@ -175,7 +176,6 @@ where
and ad.assetId = s.assetId
and ad.revisionDate = s.revisionDate
and s.revisionDate = r.revisionDate
and upd.userId = r.userId
END_SQL
}

View file

@ -9,8 +9,8 @@ our $I18N = {
},
'allow attachments help' => {
lastUpdated => 0,
message => q|?|,
context => "The number of attachments that are allowed to be placed on each wiki page."
message => q|The number of attachments that are allowed to be placed on each wiki page.|,
context => "Hover help for edit form.",
},
'assetName' => { lastUpdated => 1160157064, message => 'Wiki' },
'asset description' => { lastUpdated => 1160157064, message => q|A wiki is a collaborative content publishing mechanism. Traditionally wiki's use the wiki markup language, but that's generally not much easier to deal with than HTML, so WebGUI's wiki instead just uses a rich editor to help users publish rich great looking content.| },

View file

@ -621,6 +621,12 @@ our $I18N = {
context => q|field label|
},
'Status' => {
message => q|Status|,
lastUpdated => 0,
context => q|Whether a transaction was successful, or not.|
},
'payment method' => {
message => q|Payment Method|,
lastUpdated => 0,
@ -1695,6 +1701,17 @@ our $I18N = {
context => q|commerce setting help|
},
'Success' => {
message => q|Success|,
lastUpdated => 0,
context => q|commerce setting help|
},
'Failed' => {
message => q|Failure|,
lastUpdated => 0,
context => q|commerce setting help|
},
};

View file

@ -63,15 +63,14 @@ $testGroups{'canEdit asset'} = WebGUI::Group->new($session, 'new');
$testUsers{'canEdit group user'} = WebGUI::User->new($session, 'new');
$testUsers{'canEdit group user'}->addToGroups([$testGroups{'canEdit asset'}->getId]);
$testUsers{'canEdit group user'}->username('Edit Group User');
WebGUI::Test->groupsToDelete($testGroups{'canEdit asset'});
addToCleanup($testGroups{'canEdit asset'});
##A group and user for groupIdEdit
$testGroups{'canAdd asset'} = WebGUI::Group->new($session, 'new');
$testUsers{'canAdd group user'} = WebGUI::User->new($session, 'new');
$testUsers{'canAdd group user'}->addToGroups([$testGroups{'canAdd asset'}->getId]);
$testUsers{'canEdit group user'}->username('Can Add Group User');
WebGUI::Test->groupsToDelete($testGroups{'canAdd asset'});
WebGUI::Test->usersToDelete(values %testUsers);
addToCleanup($testGroups{'canAdd asset'}, values %testUsers);
my $canAddMaker = WebGUI::Test::Maker::Permission->new();
$canAddMaker->prepare({
@ -104,7 +103,7 @@ $properties = {
};
my $versionTag2 = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->tagsToRollback($versionTag2);
addToCleanup($versionTag2);
my $canEditAsset = $rootAsset->addChild($properties, $properties->{id});
@ -120,7 +119,7 @@ $canEditMaker->prepare({
});
my $versionTag3 = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->tagsToRollback($versionTag3);
addToCleanup($versionTag3);
$properties = {
# '1234567890123456789012'
id => 'canViewAsset0000000010',
@ -153,7 +152,7 @@ $canViewMaker->prepare(
},
);
plan tests => 116
plan tests => 126
+ scalar(@fixIdTests)
+ scalar(@fixTitleTests)
+ 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle
@ -303,7 +302,7 @@ $session->{_request} = $origRequest;
################################################################
my $versionTag = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->tagsToRollback($versionTag);
addToCleanup($versionTag);
$versionTag->set({name=>"Asset tests"});
$properties = {
@ -744,7 +743,7 @@ $product3->purge;
################################################################
my $versionTag4 = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->tagsToRollback($versionTag4);
addToCleanup($versionTag4);
$versionTag4->set( { name => 'inheritUrlFromParent tests' } );
$properties = {
@ -890,7 +889,6 @@ $session->log->warn('parent asset is now committed');
is( $testVersionTag->get('isCommitted'), 1, 'parent asset is now committed' );
$childVersionTag = WebGUI::VersionTag->new( $session, $childAsset->get('tagId') );
$session->log->warn('child asset is now committed');
is( $childVersionTag->get('isCommitted'), 1, 'child asset is now committed' );
################################################################
@ -901,12 +899,58 @@ is( $childVersionTag->get('isCommitted'), 1, 'child asset is now committed' );
my $assetToCommit = $defaultAsset->addChild({ className => 'WebGUI::Asset::Snippet', title => 'Snippet to commit and clone from db', });
my $cloneTag = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->tagsToRollback($cloneTag);
addToCleanup($cloneTag);
$cloneTag->commit;
is($assetToCommit->get('status'), 'pending', 'cloneFromDb: local asset is still pending');
$assetToCommit = $assetToCommit->cloneFromDb;
is($assetToCommit->get('status'), 'approved', '... returns fresh, commited asset from the db');
################################################################
#
# checkView
#
################################################################
my $trashedAsset = $defaultAsset->addChild({
className => 'WebGUI::Asset::Snippet', title => 'Trashy',
});
my $clippedAsset = $defaultAsset->addChild({
className => 'WebGUI::Asset::Snippet', title => 'Clippy',
});
my $checkTag = WebGUI::VersionTag->getWorking($session);
$checkTag->commit;
addToCleanup($checkTag);
$trashedAsset = $trashedAsset->cloneFromDb;
$clippedAsset = $clippedAsset->cloneFromDb;
$trashedAsset->trash;
$clippedAsset->cut;
is $trashedAsset->get('state'), 'trash', 'checkView setup: trashed an asset';
is $clippedAsset->get('state'), 'clipboard', '... clipped an asset';
$session->var->switchAdminOff;
$session->http->setRedirectLocation('');
$session->http->setStatus(200, 'OK');
$trashedAsset->checkView();
is $session->http->getStatus, 410, '... status set to 410 for trashed asset';
is $session->http->getRedirectLocation, '', '... no redirect set';
$session->http->setStatus(200, 'OK');
$clippedAsset->checkView();
is $session->http->getStatus, 410, '... status set to 410 for cut asset';
is $session->http->getRedirectLocation, '', '... no redirect set';
$session->var->switchAdminOn;
$session->http->setStatus(200, 'OK');
is $trashedAsset->checkView(), 'chunked', '... returns "chunked" when admin is on for trashed asset';
is $session->http->getRedirectLocation, $trashedAsset->getUrl('func=manageTrash'), '... trashed asset sets redirect to manageTrash';
$session->http->setRedirectLocation('');
is $clippedAsset->checkView(), 'chunked', 'checkView: returns "chunked" when admin is on for cut asset';
is $session->http->getRedirectLocation, $clippedAsset->getUrl('func=manageClipboard'), '... cut asset sets redirect to manageClipboard';
##Return an array of hashrefs. Each hashref describes a test
##for the fixId method.

View file

@ -20,7 +20,7 @@ use Data::Dumper;
use WebGUI::Test;
use WebGUI::Session;
use Test::More tests => 21; # increment this value for each test you create
use Test::More tests => 22; # increment this value for each test you create
use Test::Deep;
use WebGUI::Asset::Wobject::SyndicatedContent;
use XML::FeedPP;
@ -162,9 +162,6 @@ $cache->set($rssContent, 60);
my $filteredFeed = $syndicated_content->generateFeed();
use Data::Dumper;
diag Dumper($filteredFeed->get_item());
cmp_deeply(
[ map { $_->title } $filteredFeed->get_item() ],
[
@ -176,3 +173,34 @@ cmp_deeply(
);
$cache->delete;
####################################################################
#
# Odd feeds
#
####################################################################
##Feed with no links or pubDates.
my $oncpUrl = 'http://www.oncp.gob.ve/oncp.xml';
$syndicated_content->update({
rssUrl => $oncpUrl,
hasTerms => '',
maxHeadlines => 50,
});
my $cache = WebGUI::Cache->new($session, $oncpUrl, 'RSS');
open my $rssFile, '<', WebGUI::Test->getTestCollateralPath('oncp.xml')
or die "Unable to get RSS file: oncp.xml";
my $rssContent = do { local $/; <$rssFile>; };
close $rssFile;
$cache->set($rssContent, 60);
my $oddFeed1 = $syndicated_content->generateFeed();
my @oddItems = $oddFeed1->get_item();
is (@oddItems, 13, 'feed has items even without pubDates or links');
$cache->delete;

View file

@ -26,7 +26,7 @@ my $session = WebGUI::Test->session;
# put your tests here
plan tests => 25;
plan tests => 28;
my $timeZoneUser = addUser($session);
@ -84,6 +84,13 @@ is(
'... has correct epoch'
);
my $badday = eval { WebGUI::DateTime->new($session, '2001-08-161'); };
ok($@, 'new croaks on a bad date');
my $badday = eval { WebGUI::DateTime->new($session, '2001-08-16 99:99:99'); };
ok($@, 'new croaks on an out of range time');
my $badday = eval { WebGUI::DateTime->new($session, '2001-08-16 99:199:99'); };
ok($@, 'new croaks on an illegal time');
sub addUser {
my $session = shift;
my $user = WebGUI::User->new($session, "new");
@ -92,6 +99,6 @@ sub addUser {
##so the test will not fail in the summer
$user->profileField("timeZone","America/Hermosillo");
$user->username("Time Zone");
WebGUI::Test->usersToDelete($user);
addToCleanup($user);
return $user;
}

View file

@ -50,7 +50,7 @@ my $testBlock = [
my $formType = 'date';
my $numTests = 25 + scalar @{ $testBlock } ;
my $numTests = 26 + scalar @{ $testBlock } ;
plan tests => $numTests;
@ -141,6 +141,14 @@ is(
'2008-08-01',
"toHtml: defaultValue in epoch format, returns date in mysql format"
);
$date2 = WebGUI::Form::Date->new($session, {defaultValue => '2008-008-001'});
is(
getValueFromForm($session, $date2->toHtml),
'1970-01-01',
"toHtml: defaultValue in bad mysql format returns date from epoch 0"
);
$date2 = WebGUI::Form::Date->new($session, {defaultValue => -1});
is($date2->getValueAsHtml(), '12/31/1969', "getValueAsHtml: defaultValue as negative epoch, returns in users's format");

View file

@ -29,7 +29,7 @@ my $session = WebGUI::Test->session;
my $formType = 'datetime';
my $numTests = 34;
my $numTests = 35;
plan tests => $numTests;
@ -182,6 +182,12 @@ is(
'2001-08-16 08:00:00',
"toHtml: defaultValue in mysql format, value as mysql returns date in mysql format, adjusted for time zone"
);
$date2 = WebGUI::Form::DateTime->new($session, {defaultValue => '2008-081-01 11:34:26',});
is(
getValueFromForm($session, $date2->toHtml),
'1969-12-31 18:00:00',
"toHtml: defaultValue in bad mysql format, returns value from epoch 0, adjusted for user time zone"
);
sub getValueFromForm {
my ($session, $textForm) = @_;

View file

@ -13,7 +13,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
plan tests => 25;
plan tests => 26;
use_ok('WebGUI::Workflow::Activity::ExpireIncompleteSurveyResponses');
@ -127,6 +127,13 @@ $session->db->write('update Survey_response set endDate = 0, isComplete = 0 wher
# Make sure SQL only returns 1 incomplete response
is( scalar $session->db->buildArray($SQL), 1, 'Make sure SQL only returns 1 incomplete response');
##
# Make sure workflow handles responses for deleted users
#
$session->db->write('update Survey_response set userId = ? where Survey_responseId = ?', ['not-a-user-id', $responseId]);
is( scalar $session->db->buildArray($SQL), 1, 'Still returns 1 row, even though user does not exist (sql left outer join)');
$session->db->write('update Survey_response set userId = ? where Survey_responseId = ?', [$user->getId, $responseId]);
##
# Delete Expired
##

View file

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0"><channel>
<title><![CDATA[Oficina Nacional de Crédito Público]]></title>
<link>http://www.oncp.gob.ve</link>
<description>Información Financiera</description>
<language>es-ve</language>
<copyright>Oficina Nacional de Crédito Público - 2009</copyright>
<image>
<title>Oficina Nacional de Crédito Público</title>
<url>http://www.oncp.gob.ve/data/themes/digital//banner/oncp.png</url>
<link>http://www.oncp.gob.ve</link>
</image>
<item>
<title><![CDATA[Deuda Interna I Sem 09 / MM US$ 20.441]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[MM US$ 20.441]]></description>
<guid isPermaLink="true">http://www.oncp.gob.ve</guid>
</item>
<item>
<title><![CDATA[Deuda Externa I Sem 09 / MM US$ 29.894]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[MM US$ 29.894]]></description>
</item>
<item>
<title><![CDATA[Tasa Pasiva / 14,52%]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[14,52%]]></description>
</item>
<item>
<title><![CDATA[Tasa Activa / 19,56%]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[19,56%]]></description>
</item>
<item>
<title><![CDATA[Variación PIB II Trimestre / -2,4%]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[-2,4%]]></description>
</item>
<item>
<title><![CDATA[PIB II Trimestre 2009 / M BsF 13.979.77]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[M BsF 13.979.77]]></description>
</item>
<item>
<title><![CDATA[Unidad Tributaria / BsF. 55,00]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[BsF. 55,00]]></description>
</item>
<item>
<title><![CDATA[Cesta Venezolana / US$ 65,32]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[US$ 65,32]]></description>
</item>
<item>
<title><![CDATA[Cesta OPEP / US$ 67,92]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[US$ 67,92]]></description>
</item>
<item>
<title><![CDATA[Variación Acumuladaa / 15,6%]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[15,6%]]></description>
</item>
<item>
<title><![CDATA[IPC Variación Agosto 2009 / 2,2%]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[2,2%]]></description>
</item>
<item>
<title><![CDATA[Reservas Internacionales con BCV + FEM / MM US$ 33.213 (32.384 + 829)]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[MM US$ 33.213 (32.384 + 829)]]></description>
</item>
<item>
<title><![CDATA[Variación Acumulada / 15,6%]]></title>
<link>http://www.oncp.gob.ve</link>
<description><![CDATA[15,6%]]></description>
</item>
</channel>
</rss>

View file

@ -1,3 +1,464 @@
Version 3.2.7 (2009-09-22)
Fixed bug where uppercase paragraphs could still produce an invalid DOM tree on IE.
Fixed bug where split command didn't work on WebKit since the node serializer needs a real document to work with.
Fixed bug where it was impossible in Gecko to place the caret before a table if it was the first one.
Fixed bug where linking to urls like ../../ would produce an extra traling slash ../..//.
Fixed bug where the template cdate functionality was using an old 2.x API call. Patch contributed by vectorjohn.
Fixed bug where urls to the same site but different protocol would be converted when relative_urls where set to false. Patch contributed by Ted Rust.
Fixed bug where the paste plugin would remove mceItem prefixed classes.
Fixed bug where the paste plugin would sometimes add items in a reverse order on WebKit.
Fixed bug where the paste buttons would present an error message on Gecko even if you changed user.js. Patch contributed by Todd (teeaykay).
Fixed bug where Opera would crash if you had tables incorrectly placed inside paragraphs.
Fixed bug where styles elements wasn't properly processed if you had bad input HTML.
Fixed bug where style attributes wasn't properly forced into a specific format.
Fixed bug and issues with boolean attributes like checked, nowrap etc.
Fixed bug where input elements could override attributes on form elements.
Fixed bug where script or style elements could get modified by the DOMUtils processHTML method.
Fixed bug where the selected attribute could get lost when force root blocks logic got executed on IE. Patch contributed by Attila Mezei-Horvati.
Fixed bug where getAttribs method didn't handle boolean attributes correctly on IE.
Fixed so the paste from word dialog is presented if you paste content on an IE with to restrictive security settings.
Fixed so the paste_strip_class_attributes option is set to none by default in the paste plugin.
Removed default border=0 on tables for the default value of valid_elements.
Version 3.2.6 (2009-08-19)
Added new wordcount plugin, this will display the number of typed words as you write. Contributed by Andrew Ozz.
Added new getNext and getPrev methods to DOM utils. These will return the first matching sibling.
Fixed bug where it was impossible to place the caret after a table on Gecko. It will now add a paragraph after tables.
Fixed bug where inline dialogs would fail if used in a window opened using a showModalDialog. Patch contributed by Derek Britt.
Fixed bug where IE could sometimes render a unknown runtime error on invalid input HTML.
Fixed bug where some incorrectly placed tables wouldn't be moved outside the paragraphs on IE.
Fixed bug where uppercase script/style element wouldn't be handled correctly and converted to valid lowercase.
Fixed bug where some WebKit versions on Mac OS X would produce issues with hidden select fields.
Fixed bug where the media plugin would fail on WebKit since the node wasn't properly imported to the right document.
Fixed bug where absolute URLs for the TinyMCE script using a base href element would cause loading problems in IE 6/7.
Fixed bug where pasting using the paste plugin wasn't possible on IE with to restrictive security settings.
Fixed bug where pasting of whitespace was impossible using the new custom paste method.
Fixed bug where pasting on some WebKit browsers would not work if you pasted specific contents due to a WebKit bug.
Fixed bug where doctypes with multiple lines would not be parsed correctly by the fullpage plugin. Patch contributed by Colin.
Fixed bug where the autoresize plugin would break the fullscreen functionality.
Fixed bug where tables would be chopped up running on IE using invalid contents and pasting paragraphs into a cell.
Fixed bug where the each method of jQuery build didn't iterate styleSheets. We now use the TinyMCE API one instead.
Fixed bug where auto switching to paragraphs after headers some times failed in Gecko.
Fixed so all editor options gets passed to the Serializer class. Patch contributed by Jasper Mattsson.
Fixed so script/style blocks isn't wrapped in paragraphs as other inline elements.
Fixed so the XHR requests sends the X-Requested-With HTTP header.
Fixed so the data url scheme is handled in the tinymce.util.URI class.
Changed inline documentation to use moxiedoc style comments.
Removed the compat2x plugin people should have upgraded to the 3.x API by now. 3.0 was released more then a year ago.
Re-added Gecko specific message for users who doesn't understand the security concept regarding paste.
Version 3.2.5 (2009-06-29)
Added new jQuery plugin for the jQuery specific package. This enables you to more easily load and use TinyMCE.
Added new autoresize plugin contributed by Peter Dekkers. This plugin will auto resize the editor to the size of the contents.
Fixed so all packages have the same directory structure. Previous releases had a different structure for the production package.
Fixed so the paste from word dialog forces the contents to be processed as word contents even if it's not.
Fixed so the jQuery build adapter build works. It's currently only excluding Sizzle.
Fixed so noscript element contents is retained during the editing process.
Fixed bug where the getBookmark method would need a "simple" string input when the documented way is a boolean.
Fixed bug where invalid contents could break the fix_table_elements logic.
Fixed bug where Sizzle specific attributes would be serialized if the valid_elements was set to *[*].
Fixed bug where IE would produce an error if you specified a relative content_css and opened the paste dialog.
Fixed bug where pasting images on IE would produce broken images if they came from an external site.
Fixed bug where memory was leaked if you add/remove controls dynamically. Some event handlers wasn't removed properly.
Fixed bug where domain relaxing wasn't treated correctly if you added it after the TinyMCE script element.
Fixed bug where the activeEditor wasn't set to null if the last editor instance was removed.
Fixed bug where IE was leaking memory on the onbeforeunload event due to some recently introduced logic. Patch contributed by Options.
Fixed bug where inserting tables in Safari 4 didn't work due to a new WebKit bug where some element names are reserved.
Fixed bug where URLs having a :// value in the query string would make it absolute regardless of URL settings.
Fixed the WebKit specific bug where DOM Ranges would fail if the node wasn't attached to something in a different way.
Removed the auto_resize option and the resizeToContent method from the tinymce.Editor class. Use the new autoresize plugin instead.
Version 3.2.4.1 (2009-05-25)
Fixed bug where Gecko browsers would produce an extra space after for example strong when loaded from sub domains.
Fixed bug where script elements would be removed if they where placed inside a paragraph element.
Fixed bug where IE 8 would produce 1 item remaining when loading CSS files dynamically with an empty cache.
Fixed bug where bound events would be removed from other editor instances if a specific one was removed.
Fixed various bugs and issues with script and style elements inside the editor.
Fixed so all script contents gets wrapped in CDATA sections so that they can be parsed using a XML parser.
Fixed so it's impossible for elements marked as closed to have child nodes rendered in output.
Version 3.2.4 (2009-05-21)
Added new paste_remove_styles/paste_remove_styles_if_webkit option to paste plugin concept contributed by Hadrien Gardeur.
Added new functionality to paste plugin contributed by Scott Eade aka monkeybrain.
Added new paste_block_drop option to the paste plugin this is disabled by default and will block any drag/drop event.
Added new bind/unbind methods to DOMUtils these works like Event.add/Event.remove but is easier to access.
Added new paste_dialog_width/paste_dialog_height options to paste pluign. Enables you to change the dialog sizes.
Fixed bug on IE 8 where it would sometimes produce a "1 item remaining" status message that would never finish.
Fixed bug on Safari 4 beta that would produce DOM Range exceptions on the DOMUtils split method since the browser has a bug.
Fixed bug where the paste plugin could accidentally think that some word sentences was supposed to be list elements.
Fixed bug where paste plugin would produce one extra empty undo level on some browsers.
Fixed bug where spans wasn't produced correctly on new line when the keep_styles option was enabled.
Fixed bug where the caret would be placed at the beginning of contents in IE 8 if you selected colors from the color pickers.
Fixed so the Event class is a normal class instead of a static one. The tinymce.dom.Event is now a global instance of that class.
Fixed so internal events for instances gets removed when the DOMUtils instance is removed.
Fixed so preventDefault and stopPropagation methods can be used on the event object in all browsers.
Version 3.2.3.1 (2009-05-05)
Fixed bug where paragraphs containing form elements such as input or textarea would be removed.
Fixed bug where some IE versions would produce a wrapper function for events attributes.
Fixed bug where table cell contents could be removed if you pressed return/enter at the end of the cell contents.
Fixed bug where the paste plugin would remove a extra character if the selection range was collapsed.
Fixed bug where creating tables with % width wouldn't be handled correctly on WebKit browsers.
Version 3.2.3 (2009-04-23)
Added new paste plugin logic. This new version will autodetect Word contents and clean it up.
Added a optional root element argument to getPos so you can tell it where to stop the calculation.
Added new DOM ready logic to remove the usage of document.write. We now use basically the same method as jQuery.
Fixed bug where WebKit browsers would fail when selecting all contents in the area using Ctrl+A.
Fixed bug where IE would produce paragraphs with empty inline style elements.
Fixed bug where WebKit browsers would fail when inserting tables with a non pixel width.
Fixed bug where block elements could get a redundant br element at the end of the element.
Fixed bug where the tabfocus plugin only worked with a single editor instance on page.
Fixed bug where IE 8 was loosing caret position if the selection was collapsed and a menu was clicked.
Fixed bug with application/xhtml+xml mode where menus wasn't working properly.
Fixed bug where the onstop workaround fix for IE would produce errors in an ASP update panel.
Fixed bug where the submit function override could produce errors if executed in the wrong scope.
Fixed bug where the area element wasn't closed by a short ending.
Fixed various number issues in the style plugins properties dialog. Contributed by datpaulchen.
Fixed issues with size suffix values in the style plugin dialog.
Fixed issue where hasDuplicate variable would leak out to the global space due to a bug in the Sizzle engine.
Fixed issue where the paste event would fire a dialog warning on IE since we extracted the text contents.
Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.
Version 3.2.2.3 (2009-03-26)
Fixed regression bug with the getPos method, it would return invalid if the view port was to small.
Version 3.2.2.2 (2009-03-25)
Fixed so the DOMUtils getPos method can be used cross documents if needed.
Fixed bug where undo/redo wasn't working correctly in Gecko browsers.
Version 3.2.2.1 (2009-03-19)
Added support for tel: URL prefixes. Even though this doesn't match any official RFC.
Fixed so the select method of the Selection class selects the first best suitable contents.
Fixed bug where the regexps for www. prefixes for link and advlink dialogs would match wwwX.
Fixed bug where the preview dialog would fail to open if the content_css wasn't defined. Patch contributed by David Bildström (ChronoZ).
Fixed bug where editors wasn't converted in application/xhtml+xml mode due to an issue with Sizzle.
Fixed bug where alignment would fail if multiple lines where selected.
Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.
Version 3.2.2 (2009-03-05)
Added new CSS selector engine. Sizzle the same one that jQuery and other libraries are using.
Added new is and getParents methods to the DOMUtils class. These use the new Sizzle engine to select elements.
Added new removeformat_selector option, enables you to specify a CSS selector pattern of elements to remove when using removeformat.
Fixed so the getParent method can take CSS expressions when selecting it's parents.
Added new ant based build process, includes a new javabased preprocessor and a yuicompressor ant task.
Moved the tab_focus logic into a plugin called tabfocus, so the old tab_focus option has been removed from the core.
Replaced the TinyMCE custom unit testing framework with Qunit and rewrote all tests to match the new logic.
Moved the examples/testcases to a root directory called tests since it now includes slickspeed.
Fixed bug where nbsp wasn't replaced correctly in ForceBlocks.js. Patch contributed by thorn.
Fixed bug where an dom exception would be thrown in Gecko when the theme_advanced_path path was set to false under xml application mode.
Fixed bug where it was impossible to get out of a link at the end of a block element in Gecko.
Fixed bug where the latest WebKit nightly would fail when changing font size and font family.
Fixed bug where the latest WebKit nightly would fail when opening dialogs due to changes to the arguments object.
Fixed bug where paragraphs wasn't added to elements positioned absolute using classes.
Fixed bug where font size values with dot's like 1.4em would produce a class instead of the style value.
Fixed bug where IE 8 would return an incorrect position for elements.
Fixed bug where IE 8 would render colorpicker/filepicker icons incorrectly.
Fixed bug where trailing slashes for directories in URLs would be removed.
Fixed bug where autostart and other boolean values in the media dialog wouldn't be stored/parsed correctly.
Fixed bug where the repaint call for the media plugin wouldn't be executed due to a typo in the source.
Fixed bug where id attribute of object elements wasn't kept intact by the media plugin.
Fixed bug where preview of embeded elements when the media_use_script option was used would fail.
Fixed bug where inlinepopups could be rendered at an incorrect location on IE 6 while dragging.
Fixed bug where the blocker shim could be placed at an incorrect location on IE 6.
Fixed bug where the multiple and size attributes of select elements would produce incorrect values while running in IE.
Fixed bug where IE would loose the caret position is you selected a color from the color drop down.
Fixed bug where remove format wouldn't work on IE since it couldn't remove span elements that had style information.
Fixed bug where Opera was removing links when removing formatting from selected contents.
Fixed bug where paragraphs could be produced inside non positional elements styled with the CSS position value of static.
Fixed bug where removeformat wouldn't work if you selected part of a span in IE.
Fixed bug where media plugin didn't retain the style attribute on embed/object elements.
Fixed bug where auto focus on empty editor instances could produce strange results if you inserted an image into it.
Fixed bug where &nbsp; characters would be removed in FF when inserted with the mceInsertContent or selection.setContent methods.
Fixed bug where warning message of missing paste support wasn't displayed on WebKit browsers.
Fixed bug where anchor links could include other links. The selected range is now unlinked before adding news links to it.
Fixed memory leak when TinyMCE was used with prototype. Patch contributed by James Ots.
Fixed so the non documented fullpage_hide_in_source_view option for the fullpage plugin works again in the 3.x branch.
Fixed so tables doesn't get inserted into paragraphs by default since it's not W3C valid. Can be disabled by using the fix_table_elements option.
Fixed so the source view dialog sets a source_view state to the event object. Enables plugins to intercept the source view mode.
Fixed various validation issues with the html dialogs and pages.
Removed ask mode option since there is way better ways of doing this now. Use the add/remove control methods instead.
Removed logic for compatibility with Safari 2.x, this browser is no longer supported since no one is using it.
Removed the auto domain relaxing feature. If loading scripts cross sub domains it's better to specify the document.domain by hand.
Version 3.2.1.1 (2008-11-27)
Added new theme_advanced_default_background_color/theme_advanced_default_foreground_color options. Patch contributed by David Bildström (ChronoZ).
Fixed font style formatting compatibility issue with Adobe Air.
Fixed so legacy font elements get converted into spans even if cleanup_on_startup isn't enabled.
Fixed bug where pre elements could be incorrectly modified by an IE bug workaround. Patch contributed by hu vime.
Fixed bug where input elements inside inlinepopups wasn't editable in Firefox 2.
Fixed bug where the xhtmlxtras plugin wasn't replacing attribute values correctly.
Fixed bug where menu buttons in skin variants would look strange due to IE 8 fixes.
Fixed bug where WebKit browsers would on backspace take you back to the previous page if the editor was empty.
Fixed bug where DOMUtils decode method wouldn't handle strings larger than 4096kb due to node chunking.
Fixed bug where meta key wasn't handled as ctrl key on Mac OS X for custom keyboard short cuts.
Fixed bug where init event would get fired twice on WebKit on Mac OS X.
Version 3.2.1 (2008-11-04)
Added support for custom icon image for drop menus. Use icon_src to set a custom image directly.
Added new media_strict option to media plugin. Enables you to control if the flash embed is strict or not. Enabled by default.
Fixed so the editors script files gets dynamically loaded without using XHR or eval.
Fixed so the media plugin outputs valid XHTML object elements for Flash movies. Can be disabled with the media_strict option.
Fixed so dynamic loading doesn't require eval calls on non IE browsers for better Air support.
Fixed bug where the editor wasn't treated as empty if the remaining paragraph had attributes.
Fixed bug where id's of elements was removed ones they got wrapped in paragraphs. Patch contributed by ChronoZ.
Fixed bug where WebKit browsers where placing list elements inside paragraph elements.
Fixed bug where inserting images or links would produce absolute urls on WebKit browsers.
Fixed bug where values for checked, readonly, disabled and selected attributes was incorrect on IE.
Fixed bug where positive values for checked, readonly, disabled and selected attributes wasn't forced to valid values.
Fixed bug where selecting the first option in a native select box would produce an undefined error.
Fixed bug where tabindex 32768 could be outputted on IE if element attributes where cloned.
Fixed bug where the media dialogs preview window would display incorrect contents due to duplicate clsid prefixes.
Fixed bug where non pixel or percent heights for textarea elements would produce errors on IE.
Fixed bug where cdata sections in script elements wasn't handled correctly.
Fixed bug where nowrap of table cells would produce a 65535 value output.
Fixed bug where media plugin would produce an error if you selected the first item in the items list.
Fixed bug where media plugin would modify links with the item _value in them.
Fixed so table width/height is better forced if inline_styles is enabled. Patch contributed by daKmoR.
Fixed css for IE 8 such as opacity and other rendering quirks.
Version 3.2.0.2 (2008-10-02)
Fixed bug where the SelectBox and NativeSelectBox wasn't updated correctly if undefined was passed to them.
Fixed bug where the style dropdown wasn't correctly changed back to it's original state when element had no class.
Fixed bug where multiple pending font styles wasn't handled correctly.
Fixed so you can disable all auto css loading for dialogs by setting the popups_css option to false.
Version 3.2.0.1 (2008-09-17)
Fixed bug where font sizes and faces wouldn't be changed correctly when there was a parent with a different style.
Fixed bug where adding fonts to the same selection would produce redundant spans.
Version 3.2 (2008-09-11)
Added new text style support, it will now use span elements internally instead of font elements.
Added new improved support for the theme_advanced_font_sizes option, check the Wiki for details.
Added new keep_style setting that maintains the text style on return/enter on non IE browsers, enabled by default.
Added new onBeforeSetContent/onBeforeGetContent/onSetContent/onGetContent events to the Selection class.
Added new selectByIndex method to ListBox class. This enables you to select list items by an index instead of a value.
Added new possibility to the select method of the ListBox class. This can now have a selector function as it's value argument.
Added new possibility to skip the loading of popups css by setting the feature popup_css to the value false.
Added new possibility to skip translation of popups by setting the translate_i18n feature to false.
Added new element_format option enables you to produce HTML element endings instead of XHTML. But we are still in the XHTML is better camp.
Added missing allowfullscreen and quality options for flash elements, this will now get correctly stored.
Fixed bug where table cell dialog didn't close properly unless the accessibility_warnings option was set to false.
Fixed bug where the modal dialog blocker element for inlinepopups wasn't placed at a correct location if the page had scroll.
Fixed bug where non inline dialogs didn't close correctly if the inlinepopups plugin was used.
Fixed bug where non inline dialogs could make the modal dialog blocker to work incorrectly.
Fixed bug where style select wasn't populated correctly if you pressed the arrow. Patch by Hari Karam Singh.
Fixed bug where toggling the fullscreen mode didn't restore scrollbars on IE when the editor was inside a frame. Patch by Jacob Barrett.
Fixed bug where inserting flash contents using the template plugin didn't work correctly.
Fixed bug where inserting flash contents using the selection.setContent or mceInsertContent command didn't work correctly.
Fixed bug where IE would produce an exception if a comment started with -.
Fixed bug where the blockquote button would wrap lists incorrectly on non IE browsers.
Fixed bug where Opera would display BR elements in the element path.
Fixed bug where xhtmlxtras didn't insert elements correctly on IE.
Fixed bug where the buttons wasn't activated correctly in the xhtmlxtras plugin.
Fixed bug where adding an object as the style attribute for the dom setAttribs method wouldn't work.
Fixed bug where the background color would bleed out to parent container element in Gecko.
Fixed bug where the insert column actions for tables would fail if you did it in a thead or tfoot. Patch contributed by T Andersen (tan73).
Fixed bug where event blocker element wasn't positioned correctly for the inlinepopups plugin.
Fixed bug where pasting from Office 2007 would produce an odd comment in the contents.
Fixed bug where the paste as plain text could remove an extra character. Patch contributed by Speednet.
Fixed bug where some characters where missing for the paste_replace_list option. Patch contributed by Speednet.
Fixed bug where removing non existing editor instances by the mceRemoveControl command would produce an error.
Fixed bug where meta elements with the name description would produce errors in IE.
Fixed bug where color and background colors wouldn't be updated properly.
Fixed bug where the createMenuButton of tinymce.ControlManager didn't implement the last class argument.
Fixed bug where the editor_css option was relative from the TinyMCE installation directory not the current page.
Fixed bug where elements wouldn't be padded if the element contained bogus br elements. For example TD elements.
Fixed bug where parsing of <body > in fullpage plugin would produce an error.
Fixed bug where relative urls with just ./ would become an empty string.
Fixed bug where outdent button would be disabled if inline_styles where set to false.
Fixed bug where replace with an empty search string would produce an error on IE.
Fixed bug where restoring the overflow state of the body in fullscreen plugin running on IE would produce vertical scrollbars.
Fixed bug where pressing return/enter in list items would sometimes move the caret the to top of the content area in FF.
Fixed bug where the style listbox wouldn't be updated correctly if you used the use_native_selects option.
Fixed bug where WebKit browsers would produce a div element when ending list elements using return.
Fixed so translation of popup contents only occurs if it's needed.
Optimized the URI object in regards or converting absolute URIs to relative URIs.
Version 3.1.1 (2008-08-18)
Added new getSize method to DOMUtils it will return the dimensions only of an element.
Added new alert/confirm methods to the tinyMCEPopup class to prevent focus problems and also to shorten method calls.
Added new plugin_preview_inline option to preview plugin to enable/disable native/inline dialogs.
Added new readonly option. If this is set the editor will only display the contents for the user.
Added missing tabindex and accesskey to input elements in the default valid_elements setup.
Updated firebug lite to 1.2, to enable it use the tiny_mce_dev.js?debug=1 on the development package.
Fixed so the preview dialog in the preview plugin uses inline dialogs/popups.
Fixed so CDATA sections remains intact through the serialization process of the DOM tree.
Fixed various issues with the getAttrib command. It will now return more correct values.
Fixed bug where the embed element wasn't properly parsed in the media plugin it now supports 3 formats.
Fixed bug where the noshade attribute was serialized incorrectly on IE.
Fixed bug where editing an existing link element didn't force it relative.
Fixed bug where image link creation fails on Safari if the image is aligned.
Fixed bug where it was possible to scroll the fullscreen mode in Opera 9.50.
Fixed bug where removal of center image alignment would fail. Patch contributed by Andrew Ozz.
Fixed bug where inlinedialogs didn't work properly if the doctype was incorrect in IE.
Fixed bug where cross domain loading didn't work correctly in Opera 9.50.
Fixed bug where breaking huge text blocks with return/enter key would scroll to end of block.
Fixed bug where replace button kept inserting the replacement text even if there is no more matches.
Fixed bug with fullpage plugin where value wasn't set correctly. Patch contributed by Pascal Chantelois.
Fixed bug where the dom utils setAttrib method call could produce an exception if the input was null/false.
Fixed bug where pressing backspace would sometimes remove one extra character in Gecko browsers.
Fixed bug where the native confirm/alert boxes would move focus to parent document if fired in dialogs.
Fixed bug where Opera 9.50 was telling you that the selection is collapsed even when it isn't.
Fixed bug where mceInsertContent would break up existing elements in Opera and Gecko.
Fixed bug where TinyMCE fails to detect some keyboard combos on Mac, contributed by MattyRob.
Fixed bug where replace all didn't move the caret to beginning of text before searching.
Fixed bug where the oninit callback wasn't executed correctly when the strict_loading_mode option was used, thanks goes to Nicholas Oxhoej.
Fixed bug where a access denied exception was thrown if some other script specified document.domain before loading TinyMCE.
Fixed so setting language to empty string will skip language loading if translations are made by some backend.
Fixed so dialog_type is automatically modal if you use the inlinepopups plugin use dialog_type : "window" to re-enable the old behavior.
Version 3.1.0.1 (2008-06-18)
Fixed bug where the Opera line break fix didn't work correctly on Mac OS X and Unix.
Fixed bug where IE was producing the default value the maxlength attribute of input elements.
Version 3.1.0 (2008-06-17)
Fixed bug where the paste as text didn't work correctly it encoded produced paragraphs and br elements.
Fixed bug where embed element in XHTML style didn't work correctly in the media plugin.
Fixed bug where style elements was forced empty in IE. The will now be wrapped in a comment just like script elements.
Fixed bug where some script elements wrapped in CDATA could fail to be serialized correctly.
Fixed bug where FF 3 produced -moz- internal styles in some style attributes.
Fixed bug where query strings and external URLs didn't work correctly in style attributes.
Fixed bug where shape attribute of area elements got serialized as rect regardless of it's initial value in IE 6.
Fixed bug where selection of elements inside layers would fail in IE since focus was moved to the document body.
Fixed bug where pressing enter/return in an editable select box would produce an __mce_add_custom__ class value.
Fixed bug where changing font size of text placed inside a colored text chunk would remove the parent node.
Fixed bug where Opera 9.5 final produced a strange line break behavior due to a workaround for previous Opera versions.
Fixed bug where text/background color would produce a strange focus problem when you tried to click on the body in IE.
Fixed issue where selecting the title of an listbox equals the old 2.x behavior of changing the value to an empty string.
Fixed issue where it was common for the media plugin to break if the _value attribute wasn't added for the param element.
Fixed issue where the wrong parent editor instance might be updated if you use fullscreen mode in an incorrect way.
Fixed issue where Safari was producing a warning about the base element not being closed correctly.
Removed redundant form element name matching from regexp in the DOMUtils class.
Version 3.0.9 (2008-06-02)
Added new contextmenu_offset_x/contextmenu_offset_y options for the contextmenu plugin.
Added cite attribute to the default rule for the blockquote element.
Added support for using arrow keys for selection of items in listboxes.
Added support for using arrow keys for selection of items in dropmenus.
Fixed bug where blockformat change on elements with BR inside them didn't change correctly on Firefox.
Fixed bug where removing table rows inside thead or tfoot would remove the whole table if it was the last one.
Fixed bug where XHR synchronous mode didn't execute the callback handlers synchronously.
Fixed bug where setting border to 0 didn't add border: 0 to the style attribute when using the advimage dialog.
Fixed bug where the selection of images and table cells didn't work correctly when the editor is placed in a frame and running on IE.
Fixed bug where the store/restore of a selection didn't work correctly in non IE browsers.
Fixed bug where only the first element would be invalid for the invalid_elements option.
Fixed bug where paste as plain text didn't encode the characters correctly when they where inserted.
Fixed bug where HTML source window couldn't be maximized on Gecko when the maximizable feature was enabled.
Fixed bug where color selection using the color picker could produce exception in IE.
Fixed bug where font size changes could produce produce extra redundant elements.
Fixed bug where IE could produce unknown runtime error if you replaced a image with another image from a separate frame.
Fixed bug where the domLoaded state for the Event class wasn't set correctly if the editor was loaded dynamically using the gzip compressor.
Fixed bug where handling of the base element for a page would produce incorrect urls. Based on a patch contributed by John LeSueur.
Fixed bug where table constraint alert boxes was presented with an empty value and wasn't the skinned inline ones.
Fixed bug where the onChange event wasn't fired when the form was submitted. It's now also triggered when the save method is called.
Fixed bug where encoding set to xml didn't work as expected. It now encodes the contents into XML entities.
Fixed bug where numrows didn't work correctly for the merge cells dialog of the table plugin.
Fixed bug where the onGetContent event was fired even when the no_events flag was set.
Fixed bug where the preview panels for the advimage and the media plugin could overflow on Safari and FF 3.
Fixed bug where the editing and removal of abbr elements using the xhtmlxtras plugin working correctly on IE.
Fixed bug where save button in the save plugin didn't work correctly on IE.
Fixed bug where dragging layers didn't work as expected since it would snap back to it's original location if you saved.
Fixed bug where the description of the template plugin dialog wasn't updated correctly.
Fixed bug where the values for frame and rules in the table dialogs where swapped.
Fixed bug where the elements like ins, del, cite, acronym and abbr didn't have the default editing style as the old 2.x branch.
Fixed bug where ask mode would lock the focused textarea if you pressed cancel in the confirm dialog on FF 3.
Fixed bug where ask mode would produce contents for empty textareas if you reloaded the page.
Fixed so the onGetContent event gets the full pass through object just like the other events.
Fixed so attributes for block elements remains the same when you change format of a element.
Version 3.0.8 (2008-04-30)
Fixed bug where IE would produce an error if textareas without names where converted.
Fixed bug where editor wasn't forced empty when there was only a single br or empty paragraph left.
Fixed bug where IE would produce an warning message if object elements where produced in the media plugins preview running on https.
Fixed bug where new addVer function didn't handle hash items correctly. Patch contributed by Mirek Burkon.
Fixed bug where font_size_style_values option wasn't applied correctly to fonts inside the editor.
Fixed bug where image selection could be lost if a image was edited using context menu on IE.
Fixed bug where style values wasn't updated properly due to an invalid regexp.
Fixed bug where IE 6 where displaying warning message about insecure items when inserting an image while using https. Patch contributed by Norifumi Sunaoka.
Fixed bug where IE was producing an auto save message if you selected a color from the color split button.
Fixed bug where backspace sometimes would move the caret to the end of the previous block in Gecko.
Fixed bug where the rowlayout manager didn't work as described in the documentation.
Fixed bug where the default options for the fullpage plugin wasn't applied correctly.
Fixed bug where selection would jump one character if you applied a styles to a words in non IE browsers.
Fixed bug where undo levels wasn't added correctly if you went back in undo history and added a new event.
Fixed bug where font size dropdown didn't mark the selected size in IE.
Fixed bug where the size of the editor was determined using clientWidth instead of offsetWidth.
Fixed so the onchange event doesn't fire on the initial undo level, it will also fire when the editor is blurred.
Fixed so the advhr plugin produces XHTML valid output instead of non standard attributes.
Fixed so blockquote gets converted into [quote] in when the bbcode plugin is enabled.
Fixed so theme_advanced_font_sizes can be named for example Font 1=1, Font 2=2 etc.
Fixed so editor_selector/editor_deselector can be regexps. By default only strings are allowed not part regexps like before.
Fixed so that the version suffix is optional. It still requires the build process so you need to export it manually.
Fixed so it's possible to tab to table cells in non Gecko browsers and also produce new rows if you tab at the end of a table. Contributed by Josh Peek.
Version 3.0.7 (2008-04-14)
Added new version suffix to all internal GET requests to make sure that the users cache gets cleared correctly.
Fixed issue with isDirty returning true event if it wasn't dirty on IE due to changes in tables during initialization.
Fixed memory leak in IE where if a page was unloaded before all images on the page was loaded it would leak.
Fixed bug in IE where underline and strikethrough could produce an exception error message.
Fixed bug where inserting paragraphs in totally empty table cells would produce odd effects.
Fixed bug where layer style data wasn't updated correctly due to some performance enhancements with the DOM serializer.
Fixed bug where it would convert the wrong element if there was two elements with the same name and id on the page.
Fixed bug where it was possible to add style information to the body element using the style plugin.
Fixed bug where Gecko would add an extra undo level some times due to the blur event.
Fixed bug where the underline icon would get active if the caret was inside a link element.
Fixed bug where merging th cells not working correctly. Patch contributed by André R.
Fixed bug where forecolorpicker and backcolorpicker buttons where rendered incorrectly when the o2k7 skin was used.
Fixed bug where comment couldn't contain -- since it's invalid markup. It will now at least not break on those invalid comments.
Fixed bug where apos wasn't handled correctly in IE. It will now convert apos to &#39; on IE since that browser doesn't support that entity.
Fixed bug where entities wasn't encoded correctly inside pre elements since they where protected from whitespace removal.
Fixed bug where color split buttons where rendered incorrectly on IE6 when using the non default theme.
Fixed so caret is placed after links ones they are created, to improve usability of the editor.
Fixed so you can select tables by clicking on it's borders in non IE browsers to normalize the behavior.
Fixed so the menus can be toggled by clicking once more on the icon in listboxes, menubuttons and splitbuttons based on code contributed by Josh Peek.
Fixed so buttons can be labeled, currently only works with the default skin, so it's kind of experimental. Patch contributed by Daniel Insley.
Fixed so forecolorpicker and backcolorpicker remembers the last selected color. Patch contributed by Shane Tomlinson.
Fixed so that you can only execute the mceAddEditor command once for the same instance name.
Fixed so command functions added with addCommand can pass though the call to default handles if it returns true.
Version 3.0.6.2 (2008-04-07)
Fixed bug where empty tables couldn't be edited correctly on non IE browsers if they where loaded into the editor.
Fixed bug where it was impossible to resize layers correctly in IE since it thought it was an image.
Fixed bug where an editor instance was stealing focus in IE resulting in a scroll to the editor on page reloads.
Fixed bug where Safari was crashing on Mac OS X if you closed dialogs using the Esc key.
Version 3.0.6.1 (2008-04-04)
Added support for the missing mceAddFrameControl command. The input for this command has changed so consult the Wiki.
Fixed bug where sub menus for the drop menus would leave an empty element behind.
Fixed memory leak in IE if the editor was placed in a frame or iframe.
Version 3.0.6 (2008-04-03)
Added elements to the default value of valid_elements option. It now contains all XHTML strict elements and a few transitional.
Added more accessibility fixes, it's now possible to navigate and close list boxes and split button menus with the keyboard.
Added missing getInfo method to the contextmenu and safari plugin, this caused problems for the Drupal module.
Added new inlinepopups_zindex option to the inlinepopups plugin so that you can configure the default start z-index.
Added new setControlType method to the tinymce.ControlManager class. This method enables you to override the default classes.
Added ability to specific an optional control class to use instead of the default one for the ControlManager methods. Based on concept by Josh Peek.
Fixed bug where attribute rules for the DOM Serializer couldn't contain - or _ characters in their names.
Fixed bug where inlinepopups event blocker and modal dialog blocker elements produced vertical scrollbars.
Fixed bug where there was a rendering issue with quirks mode in Safari moving the resize handle to an incorrect position.
Fixed bug with forecolor/backcolor controls on IE. Sometimes elements positioned relative will generate display errors.
Fixed bug where a p2 was leaking out in the global name space when you selected a color from the forecolor/backcolor controls.
Fixed bug where empty paragraphs didn't work as expected in browsers other than IE.
Fixed bug where the load method of the tinymce.dom.ScriptLoader didn't check if the file was already loaded.
Fixed bug where the load method for the PluginManager and ThemeManager didn't check if a plugin/theme by a specific name was all ready loaded.
Fixed bug where the theme_advanced_link_targets option didn't work correctly with the advanced themes link dialog. Patch contributed by Arnold B.
Fixed bug where the style command would merge classes into empty span elements.
Fixed bug where the style command would remove empty span elements outside the current selection.
Fixed bug where the fix for the Safari backspace bug removed all editor contents if it was filled with empty paragraphs.
Fixed bug where alert and confirm boxes opened by the inlinepopups plugin would produce an exception if domain relaxing was used.
Fixed bug where Safari was adding style attributes to all elements when you paste them into the editor.
Fixed bug where the spellchecker menus was visually incorrect since the space for the non existing icon was still there.
Fixed bug where remove_linebreaks option didn't remove line breaks inside the text contents of a element.
Fixed bug where Safari 3.1 was introducing _mc_tmp into paragraphs due to the new querySelectorAll and a TinyMCE specific workaround.
Fixed bug where getParam method in the Editor class was returning incorrect objects and would mess up the font drop down. Patch contributed by speednet.
Fixed bug where the table dialog would produce an exception in IE when you edited tables since it tried to place focus in a disabled field.
Fixed bug where class attribute on some span elements was removed on cleanup.
Fixed bug where resizing the editor in IE could produce an exception if the editor width/height got to be a negative value.
Fixed bug where wmv files wouldn't play since the src param was used instead of the url param.
Fixed bug where br elements would be added here and there in Gecko. Geckos internal _moz_dirty br elements where serialized as well.
Fixed bug where editing named anchors would produce two anchors instead of one updated one.
Fixed bug where arrow and function keys didn't work when an noneditable element was focused within the editor.
Fixed bug where the dispatcher could produce an exception if the listener list was altered inside an event callback.
Fixed bug where it was impossible to totally empty the editor contents on Safari due to an mistreatment of nbsp as whitespace. Patch contributed by Andrew Ozz.
Fixed bug where TinyMCE would not convert textareas with the same name attribute value. It will now generate an unique id for those textareas.
Fixed bug where backspace/delete key was deleting td elements inside tables while running on Gecko.
Fixed bug where Firefox 3.0b4 and Opera 9.26 where scrolling to the top of document when pressing return/enter.
Fixed bug where the template plugin wasn't just inserting the mceTmpl tagged element.
Fixed bug where the alert method of the default WindowManager implementation didn't translate input language strings like the inlinepopups dialog does.
Fixed bugs with the backspace behavior in Gecko. The caret was placed on incorrect locations in the DOM sometimes.
Fixed so advimage dialog and table dialogs has support for editable select boxes for the class value.
Fixed so the media, pagebreak and spellchecker doesn't load it's default content.css file if the content_css option is set to false.
Fixed so the paste_use_dialog option works again it's enabled by default but can be disabled on IE. Patch contributed by Speednet.
Fixed so that the fullscreen editor is focused when switching fullscreen editing on.
Fixed so it's possible to edit images and links inside tables using the context menu.
Fixed so table dialogs and the advanced image dialog doesn't loose selection in IE if the dialogs where navigated/submitted with the keyboard.
Fixed so the theme_advanced_blockformats options can have named items for example title 1=h1;title 2=h2.
Fixed so it's possible to add a custom editor_css for the simple theme.
Fixed quirks with directionality rtl, patch contributed by Andrew Ozz.
Fixed so the inlinepopups default start zIndex is 300000.
Fixed typo in media plugin Shockware is now replaced with Shockwave.
Fixed psuedo memory leak in IE with the replaceChild method inside the DOMUtils.replace method.
Fixed so memory is released when an editor instance is removed from page.
Optimized the color split button menus so that they use less event handlers.
Removed the util/mclayer.js file since it's no longer used by any of the TinyMCE dialogs and is considered deprecated.
Version 3.0.5 (2008-03-12)
Added new black skin variant to the o2k7 skin contributed by Stefan Moonen.
Added new explode method to the tinymce core class. This does a split but removed whitespace it also defaults to a , delimiter.

View file

@ -10,7 +10,7 @@
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
@ -44,24 +44,26 @@
<body>
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<h3>Full featured example</h3>
<p>
This page shows all available buttons and plugins that are included in the TinyMCE core package.
There are more examples on how to use TinyMCE in the <a href="http://wiki.moxiecode.com/examples/tinymce/">Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
&lt;img src="media/logo.jpg" alt=" " hspace="5" vspace="5" width="250" height="48" align="right" /&gt; TinyMCE is a platform independent web based Javascript HTML &lt;strong&gt;WYSIWYG&lt;/strong&gt; editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.
&lt;/p&gt;
&lt;p&gt;
We recommend &lt;a href="http://www.getfirefox.com" target="_blank"&gt;Firefox&lt;/a&gt; and &lt;a href="http://www.google.com" target="_blank"&gt;Google&lt;/a&gt; &lt;br /&gt;
&lt;/p&gt;
</textarea>
<div>
<h3>Full featured example</h3>
<p>
This page shows all available buttons and plugins that are included in the TinyMCE core package.
There are more examples on how to use TinyMCE in the <a href="http://wiki.moxiecode.com/examples/tinymce/">Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<div>
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
</div>
<!-- Some integration calls -->
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a>
@ -72,11 +74,11 @@
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().nodeName);">[Get selected element]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>
</div>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</div>
</form>
</body>

View file

@ -27,10 +27,10 @@
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
&lt;img src="media/logo.jpg" alt=" " hspace="5" vspace="5" width="250" height="48" align="right" /&gt; TinyMCE is a platform independent web based Javascript HTML &lt;strong&gt;WYSIWYG&lt;/strong&gt; editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
We recommend &lt;a href="http://www.getfirefox.com" target="_blank"&gt;Firefox&lt;/a&gt; and &lt;a href="http://www.google.com" target="_blank"&gt;Google&lt;/a&gt; &lt;br /&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>

View file

@ -163,10 +163,10 @@
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
&lt;img src="media/logo.jpg" alt=" " hspace="5" vspace="5" width="250" height="48" align="right" /&gt; TinyMCE is a platform independent web based Javascript HTML &lt;strong&gt;WYSIWYG&lt;/strong&gt; editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
We recommend &lt;a href="http://www.getfirefox.com" target="_blank"&gt;Firefox&lt;/a&gt; and &lt;a href="http://www.google.com" target="_blank"&gt;Google&lt;/a&gt; &lt;br /&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
@ -174,10 +174,10 @@
<textarea id="elm2" name="elm2" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
&lt;img src="media/logo.jpg" alt=" " hspace="5" vspace="5" width="250" height="48" align="right" /&gt; TinyMCE is a platform independent web based Javascript HTML &lt;strong&gt;WYSIWYG&lt;/strong&gt; editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
We recommend &lt;a href="http://www.getfirefox.com" target="_blank"&gt;Firefox&lt;/a&gt; and &lt;a href="http://www.google.com" target="_blank"&gt;Google&lt;/a&gt; &lt;br /&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
@ -185,10 +185,10 @@
<textarea id="elm3" name="elm3" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
&lt;img src="media/logo.jpg" alt=" " hspace="5" vspace="5" width="250" height="48" align="right" /&gt; TinyMCE is a platform independent web based Javascript HTML &lt;strong&gt;WYSIWYG&lt;/strong&gt; editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
We recommend &lt;a href="http://www.getfirefox.com" target="_blank"&gt;Firefox&lt;/a&gt; and &lt;a href="http://www.google.com" target="_blank"&gt;Google&lt;/a&gt; &lt;br /&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
@ -196,10 +196,10 @@
<textarea id="elm4" name="elm4" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
&lt;img src="media/logo.jpg" alt=" " hspace="5" vspace="5" width="250" height="48" align="right" /&gt; TinyMCE is a platform independent web based Javascript HTML &lt;strong&gt;WYSIWYG&lt;/strong&gt; editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
We recommend &lt;a href="http://www.getfirefox.com" target="_blank"&gt;Firefox&lt;/a&gt; and &lt;a href="http://www.google.com" target="_blank"&gt;Google&lt;/a&gt; &lt;br /&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>

View file

@ -0,0 +1,80 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full featured example</title>
<style>
body {font-family:Arial,Verdana; font-size: 12px;}
</style>
<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce_dev.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
},
// Enable translation mode
translate_mode : true,
language : "en"
});
</script>
<!-- /TinyMCE -->
</head>
<body>
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<h3>Translation</h3>
<p>This page enables you to translate TinyMCE by using XML files.</p>
<p>Steps to translate:</p>
<ol>
<li>Download one of the language XML files from the TinyMCE site.</li>
<li>Place it in /jscripts/tiny_mce/langs directory, for example /jscripts/tiny_mce/langs/sv.xml.</li>
<li>Change the language init option in this file to match the XML file code. For example: sv</li>
<li>TinyMCE will now use the XML file instead of the .js versions.</li>
<li>Modify the XML file until everything is translated</li>
<li>Modify the author information, this is optional.</li>
<li>Upload the XML file to the TinyMCE site to share it with others.</li>
<li>You can now download the .js versions of the language pack from the TinyMCE site.</li>
</ol>
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
</form>
</body>
</html>

View file

@ -61,7 +61,7 @@ iespell_desc:"Run spell checking",
download:"ieSpell not detected. Do you want to install it now?"
},
advhr:{
advhr_desc:"Horizontale rule"
advhr_desc:"Horizontal rule"
},
emotions:{
emotions_desc:"Emotions"

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.AdvancedHRPlugin',{init:function(ed,url){ed.addCommand('mceAdvancedHr',function(){ed.windowManager.open({file:url+'/rule.htm',width:250+parseInt(ed.getLang('advhr.delta_width',0)),height:160+parseInt(ed.getLang('advhr.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('advhr',{title:'advhr.advhr_desc',cmd:'mceAdvancedHr'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('advhr',n.nodeName=='HR');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='HR')ed.selection.select(e);});},getInfo:function(){return{longname:'Advanced HR',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advhr',tinymce.plugins.AdvancedHRPlugin);})();
(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();

View file

@ -3,25 +3,34 @@ var AdvHRDialog = {
var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
w = dom.getAttrib(n, 'width');
f.width.value = w ? parseInt(w) : '';
f.size.value = dom.getAttrib(n, 'size');
f.noshade.checked = !!dom.getAttrib(n, 'noshade');
f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
},
update : function() {
var ed = tinyMCEPopup.editor, h, f = document.forms[0];
var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
h = '<hr';
if (f.size.value)
if (f.size.value) {
h += ' size="' + f.size.value + '"';
st += ' height:' + f.size.value + 'px;';
}
if (f.width.value)
if (f.width.value) {
h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
}
if (f.noshade.checked)
if (f.noshade.checked) {
h += ' noshade="noshade"';
st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
}
if (ed.settings.inline_styles)
h += ' style="' + tinymce.trim(st) + '"';
h += ' />';

View file

@ -7,7 +7,6 @@
<script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<link href="css/advhr.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body>
<form onsubmit="AdvHRDialog.update();return false;" action="#">
@ -22,7 +21,7 @@
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="width">{#advhr_dlg.width}</label></td>
<td nowrap="nowrap">
<td class="nowrap">
<input id="width" name="width" type="text" value="" class="mceFocus" />
<select name="width2" id="width2">
<option value="">px</option>

View file

@ -3,7 +3,7 @@
.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
.checkbox {border:0;}
.panel_wrapper div.current {height:305px;}
#prev {margin:0; border:1px solid #000; width:99%; height:150px; overflow:auto;}
#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
#align, #classlist {width:150px;}
#width, #height {vertical-align:middle; width:50px; text-align:center;}
#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.AdvancedImagePlugin',{init:function(ed,url){ed.addCommand('mceAdvImage',function(){if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({file:url+'/image.htm',width:480+parseInt(ed.getLang('advimage.delta_width',0)),height:385+parseInt(ed.getLang('advimage.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('image',{title:'advimage.image_desc',cmd:'mceAdvImage'});},getInfo:function(){return{longname:'Advanced image',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advimage',tinymce.plugins.AdvancedImagePlugin);})();
(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();

View file

@ -6,9 +6,9 @@
<script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="../../utils/validate.js"></script>
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
<script type="text/javascript" src="js/image.js"></script>
<link href="css/advimage.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body id="advimage" style="display: none">
<form onsubmit="ImageDialog.insert();return false;" action="#">
@ -37,7 +37,7 @@
</tr>
<tr>
<td><label for="src_list">{#advimage_dlg.image_list}</label></td>
<td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"></select></td>
<td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>
</tr>
<tr>
<td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
@ -88,7 +88,7 @@
<tr>
<td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
<td nowrap="nowrap">
<td class="nowrap">
<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x
<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px
</td>
@ -122,7 +122,7 @@
<tr>
<td><label for="class_list">{#class_name}</label></td>
<td><select id="class_list" name="class_list"></select></td>
<td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>
</tr>
<tr>
@ -157,7 +157,7 @@
</tr>
<tr>
<td><label for="over_list">{#advimage_dlg.image_list}</label></td>
<td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"></select></td>
<td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
</tr>
<tr>
<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
@ -170,7 +170,7 @@
</tr>
<tr>
<td><label for="out_list">{#advimage_dlg.image_list}</label></td>
<td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"></select></td>
<td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
</tr>
</table>
</fieldset>

View file

@ -16,6 +16,7 @@ var ImageDialog = {
this.fillFileList('src_list', 'tinyMCEImageList');
this.fillFileList('over_list', 'tinyMCEImageList');
this.fillFileList('out_list', 'tinyMCEImageList');
TinyMCE_EditableSelects.init();
if (n.nodeName == 'IMG') {
nl.src.value = dom.getAttrib(n, 'src');
@ -27,7 +28,7 @@ var ImageDialog = {
nl.hspace.value = this.getAttrib(n, 'hspace');
nl.border.value = this.getAttrib(n, 'border');
selectByValue(f, 'align', this.getAttrib(n, 'align'));
selectByValue(f, 'class_list', dom.getAttrib(n, 'class'));
selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);
nl.style.value = dom.getAttrib(n, 'style');
nl.id.value = dom.getAttrib(n, 'id');
nl.dir.value = dom.getAttrib(n, 'dir');
@ -102,7 +103,7 @@ var ImageDialog = {
if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
if (!f.alt.value) {
tinyMCEPopup.editor.windowManager.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
if (s)
t.insertAndClose();
});
@ -170,7 +171,7 @@ var ImageDialog = {
if (el && el.nodeName == 'IMG') {
ed.dom.setAttribs(el, args);
} else {
ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" src="javascript:;" />', {skip_undo : 1});
ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
ed.dom.setAttribs('__mce_tmp', args);
ed.dom.setAttrib('__mce_tmp', 'id', '');
ed.undoManager.add();
@ -271,6 +272,7 @@ var ImageDialog = {
cl = tinyMCEPopup.editor.dom.getClasses();
if (cl.length > 0) {
lst.options.length = 0;
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
tinymce.each(cl, function(o) {
@ -284,6 +286,7 @@ var ImageDialog = {
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
l = window[l];
lst.options.length = 0;
if (l && l.length > 0) {
lst.options[lst.options.length] = new Option('', '');
@ -380,7 +383,7 @@ var ImageDialog = {
v = f.border.value;
if (v || v == '0') {
if (v == '0')
img.style.border = '';
img.style.border = '0';
else
img.style.border = v + 'px solid black';
}

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.AdvancedLinkPlugin',{init:function(ed,url){this.editor=ed;ed.addCommand('mceAdvLink',function(){var se=ed.selection;if(se.isCollapsed()&&!ed.dom.getParent(se.getNode(),'A'))return;ed.windowManager.open({file:url+'/link.htm',width:480+parseInt(ed.getLang('advlink.delta_width',0)),height:400+parseInt(ed.getLang('advlink.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('link',{title:'advlink.link_desc',cmd:'mceAdvLink'});ed.addShortcut('ctrl+k','advlink.advlink_desc','mceAdvLink');ed.onNodeChange.add(function(ed,cm,n,co){cm.setDisabled('link',co&&n.nodeName!='A');cm.setActive('link',n.nodeName=='A'&&!n.name);});},getInfo:function(){return{longname:'Advanced link',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advlink',tinymce.plugins.AdvancedLinkPlugin);})();
(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();

View file

@ -14,8 +14,9 @@ function preinit() {
}
function changeClass() {
var formObj = document.forms[0];
formObj.classes.value = getSelectValue(formObj, 'classlist');
var f = document.forms[0];
f.classes.value = getSelectValue(f, 'classlist');
}
function init() {
@ -115,7 +116,7 @@ function checkPrefix(n) {
if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
n.value = 'mailto:' + n.value;
if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
n.value = 'http://' + n.value;
}
@ -234,7 +235,7 @@ function parseLink(link) {
regExp += "\\);?";
// Build variable array
var variables = new Array();
var variables = [];
variables["_function"] = fnName;
var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
for (var i=0; i<variableNames.length; i++)
@ -248,7 +249,7 @@ function parseLink(link) {
function parseOptions(opts) {
if (opts == null || opts == "")
return new Array();
return [];
// Cleanup the options
opts = opts.toLowerCase();
@ -256,7 +257,7 @@ function parseOptions(opts) {
opts = opts.replace(/[^0-9a-z=,]/g, "");
var optionChunks = opts.split(',');
var options = new Array();
var options = [];
for (var i=0; i<optionChunks.length; i++) {
var parts = optionChunks[i].split('=');
@ -401,47 +402,23 @@ function insertAction() {
// Create new anchor elements
if (elm == null) {
inst.getDoc().execCommand("unlink", false, null);
tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
for (i=0; i<elementArray.length; i++) {
elm = elementArray[i];
// Move cursor to end
try {
tinyMCEPopup.editor.selection.collapse(false);
} catch (ex) {
// Ignore
}
// Move cursor behind the new anchor
// Don't remember why this was needed so it's now removed
/*
if (tinyMCE.isGecko) {
var sp = inst.getDoc().createTextNode(" ");
if (elm.nextSibling)
elm.parentNode.insertBefore(sp, elm.nextSibling);
else
elm.parentNode.appendChild(sp);
// Set range after link
var rng = inst.getDoc().createRange();
rng.setStartAfter(elm);
rng.setEndAfter(elm);
// Update selection
var sel = inst.getSel();
sel.removeAllRanges();
sel.addRange(rng);
}
*/
setAllAttribs(elm);
}
for (i=0; i<elementArray.length; i++)
setAllAttribs(elm = elementArray[i]);
} else
setAllAttribs(elm);
// Don't move caret if selection was image
if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
inst.focus();
inst.selection.select(elm);
inst.selection.collapse(0);
tinyMCEPopup.storeSelection();
}
tinyMCEPopup.execCommand("mceEndUndoLevel");
tinyMCEPopup.close();
}
@ -452,7 +429,6 @@ function setAllAttribs(elm) {
var target = getSelectValue(formObj, 'targetlist');
setAttrib(elm, 'href', href);
setAttrib(elm, 'mce_href', href);
setAttrib(elm, 'title');
setAttrib(elm, 'target', target == '_self' ? '' : target);
setAttrib(elm, 'id');
@ -488,7 +464,7 @@ function setAllAttribs(elm) {
function getSelectValue(form_obj, field_name) {
var elm = form_obj.elements[field_name];
if (elm == null || elm.options == null)
if (!elm || elm.options == null || elm.selectedIndex == -1)
return "";
return elm.options[elm.selectedIndex].value;

View file

@ -8,7 +8,6 @@
<script type="text/javascript" src="../../utils/validate.js"></script>
<script type="text/javascript" src="js/advlink.js"></script>
<link href="css/advlink.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body id="advlink" style="display: none">
<form onsubmit="insertAction();return false;" action="#">
@ -28,7 +27,7 @@
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td nowrap="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
<td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
<td><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
@ -38,25 +37,25 @@
</tr>
<tr id="linklisthrefrow">
<td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>
<td colspan="2" id="linklisthrefcontainer">&nbsp;</td>
<td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td>
</tr>
<tr>
<td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
<td colspan="2" id="anchorlistcontainer">&nbsp;</td>
<td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>
</tr>
<tr>
<td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
<td id="targetlistcontainer">&nbsp;</td>
<td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>
</tr>
<tr>
<td nowrap="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>
<td class="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>
<td><input id="title" name="title" type="text" value="" /></td>
</tr>
<tr>
<td><label id="classlabel" for="classlist">{#class_name}</label></td>
<td>
<select id="classlist" name="classlist" onchange="changeClass();">
<option value="" selected>{#not_set}</option>
<option value="" selected="selected">{#not_set}</option>
</select>
</td>
</tr>
@ -73,7 +72,7 @@
<table border="0" cellpadding="0" cellspacing="4">
<tr>
<td nowrap="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label>&nbsp;</td>
<td class="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label>&nbsp;</td>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
@ -84,19 +83,19 @@
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label>&nbsp;</td>
<td class="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label>&nbsp;</td>
<td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
</tr>
<tr>
<td nowrap="nowrap"><label>{#advlink_dlg.popup_size}</label>&nbsp;</td>
<td nowrap="nowrap">
<td class="nowrap"><label>{#advlink_dlg.popup_size}</label>&nbsp;</td>
<td class="nowrap">
<input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
<input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
</td>
</tr>
<tr>
<td nowrap="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label>&nbsp;</td>
<td nowrap="nowrap">
<td class="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label>&nbsp;</td>
<td class="nowrap">
<input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /
<input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
</td>
@ -109,27 +108,27 @@
<table border="0" cellpadding="0" cellspacing="4">
<tr>
<td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
<td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
<td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
<td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
<td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
<td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
</tr>
<tr>
<td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
<td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
<td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
<td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
<td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
<td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
</tr>
<tr>
<td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
<td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
<td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
<td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
<td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
<td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
</tr>
<tr>
<td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
<td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
<td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
<td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
<td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
<td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
</tr>
</table>
</fieldset>

View file

@ -0,0 +1 @@
(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)});a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();

View file

@ -0,0 +1,114 @@
/**
* $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
/**
* Auto Resize
*
* This plugin automatically resizes the content area to fit its content height.
* It will retain a minimum height, which is the height of the content area when
* it's initialized.
*/
tinymce.create('tinymce.plugins.AutoResizePlugin', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished it's initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
var t = this;
if (ed.getParam('fullscreen_is_enabled'))
return;
/**
* This method gets executed each time the editor needs to resize.
*/
function resize() {
var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
// Get height differently depending on the browser used
myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight;
// Don't make it smaller than the minimum height
if (myHeight > t.autoresize_min_height)
resizeHeight = myHeight;
// Resize content element
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
// if we're throbbing, we'll re-throb to match the new size
if (t.throbbing) {
ed.setProgressState(false);
ed.setProgressState(true);
}
};
t.editor = ed;
// Define minimum height
t.autoresize_min_height = ed.getElement().offsetHeight;
// Things to do when the editor is ready
ed.onInit.add(function(ed, l) {
// Show throbber until content area is resized properly
ed.setProgressState(true);
t.throbbing = true;
// Hide scrollbars
ed.getBody().style.overflowY = "hidden";
});
// Add appropriate listeners for resizing content area
ed.onChange.add(resize);
ed.onSetContent.add(resize);
ed.onPaste.add(resize);
ed.onKeyUp.add(resize);
ed.onPostRender.add(resize);
ed.onLoadContent.add(function(ed, l) {
resize();
// Because the content area resizes when its content CSS loads,
// and we can't easily add a listener to its onload event,
// we'll just trigger a resize after a short loading period
setTimeout(function() {
resize();
// Disable throbber
ed.setProgressState(false);
t.throbbing = false;
}, 1250);
});
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
ed.addCommand('mceAutoResize', resize);
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
getInfo : function() {
return {
longname : 'Auto Resize',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
})();

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})();
(function(){tinymce.create("tinymce.plugins.AutoSavePlugin",{init:function(a,b){var c=this;c.editor=a;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:tinymce.majorVersion+"."+tinymce.minorVersion}},"static":{_beforeUnloadHandler:function(){var a;tinymce.each(tinyMCE.editors,function(b){if(b.getParam("fullscreen_is_enabled")){return}if(b.isDirty()){a=b.getLang("autosave.unload_msg");return false}});return a}}});tinymce.PluginManager.add("autosave",tinymce.plugins.AutoSavePlugin)})();

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.BBCodePlugin',{init:function(ed,url){var t=this,dialect=ed.getParam('bbcode_dialect','punbb').toLowerCase();ed.onBeforeSetContent.add(function(ed,o){o.content=t['_'+dialect+'_bbcode2html'](o.content);});ed.onPostProcess.add(function(ed,o){if(o.set)o.content=t['_'+dialect+'_bbcode2html'](o.content);if(o.get)o.content=t['_'+dialect+'_html2bbcode'](o.content);});},getInfo:function(){return{longname:'BBCode Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_punbb_html2bbcode:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str);};rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");rep(/<font>(.*?)<\/font>/gi,"$1");rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");rep(/<\/(strong|b)>/gi,"[/b]");rep(/<(strong|b)>/gi,"[b]");rep(/<\/(em|i)>/gi,"[/i]");rep(/<(em|i)>/gi,"[i]");rep(/<\/u>/gi,"[/u]");rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");rep(/<u>/gi,"[u]");rep(/<br \/>/gi,"\n");rep(/<br\/>/gi,"\n");rep(/<br>/gi,"\n");rep(/<p>/gi,"");rep(/<\/p>/gi,"\n");rep(/&nbsp;/gi," ");rep(/&quot;/gi,"\"");rep(/&lt;/gi,"<");rep(/&gt;/gi,">");rep(/&amp;/gi,"&");return s;},_punbb_bbcode2html:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str);};rep(/\n/gi,"<br />");rep(/\[b\]/gi,"<strong>");rep(/\[\/b\]/gi,"</strong>");rep(/\[i\]/gi,"<em>");rep(/\[\/i\]/gi,"</em>");rep(/\[u\]/gi,"<u>");rep(/\[\/u\]/gi,"</u>");rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");return s;}});tinymce.PluginManager.add('bbcode',tinymce.plugins.BBCodePlugin);})();
(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/&nbsp;/gi," ");b(/&quot;/gi,'"');b(/&lt;/gi,"<");b(/&gt;/gi,">");b(/&amp;/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();

View file

@ -69,6 +69,8 @@
rep(/<\/u>/gi,"[/u]");
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
rep(/<u>/gi,"[u]");
rep(/<blockquote[^>]*>/gi,"[quote]");
rep(/<\/blockquote>/gi,"[/quote]");
rep(/<br \/>/gi,"\n");
rep(/<br\/>/gi,"\n");
rep(/<br>/gi,"\n");

View file

@ -1 +1 @@
(function(){var Event=tinymce.dom.Event,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.ContextMenu',{init:function(ed){var t=this;t.editor=ed;t.onContextMenu=new tinymce.util.Dispatcher(this);ed.onContextMenu.add(function(ed,e){if(!e.ctrlKey){t._getMenu(ed).showMenu(e.clientX,e.clientY);Event.cancel(e);}});function hide(){if(t._menu){t._menu.removeAll();t._menu.destroy();}};ed.onMouseDown.add(hide);ed.onKeyDown.add(hide);Event.add(document,'click',hide);},_getMenu:function(ed){var t=this,m=t._menu,se=ed.selection,col=se.isCollapsed(),el=se.getNode()||ed.getBody(),am,p1,p2;if(m){m.removeAll();m.destroy();}p1=DOM.getPos(ed.getContentAreaContainer());p2=DOM.getPos(ed.getContainer());m=ed.controlManager.createDropMenu('contextmenu',{offset_x:p1.x,offset_y:p1.y,constrain:1});t._menu=m;m.add({title:'advanced.cut_desc',icon:'cut',cmd:'Cut'}).setDisabled(col);m.add({title:'advanced.copy_desc',icon:'copy',cmd:'Copy'}).setDisabled(col);m.add({title:'advanced.paste_desc',icon:'paste',cmd:'Paste'});if((el.nodeName=='A'&&!ed.dom.getAttrib(el,'name'))||!col){m.addSeparator();m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});}m.addSeparator();m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();am=m.addMenu({title:'contextmenu.align'});am.add({title:'contextmenu.left',icon:'justifyleft',cmd:'JustifyLeft'});am.add({title:'contextmenu.center',icon:'justifycenter',cmd:'JustifyCenter'});am.add({title:'contextmenu.right',icon:'justifyright',cmd:'JustifyRight'});am.add({title:'contextmenu.full',icon:'justifyfull',cmd:'JustifyFull'});t.onContextMenu.dispatch(t,m,el,col);return m;}});tinymce.PluginManager.add('contextmenu',tinymce.plugins.ContextMenu);})();
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();

View file

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 665 2008-03-04 13:26:59Z spocke $
* $Id: editor_plugin_src.js 848 2008-05-15 11:54:40Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@ -18,6 +18,7 @@
ed.onContextMenu.add(function(ed, e) {
if (!e.ctrlKey) {
t._getMenu(ed).showMenu(e.clientX, e.clientY);
Event.add(ed.getDoc(), 'click', hide);
Event.cancel(e);
}
});
@ -26,12 +27,22 @@
if (t._menu) {
t._menu.removeAll();
t._menu.destroy();
Event.remove(ed.getDoc(), 'click', hide);
}
};
ed.onMouseDown.add(hide);
ed.onKeyDown.add(hide);
Event.add(document, 'click', hide);
},
getInfo : function() {
return {
longname : 'Contextmenu',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
_getMenu : function(ed) {
@ -46,10 +57,8 @@
p2 = DOM.getPos(ed.getContainer());
m = ed.controlManager.createDropMenu('contextmenu', {
offset_x : p1.x,
offset_y : p1.y,
/* vp_offset_x : p2.x,
vp_offset_y : p2.y,*/
offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0),
offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0),
constrain : 1
});

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})();
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.EmotionsPlugin',{init:function(ed,url){ed.addCommand('mceEmotion',function(){ed.windowManager.open({file:url+'/emotions.htm',width:250+parseInt(ed.getLang('emotions.delta_width',0)),height:160+parseInt(ed.getLang('emotions.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('emotions',{title:'emotions.emotions_desc',cmd:'mceEmotion'});},getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('emotions',tinymce.plugins.EmotionsPlugin);})();
(function(){tinymce.create("tinymce.plugins.EmotionsPlugin",{init:function(a,b){a.addCommand("mceEmotion",function(){a.windowManager.open({file:b+"/emotions.htm",width:250+parseInt(a.getLang("emotions.delta_width",0)),height:160+parseInt(a.getLang("emotions.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("emotions",tinymce.plugins.EmotionsPlugin)})();

View file

@ -1,10 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#emotions_dlg.title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/emotions.js"></script>
<base target="_self" />
</head>
<body style="display: none">
<div align="center">

View file

@ -1 +1 @@
(function(){tinymce.PluginManager.requireLangPack('example');tinymce.create('tinymce.plugins.ExamplePlugin',{init:function(ed,url){ed.addCommand('mceExample',function(){ed.windowManager.open({file:url+'/dialog.htm',width:320+parseInt(ed.getLang('example.delta_width',0)),height:120+parseInt(ed.getLang('example.delta_height',0)),inline:1},{plugin_url:url,some_custom_arg:'custom arg'});});ed.addButton('example',{title:'example.desc',cmd:'mceExample',image:url+'/img/example.gif'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('example',n.nodeName=='IMG');});},createControl:function(n,cm){return null;},getInfo:function(){return{longname:'Example plugin',author:'Some author',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',version:"1.0"};}});tinymce.PluginManager.add('example',tinymce.plugins.ExamplePlugin);})();
(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})();

View file

@ -53,6 +53,10 @@
height: 20px;
}
#doctypes {
width: 200px;
}
.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover {
border: 1px solid #0A246A;
background-color: #B6BDD2;

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.FullPagePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceFullPageProperties',function(){ed.windowManager.open({file:url+'/fullpage.htm',width:430+parseInt(ed.getLang('fullpage.delta_width',0)),height:495+parseInt(ed.getLang('fullpage.delta_height',0)),inline:1},{plugin_url:url,head_html:t.head});});ed.addButton('fullpage',{title:'fullpage.desc',cmd:'mceFullPageProperties'});ed.onBeforeSetContent.add(t._setContent,t);ed.onSetContent.add(t._setBodyAttribs,t);ed.onGetContent.add(t._getContent,t);},getInfo:function(){return{longname:'Fullpage',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_setBodyAttribs:function(ed,o){var bdattr,i,len,kv,k,v,t,attr=this.head.match(/body(.*?)>/i);if(attr&&attr[1]){bdattr=attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);for(i=0,len=bdattr.length;i<len;i++){kv=bdattr[i].split('=');k=kv[0].replace(/\s/,'');v=kv[1];if(v){v=v.replace(/^\s+/,'').replace(/\s+$/,'');t=v.match(/^["'](.*)["']$/);if(t)v=t[1];}else v=k;ed.dom.setAttrib(ed.getBody(),'style',v);}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true});},_setContent:function(ed,o){var t=this,sp,ep,c=o.content;c=c.replace(/<(\/?)BODY/gi,'<$1body');sp=c.indexOf('<body');if(sp!=-1){sp=c.indexOf('>',sp);t.head=c.substring(0,sp+1);ep=c.indexOf('</body',sp);if(ep==-1)ep=c.indexOf('</body',ep);o.content=c.substring(sp+1,ep);t.foot=c.substring(ep);function low(s){return s.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase();})};t.head=low(t.head);t.foot=low(t.foot);}else{t.head='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';t.head+='\n<html>\n<head>\n<title>Untitled document</title>\n</head>\n<body>\n';t.foot='\n</body>\n</html>';}},_getContent:function(ed,o){var t=this;o.content=tinymce.trim(t.head)+'\n'+tinymce.trim(o.content)+'\n'+tinymce.trim(t.foot);}});tinymce.PluginManager.add('fullpage',tinymce.plugins.FullPagePlugin);})();
(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c<e;c++){g=l[c].split("=");b=g[0].replace(/\s/,"");h=g[1];if(h){h=h.replace(/^\s+/,"").replace(/\s+$/,"");j=h.match(/^["'](.*)["']$/);if(j){h=j[1]}}else{h=b}d.dom.setAttrib(d.getBody(),"style",h)}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true})},_setContent:function(d,b){var h=this,a,j,f=b.content,g,i="";if(b.source_view&&d.getParam("fullpage_hide_in_source_view")){return}f=f.replace(/<(\/?)BODY/gi,"<$1body");a=f.indexOf("<body");if(a!=-1){a=f.indexOf(">",a);h.head=f.substring(0,a+1);j=f.indexOf("</body",a);if(j==-1){j=f.indexOf("</body",j)}b.content=f.substring(a+1,j);h.foot=f.substring(j);function e(c){return c.replace(/<\/?[A-Z]+/g,function(k){return k.toLowerCase()})}h.head=e(h.head);h.foot=e(h.foot)}else{h.head="";if(d.getParam("fullpage_default_xml_pi")){h.head+='<?xml version="1.0" encoding="'+d.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}h.head+=d.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');h.head+="\n<html>\n<head>\n<title>"+d.getParam("fullpage_default_title","Untitled document")+"</title>\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='<meta http-equiv="Content-Type" content="'+g+'" />\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n";h.foot="\n</body>\n</html>"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})();

View file

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 593 2008-02-13 13:00:12Z spocke $
* $Id: editor_plugin_src.js 1029 2009-02-24 22:32:21Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@ -51,21 +51,23 @@
if (attr && attr[1]) {
bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);
for(i = 0, len = bdattr.length; i < len; i++) {
kv = bdattr[i].split('=');
k = kv[0].replace(/\s/,'');
v = kv[1];
if (bdattr) {
for(i = 0, len = bdattr.length; i < len; i++) {
kv = bdattr[i].split('=');
k = kv[0].replace(/\s/,'');
v = kv[1];
if (v) {
v = v.replace(/^\s+/,'').replace(/\s+$/,'');
t = v.match(/^["'](.*)["']$/);
if (v) {
v = v.replace(/^\s+/,'').replace(/\s+$/,'');
t = v.match(/^["'](.*)["']$/);
if (t)
v = t[1];
} else
v = k;
if (t)
v = t[1];
} else
v = k;
ed.dom.setAttrib(ed.getBody(), 'style', v);
ed.dom.setAttrib(ed.getBody(), 'style', v);
}
}
}
},
@ -78,7 +80,10 @@
},
_setContent : function(ed, o) {
var t = this, sp, ep, c = o.content;
var t = this, sp, ep, c = o.content, v, st = '';
if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))
return;
// Parse out head, body and footer
c = c.replace(/<(\/?)BODY/gi, '<$1body');
@ -104,8 +109,26 @@
t.head = low(t.head);
t.foot = low(t.foot);
} else {
t.head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
t.head += '\n<html>\n<head>\n<title>Untitled document</title>\n</head>\n<body>\n';
t.head = '';
if (ed.getParam('fullpage_default_xml_pi'))
t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
t.head += ed.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n';
if (v = ed.getParam('fullpage_default_encoding'))
t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n';
if (v = ed.getParam('fullpage_default_font_family'))
st += 'font-family: ' + v + ';';
if (v = ed.getParam('fullpage_default_font_size'))
st += 'font-size: ' + v + ';';
if (v = ed.getParam('fullpage_default_text_color'))
st += 'color: ' + v + ';';
t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n';
t.foot = '\n</body>\n</html>';
}
},
@ -113,7 +136,8 @@
_getContent : function(ed, o) {
var t = this;
o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot);
if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))
o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot);
}
});

View file

@ -7,7 +7,6 @@
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="js/fullpage.js"></script>
<link href="css/fullpage.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body id="advlink" style="display: none">
<form onsubmit="updateAction();return false;" name="fullpage" action="#">
@ -26,27 +25,27 @@
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td nowrap="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label>&nbsp;</td>
<td class="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label>&nbsp;</td>
<td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td>
</tr>
<tr>
<td nowrap="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label>&nbsp;</td>
<td class="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label>&nbsp;</td>
<td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>
</tr>
<tr>
<td nowrap="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label>&nbsp;</td>
<td class="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label>&nbsp;</td>
<td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>
</tr>
<tr>
<td nowrap="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label>&nbsp;</td>
<td class="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label>&nbsp;</td>
<td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>
</tr>
<tr>
<td nowrap="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label>&nbsp;</td>
<td class="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label>&nbsp;</td>
<td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>
</tr>
<tr>
<td nowrap="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label>&nbsp;</td>
<td class="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label>&nbsp;</td>
<td>
<select id="metarobots" name="metarobots">
<option value="">{#not_set}</option>
@ -73,7 +72,7 @@
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label>&nbsp;</td>
<td class="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label>&nbsp;</td>
<td>
<select id="doctypes" name="doctypes">
<option value="">{#not_set}</option>
@ -81,7 +80,7 @@
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label>&nbsp;</td>
<td class="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label>&nbsp;</td>
<td><input type="text" id="langcode" name="langcode" value="" /></td>
</tr>
<tr>
@ -95,7 +94,7 @@
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label>&nbsp;</td>
<td class="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label>&nbsp;</td>
<td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>
</tr>
</table>

View file

@ -123,7 +123,7 @@ function init() {
// Parse xml and doctype
xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
docType = getReItem(/<\!DOCTYPE.*?>/gi, h, 0);
docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' ');
f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);
// Parse title
@ -143,7 +143,7 @@ function init() {
switch (eq.toLowerCase()) {
case "content-type":
tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, value, 1);
tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1);
// Override XML encoding
if (tmp != "")
@ -374,7 +374,6 @@ function updateAction() {
}
function changedStyleField(field) {
//alert(field.id);
}
function setMeta(he, k, v) {

View file

@ -1 +1 @@
(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=document.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{window.setTimeout(function(){tinymce.dom.Event.remove(window,'resize',t.resizeFunc);tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(document.body,'overflow',ed.getParam('fullscreen_overflow'));window.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));tinyMCE.settings=tinyMCE.oldSettings;},10);}return;}if(ed.getParam('fullscreen_new_window')){win=window.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{tinyMCE.oldSettings=tinyMCE.settings;s.fullscreen_overflow=DOM.getStyle(document.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(document.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();window.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(document.body,'div',{id:'mce_fullscreen_container',style:'position:absolute;top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:150;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent({format:'raw'}),{format:'raw'});ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent());});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();t.resizeFunc=tinymce.dom.Event.add(window,'resize',function(){var vp=tinymce.DOM.getViewPort();t.fullscreenEditor.theme.resizeTo(vp.w,vp.h);});}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})();
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(c,d){var e=this,f={},b;e.editor=c;c.addCommand("mceFullScreen",function(){var h,i=a.doc.documentElement;if(c.getParam("fullscreen_is_enabled")){if(c.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",e.resizeFunc);tinyMCE.get(c.getParam("fullscreen_editor_id")).setContent(c.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(c);a.remove("mce_fullscreen_container");i.style.overflow=c.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",c.getParam("fullscreen_overflow"));a.win.scrollTo(c.getParam("fullscreen_scrollx"),c.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(c.getParam("fullscreen_new_window")){h=a.win.open(d+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{h.resizeTo(screen.availWidth,screen.availHeight)}catch(g){}}else{tinyMCE.oldSettings=tinyMCE.settings;f.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";f.fullscreen_html_overflow=a.getStyle(i,"overflow",1);b=a.getViewPort();f.fullscreen_scrollx=b.x;f.fullscreen_scrolly=b.y;if(tinymce.isOpera&&f.fullscreen_overflow=="visible"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&f.fullscreen_overflow=="scroll"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&(f.fullscreen_html_overflow=="visible"||f.fullscreen_html_overflow=="scroll")){f.fullscreen_html_overflow="auto"}if(f.fullscreen_overflow=="0px"){f.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");i.style.overflow="hidden";b=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){b.h-=1}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!a.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+b.w+"px;height:"+b.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(c.settings,function(j,k){f[k]=j});f.id="mce_fullscreen";f.width=n.clientWidth;f.height=n.clientHeight-15;f.fullscreen_is_enabled=true;f.fullscreen_editor_id=c.id;f.theme_advanced_resizing=false;f.save_onsavecallback=function(){c.setContent(tinyMCE.get(f.id).getContent({format:"raw"}),{format:"raw"});c.execCommand("mceSave")};tinymce.each(c.getParam("fullscreen_settings"),function(l,j){f[j]=l});if(f.theme_advanced_toolbar_location==="external"){f.theme_advanced_toolbar_location="top"}e.fullscreenEditor=new tinymce.Editor("mce_fullscreen",f);e.fullscreenEditor.onInit.add(function(){e.fullscreenEditor.setContent(c.getContent());e.fullscreenEditor.focus()});e.fullscreenEditor.render();tinyMCE.add(e.fullscreenEditor);e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var j=tinymce.DOM.getViewPort();e.fullscreenEditor.theme.resizeTo(j.w,j.h)})}});c.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});c.onNodeChange.add(function(h,g){g.setActive("fullscreen",h.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();

View file

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 689 2008-03-09 18:47:19Z spocke $
* $Id: editor_plugin_src.js 923 2008-09-09 16:45:29Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@ -16,20 +16,20 @@
// Register commands
ed.addCommand('mceFullScreen', function() {
var win, de = document.documentElement;
var win, de = DOM.doc.documentElement;
if (ed.getParam('fullscreen_is_enabled')) {
if (ed.getParam('fullscreen_new_window'))
closeFullscreen(); // Call to close in new window
else {
window.setTimeout(function() {
tinymce.dom.Event.remove(window, 'resize', t.resizeFunc);
DOM.win.setTimeout(function() {
tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
tinyMCE.remove(ed);
DOM.remove('mce_fullscreen_container');
de.style.overflow = ed.getParam('fullscreen_html_overflow');
DOM.setStyle(document.body, 'overflow', ed.getParam('fullscreen_overflow'));
window.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
}, 10);
}
@ -38,7 +38,7 @@
}
if (ed.getParam('fullscreen_new_window')) {
win = window.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
try {
win.resizeTo(screen.availWidth, screen.availHeight);
} catch (e) {
@ -46,7 +46,7 @@
}
} else {
tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
s.fullscreen_overflow = DOM.getStyle(document.body, 'overflow', 1) || 'auto';
s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
vp = DOM.getViewPort();
s.fullscreen_scrollx = vp.x;
@ -60,18 +60,22 @@
if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
s.fullscreen_overflow = 'auto';
// Fixes an IE bug where the scrollbars doesn't reappear
if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
s.fullscreen_html_overflow = 'auto';
if (s.fullscreen_overflow == '0px')
s.fullscreen_overflow = '';
DOM.setStyle(document.body, 'overflow', 'hidden');
DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
de.style.overflow = 'hidden'; //Fix for IE6/7
vp = DOM.getViewPort();
window.scrollTo(0, 0);
DOM.win.scrollTo(0, 0);
if (tinymce.isIE)
vp.h -= 1;
n = DOM.add(document.body, 'div', {id : 'mce_fullscreen_container', style : 'position:absolute;top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:150;'});
n = DOM.add(DOM.doc.body, 'div', {id : 'mce_fullscreen_container', style : 'position:' + (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel) ? 'absolute' : 'fixed') + ';top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
DOM.add(n, 'div', {id : 'mce_fullscreen'});
tinymce.each(ed.settings, function(v, n) {
@ -99,6 +103,7 @@
t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
t.fullscreenEditor.onInit.add(function() {
t.fullscreenEditor.setContent(ed.getContent());
t.fullscreenEditor.focus();
});
t.fullscreenEditor.render();
@ -108,7 +113,7 @@
t.fullscreenElement.update();
//document.body.overflow = 'hidden';
t.resizeFunc = tinymce.dom.Event.add(window, 'resize', function() {
t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {
var vp = tinymce.DOM.getViewPort();
t.fullscreenEditor.theme.resizeTo(vp.w, vp.h);

View file

@ -10,7 +10,7 @@
settings[key] = "window.opener." + settings[key];
}
var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings;
var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;
// Clone array
for (var n in paSe)
@ -41,13 +41,13 @@
settings['ask'] = false;
settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
settings['fullscreen_is_enabled'] = true;
settings['fullscreen_editor_id'] = window.opener.tinyMCE.activeEditor.id;
settings['fullscreen_editor_id'] = oeID;
settings['theme_advanced_resizing'] = false;
settings['strict_loading_mode'] = true;
settings.save_onsavecallback = function() {
window.opener.tinyMCE.activeEditor.setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
window.opener.tinyMCE.activeEditor.execCommand('mceSave');
window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
window.opener.tinyMCE.get(oeID).execCommand('mceSave');
window.close();
};
@ -56,7 +56,7 @@
}
function moveContent() {
window.opener.tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
}
function closeFullscreen() {
@ -78,7 +78,7 @@
function render() {
var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
e.value = window.opener.tinyMCE.activeEditor.getContent();
e.value = window.opener.tinyMCE.get(oeID).getContent();
vp = dom.getViewPort();
settings.width = vp.w;
@ -96,7 +96,6 @@
// Add onunload
tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
</script>
<base target="_self" />
</head>
<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
<form onsubmit="doParentSubmit();">

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.IESpell',{init:function(ed,url){var t=this,sp;if(!tinymce.isIE)return;t.editor=ed;ed.addCommand('mceIESpell',function(){try{sp=new ActiveXObject("ieSpell.ieSpellExtension");sp.CheckDocumentNode(ed.getDoc().documentElement);}catch(e){if(e.number==-2146827859){ed.windowManager.confirm(ed.getLang("iespell.download"),function(s){if(s)window.open('http://www.iespell.com/download.php','ieSpellDownload','');});}else ed.windowManager.alert("Error Loading ieSpell: Exception "+e.number);}});ed.addButton('iespell',{title:'iespell.iespell_desc',cmd:'mceIESpell'});},getInfo:function(){return{longname:'IESpell (IE Only)',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('iespell',tinymce.plugins.IESpell);})();
(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})();

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 697 2008-03-11 10:33:06Z spocke $
* $Id: editor_plugin_src.js 1150 2009-06-01 11:50:46Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@ -33,8 +33,9 @@
var t = this;
t.parent(ed);
t.zIndex = 1000;
t.zIndex = 300000;
t.count = 0;
t.windows = {};
},
open : function(f, p) {
@ -47,7 +48,10 @@
if (!f.inline)
return t.parent(f, p);
t.bookmark = ed.selection.getBookmark('simple');
// Only store selection if the type is a normal window
if (!f.type)
t.bookmark = ed.selection.getBookmark(1);
id = DOM.uniqueId();
vp = DOM.getViewPort();
f.width = parseInt(f.width || 320);
@ -99,8 +103,8 @@
opt += ' mceMovable';
// Create DOM objects
t._addAll(document.body,
['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', dir : 'ltr', style : 'width:100px;height:100px'},
t._addAll(DOM.doc.body,
['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'},
['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
['div', {id : id + '_top', 'class' : 'mceTop'},
['div', {'class' : 'mceLeft'}],
@ -157,8 +161,12 @@
DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});
u = f.url || f.file;
if (tinymce.relaxedDomain)
u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;
if (u) {
if (tinymce.relaxedDomain)
u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;
u = tinymce._addVer(u);
}
if (!f.type) {
DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});
@ -230,7 +238,6 @@
});
// Add window
t.windows = t.windows || {};
w = t.windows[id] = {
id : id,
mousedown_func : mdf,
@ -247,17 +254,20 @@
});
// Setup blocker
if (t.count == 0 && t.editor.getParam('dialog_type') == 'modal') {
if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {
DOM.add(DOM.doc.body, 'div', {
id : 'mceModalBlocker',
'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',
style : {left : vp.x, top : vp.y, width : vp.w, height : vp.h, zIndex : t.zIndex - 1}
style : {zIndex : t.zIndex - 1}
});
DOM.show('mceModalBlocker'); // Reduces flicker in IE
} else
DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);
if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))
DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
t.focus(id);
t._fixIELayout(id, 1);
@ -271,16 +281,18 @@
},
focus : function(id) {
var t = this, w = t.windows[id];
var t = this, w;
w.zIndex = this.zIndex++;
w.element.setStyle('zIndex', w.zIndex);
w.element.update();
if (w = t.windows[id]) {
w.zIndex = this.zIndex++;
w.element.setStyle('zIndex', w.zIndex);
w.element.update();
id = id + '_wrapper';
DOM.removeClass(t.lastId, 'mceFocus');
DOM.addClass(id, 'mceFocus');
t.lastId = id;
id = id + '_wrapper';
DOM.removeClass(t.lastId, 'mceFocus');
DOM.addClass(id, 'mceFocus');
t.lastId = id;
}
},
_addAll : function(te, ne) {
@ -297,7 +309,7 @@
},
_startDrag : function(id, se, ac) {
var t = this, mu, mm, d = document, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh;
var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh;
// Get positons and sizes
// cp = DOM.getPos(t.editor.getContainer());
@ -342,8 +354,12 @@
DOM.add(d.body, 'div', {
id : 'mceEventBlocker',
'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),
style : {left : vp.x, top : vp.y, width : vp.w + 2, height : vp.h + 2, zIndex : 20001}
style : {zIndex : t.zIndex + 1}
});
if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))
DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
eb = new Element('mceEventBlocker');
eb.update();
@ -459,23 +475,27 @@
},
close : function(win, id) {
var t = this, w, d = document, ix = 0, fw;
var t = this, w, d = DOM.doc, ix = 0, fw, id;
id = t._findId(id || win);
// Probably not inline
if (!t.windows[id]) {
t.parent(win);
return;
}
t.count--;
if (t.count == 0)
DOM.remove('mceModalBlocker');
// Probably not inline
if (!id && win) {
t.parent(win);
return;
}
if (w = t.windows[id]) {
t.onClose.dispatch(t);
Event.remove(d, 'mousedown', w.mousedownFunc);
Event.remove(d, 'click', w.clickFunc);
Event.clear(id);
Event.clear(id + '_ifr');
DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak
w.element.remove();
@ -494,8 +514,13 @@
}
},
setTitle : function(ti, id) {
DOM.get(id + '_title').innerHTML = DOM.encode(ti);
setTitle : function(w, ti) {
var e;
w = this._findId(w);
if (e = DOM.get(w + '_title'))
e.innerHTML = DOM.encode(ti);
},
alert : function(txt, cb, s) {
@ -538,6 +563,24 @@
// Internal functions
_findId : function(w) {
var t = this;
if (typeof(w) == 'string')
return w;
each(t.windows, function(wo) {
var ifr = DOM.get(wo.id + '_ifr');
if (ifr && w == ifr.contentWindow) {
w = wo.id;
return false;
}
});
return w;
},
_fixIELayout : function(id, s) {
var w, img;

View file

@ -1,14 +1,14 @@
/* Clearlooks 2 */
/* Reset */
.clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
/* General */
.clearlooks2 {position:absolute}
.clearlooks2 {position:absolute; direction:ltr}
.clearlooks2 .mceWrapper {position:static}
.mceEventBlocker {position:absolute; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; filter:alpha(opacity=50)}
.clearlooks2_modalBlocker {position:absolute; left:0; top:0; background:#FFF; opacity:0.6; filter:alpha(opacity=60); display:none}
.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
/* Top */
.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.InsertDateTime',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertDate',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_dateFormat",ed.getLang('insertdatetime.date_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addCommand('mceInsertTime',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_timeFormat",ed.getLang('insertdatetime.time_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addButton('insertdate',{title:'insertdatetime.insertdate_desc',cmd:'mceInsertDate'});ed.addButton('inserttime',{title:'insertdatetime.inserttime_desc',cmd:'mceInsertTime'});},getInfo:function(){return{longname:'Insert date/time',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_getDateTime:function(d,fmt){var ed=this.editor;function addZeros(value,len){value=""+value;if(value.length<len){for(var i=0;i<(len-value.length);i++)value="0"+value;}return value;};fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt.replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);fmt=fmt.replace("%b",""+ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);fmt=fmt.replace("%A",""+ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);fmt=fmt.replace("%a",""+ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);fmt=fmt.replace("%%","%");return fmt;}});tinymce.PluginManager.add('insertdatetime',tinymce.plugins.InsertDateTime);})();
(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length<d){for(var f=0;f<(d-g.length);f++){g="0"+g}}return g}a=a.replace("%D","%m/%d/%y");a=a.replace("%r","%I:%M:%S %p");a=a.replace("%Y",""+e.getFullYear());a=a.replace("%y",""+e.getYear());a=a.replace("%m",b(e.getMonth()+1,2));a=a.replace("%d",b(e.getDate(),2));a=a.replace("%H",""+b(e.getHours(),2));a=a.replace("%M",""+b(e.getMinutes(),2));a=a.replace("%S",""+b(e.getSeconds(),2));a=a.replace("%I",""+((e.getHours()+11)%12+1));a=a.replace("%p",""+(e.getHours()<12?"AM":"PM"));a=a.replace("%B",""+c.getLang("insertdatetime.months_long").split(",")[e.getMonth()]);a=a.replace("%b",""+c.getLang("insertdatetime.months_short").split(",")[e.getMonth()]);a=a.replace("%A",""+c.getLang("insertdatetime.day_long").split(",")[e.getDay()]);a=a.replace("%a",""+c.getLang("insertdatetime.day_short").split(",")[e.getDay()]);a=a.replace("%%","%");return a}});tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime)})();

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.Layer',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertLayer',t._insertLayer,t);ed.addCommand('mceMoveForward',function(){t._move(1);});ed.addCommand('mceMoveBackward',function(){t._move(-1);});ed.addCommand('mceMakeAbsolute',function(){t._toggleAbsolute();});ed.addButton('moveforward',{title:'layer.forward_desc',cmd:'mceMoveForward'});ed.addButton('movebackward',{title:'layer.backward_desc',cmd:'mceMoveBackward'});ed.addButton('absolute',{title:'layer.absolute_desc',cmd:'mceMakeAbsolute'});ed.addButton('insertlayer',{title:'layer.insertlayer_desc',cmd:'mceInsertLayer'});ed.onInit.add(function(){if(tinymce.isIE)ed.getDoc().execCommand('2D-Position',false,true);});ed.onNodeChange.add(t._nodeChange,t);ed.onVisualAid.add(t._visualAid,t);},getInfo:function(){return{longname:'Layer',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var le,p;le=this._getParentLayer(n);p=ed.dom.getParent(n,'DIV,P,IMG');if(!p){cm.setDisabled('absolute',1);cm.setDisabled('moveforward',1);cm.setDisabled('movebackward',1);}else{cm.setDisabled('absolute',0);cm.setDisabled('moveforward',!le);cm.setDisabled('movebackward',!le);cm.setActive('absolute',le&&le.style.position.toLowerCase()=="absolute");}},_visualAid:function(ed,e,s){var dom=ed.dom;tinymce.each(dom.select('div,p',e),function(e){if(/^(absolute|relative|static)$/i.test(e.style.position)){if(s)dom.addClass(e,'mceItemVisualAid');else dom.removeClass(e,'mceItemVisualAid');}});},_move:function(d){var ed=this.editor,i,z=[],le=this._getParentLayer(ed.selection.getNode()),ci=-1,fi=-1,nl;nl=[];tinymce.walk(ed.getBody(),function(n){if(n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position))nl.push(n);},'childNodes');for(i=0;i<nl.length;i++){z[i]=nl[i].style.zIndex?parseInt(nl[i].style.zIndex):0;if(ci<0&&nl[i]==le)ci=i;}if(d<0){for(i=0;i<z.length;i++){if(z[i]<z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else{if(z[ci]>0)nl[ci].style.zIndex=z[ci]-1;}}else{for(i=0;i<z.length;i++){if(z[i]>z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else nl[ci].style.zIndex=z[ci]+1;}ed.execCommand('mceRepaint');},_getParentLayer:function(n){return this.editor.dom.getParent(n,function(n){return n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position);});},_insertLayer:function(){var ed=this.editor,p=ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(),'*'));ed.dom.add(ed.getBody(),'div',{style:{position:'absolute',left:p.x,top:(p.y>20?p.y:20),width:100,height:100},'class':'mceItemVisualAid'},ed.selection.getContent()||ed.getLang('layer.content'));},_toggleAbsolute:function(){var ed=this.editor,le=this._getParentLayer(ed.selection.getNode());if(!le)le=ed.dom.getParent(ed.selection.getNode(),'DIV,P,IMG');if(le){if(le.style.position.toLowerCase()=="absolute"){ed.dom.setStyles(le,{position:'',left:'',top:'',width:'',height:''});ed.dom.removeClass(le,'mceItemVisualAid');}else{if(le.style.left=="")le.style.left=20+'px';if(le.style.top=="")le.style.top=20+'px';if(le.style.width=="")le.style.width=le.width?(le.width+'px'):'100px';if(le.style.height=="")le.style.height=le.height?(le.height+'px'):'100px';le.style.position="absolute";ed.addVisual(ed.getBody());}ed.execCommand('mceRepaint');ed.nodeChanged();}}});tinymce.PluginManager.add('layer',tinymce.plugins.Layer);})();
(function(){tinymce.create("tinymce.plugins.Layer",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertLayer",c._insertLayer,c);a.addCommand("mceMoveForward",function(){c._move(1)});a.addCommand("mceMoveBackward",function(){c._move(-1)});a.addCommand("mceMakeAbsolute",function(){c._toggleAbsolute()});a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});a.onInit.add(function(){if(tinymce.isIE){a.getDoc().execCommand("2D-Position",false,true)}});a.onNodeChange.add(c._nodeChange,c);a.onVisualAid.add(c._visualAid,c)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var c,d;c=this._getParentLayer(e);d=b.dom.getParent(e,"DIV,P,IMG");if(!d){a.setDisabled("absolute",1);a.setDisabled("moveforward",1);a.setDisabled("movebackward",1)}else{a.setDisabled("absolute",0);a.setDisabled("moveforward",!c);a.setDisabled("movebackward",!c);a.setActive("absolute",c&&c.style.position.toLowerCase()=="absolute")}},_visualAid:function(a,c,b){var d=a.dom;tinymce.each(d.select("div,p",c),function(f){if(/^(absolute|relative|static)$/i.test(f.style.position)){if(b){d.addClass(f,"mceItemVisualAid")}else{d.removeClass(f,"mceItemVisualAid")}}})},_move:function(h){var b=this.editor,f,g=[],e=this._getParentLayer(b.selection.getNode()),c=-1,j=-1,a;a=[];tinymce.walk(b.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){a.push(d)}},"childNodes");for(f=0;f<a.length;f++){g[f]=a[f].style.zIndex?parseInt(a[f].style.zIndex):0;if(c<0&&a[f]==e){c=f}}if(h<0){for(f=0;f<g.length;f++){if(g[f]<g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;f<g.length;f++){if(g[f]>g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();

View file

@ -1,68 +1,16 @@
#id, #name, #hspace, #vspace, #class_name, #align {
width: 100px;
}
#hspace, #vspace {
width: 50px;
}
#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode {
width: 100px;
}
#flash_base, #flash_flashvars {
width: 240px;
}
#width, #height {
width: 40px;
}
#src, #media_type {
width: 250px;
}
#class {
width: 120px;
}
#prev {
margin: 0;
border: 1px solid black;
width: 99%;
height: 230px;
overflow: auto;
}
.panel_wrapper div.current {
height: 390px;
overflow: auto;
}
#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options {
display: none;
}
.mceAddSelectValue {
background-color: #DDDDDD;
}
#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume {
width: 70px;
}
#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume {
width: 70px;
}
#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks {
width: 70px;
}
#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle {
width: 90px;
}
#qt_qtsrc {
width: 200px;
}
#id, #name, #hspace, #vspace, #class_name, #align { width: 100px }
#hspace, #vspace { width: 50px }
#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }
#flash_base, #flash_flashvars { width: 240px }
#width, #height { width: 40px }
#src, #media_type { width: 250px }
#class { width: 120px }
#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto }
.panel_wrapper div.current { height: 390px; overflow: auto }
#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }
.mceAddSelectValue { background-color: #DDDDDD }
#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }
#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }
#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }
#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }
#qt_qtsrc { width: 200px }

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 615 2008-02-20 23:18:01Z spocke $
* $Id: editor_plugin_src.js 1222 2009-09-03 17:26:47Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@ -19,6 +19,11 @@
return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);
};
ed.onPreInit.add(function() {
// Force in _value parameter this extra parameter is required for older Opera versions
ed.serializer.addRules('param[name|value|_mce_value]');
});
// Register commands
ed.addCommand('mceMedia', function() {
ed.windowManager.open({
@ -47,9 +52,16 @@
mceItemRealMedia : 'realmedia'
};
ed.dom.loadCSS(url + "/css/content.css");
ed.selection.onSetContent.add(function() {
t._spansToImgs(ed.getBody());
});
if (ed.theme.onResolveName) {
ed.selection.onBeforeSetContent.add(t._objectsToSpans, t);
if (ed.settings.content_css !== false)
ed.dom.loadCSS(url + "/css/content.css");
if (ed.theme && ed.theme.onResolveName) {
ed.theme.onResolveName.add(function(th, o) {
if (o.name == 'img') {
each(lo, function(v, k) {
@ -72,23 +84,7 @@
}
});
ed.onBeforeSetContent.add(function(ed, o) {
var h = o.content;
h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {
var o = t._parse(c);
return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'
});
h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');
h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');
h = h.replace(/<\/(object|embed)([^>]*)>/gi, '</span>');
h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_value=') + ' class="mceItemParam"></span>'});
h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');
o.content = h;
});
ed.onBeforeSetContent.add(t._objectsToSpans, t);
ed.onSetContent.add(function() {
t._spansToImgs(ed.getBody());
@ -166,17 +162,17 @@
});
ed.onPostProcess.add(function(ed, o) {
o.content = o.content.replace(/_value=/g, 'value=');
o.content = o.content.replace(/_mce_value=/g, 'value=');
});
if (ed.getParam('media_use_script')) {
function getAttr(s, n) {
n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
function getAttr(s, n) {
n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
return n ? ed.dom.decode(n[1]) : '';
};
return n ? ed.dom.decode(n[1]) : '';
};
ed.onPostProcess.add(function(ed, o) {
ed.onPostProcess.add(function(ed, o) {
if (ed.getParam('media_use_script')) {
o.content = o.content.replace(/<img[^>]+>/g, function(im) {
var cl = getAttr(im, 'class');
@ -189,8 +185,8 @@
return im;
});
});
}
}
});
},
getInfo : function() {
@ -204,30 +200,72 @@
},
// Private methods
_objectsToSpans : function(ed, o) {
var t = this, h = o.content;
h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {
var o = t._parse(c);
return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'
});
h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');
h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>');
h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');
h = h.replace(/<\/(object)([^>]*)>/gi, '</span>');
h = h.replace(/<\/embed>/gi, '');
h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_mce_value=') + ' class="mceItemParam"></span>'});
h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');
o.content = h;
},
_buildObj : function(o, n) {
var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title);
var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc;
stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash';
p.width = o.width = dom.getAttrib(n, 'width') || 100;
p.height = o.height = dom.getAttrib(n, 'height') || 100;
ob = dom.create('span', {
mce_name : 'object',
classid : "clsid:" + o.classid,
codebase : o.codebase,
width : o.width,
height : o.height
});
if (p.src)
p.src = ed.convertURL(p.src, 'src', n);
if (stc) {
ob = dom.create('span', {
id : p.id,
mce_name : 'object',
type : 'application/x-shockwave-flash',
data : p.src,
style : dom.getAttrib(n, 'style'),
width : o.width,
height : o.height
});
} else {
ob = dom.create('span', {
id : p.id,
mce_name : 'object',
classid : "clsid:" + o.classid,
style : dom.getAttrib(n, 'style'),
codebase : o.codebase,
width : o.width,
height : o.height
});
}
each (p, function(v, k) {
if (!/^(width|height|codebase|classid)$/.test(k))
dom.add(ob, 'span', {mce_name : 'param', name : k, '_value' : v});
if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) {
// Use url instead of src in IE for Windows media
if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url)
k = 'url';
if (v)
dom.add(ob, 'span', {mce_name : 'param', name : k, '_mce_value' : v});
}
});
dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type}, p));
if (!stc)
dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p));
return ob;
},
@ -301,18 +339,21 @@
},
_createImg : function(cl, n) {
var im, dom = this.editor.dom, pa = {}, ti = '';
var im, dom = this.editor.dom, pa = {}, ti = '', args;
args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data'];
// Create image
im = dom.create('img', {
src : this.url + '/img/trans.gif',
width : dom.getAttrib(n, 'width') || 100,
height : dom.getAttrib(n, 'height') || 100,
style : dom.getAttrib(n, 'style'),
'class' : cl
});
// Setup base parameters
each(['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode'], function(na) {
each(args, function(na) {
var v = dom.getAttrib(n, na);
if (v)
@ -322,7 +363,7 @@
// Add optional parameters
each(dom.select('span', n), function(n) {
if (dom.hasClass(n, 'mceItemParam'))
pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_value');
pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value');
});
// Use src not movie
@ -331,6 +372,23 @@
delete pa.movie;
}
// No src try data
if (!pa.src) {
pa.src = pa.data;
delete pa.data;
}
// Merge with embed args
n = dom.select('.mceItemEmbed', n)[0];
if (n) {
each(args, function(na) {
var v = dom.getAttrib(n, na);
if (v && !pa[na])
pa[na] = v;
});
}
delete pa.width;
delete pa.height;

View file

@ -183,7 +183,7 @@ function insertMedia() {
tinyMCEPopup.restoreSelection();
if (!AutoValidator.validate(f)) {
alert(ed.getLang('invalid_data'));
tinyMCEPopup.alert(ed.getLang('invalid_data'));
return false;
}
@ -218,7 +218,7 @@ function insertMedia() {
break;
}
if (fe.width != f.width.value || fe.height != f.height.height)
if (fe.width != f.width.value || fe.height != f.height.value)
ed.execCommand('mceRepaint');
fe.title = serializeParameters();
@ -359,7 +359,9 @@ function changedType(t) {
d.getElementById('shockwave_options').style.display = 'none';
d.getElementById('wmp_options').style.display = 'none';
d.getElementById('rmp_options').style.display = 'none';
d.getElementById(t + '_options').style.display = 'block';
if (t)
d.getElementById(t + '_options').style.display = 'block';
}
function serializeParameters() {
@ -467,7 +469,7 @@ function setBool(pl, p, n) {
if (typeof(pl[n]) == "undefined")
return;
document.forms[0].elements[p + "_" + n].checked = pl[n];
document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false';
}
function setStr(pl, p, n) {
@ -488,7 +490,7 @@ function getBool(p, n, d, tv, fv) {
tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'";
fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'";
return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ',');
return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',");
}
function getStr(p, n, d) {
@ -598,14 +600,17 @@ function generatePreview(c) {
pl.name = !pl.name ? 'eobj' : pl.name;
pl.align = !pl.align ? '' : pl.align;
h += '<object classid="clsid:' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
// Avoid annoying warning about insecure items
if (!tinymce.isIE || document.location.protocol != 'https:') {
h += '<object classid="' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
for (n in pl) {
h += '<param name="' + n + '" value="' + pl[n] + '">';
for (n in pl) {
h += '<param name="' + n + '" value="' + pl[n] + '">';
// Add extra url parameter if it's an absolute URL
if (n == 'src' && pl[n].indexOf('://') != -1)
h += '<param name="url" value="' + pl[n] + '" />';
// Add extra url parameter if it's an absolute URL
if (n == 'src' && pl[n].indexOf('://') != -1)
h += '<param name="url" value="' + pl[n] + '" />';
}
}
h += '<embed type="' + type + '" ';
@ -613,7 +618,11 @@ function generatePreview(c) {
for (n in pl)
h += n + '="' + pl[n] + '" ';
h += '></embed></object>';
h += '></embed>';
// Avoid annoying warning about insecure items
if (!tinymce.isIE || document.location.protocol != 'https:')
h += '</object>';
p.innerHTML = "<!-- x --->" + h;
}

View file

@ -9,7 +9,6 @@
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
<link href="css/media.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body style="display: none">
<form onsubmit="insertMedia();return false;" action="#">
@ -33,7 +32,7 @@
<option value="flash">Flash</option>
<!-- <option value="flv">Flash video (FLV)</option> -->
<option value="qt">Quicktime</option>
<option value="shockwave">Shockware</option>
<option value="shockwave">Shockwave</option>
<option value="wmp">Windows Media</option>
<option value="rmp">Real Media</option>
</select>
@ -52,7 +51,7 @@
</tr>
<tr id="linklistrow">
<td><label for="linklist">{#media_dlg.list}</label></td>
<td id="linklistcontainer">&nbsp;</td>
<td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td>
</tr>
<tr>
<td><label for="width">{#media_dlg.size}</label></td>
@ -260,8 +259,7 @@
<td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td>
<td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td>
<td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>
<td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>
</tr>
<tr>

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.Nonbreaking',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceNonBreaking',function(){ed.execCommand('mceInsertContent',false,(ed.plugins.visualchars&&ed.plugins.visualchars.state)?'<span class="mceItemHidden mceVisualNbsp">&middot;</span>':'&nbsp;');});ed.addButton('nonbreaking',{title:'nonbreaking.nonbreaking_desc',cmd:'mceNonBreaking'});if(ed.getParam('nonbreaking_force_tab')){ed.onKeyDown.add(function(ed,e){if(tinymce.isIE&&e.keyCode==9){ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');tinymce.dom.Event.cancel(e);}});}},getInfo:function(){return{longname:'Nonbreaking space',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('nonbreaking',tinymce.plugins.Nonbreaking);})();
(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'<span class="mceItemHidden mceVisualNbsp">&middot;</span>':"&nbsp;")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})();

View file

@ -1 +1 @@
(function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.NonEditablePlugin',{init:function(ed,url){var t=this,editClass,nonEditClass;t.editor=ed;editClass=ed.getParam("noneditable_editable_class","mceEditable");nonEditClass=ed.getParam("noneditable_noneditable_class","mceNonEditable");ed.onNodeChange.addToTop(function(ed,cm,n){var sc,ec;sc=ed.dom.getParent(ed.selection.getStart(),function(n){return ed.dom.hasClass(n,nonEditClass);});ec=ed.dom.getParent(ed.selection.getEnd(),function(n){return ed.dom.hasClass(n,nonEditClass);});if(sc||ec){t._setDisabled(1);return false;}else t._setDisabled(0);});},getInfo:function(){return{longname:'Non editable elements',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_block:function(ed,e){return Event.cancel(e);},_setDisabled:function(s){var t=this,ed=t.editor;tinymce.each(ed.controlManager.controls,function(c){c.setDisabled(s);});if(s!==t.disabled){if(s){ed.onKeyDown.addToTop(t._block);ed.onKeyPress.addToTop(t._block);ed.onKeyUp.addToTop(t._block);ed.onPaste.addToTop(t._block);}else{ed.onKeyDown.remove(t._block);ed.onKeyPress.remove(t._block);ed.onKeyUp.remove(t._block);ed.onPaste.remove(t._block);}t.disabled=s;}}});tinymce.PluginManager.add('noneditable',tinymce.plugins.NonEditablePlugin);})();
(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})();

View file

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
* $Id: editor_plugin_src.js 743 2008-03-23 17:47:33Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@ -48,6 +48,12 @@
},
_block : function(ed, e) {
var k = e.keyCode;
// Don't block arrow keys, pg up/down, and F1-F12
if ((k > 32 && k < 41) || (k > 111 && k < 124))
return;
return Event.cancel(e);
},

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.PageBreakPlugin',{init:function(ed,url){var pb='<img src="'+url+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',cls='mcePageBreak',sep=ed.getParam('pagebreak_separator','<!-- pagebreak -->'),pbRE;pbRE=new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return'\\'+a;}),'g');ed.addCommand('mcePageBreak',function(){ed.execCommand('mceInsertContent',0,pb);});ed.addButton('pagebreak',{title:'pagebreak.desc',cmd:cls});ed.onInit.add(function(){ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.node.nodeName=='IMG'&&ed.dom.hasClass(o.node,cls))o.name='pagebreak';});}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='IMG'&&ed.dom.hasClass(e,cls))ed.selection.select(e);});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('pagebreak',n.nodeName==='IMG'&&ed.dom.hasClass(n,cls));});ed.onBeforeSetContent.add(function(ed,o){o.content=o.content.replace(pbRE,pb);});ed.onPostProcess.add(function(ed,o){if(o.get)o.content=o.content.replace(/<img[^>]+>/g,function(im){if(im.indexOf('class="mcePageBreak')!==-1)im=sep;return im;});});},getInfo:function(){return{longname:'PageBreak',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('pagebreak',tinymce.plugins.PageBreakPlugin);})();
(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='<img src="'+d+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',a="mcePageBreak",c=b.getParam("pagebreak_separator","<!-- pagebreak -->"),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.settings.content_css!==false){b.dom.loadCSS(d+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})();

View file

@ -21,7 +21,8 @@
ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});
ed.onInit.add(function() {
ed.dom.loadCSS(url + "/css/content.css");
if (ed.settings.content_css !== false)
ed.dom.loadCSS(url + "/css/content.css");
if (ed.theme.onResolveName) {
ed.theme.onResolveName.add(function(th, o) {

File diff suppressed because one or more lines are too long

View file

@ -1,75 +1,179 @@
/**
* $Id: editor_plugin_src.js 650 2008-02-27 13:41:02Z spocke $
* $Id: editor_plugin_src.js 1225 2009-09-07 19:06:19Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
var Event = tinymce.dom.Event;
var each = tinymce.each;
tinymce.create('tinymce.plugins.PastePlugin', {
init : function(ed, url) {
var t = this;
var t = this, cb;
t.editor = ed;
t.editor = ed;
t.url = url;
// Register commands
ed.addCommand('mcePasteText', function(ui, v) {
if (ui) {
ed.windowManager.open({
file : url + '/pastetext.htm',
width : 450,
height : 400,
inline : 1
}, {
plugin_url : url
});
} else
t._insertText(v.html, v.linebreaks);
// Setup plugin events
t.onPreProcess = new tinymce.util.Dispatcher(t);
t.onPostProcess = new tinymce.util.Dispatcher(t);
// Register default handlers
t.onPreProcess.add(t._preProcess);
t.onPostProcess.add(t._postProcess);
// Register optional preprocess handler
t.onPreProcess.add(function(pl, o) {
ed.execCallback('paste_preprocess', pl, o);
});
ed.addCommand('mcePasteWord', function(ui, v) {
if (ui) {
ed.windowManager.open({
file : url + '/pasteword.htm',
width : 450,
height : 400,
inline : 1
}, {
plugin_url : url
});
} else
t._insertWordContent(v);
// Register optional postprocess
t.onPostProcess.add(function(pl, o) {
ed.execCallback('paste_postprocess', pl, o);
});
ed.addCommand('mceSelectAll', function() {
ed.execCommand('selectall');
// This function executes the process handlers and inserts the contents
function process(o) {
var dom = ed.dom;
// Execute pre process handlers
t.onPreProcess.dispatch(t, o);
// Create DOM structure
o.node = dom.create('div', 0, o.content);
// Execute post process handlers
t.onPostProcess.dispatch(t, o);
// Serialize content
o.content = ed.serializer.serialize(o.node, {getInner : 1});
// Insert cleaned content. We need to handle insertion of contents containing block elements separately
if (/<(p|h[1-6]|ul|ol)/.test(o.content))
t._insertBlockContent(ed, dom, o.content);
else
t._insert(o.content);
};
// Add command for external usage
ed.addCommand('mceInsertClipboardContent', function(u, o) {
process(o);
});
// Register buttons
ed.addButton('pastetext', {title : 'paste.paste_text_desc', cmd : 'mcePasteText', ui : true});
ed.addButton('pasteword', {title : 'paste.paste_word_desc', cmd : 'mcePasteWord', ui : true});
ed.addButton('selectall', {title : 'paste.selectall_desc', cmd : 'mceSelectAll'});
// This function grabs the contents from the clipboard by adding a
// hidden div and placing the caret inside it and after the browser paste
// is done it grabs that contents and processes that
function grabContent(e) {
var n, or, rng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY;
if (ed.getParam("paste_auto_cleanup_on_paste", false)) {
ed.onPaste.add(function(ed, e) {
return t._handlePasteEvent(e)
if (dom.get('_mcePaste'))
return;
// Create container to paste into
n = dom.add(body, 'div', {id : '_mcePaste'}, '\uFEFF');
// If contentEditable mode we need to find out the position of the closest element
if (body != ed.getDoc().body)
posY = dom.getPos(ed.selection.getStart(), body).y;
else
posY = body.scrollTop;
// Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles
dom.setStyles(n, {
position : 'absolute',
left : -10000,
top : posY,
width : 1,
height : 1,
overflow : 'hidden'
});
}
if (!tinymce.isIE && ed.getParam("paste_auto_cleanup_on_paste", false)) {
// Force paste dialog if non IE browser
ed.onKeyDown.add(function(ed, e) {
if (e.ctrlKey && e.keyCode == 86) {
window.setTimeout(function() {
ed.execCommand("mcePasteText", true);
}, 1);
if (tinymce.isIE) {
// Select the container
rng = dom.doc.body.createTextRange();
rng.moveToElementText(n);
rng.execCommand('Paste');
Event.cancel(e);
// Remove container
dom.remove(n);
// Check if the contents was changed, if it wasn't then clipboard extraction failed probably due
// to IE security settings so we pass the junk though better than nothing right
if (n.innerHTML === '\uFEFF') {
ed.execCommand('mcePasteWord');
e.preventDefault();
return;
}
// Process contents
process({content : n.innerHTML});
// Block the real paste event
return tinymce.dom.Event.cancel(e);
} else {
or = ed.selection.getRng();
// Move caret into hidden div
n = n.firstChild;
rng = ed.getDoc().createRange();
rng.setStart(n, 0);
rng.setEnd(n, 1);
sel.setRng(rng);
// Wait a while and grab the pasted contents
window.setTimeout(function() {
var h = '', nl = dom.select('div[id=_mcePaste]');
// WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string
each(nl, function(n) {
h += (dom.select('> span.Apple-style-span div', n)[0] || dom.select('> span.Apple-style-span', n)[0] || n).innerHTML;
});
// Remove the nodes
each(nl, function(n) {
dom.remove(n);
});
// Restore the old selection
if (or)
sel.setRng(or);
process({content : h});
}, 0);
}
};
// Check if we should use the new auto process method
if (ed.getParam('paste_auto_cleanup_on_paste', true)) {
// Is it's Opera or older FF use key handler
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
ed.onKeyDown.add(function(ed, e) {
if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
grabContent(e);
});
} else {
// Grab contents on paste event on Gecko and WebKit
ed.onPaste.addToTop(function(ed, e) {
return grabContent(e);
});
}
}
// Block all drag/drop events
if (ed.getParam('paste_block_drop')) {
ed.onInit.add(function() {
ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {
e.preventDefault();
e.stopPropagation();
return false;
});
});
}
// Add legacy support
t._legacySupport();
},
getInfo : function() {
@ -82,297 +186,343 @@
};
},
// Private methods
_preProcess : function(pl, o) {
var ed = this.editor, h = o.content, process, stripClass;
_handlePasteEvent : function(e) {
var html = this._clipboardHTML(), ed = this.editor, sel = ed.selection, r;
//console.log('Before preprocess:' + o.content);
// Removes italic, strong etc, the if was needed due to bug #1437114
if (ed && (r = sel.getRng()) && r.text.length > 0)
ed.execCommand('delete');
function process(items) {
each(items, function(v) {
// Remove or replace
if (v.constructor == RegExp)
h = h.replace(v, '');
else
h = h.replace(v[0], v[1]);
});
};
if (html && html.length > 0)
ed.execCommand('mcePasteWord', false, html);
// Detect Word content and process it more aggressive
if (/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(h) || o.wordContent) {
o.wordContent = true; // Mark the pasted contents as word specific content
//console.log('Word contents detected.');
return Event.cancel(e);
// Process away some basic content
process([
/^\s*(&nbsp;)+/g, // nbsp entities at the start of contents
/(&nbsp;|<br[^>]*>)+\s*$/g // nbsp entities at the end of contents
]);
if (ed.getParam('paste_convert_middot_lists', true)) {
process([
[/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker
[/(<span[^>]+:\s*symbol[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert symbol spans to list items
[/(<span[^>]+mso-list:[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list to item marker
]);
}
process([
/<!--[\s\S]+?-->/gi, // Word comments
/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi, // Remove some tags including VML content
/<\\?\?xml[^>]*>/gi, // XML namespace declarations
/<\/?o:[^>]*>/gi, // MS namespaced elements <o:tag>
/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi, // on.., class, style and language attributes with quotes
/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi, // on.., class, style and language attributes without quotes (IE)
[/<(\/?)s>/gi, '<$1strike>'], // Convert <s> into <strike> for line-though
/<script[^>]+>[\s\S]*?<\/script>/gi, // All scripts elements for msoShowComment for example
[/&nbsp;/g, '\u00a0'] // Replace nsbp entites to char since it's easier to handle
]);
// Remove all spans if no styles is to be retained
if (!ed.getParam('paste_retain_style_properties')) {
process([
/<\/?(span)[^>]*>/gi
]);
}
}
// Allow for class names to be retained if desired; either all, or just the ones from Word
// Note that the paste_strip_class_attributes: 'none, verify_css_classes: true is also a good variation.
stripClass = ed.getParam('paste_strip_class_attributes');
if (stripClass != 'none') {
// Cleans everything but mceItem... classes
function cleanClasses(str, cls) {
var i, out = '';
// Remove all classes
if (stripClass == 'all')
return '';
cls = tinymce.explode(cls, ' ');
for (i = cls.length - 1; i >= 0; i--) {
// Remove Mso classes
if (!/^(Mso)/i.test(cls[i]))
out += (!out ? '' : ' ') + cls[i];
}
return ' class="' + out + '"';
};
process([
[/ class=\"([^\"]*)\"/gi, cleanClasses], // class attributes with quotes
[/ class=(\w+)/gi, cleanClasses] // class attributes without quotes (IE)
]);
}
// Remove spans option
if (ed.getParam('paste_remove_spans')) {
process([
/<\/?(span)[^>]*>/gi
]);
}
//console.log('After preprocess:' + h);
o.content = h;
},
_insertText : function(content, bLinebreaks) {
if (content && content.length > 0) {
if (bLinebreaks) {
// Special paragraph treatment
if (this.editor.getParam("paste_create_paragraphs", true)) {
var rl = this.editor.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
for (var i=0; i<rl.length; i+=2)
content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
/**
* Various post process items.
*/
_postProcess : function(pl, o) {
var t = this, ed = t.editor, dom = ed.dom, styleProps;
content = content.replace(/\r\n\r\n/g, '</p><p>');
content = content.replace(/\r\r/g, '</p><p>');
content = content.replace(/\n\n/g, '</p><p>');
if (o.wordContent) {
// Remove named anchors or TOC links
each(dom.select('a', o.node), function(a) {
if (!a.href || a.href.indexOf('#_Toc') != -1)
dom.remove(a, 1);
});
// Has paragraphs
if ((pos = content.indexOf('</p><p>')) != -1) {
this.editor.execCommand("Delete");
if (t.editor.getParam('paste_convert_middot_lists', true))
t._convertLists(pl, o);
var node = this.editor.selection.getNode();
// Process styles
styleProps = ed.getParam('paste_retain_style_properties'); // retained properties
// Get list of elements to break
var breakElms = [];
// If string property then split it
if (tinymce.is(styleProps, 'string'))
styleProps = tinymce.explode(styleProps);
do {
if (node.nodeType == 1) {
// Don't break tables and break at body
if (node.nodeName == "TD" || node.nodeName == "BODY")
break;
breakElms[breakElms.length] = node;
}
} while(node = node.parentNode);
// Retains some style properties
each(dom.select('*', o.node), function(el) {
var newStyle = {}, npc = 0, i, sp, sv;
var before = "", after = "</p>";
before += content.substring(0, pos);
// Store a subset of the existing styles
if (styleProps) {
for (i = 0; i < styleProps.length; i++) {
sp = styleProps[i];
sv = dom.getStyle(el, sp);
for (var i=0; i<breakElms.length; i++) {
before += "</" + breakElms[i].nodeName + ">";
after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">";
}
before += "<p>";
content = before + content.substring(pos+7) + after;
}
}
if (this.editor.getParam("paste_create_linebreaks", true)) {
content = content.replace(/\r\n/g, '<br />');
content = content.replace(/\r/g, '<br />');
content = content.replace(/\n/g, '<br />');
if (sv) {
newStyle[sp] = sv;
npc++;
}
}
}
}
this.editor.execCommand("mceInsertRawHTML", false, content);
// Remove all of the existing styles
dom.setAttrib(el, 'style', '');
if (styleProps && npc > 0)
dom.setStyles(el, newStyle); // Add back the stored subset of styles
else // Remove empty span tags that do not have class attributes
if (el.nodeName == 'SPAN' && !el.className)
dom.remove(el, true);
});
}
// Remove all style information or only specifically on WebKit to avoid the style bug on that browser
if (ed.getParam("paste_remove_styles") || (ed.getParam("paste_remove_styles_if_webkit") && tinymce.isWebKit)) {
each(dom.select('*[style]', o.node), function(el) {
el.removeAttribute('style');
el.removeAttribute('mce_style');
});
} else {
if (tinymce.isWebKit) {
// We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." />
// Removing the mce_style that contains the real value will force the Serializer engine to compress the styles
each(dom.select('*', o.node), function(el) {
el.removeAttribute('mce_style');
});
}
}
},
_insertWordContent : function(content) {
/**
* Converts the most common bullet and number formats in Office into a real semantic UL/LI list.
*/
_convertLists : function(pl, o) {
var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;
// Convert middot lists into real semantic lists
each(dom.select('p', o.node), function(p) {
var sib, val = '', type, html, idx, parents;
// Get text node value at beginning of paragraph
for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)
val += sib.nodeValue;
val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/&nbsp;/g, '\u00a0');
// Detect unordered lists look for bullets
if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(val))
type = 'ul';
// Detect ordered lists 1., a. or ixv.
if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(val))
type = 'ol';
// Check if node value matches the list pattern: o&nbsp;&nbsp;
if (type) {
margin = parseFloat(p.style.marginLeft || 0);
if (margin > lastMargin)
levels.push(margin);
if (!listElm || type != lastType) {
listElm = dom.create(type);
dom.insertAfter(listElm, p);
} else {
// Nested list element
if (margin > lastMargin) {
listElm = li.appendChild(dom.create(type));
} else if (margin < lastMargin) {
// Find parent level based on margin value
idx = tinymce.inArray(levels, margin);
parents = dom.getParents(listElm.parentNode, type);
listElm = parents[parents.length - 1 - idx] || listElm;
}
}
// Remove middot or number spans if they exists
each(dom.select('span', p), function(span) {
var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');
// Remove span with the middot or the number
if (type == 'ul' && /^[\u2022\u00b7\u00a7\u00d8o]/.test(html))
dom.remove(span);
else if (/^[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(html))
dom.remove(span);
});
html = p.innerHTML;
// Remove middot/list items
if (type == 'ul')
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*(&nbsp;|\u00a0)+\s*/, '');
else
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/, '');
// Create li and add paragraph data into the new li
li = listElm.appendChild(dom.create('li', 0, html));
dom.remove(p);
lastMargin = margin;
lastType = type;
} else
listElm = lastMargin = 0; // End list element
});
// Remove any left over makers
html = o.node.innerHTML;
if (html.indexOf('__MCE_ITEM__') != -1)
o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');
},
/**
* This method will split the current block parent and insert the contents inside the split position.
* This logic can be improved so text nodes at the start/end remain in the start/end block elements
*/
_insertBlockContent : function(ed, dom, content) {
var parentBlock, marker, sel = ed.selection, last, elm, vp, y, elmHeight;
function select(n) {
var r;
if (tinymce.isIE) {
r = ed.getDoc().body.createTextRange();
r.moveToElementText(n);
r.collapse(false);
r.select();
} else {
sel.select(n, 1);
sel.collapse(false);
}
};
// Insert a marker for the caret position
this._insert('<span id="_marker">&nbsp;</span>', 1);
marker = dom.get('_marker');
parentBlock = dom.getParent(marker, 'p,h1,h2,h3,h4,h5,h6,ul,ol,th,td');
// If it's a parent block but not a table cell
if (parentBlock && !/TD|TH/.test(parentBlock.nodeName)) {
// Split parent block
marker = dom.split(parentBlock, marker);
// Insert nodes before the marker
each(dom.create('div', 0, content).childNodes, function(n) {
last = marker.parentNode.insertBefore(n.cloneNode(true), marker);
});
// Move caret after marker
select(last);
} else {
dom.setOuterHTML(marker, content);
sel.select(ed.getBody(), 1);
sel.collapse(0);
}
dom.remove('_marker'); // Remove marker if it's left
// Get element, position and height
elm = sel.getStart();
vp = dom.getViewPort(ed.getWin());
y = ed.dom.getPos(elm).y;
elmHeight = elm.clientHeight;
// Is element within viewport if not then scroll it into view
if (y < vp.y || y + elmHeight > vp.y + vp.h)
ed.getDoc().body.scrollTop = y < vp.y ? y : y - vp.h + 25;
},
/**
* Inserts the specified contents at the caret position.
*/
_insert : function(h, skip_undo) {
var ed = this.editor;
// First delete the contents seems to work better on WebKit
if (!ed.selection.isCollapsed())
ed.getDoc().execCommand('Delete', false, null);
// It's better to use the insertHTML method on Gecko since it will combine paragraphs correctly before inserting the contents
ed.execCommand(tinymce.isGecko ? 'insertHTML' : 'mceInsertContent', false, h, {skip_undo : skip_undo});
},
/**
* This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.
*/
_legacySupport : function() {
var t = this, ed = t.editor;
if (content && content.length > 0) {
// Cleanup Word content
var bull = String.fromCharCode(8226);
var middot = String.fromCharCode(183);
// Register commands for backwards compatibility
each(['mcePasteText', 'mcePasteWord'], function(cmd) {
ed.addCommand(cmd, function() {
ed.windowManager.open({
file : t.url + (cmd == 'mcePasteText' ? '/pastetext.htm' : '/pasteword.htm'),
width : parseInt(ed.getParam("paste_dialog_width", "450")),
height : parseInt(ed.getParam("paste_dialog_height", "400")),
inline : 1
});
});
});
if (ed.getParam('paste_insert_word_content_callback'))
content = ed.execCallback('paste_insert_word_content_callback', 'before', content);
var rl = ed.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
for (var i=0; i<rl.length; i+=2)
content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
if (this.editor.getParam("paste_convert_headers_to_strong", false)) {
content = content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>', 'gi'), '<p><b>$1</b></p>');
}
content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--");
content = content.replace(new RegExp(bull + "(.*?)<BR>", "gi"), "<p>" + middot + "$1</p>");
content = content.replace(new RegExp('<SPAN style="mso-list: Ignore">', 'gi'), "<span>" + bull); // Covert to bull list
content = content.replace(/<o:p><\/o:p>/gi, "");
content = content.replace(new RegExp('<br style="page-break-before: always;.*>', 'gi'), '-- page break --'); // Replace pagebreaks
content = content.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), ""); // Word comments
if (this.editor.getParam("paste_remove_spans", true))
content = content.replace(/<\/?span[^>]*>/gi, "");
if (this.editor.getParam("paste_remove_styles", true))
content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3");
content = content.replace(/<\/?font[^>]*>/gi, "");
// Strips class attributes.
switch (this.editor.getParam("paste_strip_class_attributes", "all")) {
case "all":
content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
break;
case "mso":
content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3");
break;
}
content = content.replace(new RegExp('href="?' + this._reEscape("" + document.location) + '', 'gi'), 'href="' + this.editor.documentBaseURI.getURI());
content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
content = content.replace(/<\\?\?xml[^>]*>/gi, "");
content = content.replace(/<\/?\w+:[^>]*>/gi, "");
content = content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi, ""); // Remove pagebreaks
content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks
// content = content.replace(/\/?&nbsp;*/gi, ""); &nbsp;
// content = content.replace(/<p>&nbsp;<\/p>/gi, '');
if (!this.editor.getParam('force_p_newlines')) {
content = content.replace('', '' ,'gi');
content = content.replace('</p>', '<br /><br />' ,'gi');
}
if (!tinymce.isIE && !this.editor.getParam('force_p_newlines')) {
content = content.replace(/<\/?p[^>]*>/gi, "");
}
content = content.replace(/<\/?div[^>]*>/gi, "");
// Convert all middlot lists to UL lists
if (this.editor.getParam("paste_convert_middot_lists", true)) {
var div = ed.dom.create("div", null, content);
// Convert all middot paragraphs to li elements
var className = this.editor.getParam("paste_unindented_list_class", "unIndentedList");
while (this._convertMiddots(div, "--list--")) ; // bull
while (this._convertMiddots(div, middot, className)) ; // Middot
while (this._convertMiddots(div, bull)) ; // bull
content = div.innerHTML;
}
// Replace all headers with strong and fix some other issues
if (this.editor.getParam("paste_convert_headers_to_strong", false)) {
content = content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi, '<p>&nbsp;&nbsp;</p>');
content = content.replace(/<h[1-6]>/gi, '<p><b>');
content = content.replace(/<\/h[1-6]>/gi, '</b></p>');
content = content.replace(/<b>&nbsp;<\/b>/gi, '<b>&nbsp;&nbsp;</b>');
content = content.replace(/^(&nbsp;)*/gi, '');
}
content = content.replace(/--list--/gi, ""); // Remove --list--
if (ed.getParam('paste_insert_word_content_callback'))
content = ed.execCallback('paste_insert_word_content_callback', 'after', content);
// Insert cleaned content
this.editor.execCommand("mceInsertContent", false, content);
if (this.editor.getParam('paste_force_cleanup_wordpaste', true)) {
var ed = this.editor;
window.setTimeout(function() {
ed.execCommand("mceCleanup");
}, 1); // Do normal cleanup detached from this thread
}
}
},
_reEscape : function(s) {
var l = "?.\\*[](){}+^$:";
var o = "";
for (var i=0; i<s.length; i++) {
var c = s.charAt(i);
if (l.indexOf(c) != -1)
o += '\\' + c;
else
o += c;
}
return o;
},
_convertMiddots : function(div, search, class_name) {
var ed = this.editor, mdot = String.fromCharCode(183), bull = String.fromCharCode(8226);
var nodes, prevul, i, p, ul, li, np, cp, li;
nodes = div.getElementsByTagName("p");
for (i=0; i<nodes.length; i++) {
p = nodes[i];
// Is middot
if (p.innerHTML.indexOf(search) == 0) {
ul = ed.dom.create("ul");
if (class_name)
ul.className = class_name;
// Add the first one
li = ed.dom.create("li");
li.innerHTML = p.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
ul.appendChild(li);
// Add the rest
np = p.nextSibling;
while (np) {
// If the node is whitespace, then
// ignore it and continue on.
if (np.nodeType == 3 && new RegExp('^\\s$', 'm').test(np.nodeValue)) {
np = np.nextSibling;
continue;
}
if (search == mdot) {
if (np.nodeType == 1 && new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)) {
// Second level of nesting
if (!prevul) {
prevul = ul;
ul = ed.dom.create("ul");
prevul.appendChild(ul);
}
np.innerHTML = np.innerHTML.replace(/^o/, '');
} else {
// Pop the stack if we're going back up to the first level
if (prevul) {
ul = prevul;
prevul = null;
}
// Not element or middot paragraph
if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
break;
}
} else {
// Not element or middot paragraph
if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
break;
}
cp = np.nextSibling;
li = ed.dom.create("li");
li.innerHTML = np.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
np.parentNode.removeChild(np);
ul.appendChild(li);
np = cp;
}
p.parentNode.replaceChild(ul, p);
return true;
}
}
return false;
},
_clipboardHTML : function() {
var div = document.getElementById('_TinyMCE_clipboardHTML');
if (!div) {
var div = document.createElement('DIV');
div.id = '_TinyMCE_clipboardHTML';
with (div.style) {
visibility = 'hidden';
overflow = 'hidden';
position = 'absolute';
width = 1;
height = 1;
}
document.body.appendChild(div);
}
div.innerHTML = '';
var rng = document.body.createTextRange();
rng.moveToElementText(div);
rng.execCommand('Paste');
var html = div.innerHTML;
div.innerHTML = '';
return html;
// Register buttons for backwards compatibility
ed.addButton('pastetext', {title : 'paste.paste_text_desc', cmd : 'mcePasteText'});
ed.addButton('pasteword', {title : 'paste.paste_word_desc', cmd : 'mcePasteWord'});
ed.addButton('selectall', {title : 'paste.selectall_desc', cmd : 'selectall'});
}
});

View file

@ -1,42 +1,36 @@
tinyMCEPopup.requireLangPack();
function saveContent() {
if (document.forms[0].htmlSource.value == '') {
var PasteTextDialog = {
init : function() {
this.resize();
},
insert : function() {
var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;
// Convert linebreaks into paragraphs
if (document.getElementById('linebreaks').checked) {
lines = h.split(/\r?\n/);
if (lines.length > 1) {
h = '';
tinymce.each(lines, function(row) {
h += '<p>' + row + '</p>';
});
}
}
tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h});
tinyMCEPopup.close();
return false;
},
resize : function() {
var vp = tinyMCEPopup.dom.getViewPort(window), el;
el = document.getElementById('content');
el.style.width = (vp.w - 20) + 'px';
el.style.height = (vp.h - 90) + 'px';
}
};
tinyMCEPopup.execCommand('mcePasteText', false, {
html : document.forms[0].htmlSource.value,
linebreaks : document.forms[0].linebreaks.checked
});
tinyMCEPopup.close();
}
function onLoadInit() {
tinyMCEPopup.resizeToInnerSize();
// Remove Gecko spellchecking
if (tinymce.isGecko)
document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
resizeInputs();
}
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
function resizeInputs() {
if (!tinymce.isIE) {
wHeight = self.innerHeight-80;
wWidth = self.innerWidth-17;
} else {
wHeight = document.body.clientHeight-80;
wWidth = document.body.clientWidth-17;
}
document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
}
tinyMCEPopup.onInit.add(onLoadInit);
tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);

View file

@ -1,56 +1,51 @@
tinyMCEPopup.requireLangPack();
function saveContent() {
var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;
var PasteWordDialog = {
init : function() {
var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = '';
if (html == ''){
// Create iframe
el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>';
ifr = document.getElementById('iframe');
doc = ifr.contentWindow.document;
// Force absolute CSS urls
css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];
css = css.concat(tinymce.explode(ed.settings.content_css) || []);
tinymce.each(css, function(u) {
cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />';
});
// Write content into iframe
doc.open();
doc.write('<html><head>' + cssHTML + '</head><body class="mceContentBody" spellcheck="false"></body></html>');
doc.close();
doc.designMode = 'on';
this.resize();
window.setTimeout(function() {
ifr.contentWindow.focus();
}, 10);
},
insert : function() {
var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;
tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true});
tinyMCEPopup.close();
return false;
},
resize : function() {
var vp = tinyMCEPopup.dom.getViewPort(window), el;
el = document.getElementById('iframe');
if (el) {
el.style.width = (vp.w - 20) + 'px';
el.style.height = (vp.h - 90) + 'px';
}
}
};
tinyMCEPopup.execCommand('mcePasteWord', false, html);
tinyMCEPopup.close();
}
function onLoadInit() {
tinyMCEPopup.resizeToInnerSize();
// Fix for endless reloading in FF
window.setTimeout(createIFrame, 10);
}
function createIFrame() {
document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>';
}
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
function initIframe(doc) {
var dir = tinyMCEPopup.editor.settings.directionality;
doc.body.dir = dir;
// Remove Gecko spellchecking
if (tinymce.isGecko)
doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
resizeInputs();
}
function resizeInputs() {
if (!tinymce.isIE) {
wHeight = self.innerHeight - 80;
wWidth = self.innerWidth - 18;
} else {
wHeight = document.body.clientHeight - 80;
wWidth = document.body.clientWidth - 18;
}
var elm = document.getElementById('frmData');
if (elm) {
elm.style.height = Math.abs(wHeight) + 'px';
elm.style.width = Math.abs(wWidth) + 'px';
}
}
tinyMCEPopup.onInit.add(onLoadInit);
tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog);

View file

@ -4,31 +4,30 @@
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/pastetext.js"></script>
<base target="_self" />
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="saveContent();return false;" action="#">
<div style="float: left" class="title">{#paste.paste_text_desc}</div>
<div style="float: right">
<input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
</div>
<br style="clear: both" />
<div>{#paste_dlg.text_title}</div>
<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>
<div class="mceActionPanel">
<div style="float: left">
<input type="submit" name="insert" value="{#insert}" id="insert" />
</div>
<body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="return PasteTextDialog.insert();" action="#">
<div style="float: left" class="title">{#paste.paste_text_desc}</div>
<div style="float: right">
<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
<input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
</div>
</div>
</form>
<br style="clear: both" />
<div>{#paste_dlg.text_title}</div>
<textarea id="content" name="content" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>
<div class="mceActionPanel">
<div style="float: left">
<input type="submit" name="insert" value="{#insert}" id="insert" />
</div>
<div style="float: right">
<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
</div>
</div>
</form>
</body>
</html>

View file

@ -4,11 +4,9 @@
<title>{#paste.paste_word_desc}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/pasteword.js"></script>
<link href="css/pasteword.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="saveContent();" action="#">
<body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="return PasteWordDialog.insert();" action="#">
<div class="title">{#paste.paste_word_desc}</div>
<div>{#paste_dlg.word_title}</div>
@ -17,7 +15,7 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{#insert}" onclick="saveContent();" />
<input type="submit" id="insert" name="insert" value="{#insert}" />
</div>
<div style="float: right">

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePreview',t._preview,t);ed.addButton('preview',{title:'preview.preview_desc',cmd:'mcePreview'});},getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_preview:function(){var ed=this.editor,win,html,c,pos,pos2,css,i,page=ed.getParam("plugin_preview_pageurl",null),w=ed.getParam("plugin_preview_width","550"),h=ed.getParam("plugin_preview_height","600");if(page){ed.windowManager.open({file:ed.getParam("plugin_preview_pageurl",null),width:w,height:h},{resizable:"yes",scrollbars:"yes",inline:1});}else{win=window.open("","mcePreview","menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width="+w+",height="+h);html="";c=ed.getContent();pos=c.indexOf('<body');css=ed.getParam("content_css",'').split(',');tinymce.map(css,function(u){return ed.documentBaseURI.toAbsolute(u);});if(pos!=-1){pos=c.indexOf('>',pos);pos2=c.lastIndexOf('</body>');c=c.substring(pos+1,pos2);}html+=ed.getParam('doctype');html+='<html xmlns="http://www.w3.org/1999/xhtml">';html+='<head>';html+='<title>'+ed.getLang('preview.preview_desc')+'</title>';html+='<base href="'+ed.documentBaseURI.getURI()+'" />';html+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(i=0;i<css.length;i++)html+='<link href="'+css[i]+'" rel="stylesheet" type="text/css" />';html+='</head>';html+='<body dir="'+ed.getParam("directionality")+'" onload="window.opener.tinymce.EditorManager.get(\''+ed.id+'\').plugins[\'preview\']._onLoad(window,document);">';html+=c;html+='</body>';html+='</html>';win.document.write(html);win.document.close();}},_onLoad:function(w,d){var t=this,nl,i,el=[],sv,ne;t._doc=d;w.writeFlash=t._writeFlash;w.writeShockWave=t._writeShockWave;w.writeQuickTime=t._writeQuickTime;w.writeRealMedia=t._writeRealMedia;w.writeWindowsMedia=t._writeWindowsMedia;w.writeEmbed=t._writeEmbed;nl=d.getElementsByTagName("script");for(i=0;i<nl.length;i++){sv=tinymce.isIE?nl[i].innerHTML:nl[i].firstChild.nodeValue;if(new RegExp('write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\\(.*','g').test(sv))el[el.length]=nl[i];}for(i=0;i<el.length;i++){ne=d.createElement("div");ne.innerHTML=d._embeds[i];el[i].parentNode.insertBefore(ne.firstChild,el[i]);}},_writeFlash:function(p){p.src=this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('D27CDB6E-AE6D-11cf-96B8-444553540000','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0','application/x-shockwave-flash',p);},_writeShockWave:function(p){this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('166B1BCA-3F9C-11CF-8075-444553540000','http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0','application/x-director',p);},_writeQuickTime:function(p){this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('02BF25D5-8C17-4B23-BC80-D3488ABDDC6B','http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0','video/quicktime',p);},_writeRealMedia:function(p){this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0','audio/x-pn-realaudio-plugin',p);},_writeWindowsMedia:function(p){this.editor.documentBaseURI.toAbsolute(p.src);p.url=p.src;TinyMCE_PreviewPlugin._writeEmbed('6BF52A52-394A-11D3-B153-00C04F79FAA6','http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701','application/x-mplayer2',p);},_writeEmbed:function(cls,cb,mt,p){var h='',n,d=t._doc,ne,c;h+='<object classid="clsid:'+cls+'" codebase="'+cb+'"';h+=typeof(p.id)!="undefined"?'id="'+p.id+'"':'';h+=typeof(p.name)!="undefined"?'name="'+p.name+'"':'';h+=typeof(p.width)!="undefined"?'width="'+p.width+'"':'';h+=typeof(p.height)!="undefined"?'height="'+p.height+'"':'';h+=typeof(p.align)!="undefined"?'align="'+p.align+'"':'';h+='>';for(n in p)h+='<param name="'+n+'" value="'+p[n]+'">';h+='<embed type="'+mt+'"';for(n in p)h+=n+'="'+p[n]+'" ';h+='></embed></object>';d._embeds[d._embeds.length]=h;}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})();
(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})();

View file

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 537 2008-01-14 16:38:33Z spocke $
* $Id: editor_plugin_src.js 1056 2009-03-13 12:47:03Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@ -8,11 +8,29 @@
(function() {
tinymce.create('tinymce.plugins.Preview', {
init : function(ed, url) {
var t = this;
var t = this, css = tinymce.explode(ed.settings.content_css);
t.editor = ed;
ed.addCommand('mcePreview', t._preview, t);
// Force absolute CSS urls
tinymce.each(css, function(u, k) {
css[k] = ed.documentBaseURI.toAbsolute(u);
});
ed.addCommand('mcePreview', function() {
ed.windowManager.open({
file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
width : parseInt(ed.getParam("plugin_preview_width", "550")),
height : parseInt(ed.getParam("plugin_preview_height", "600")),
resizable : "yes",
scrollbars : "yes",
popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
inline : ed.getParam("plugin_preview_inline", 1)
}, {
base : ed.documentBaseURI.getURI()
});
});
ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
},
@ -24,161 +42,6 @@
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
// Private methods
_preview : function() {
var ed = this.editor, win, html, c, pos, pos2, css, i, page = ed.getParam("plugin_preview_pageurl", null), w = ed.getParam("plugin_preview_width", "550"), h = ed.getParam("plugin_preview_height", "600");
// Use a custom preview page
if (page) {
ed.windowManager.open({
file : ed.getParam("plugin_preview_pageurl", null),
width : w,
height : h
}, {
resizable : "yes",
scrollbars : "yes",
inline : 1
});
} else {
win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + w + ",height=" + h);
html = "";
c = ed.getContent();
pos = c.indexOf('<body');
css = ed.getParam("content_css", '').split(',');
tinymce.map(css, function(u) {
return ed.documentBaseURI.toAbsolute(u);
});
if (pos != -1) {
pos = c.indexOf('>', pos);
pos2 = c.lastIndexOf('</body>');
c = c.substring(pos + 1, pos2);
}
html += ed.getParam('doctype');
html += '<html xmlns="http://www.w3.org/1999/xhtml">';
html += '<head>';
html += '<title>' + ed.getLang('preview.preview_desc') + '</title>';
html += '<base href="' + ed.documentBaseURI.getURI() + '" />';
html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
for (i=0; i<css.length; i++)
html += '<link href="' + css[i] + '" rel="stylesheet" type="text/css" />';
html += '</head>';
html += '<body dir="' + ed.getParam("directionality") + '" onload="window.opener.tinymce.EditorManager.get(\'' + ed.id + '\').plugins[\'preview\']._onLoad(window,document);">';
html += c;
html += '</body>';
html += '</html>';
win.document.write(html);
win.document.close();
}
},
_onLoad : function(w, d) {
var t = this, nl, i, el = [], sv, ne;
t._doc = d;
w.writeFlash = t._writeFlash;
w.writeShockWave = t._writeShockWave;
w.writeQuickTime = t._writeQuickTime;
w.writeRealMedia = t._writeRealMedia;
w.writeWindowsMedia = t._writeWindowsMedia;
w.writeEmbed = t._writeEmbed;
nl = d.getElementsByTagName("script");
for (i=0; i<nl.length; i++) {
sv = tinymce.isIE ? nl[i].innerHTML : nl[i].firstChild.nodeValue;
if (new RegExp('write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\\(.*', 'g').test(sv))
el[el.length] = nl[i];
}
for (i=0; i<el.length; i++) {
ne = d.createElement("div");
ne.innerHTML = d._embeds[i];
el[i].parentNode.insertBefore(ne.firstChild, el[i]);
}
},
_writeFlash : function(p) {
p.src = this.editor.documentBaseURI.toAbsolute(p.src);
TinyMCE_PreviewPlugin._writeEmbed(
'D27CDB6E-AE6D-11cf-96B8-444553540000',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
'application/x-shockwave-flash',
p
);
},
_writeShockWave : function(p) {
this.editor.documentBaseURI.toAbsolute(p.src);
TinyMCE_PreviewPlugin._writeEmbed(
'166B1BCA-3F9C-11CF-8075-444553540000',
'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
'application/x-director',
p
);
},
_writeQuickTime : function(p) {
this.editor.documentBaseURI.toAbsolute(p.src);
TinyMCE_PreviewPlugin._writeEmbed(
'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
'video/quicktime',
p
);
},
_writeRealMedia : function(p) {
this.editor.documentBaseURI.toAbsolute(p.src);
TinyMCE_PreviewPlugin._writeEmbed(
'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
'audio/x-pn-realaudio-plugin',
p
);
},
_writeWindowsMedia : function(p) {
this.editor.documentBaseURI.toAbsolute(p.src);
p.url = p.src;
TinyMCE_PreviewPlugin._writeEmbed(
'6BF52A52-394A-11D3-B153-00C04F79FAA6',
'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
'application/x-mplayer2',
p
);
},
_writeEmbed : function(cls, cb, mt, p) {
var h = '', n, d = t._doc, ne, c;
h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
h += '>';
for (n in p)
h += '<param name="' + n + '" value="' + p[n] + '">';
h += '<embed type="' + mt + '"';
for (n in p)
h += n + '="' + p[n] + '" ';
h += '></embed></object>';
d._embeds[d._embeds.length] = h;
}
});

View file

@ -0,0 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="jscripts/embed.js"></script>
<script type="text/javascript"><!--
document.write('<base href="' + tinyMCEPopup.getWindowArg("base") + '">');
// -->
</script>
<title>{#preview.preview_desc}</title>
</head>
<body id="content">
<script type="text/javascript">
document.write(tinyMCEPopup.editor.getContent());
</script>
</body>
</html>

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.Print',{init:function(ed,url){ed.addCommand('mcePrint',function(){ed.getWin().print();});ed.addButton('print',{title:'print.print_desc',cmd:'mcePrint'});},getInfo:function(){return{longname:'Print',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('print',tinymce.plugins.Print);})();
(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})();

File diff suppressed because one or more lines are too long

View file

@ -6,7 +6,30 @@
*/
(function() {
var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray, isOldWebKit = tinymce.isOldWebKit;
var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray;
function isEmpty(d, e, f) {
var w, n;
w = d.createTreeWalker(e, NodeFilter.SHOW_ALL, null, false);
while (n = w.nextNode()) {
// Filter func
if (f) {
if (!f(n))
return false;
}
// Non whitespace text node
if (n.nodeType == 3 && n.nodeValue && /[^\s\u00a0]+/.test(n.nodeValue))
return false;
// Is non text element byt still content
if (n.nodeType == 1 && /^(HR|IMG|TABLE)$/.test(n.nodeName))
return false;
}
return true;
};
tinymce.create('tinymce.plugins.Safari', {
init : function(ed) {
@ -20,21 +43,61 @@
t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];
t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large'];
// Safari will crash if the build in createlink command is used
/* ed.addCommand('CreateLink', function(u, v) {
ed.execCommand("mceInsertContent", false, '<a href="' + dom.encode(v) + '">' + ed.selection.getContent() + '</a>');
});*/
// Safari CreateLink command will not work correctly on images that is aligned
ed.addCommand('CreateLink', function(u, v) {
var n = ed.selection.getNode(), dom = ed.dom, a;
if (n && (/^(left|right)$/i.test(dom.getStyle(n, 'float', 1)) || /^(left|right)$/i.test(dom.getAttrib(n, 'align')))) {
a = dom.create('a', {href : v}, n.cloneNode());
n.parentNode.replaceChild(a, n);
ed.selection.select(a);
} else
ed.getDoc().execCommand("CreateLink", false, v);
});
/*
// WebKit generates spans out of thin air this patch used to remove them but it will also remove styles we want so it's disabled for now
ed.onPaste.add(function(ed, e) {
function removeStyles(e) {
e = e.target;
if (e.nodeType == 1) {
e.style.cssText = '';
each(ed.dom.select('*', e), function(e) {
e.style.cssText = '';
});
}
};
Event.add(ed.getDoc(), 'DOMNodeInserted', removeStyles);
window.setTimeout(function() {
Event.remove(ed.getDoc(), 'DOMNodeInserted', removeStyles);
}, 0);
});
*/
ed.onKeyUp.add(function(ed, e) {
var h;
var h, b, r, n, s;
// If backspace or delete key
if (e.keyCode == 46 || e.keyCode == 8) {
h = ed.getBody().innerHTML;
b = ed.getBody();
h = b.innerHTML;
s = ed.selection;
// If there is no text content or images or hr elements then remove everything
if (!/<(img|hr)/.test(h) && tinymce.trim(h.replace(/<[^>]+>/g, '')).length == 0)
ed.setContent('', {format : 'raw'});
if (b.childNodes.length == 1 && !/<(img|hr)/.test(h) && tinymce.trim(h.replace(/<[^>]+>/g, '')).length == 0) {
// Inject paragrah and bogus br
ed.setContent('<p><br mce_bogus="1" /></p>', {format : 'raw'});
// Move caret before bogus br
n = b.firstChild;
r = s.getRng();
r.setStart(n, 0);
r.setEnd(n, 0);
s.setRng(r);
}
}
});
@ -51,49 +114,96 @@
// Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382
ed.addCommand('mceInsertContent', function(u, v) {
ed.getDoc().execCommand("InsertText", false, 'mce_marker');
ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, v + '<span id="_mce_tmp">XX</span>');
ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, ed.dom.processHTML(v) + '<span id="_mce_tmp">XX</span>');
ed.selection.select(ed.dom.get('_mce_tmp'));
ed.getDoc().execCommand("Delete", false, ' ');
});
/* ed.onKeyDown.add(function(ed, e) {
// Ctrl+A select all will fail on WebKit since if you paste the contents you selected it will produce a odd div wrapper
if ((e.ctrlKey || e.metaKey) && e.keyCode == 65) {
ed.selection.select(ed.getBody(), 1);
return Event.cancel(e);
}
});*/
// Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973
ed.onKeyPress.add(function(ed, e) {
if (e.keyCode == 13 && (e.shiftKey || ed.settings.force_br_newlines && ed.selection.getNode().nodeName != 'LI')) {
t._insertBR(ed);
Event.cancel(e);
var se, li, lic, r1, r2, n, sel, doc, be, af, pa;
if (e.keyCode == 13) {
sel = ed.selection;
se = sel.getNode();
// Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973
if (e.shiftKey || ed.settings.force_br_newlines && se.nodeName != 'LI') {
t._insertBR(ed);
Event.cancel(e);
}
// Workaround for DIV elements produced by Safari
if (li = dom.getParent(se, 'LI')) {
lic = dom.getParent(li, 'OL,UL');
doc = ed.getDoc();
pa = dom.create('p');
dom.add(pa, 'br', {mce_bogus : "1"});
if (isEmpty(doc, li)) {
// If list in list then use browser default behavior
if (n = dom.getParent(lic.parentNode, 'LI,OL,UL'))
return;
n = dom.getParent(lic, 'p,h1,h2,h3,h4,h5,h6,div') || lic;
// Create range from the start of block element to the list item
r1 = doc.createRange();
r1.setStartBefore(n);
r1.setEndBefore(li);
// Create range after the list to the end of block element
r2 = doc.createRange();
r2.setStartAfter(li);
r2.setEndAfter(n);
be = r1.cloneContents();
af = r2.cloneContents();
if (!isEmpty(doc, af))
dom.insertAfter(af, n);
dom.insertAfter(pa, n);
if (!isEmpty(doc, be))
dom.insertAfter(be, n);
dom.remove(n);
n = pa.firstChild;
r1 = doc.createRange();
r1.setStartBefore(n);
r1.setEndBefore(n);
sel.setRng(r1);
return Event.cancel(e);
}
}
}
});
// Safari returns incorrect values
ed.addQueryValueHandler('FontSize', function(u, v) {
var e, v;
// Safari doesn't place lists outside block elements
ed.onExecCommand.add(function(ed, cmd) {
var sel, dom, bl, bm;
// Check for the real font size at the start of selection
if ((e = ed.dom.getParent(ed.selection.getStart(), 'span')) && (v = e.style.fontSize))
return tinymce.inArray(t.namedFontSizes, v) + 1;
if (cmd == 'InsertUnorderedList' || cmd == 'InsertOrderedList') {
sel = ed.selection;
dom = ed.dom;
// Check for the real font size at the end of selection
if ((e = ed.dom.getParent(ed.selection.getEnd(), 'span')) && (v = e.style.fontSize))
return tinymce.inArray(t.namedFontSizes, v) + 1;
// Return default value it's better than nothing right!
return ed.getDoc().queryCommandValue('FontSize');
});
// Safari returns incorrect values
ed.addQueryValueHandler('FontName', function(u, v) {
var e, v;
// Check for the real font name at the start of selection
if ((e = ed.dom.getParent(ed.selection.getStart(), 'span')) && (v = e.style.fontFamily))
return v.replace(/, /g, ',');
// Check for the real font name at the end of selection
if ((e = ed.dom.getParent(ed.selection.getEnd(), 'span')) && (v = e.style.fontFamily))
return v.replace(/, /g, ',');
// Return default value it's better than nothing right!
return ed.getDoc().queryCommandValue('FontName');
if (bl = dom.getParent(sel.getNode(), function(n) {return /^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})) {
bm = sel.getBookmark();
dom.remove(bl, 1);
sel.moveToBookmark(bm);
}
}
});
// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
@ -107,36 +217,8 @@
t.selElm = null;
});
ed.onBeforeExecCommand.add(function(ed, c, b) {
var r = t.bookmarkRng;
// Restore selection
if (r) {
ed.selection.setRng(r);
t.bookmarkRng = null;
//console.debug('restore', r.startContainer, r.startOffset, r.endContainer, r.endOffset);
}
});
ed.onInit.add(function() {
t._fixWebKitSpans();
ed.windowManager.onOpen.add(function() {
var r = ed.selection.getRng();
// Store selection if valid
if (r.startContainer != ed.getDoc()) {
t.bookmarkRng = r.cloneRange();
//console.debug('store', r.startContainer, r.startOffset, r.endContainer, r.endOffset);
}
});
ed.windowManager.onClose.add(function() {
t.bookmarkRng = null;
});
if (isOldWebKit)
t._patchSafari2x(ed);
});
ed.onSetContent.add(function() {
@ -247,27 +329,28 @@
});
},
getInfo : function() {
return {
longname : 'Safari compatibility',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
// Internal methods
_fixWebKitSpans : function() {
var t = this, ed = t.editor;
if (!isOldWebKit) {
// Use mutator events on new WebKit
Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) {
e = e.target;
// Use mutator events on new WebKit
Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) {
e = e.target;
if (e && e.nodeType == 1)
t._fixAppleSpan(e);
});
} else {
// Do post command processing in old WebKit since the browser crashes on Mutator events :(
ed.onExecCommand.add(function() {
each(ed.dom.select('span'), function(n) {
t._fixAppleSpan(n);
});
ed.nodeChanged();
});
}
if (e && e.nodeType == 1)
t._fixAppleSpan(e);
});
},
_fixAppleSpan : function(e) {
@ -327,78 +410,6 @@
}
},
_patchSafari2x : function(ed) {
var t = this, setContent, getNode, dom = ed.dom, lr;
// Inline dialogs
if (ed.windowManager.onBeforeOpen) {
ed.windowManager.onBeforeOpen.add(function() {
r = ed.selection.getRng();
});
}
// Fake select on 2.x
ed.selection.select = function(n) {
this.getSel().setBaseAndExtent(n, 0, n, 1);
};
getNode = ed.selection.getNode;
ed.selection.getNode = function() {
return t.selElm || getNode.call(this);
};
// Fake range on Safari 2.x
ed.selection.getRng = function() {
var t = this, s = t.getSel(), d = ed.getDoc(), r, rb, ra, di;
// Fake range on Safari 2.x
if (s.anchorNode) {
r = d.createRange();
try {
// Setup before range
rb = d.createRange();
rb.setStart(s.anchorNode, s.anchorOffset);
rb.collapse(1);
// Setup after range
ra = d.createRange();
ra.setStart(s.focusNode, s.focusOffset);
ra.collapse(1);
// Setup start/end points by comparing locations
di = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0;
r.setStart(di ? s.anchorNode : s.focusNode, di ? s.anchorOffset : s.focusOffset);
r.setEnd(di ? s.focusNode : s.anchorNode, di ? s.focusOffset : s.anchorOffset);
lr = r;
} catch (ex) {
// Sometimes fails, at least we tried to do it by the book. I hope Safari 2.x will go disappear soooon!!!
}
}
return r || lr;
};
// Fix setContent so it works
setContent = ed.selection.setContent;
ed.selection.setContent = function(h, s) {
var r = this.getRng(), b;
try {
setContent.call(this, h, s);
} catch (ex) {
// Workaround for Safari 2.x
b = dom.create('body');
b.innerHTML = h;
each(b.childNodes, function(n) {
r.insertNode(n.cloneNode(true));
});
}
};
},
_insertBR : function(ed) {
var dom = ed.dom, s = ed.selection, r = s.getRng(), br;

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.Save',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceSave',t._save,t);ed.addCommand('mceCancel',t._cancel,t);ed.addButton('save',{title:'save.save_desc',cmd:'mceSave'});ed.addButton('cancel',{title:'save.cancel_desc',cmd:'mceCancel'});ed.onNodeChange.add(t._nodeChange,t);ed.addShortcut('ctrl+s',ed.getLang('save.save_desc'),'mceSave');},getInfo:function(){return{longname:'Save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var ed=this.editor;if(ed.getParam('save_enablewhendirty')){cm.setDisabled('save',!ed.isDirty());cm.setDisabled('cancel',!ed.isDirty());}},_save:function(){var ed=this.editor,formObj,os,i,elementId;formObj=tinymce.DOM.get(ed.id).form||tinymce.DOM.getParent(ed.id,'form');if(ed.getParam("save_enablewhendirty")&&!ed.isDirty())return true;tinyMCE.triggerSave();if(os=ed.getParam("save_onsavecallback")){if(ed.execCallback('save_onsavecallback',ed)){ed.startContent=tinymce.trim(ed.getContent({format:'raw'}));ed.nodeChanged();}return;}if(formObj){ed.isNotDirty=true;if(formObj.onsubmit==null||formObj.onsubmit()!=false)formObj.submit();ed.nodeChanged();}else ed.windowManager.alert("Error: No form element found.");return true;},_cancel:function(){var ed=this.editor,os,h=tinymce.trim(ed.startContent);if(os=ed.getParam("save_oncancelcallback")){ed.execCallback('save_oncancelcallback',ed);return;}ed.setContent(h);ed.undoManager.clear();ed.nodeChanged();}});tinymce.PluginManager.add('save',tinymce.plugins.Save);})();
(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})();

View file

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 609 2008-02-18 16:19:27Z spocke $
* $Id: editor_plugin_src.js 851 2008-05-26 15:38:49Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@ -53,7 +53,7 @@
formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form');
if (ed.getParam("save_enablewhendirty") && !ed.isDirty())
return true;
return;
tinyMCE.triggerSave();
@ -76,8 +76,6 @@
ed.nodeChanged();
} else
ed.windowManager.alert("Error: No form element found.");
return true;
},
_cancel : function() {

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:url+'/searchreplace.htm',width:420+parseInt(ed.getLang('searchreplace.delta_width',0)),height:160+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1,auto_focus:0},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};ed.addCommand('mceSearch',function(){open('search');});ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});ed.addShortcut('ctrl+f','searchreplace.search_desc','mceSearch');},getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('searchreplace',tinymce.plugins.SearchReplacePlugin);})();
(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:160+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})();

View file

@ -42,6 +42,9 @@ var SearchReplaceDialog = {
ca = f[m + '_panel_casesensitivebox'].checked;
rs = f['replace_panel_replacestring'].value;
if (s == '')
return;
function fix() {
// Correct Firefox graphics glitches
r = se.getRng().cloneRange();
@ -62,6 +65,10 @@ var SearchReplaceDialog = {
switch (a) {
case 'all':
// Move caret to beginning of text
ed.execCommand('SelectAll');
ed.selection.collapse(true);
if (tinymce.isIE) {
while (r.findText(s, b ? -1 : 1, fl)) {
r.scrollIntoView();
@ -79,14 +86,16 @@ var SearchReplaceDialog = {
}
if (fo)
wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));
else
wm.alert(ed.getLang('searchreplace_dlg.notfound'));
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
return;
case 'current':
replace();
if (!ed.selection.isCollapsed())
replace();
break;
}
@ -102,12 +111,12 @@ var SearchReplaceDialog = {
r.scrollIntoView();
r.select();
} else
wm.alert(ed.getLang('searchreplace_dlg.notfound'));
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
tinyMCEPopup.storeSelection();
} else {
if (!w.find(s, ca, b, false, false, false, false))
wm.alert(ed.getLang('searchreplace_dlg.notfound'));
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
else
fix();
}

View file

@ -7,7 +7,6 @@
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="js/searchreplace.js"></script>
<link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
<base target="_self" />
</head>
<body style="display:none;">
<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">

File diff suppressed because one or more lines are too long

View file

@ -45,7 +45,8 @@
});
ed.onInit.add(function() {
ed.dom.loadCSS(url + '/css/content.css');
if (ed.settings.content_css !== false)
ed.dom.loadCSS(url + '/css/content.css');
});
ed.onClick.add(t._showMenu, t);
@ -227,7 +228,7 @@
m = ed.controlManager.createDropMenu('spellcheckermenu', {
offset_x : p1.x,
offset_y : p1.y,
'class' : 'noIcons'
'class' : 'mceNoIcons'
});
t._menu = m;

View file

@ -1 +1 @@
(function(){tinymce.create('tinymce.plugins.StylePlugin',{init:function(ed,url){ed.addCommand('mceStyleProps',function(){ed.windowManager.open({file:url+'/props.htm',width:480+parseInt(ed.getLang('style.delta_width',0)),height:320+parseInt(ed.getLang('style.delta_height',0)),inline:1},{plugin_url:url,style_text:ed.selection.getNode().style.cssText});});ed.addCommand('mceSetElementStyle',function(ui,v){if(e=ed.selection.getNode()){ed.dom.setAttrib(e,'style',v);ed.execCommand('mceRepaint');}});ed.addButton('styleprops',{title:'style.desc',cmd:'mceStyleProps'});},getInfo:function(){return{longname:'Style',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('style',tinymce.plugins.StylePlugin);})();
(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})();

View file

@ -1,5 +1,5 @@
/**
* $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
* $Id: editor_plugin_src.js 787 2008-04-10 11:40:57Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
@ -28,6 +28,10 @@
}
});
ed.onNodeChange.add(function(ed, cm, n) {
cm.setDisabled('styleprops', n.nodeName === 'BODY');
});
// Register buttons
ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});
},

View file

@ -10,9 +10,9 @@ var defaultFonts = "" +
"Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%";
var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%";
var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%";
var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";
var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%";
var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";
var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
var defaultTextStyle = "normal;italic;oblique";
var defaultVariant = "normal;small-caps";
@ -223,12 +223,12 @@ function setupFormData() {
f.positioning_height.value = getNum(ce.style.height);
selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
setupBox(f, ce, 'positioning_placement', '', '', new Array('top', 'right', 'bottom', 'left'));
setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);
s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
s = s.replace(/,/g, ' ');
if (!hasEqualValues(new Array(getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)))) {
if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {
f.positioning_clip_top.value = getNum(getVal(s, 0));
selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
f.positioning_clip_right.value = getNum(getVal(s, 1));
@ -247,12 +247,12 @@ function setupFormData() {
}
function getMeasurement(s) {
return s.replace(/^([0-9]+)(.*)$/, "$2");
return s.replace(/^([0-9.]+)(.*)$/, "$2");
}
function getNum(s) {
if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s))
return s.replace(/[^0-9]/g, '');
if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s))
return s.replace(/[^0-9.]/g, '');
return s;
}
@ -279,7 +279,7 @@ function setValue(f, n, v) {
function setupBox(f, ce, fp, pr, sf, b) {
if (typeof(b) == "undefined")
b = new Array('Top', 'Right', 'Bottom', 'Left');
b = ['Top', 'Right', 'Bottom', 'Left'];
if (isSame(ce, pr, sf, b)) {
f.elements[fp + "_same"].checked = true;
@ -328,10 +328,10 @@ function setupBox(f, ce, fp, pr, sf, b) {
}
function isSame(e, pr, sf, b) {
var a = new Array(), i, x;
var a = [], i, x;
if (typeof(b) == "undefined")
b = new Array('Top', 'Right', 'Bottom', 'Left');
b = ['Top', 'Right', 'Bottom', 'Left'];
if (typeof(sf) == "undefined" || sf == null)
sf = "";
@ -478,7 +478,7 @@ function generateCSS() {
ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");
ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");
} else
ce.style.borderWidth = f.border_width_top.value;
ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
if (!f.border_color_same.checked) {
ce.style.borderTopColor = f.border_color_top.value;

Some files were not shown because too many files have changed in this diff Show more