Skip to content

Commit

Permalink
Merge pull request #1 from takeyuweb/support-7
Browse files Browse the repository at this point in the history
MT7対応
  • Loading branch information
takeyuweb authored Feb 23, 2023
2 parents 222ed0d + fd9efd8 commit 13a05fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PreviewURL プラグイン
動作要件
-----------

* MT(MTOS) 5.0 / 5.1 / 5.2 / 6.0 / 6.1
* MT(MTOS) 5.0 / 5.1 / 5.2 / 6.0 / 6.1 / 7
* CGI / PSGI対応

インストール
Expand Down
2 changes: 1 addition & 1 deletion plugins/PreviewURL/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ l10n_class: PreviewURL::L10N
id: PreviewURL
key: previewurl
name: <__trans phrase="PreviewURL">
version: 1.6
version: 1.7
author_name: <__trans phrase="_PLUGIN_AUTHOR">
author_link: http://takeyu-web.com/
description: <__trans phrase="_PLUGIN_DESCRIPTION">
Expand Down
13 changes: 10 additions & 3 deletions plugins/PreviewURL/lib/PreviewURL/Callbacks.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ sub _cb_template_param_edit_entry {
required => 0,
class => 'field-no-header' });
my $innerHTML = <<"HTML";
<strong>@{[ $plugin->translate( 'Preview URL' ) ]}:</strong>
<input type="text" readonly="readonly" onclick="this.select();" style="width: 530px;" value="$preview_url" />
<a class="button" href="$preview_url" target="<__trans phrase="_external_link_target">"><__trans phrase="View"></a>
<label>@{[ $plugin->translate( 'Preview URL' ) ]}</label>
<div class="input-group">
<input type="text" readonly="readonly" onclick="this.select();" class="form-control text med" value="$preview_url" />
<div class="input-group-append">
<a class="button btn btn-default" href="$preview_url" target="_blank"><__trans phrase="View"></a>
</div>
</div>
HTML
$nodeset->innerHTML($innerHTML);
$tmpl->insertAfter($nodeset, $pointer_field);
Expand Down Expand Up @@ -101,6 +105,9 @@ sub preview_url {
);
my $cfg = $app->config;
my $url_base = $cfg->AdminCGIPath || $cfg->CGIPath;
if ($url_base !~ m!^https://!) {
$url_base = $app->{query}->url;
}
$url_base = $url_base =~ m!^(https?://[^/]+/?).*$!i ? $1 : '/';
return caturl( $url_base, $uri );
}
Expand Down

0 comments on commit 13a05fc

Please sign in to comment.