How increase the size of the "Post" and "Preview" buttons, and reposition them

Started by fapencio, July 06, 2015, 02:27:52 PM

Previous topic - Next topic

fapencio

Hi, i want to help me with a code for increase the size of the "Post" and "Preview" buttons, and reposition them, that is, reposition both buttons, "preview" button to the left side, and "Post" button to the right side,

thanks in advance  :)
My smf forum is 2.0.10 version
my theme is default
language spanish es utf8

Kindred

well, much of that would depend on your theme...

Also, your description (while nice to see someone try to explain in words, instead of "do this... IMG" - in this case, a marked up image would be helpful
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

fapencio

my forum have this buttons :



but i want change the position, like this:



and increase the size of both buttons,

help, thanks in advance

:)
My smf forum is 2.0.10 version
my theme is default
language spanish es utf8

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

fapencio

My smf forum is 2.0.10 version
my theme is default
language spanish es utf8

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Antes

Lets start with GenericControls.template

    echo '
        <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" tabindex="', $context['tabindex']++, '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit" />';

    if ($editor_context['preview_type'])
        echo '
        <input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', $context['tabindex']++, '" onclick="', $editor_context['preview_type'] == 2 ? 'return event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button_submit" />';


move the preview code up-side like this;

    if ($editor_context['preview_type'])
        echo '
        <input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', $context['tabindex']++, '" onclick="', $editor_context['preview_type'] == 2 ? 'return event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button_submit" />';

    echo '
        <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" tabindex="', $context['tabindex']++, '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit" />';


this will put preview to left-side, do note you can do it with css when it has 2 buttons, when spell check button cames into life it goes to far-left side of the box.

To make those buttons (inputs) bigger, you can change the padding value.

#post_confirm_buttons input
{
    padding: 5px;
}

fapencio

@Antes I already missed people who know and like to help, my respect for you

now, I want to do the same but with quick reply buttons, please help me @Antes :)
My smf forum is 2.0.10 version
my theme is default
language spanish es utf8

Antes

This may not work for all themes since some of them are actually using different Display.template.php but don't think you gonna see that :)

open your Display.template
Code (Find) Select
<input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
<input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />';

Code (Replace) Select
<input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />
<input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />';


If you also want to resize this buttons add this "#quickReplyOptions input" to your CSS, like I showed above. If you want to resize both buttons at same you can use comma. Example;

#post_confirm_buttons input,
#quickReplyOptions input
{
padding: 5px;
}


I apologize for the harsh treatment you see. But I just want to add since Kindred has little to no involvement in development side its very normal that he doesn't have much knowledge. I hope you can forgive him.

Anyone questions feel free to ask here or open new topic, we'll gladly help you :)

fapencio

My smf forum is 2.0.10 version
my theme is default
language spanish es utf8

Advertisement: