Commit cf1a4d82 authored by Evan Prodromou's avatar Evan Prodromou

Input form switcher works

This change adds the input form switcher, which adds a navigation menu
across the top of the input form, letting you switch between different kinds of input.

The input menu doesn't yet look like a nice set of tabs; it could use some love.
parent 7aa55f82
......@@ -1272,7 +1272,16 @@ var SN = { // StatusNet
// UI links currently on the page use malleable names.
return false;
}
},
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: {
......
This diff is collapsed.
......@@ -657,7 +657,8 @@ class Action extends HTMLOutputter // lawsuit
foreach ($tabs as $tag => $title) {
$attrs = array('id' => 'input_form_nav_'.$title);
$attrs = array('id' => 'input_form_nav_'.$tag,
'class' => 'input_form_nav_tab');
if ($tag == 'status') {
$attrs['class'] = 'current';
......@@ -666,7 +667,7 @@ class Action extends HTMLOutputter // lawsuit
$this->elementStart('li', $attrs);
$this->element('a',
array('href' => 'javascript:switchInputFormTab("'.$tag.'")'),
array('href' => 'javascript:SN.U.switchInputFormTab("'.$tag.'")'),
$title);
$this->elementEnd('li');
}
......@@ -679,9 +680,7 @@ class Action extends HTMLOutputter // lawsuit
'id' => 'input_form_'.$tag);
if ($tag == 'status') {
$attrs['class'] .= ' active';
} else {
$attrs['class'] .= ' inactive';
$attrs['class'] .= ' current';
}
$this->elementStart('div', $attrs);
......@@ -698,6 +697,8 @@ class Action extends HTMLOutputter // lawsuit
if (!empty($form)) {
$form->show();
}
$this->elementEnd('div');
}
}
}
......
......@@ -1953,8 +1953,27 @@ 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;
}
.input_form.current {
display: block;
}
}/*end of @media screen, projection, tv*/
/*end of @media screen, projection, tv*/
@media print {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment