]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
status update placeholder removed, javascript not required to post
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 8 Jan 2015 17:04:46 +0000 (18:04 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 8 Jan 2015 17:04:46 +0000 (18:04 +0100)
js/util.js
lib/action.php
lib/noticeplaceholderform.php [deleted file]
theme/base/css/display.css

index 82ca6e4bcec149bb118742e0915b629c82c8dac7..6fabb1e13b1f65492746a3b410aa5a1ae85fe018 100644 (file)
@@ -433,7 +433,7 @@ var SN = { // StatusNet
                                         .css({display: 'none'})
                                         .fadeIn(2500);
                                     SN.U.NoticeWithAttachment($('#' + notice.id));
-                                    SN.U.switchInputFormTab("placeholder");
+                                    SN.U.switchInputFormTab(null);
                                 }
                             } else {
                                 // Not on a timeline that this belongs on?
@@ -1382,14 +1382,10 @@ var SN = { // StatusNet
          *
          * @param {String} tag
          */
-    switchInputFormTab: function (tag) {
-        // The one that's current isn't current anymore
-        $('.input_form_nav_tab.current').removeClass('current');
-            if (tag == 'placeholder') {
-                // Hack: when showing the placeholder, mark the tab
-                // as current for 'Status'.
-                $('#input_form_nav_status').addClass('current');
-            } else {
+        switchInputFormTab: function (tag) {
+            // The one that's current isn't current anymore
+            $('.input_form_nav_tab.current').removeClass('current');
+            if (tag != null) {
                 $('#input_form_nav_' + tag).addClass('current');
             }
 
@@ -1401,17 +1397,22 @@ var SN = { // StatusNet
                 return;
             }
 
-        $('.input_form.current').removeClass('current');
-        $('#input_form_' + tag)
-                .addClass('current')
-                .find('.ajax-notice').each(function () {
-                    var form = $(this);
-                    SN.Init.NoticeFormSetup(form);
-                })
-                .find('.notice_data-text').focus();
+            $('.input_form.current').removeClass('current');
+            if (tag == null) {
+                // we're done here, no new inputform to focus on
+                return false;
+            }
 
-        return false;
-    },
+            $('#input_form_' + tag)
+                    .addClass('current')
+                    .find('.ajax-notice').each(function () {
+                        var form = $(this);
+                        SN.Init.NoticeFormSetup(form);
+                    })
+                    .find('.notice_data-text').focus();
+
+            return false;
+        },
 
         showMoreMenuItems: function (menuid) {
             $('#' + menuid + ' .more_link').remove();
@@ -1436,11 +1437,6 @@ var SN = { // StatusNet
                 // SN.Init.NoticeFormSetup() will get run
                 // when forms get displayed for the first time...
 
-                // Hack to initialize the placeholder at top
-                $('#input_form_placeholder input.placeholder').focus(function () {
-                    SN.U.switchInputFormTab("status");
-                });
-
                 // Make inline reply forms self-close when clicking out.
                 $('body').on('click', function (e) {
                     var currentForm = $('#content .input_forms div.current');
@@ -1453,7 +1449,7 @@ var SN = { // StatusNet
                                 anything = anything || $(this).val();
                             });
                             if (!anything) {
-                                SN.U.switchInputFormTab("placeholder");
+                                SN.U.switchInputFormTab(null);
                             }
                         }
                     }
index 4909af992656eb02b706b771abef9c3bb5f88baa..cc02305ffe10549fa0e81f654b385f8bce66d4d1 100644 (file)
@@ -736,9 +736,6 @@ class Action extends HTMLOutputter // lawsuit
                                'class' => 'input_form_nav_tab');
 
                 if ($tag == 'status') {
-                    // We're actually showing the placeholder form,
-                    // but we special-case the 'Status' tab as if
-                    // it were a small version of it.
                     $attrs['class'] .= ' current';
                 }
                 $this->elementStart('li', $attrs);
@@ -752,16 +749,12 @@ class Action extends HTMLOutputter // lawsuit
 
             $this->elementEnd('ul');
 
-            $attrs = array('class' => 'input_form current',
-                           'id' => 'input_form_placeholder');
-            $this->elementStart('div', $attrs);
-            $form = new NoticePlaceholderForm($this);
-            $form->show();
-            $this->elementEnd('div');
-
             foreach ($tabs as $tag => $data) {
                 $attrs = array('class' => 'input_form',
                                'id' => 'input_form_'.$tag);
+                if ($tag == 'status') {
+                    $attrs['class'] .= ' current';
+                }
 
                 $this->elementStart('div', $attrs);
 
diff --git a/lib/noticeplaceholderform.php b/lib/noticeplaceholderform.php
deleted file mode 100644 (file)
index 87e64fb..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
- * StatusNet, the distributed open-source microblogging tool
- *
- * Form for posting a notice
- *
- * PHP version 5
- *
- * LICENCE: This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- * @category  Form
- * @package   StatusNet
- * @author   Brion Vibber <brion@status.net>
- * @copyright 2011 StatusNet, Inc.
- * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://status.net/
- */
-
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/form.php';
-
-/**
- * Placeholder form for posting a notice
- *
- * Frequently-used form for posting a notice
- *
- * @category Form
- * @package  StatusNet
- * @author   Brion Vibber <brion@status.net>
- * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link     http://status.net/
- *
- * @see      HTMLOutputter
- */
-class NoticePlaceholderForm extends Widget
-{
-    function show()
-    {
-        // Similar to that for inline replies, but not quite!
-        // TRANS: Field label for notice text.
-        $placeholder = _('Update your status...');
-        $this->out->elementStart('div', 'form_notice_placeholder');
-        $this->out->element('input', array('class' => 'placeholder',
-                                           'value' => $placeholder));
-        $this->out->elementEnd('div');
-    }
-}
index 4b68ae1ade7d9773b16d47065e4834b9f6c16f74..4be2d61e285343bd7b0922118b49a394eaaeb07b 100644 (file)
@@ -248,15 +248,14 @@ address .poweredby {
 /* input forms */
 
 .input_forms {
-    float: left;
     position: relative;
     margin-bottom: 10px;
     border-bottom: 1px dotted #ccc;
+    width: 100%;
 }
 
 #input_form_nav {
     float: left;
-    width: 100%;
     margin-bottom: 10px;
     list-style-type: none;
 }