Skip to content

Commit 13a05fc

Browse files
authored
Merge pull request #1 from takeyuweb/support-7
MT7対応
2 parents 222ed0d + fd9efd8 commit 13a05fc

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PreviewURL プラグイン
2121
動作要件
2222
-----------
2323

24-
* MT(MTOS) 5.0 / 5.1 / 5.2 / 6.0 / 6.1
24+
* MT(MTOS) 5.0 / 5.1 / 5.2 / 6.0 / 6.1 / 7
2525
* CGI / PSGI対応
2626

2727
インストール

plugins/PreviewURL/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ l10n_class: PreviewURL::L10N
22
id: PreviewURL
33
key: previewurl
44
name: <__trans phrase="PreviewURL">
5-
version: 1.6
5+
version: 1.7
66
author_name: <__trans phrase="_PLUGIN_AUTHOR">
77
author_link: http://takeyu-web.com/
88
description: <__trans phrase="_PLUGIN_DESCRIPTION">

plugins/PreviewURL/lib/PreviewURL/Callbacks.pm

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ sub _cb_template_param_edit_entry {
3535
required => 0,
3636
class => 'field-no-header' });
3737
my $innerHTML = <<"HTML";
38-
<strong>@{[ $plugin->translate( 'Preview URL' ) ]}:</strong>
39-
<input type="text" readonly="readonly" onclick="this.select();" style="width: 530px;" value="$preview_url" />
40-
<a class="button" href="$preview_url" target="<__trans phrase="_external_link_target">"><__trans phrase="View"></a>
38+
<label>@{[ $plugin->translate( 'Preview URL' ) ]}</label>
39+
<div class="input-group">
40+
<input type="text" readonly="readonly" onclick="this.select();" class="form-control text med" value="$preview_url" />
41+
<div class="input-group-append">
42+
<a class="button btn btn-default" href="$preview_url" target="_blank"><__trans phrase="View"></a>
43+
</div>
44+
</div>
4145
HTML
4246
$nodeset->innerHTML($innerHTML);
4347
$tmpl->insertAfter($nodeset, $pointer_field);
@@ -101,6 +105,9 @@ sub preview_url {
101105
);
102106
my $cfg = $app->config;
103107
my $url_base = $cfg->AdminCGIPath || $cfg->CGIPath;
108+
if ($url_base !~ m!^https://!) {
109+
$url_base = $app->{query}->url;
110+
}
104111
$url_base = $url_base =~ m!^(https?://[^/]+/?).*$!i ? $1 : '/';
105112
return caturl( $url_base, $uri );
106113
}

0 commit comments

Comments
 (0)