]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/DirectionDetector/DirectionDetectorPlugin.php
Change status.net/wiki URLs to git.gnu.io
[quix0rs-gnu-social.git] / plugins / DirectionDetector / DirectionDetectorPlugin.php
index 4a38f390f10a814089abba753c1fef5a5d2aa896..1f77a61acc3897be4e3c6ca45d53a549ca3c2077 100644 (file)
@@ -37,20 +37,12 @@ class DirectionDetectorPlugin extends Plugin {
      * @param object $notice notice is going to be saved
      */
     public function onStartNoticeSave($notice){
+        // don't use getRendered() here since it's not saved yet and thus can't ->update in case that would happen
         if(!preg_match('/<span class="rtl">/', $notice->rendered) && self::isRTL($notice->content))
             $notice->rendered = '<span class="rtl">'.$notice->rendered.'</span>';
         return true;
     }
 
-    /**
-     * SN plugin API, here we will add css needed for modifiyed rendered
-     *
-     * @param Action $xml
-     */
-    public function onEndShowStatusNetStyles($xml){
-        $xml->element('style', array('type' => 'text/css'), 'span.rtl {display:block;direction:rtl;text-align:right;float:right;} .notice .author {float:left}');
-    }
-
     /**
      * is passed string a rtl content or not
      *
@@ -129,7 +121,7 @@ class DirectionDetectorPlugin extends Plugin {
      */
     function onEndShowScripts($action){
         if (common_logged_in()) {
-            $action->script('plugins/DirectionDetector/jquery.DirectionDetector.js');
+            $action->script($this->path('jquery.DirectionDetector.js'));
         }
     }
 
@@ -253,14 +245,15 @@ class DirectionDetectorPlugin extends Plugin {
     /**
      * plugin details
      */
-    function onPluginVersion(&$versions){
-        $url = 'http://status.net/wiki/Plugin:DirectionDetector';
+    function onPluginVersion(array &$versions){
+        $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/DirectionDetector';
 
         $versions[] = array(
             'name' => 'Direction detector',
             'version' => DIRECTIONDETECTORPLUGIN_VERSION,
             'author' => 'Behrooz Shabani',
             'homepage' => $url,
+            // TRANS: Plugin description.
             'rawdescription' => _m('Shows notices with right-to-left content in correct direction.')
         );
         return true;