X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FClientSideShorten%2FClientSideShortenPlugin.php;h=6379acd3340ceda95d016e74e6ed8d2335b55bc6;hb=7f1a30dc40ac772247425a49498d7f5d4550e01f;hp=443d2fffe03fee20797a8f4e4f6c3e2e8deea806;hpb=91485718c4a07e217f41d395d7e7cf057875e751;p=quix0rs-gnu-social.git diff --git a/plugins/ClientSideShorten/ClientSideShortenPlugin.php b/plugins/ClientSideShorten/ClientSideShortenPlugin.php index 443d2fffe0..6379acd334 100644 --- a/plugins/ClientSideShorten/ClientSideShortenPlugin.php +++ b/plugins/ClientSideShorten/ClientSideShortenPlugin.php @@ -51,9 +51,11 @@ class ClientSideShortenPlugin extends Plugin } function onEndShowScripts($action){ - $action->inlineScript('var Notice_maxContent = ' . Notice::maxContent()); if (common_logged_in()) { - $action->script($this->path('shorten.js')); + $user = common_current_user(); + $action->inlineScript('var maxNoticeLength = ' . User_urlshortener_prefs::maxNoticeLength($user)); + $action->inlineScript('var maxUrlLength = ' . User_urlshortener_prefs::maxUrlLength($user)); + $action->script('plugins/ClientSideShorten/shorten.js'); } } @@ -71,6 +73,7 @@ class ClientSideShortenPlugin extends Plugin 'author' => 'Craig Andrews', 'homepage' => 'http://status.net/wiki/Plugin:ClientSideShorten', 'rawdescription' => + // TRANS: Plugin description. _m('ClientSideShorten causes the web interface\'s notice form to automatically shorten URLs as they entered, and before the notice is submitted.')); return true; }