]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Only load json2.js if native JSON is not supported
[quix0rs-gnu-social.git] / lib / action.php
index e2427755852120fa61d1b5b8cb6576b1170dba49..cd84662c9623a187f15f921c8f6923586afe5983 100644 (file)
@@ -246,18 +246,18 @@ class Action extends HTMLOutputter // lawsuit
     {
         if (Event::handle('StartShowScripts', array($this))) {
             if (Event::handle('StartShowJQueryScripts', array($this))) {
-                $this->script('js/jquery.min.js');
-                $this->script('js/jquery.form.js');
-                $this->script('js/jquery.cookie.js');
-                $this->script('js/json2.js');
-                $this->script('js/jquery.joverlay.min.js');
+                $this->script('jquery.min.js');
+                $this->script('jquery.form.js');
+                $this->script('jquery.cookie.js');
+                $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.js').'"); }');
+                $this->script('jquery.joverlay.min.js');
                 Event::handle('EndShowJQueryScripts', array($this));
             }
             if (Event::handle('StartShowStatusNetScripts', array($this)) &&
                 Event::handle('StartShowLaconicaScripts', array($this))) {
-                $this->script('js/xbImportNode.js');
-                $this->script('js/util.js');
-                $this->script('js/geometa.js');
+                $this->script('xbImportNode.js');
+                $this->script('util.js');
+                $this->script('geometa.js');
                 // Frame-busting code to avoid clickjacking attacks.
                 $this->element('script', array('type' => 'text/javascript'),
                                'if (window.top !== window.self) { window.top.location.href = window.self.location.href; }');
@@ -392,13 +392,20 @@ class Action extends HTMLOutputter // lawsuit
         $this->elementStart('address', array('id' => 'site_contact',
                                              'class' => 'vcard'));
         if (Event::handle('StartAddressData', array($this))) {
+            if (common_config('singleuser', 'enabled')) {
+                $url = common_local_url('showstream',
+                                        array('nickname' => common_config('singleuser', 'nickname')));
+            } else {
+                $url = common_local_url('public');
+            }
             $this->elementStart('a', array('class' => 'url home bookmark',
-                                           'href' => common_local_url('public')));
+                                           'href' => $url));
             if (common_config('site', 'logo') || file_exists(Theme::file('logo.png'))) {
                 $this->element('img', array('class' => 'logo photo',
                                             'src' => (common_config('site', 'logo')) ? common_config('site', 'logo') : Theme::path('logo.png'),
                                             'alt' => common_config('site', 'name')));
             }
+            $this->text(' ');
             $this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
             $this->elementEnd('a');
             Event::handle('EndAddressData', array($this));
@@ -816,12 +823,14 @@ class Action extends HTMLOutputter // lawsuit
                                             'alt' => common_config('license', 'title'),
                                             'width' => '80',
                                             'height' => '15'));
+                $this->text(' ');
                 //TODO: This is dirty: i18n
                 $this->text(_('All '.common_config('site', 'name').' content and data are available under the '));
                 $this->element('a', array('class' => 'license',
                                           'rel' => 'external license',
                                           'href' => common_config('license', 'url')),
                                common_config('license', 'title'));
+                $this->text(' ');
                 $this->text(_('license.'));
                 $this->elementEnd('p');
                 break;