]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use jquery-ui for input_forms tabset
authorEvan Prodromou <evan@status.net>
Thu, 10 Mar 2011 16:53:11 +0000 (10:53 -0600)
committerEvan Prodromou <evan@status.net>
Thu, 10 Mar 2011 16:53:11 +0000 (10:53 -0600)
js/util.js
lib/action.php
theme/rebase/css/display.css

index cc95a08bf58049232abfd41557e2dc5e6213c583..67e28485e41b4bf4266049ce849479093fa89826 100644 (file)
@@ -1276,22 +1276,6 @@ var SN = { // StatusNet
 
             return false;
         },
-
-        /**
-         * Switch to another active input sub-form.
-         * This will hide the current form (if any), show the new one, and
-         * update the input type tab selection state.
-         *
-         * @param {String} tag
-         */
-       switchInputFormTab: function(tag) {
-           // The one that's current isn't current anymore
-           $('.input_form_nav_tab.current').removeClass('current');
-           $('#input_form_nav_'+tag).addClass('current');
-
-           $('.input_form.current').removeClass('current');
-           $('#input_form_'+tag).addClass('current');
-       }
     },
 
     Init: {
index 7614f4be3aec05a568a62d4a6699e2bd3531c060..686b512a2c3973e3a8eddd084968bf57cfdc8d8f 100644 (file)
@@ -315,6 +315,7 @@ class Action extends HTMLOutputter // lawsuit
                 $this->showScriptMessages();
                 // Frame-busting code to avoid clickjacking attacks.
                 $this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }');
+                $this->inlineScript('$(document).ready(function(){ $(\'#input_forms\').tabs(); });');
                 Event::handle('EndShowStatusNetScripts', array($this));
                 Event::handle('EndShowLaconicaScripts', array($this));
             }
@@ -592,7 +593,7 @@ class Action extends HTMLOutputter // lawsuit
     {
         $tabs = array('status' => _('Status'));
 
-        $this->elementStart('div', 'input_forms');
+        $this->elementStart('div', array('id' => 'input_forms'));
 
         if (Event::handle('StartShowEntryForms', array(&$tabs))) {
 
@@ -611,7 +612,7 @@ class Action extends HTMLOutputter // lawsuit
                 $this->elementStart('li', $attrs);
 
                 $this->element('a',
-                               array('href' => 'javascript:SN.U.switchInputFormTab("'.$tag.'")'),
+                               array('href' => '#input_forms-'.$tag),
                                $title);
                 $this->elementEnd('li');
             }
@@ -621,7 +622,7 @@ class Action extends HTMLOutputter // lawsuit
             foreach ($tabs as $tag => $title) {
 
                 $attrs = array('class' => 'input_form',
-                               'id' => 'input_form_'.$tag);
+                               'id' => 'input_forms-'.$tag);
 
                 if ($tag == 'status') {
                     $attrs['class'] .= ' current';
index c1ac1e8f4d7a8cd6972f09d50d8e9635c08afe4b..f7a9486f244f96992ab95a11ae8ff3cc761c3619 100644 (file)
@@ -1962,18 +1962,6 @@ margin-bottom:18px;
 padding-left:20px;
 }
 
-#input_form_nav { 
-    list-style-type: none;
-}
-
-#input_form_nav li { 
-    display:inline;
-}
-
-.input_form_nav_tab.current {
-    text-decoration: underline;
-}
-
 .input_form { 
     display: none;
 }