]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/ClientSideShorten/ClientSideShortenPlugin.php
Makes ClientSideShorten loading shorten.js from config['plugins']['server'] if setted...
[quix0rs-gnu-social.git] / plugins / ClientSideShorten / ClientSideShortenPlugin.php
index 27a3a56f72d2e3cd62db96aaf3d366a03acef5b2..cc109292318a06d3a04ee1191ad649d58380dea7 100644 (file)
@@ -51,9 +51,11 @@ class ClientSideShortenPlugin extends Plugin
     }
 
     function onEndShowScripts($action){
-        $action->inlineScript('var Notice_maxContent = ' . Notice::maxContent());
         if (common_logged_in()) {
-            $action->script('plugins/ClientSideShorten/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($this->path('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;
     }