• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Playing with the fonts

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
2 posts • Page 1 of 1

Postby waiheke » Tue Oct 19, 2010 3:30 am

Following on from this thread: http://www.phpfreechat.net/forum/viewto ... 042#p16042

I found you can play with sizings too
That is a SHOUT button and a (whisper) button

Make the 2 buttons, bt_small.gif and bt_large.gif

Add to the chat.html.tpl.php, after the reference to the delete button (which isn't a delete, but strike-through):

Code: Select all
      <div id="pfc_bt_delete_btn" class="pfc_btn">
        <img src="<?php echo $c->getFileUrlFromTheme('images/bt_small.gif'); ?>" width="21" height="21"
             id="pfc_bt_small" name="small"
             alt="<?php echo _pfc("Whisper"); ?>"
             title="<?php echo _pfc("Whisper"); ?>"
             class="pfc_bt_small"
             onclick="pfc.insert_text('[v]','[/v]',true)" />
      </div>

      <div id="pfc_btlarge_btn" class="pfc_btn">
        <img src="<?php echo $c->getFileUrlFromTheme('images/bt_large.gif'); ?>" width="21" height="21"
             id="pfc_bt_large" name="large"
             alt="<?php echo _pfc("Shout"); ?>"
             title="<?php echo _pfc("Shout"); ?>"
             class="pfc_bt_large"
             onclick="pfc.insert_text('[l]','[/l]',true)" />
</div>

Then add to the chat.js.tpl.php

(somewhere around line 1595, after this line .....)

msg = msg.replace(rx, '<span style="text-decoration: line-through">$1</span>');

(add:)

Code: Select all
    rx = new RegExp('\[l\](.+?)\[/l\]','ig');
    msg = msg.replace(rx, '<span style="font-size: 14pt">$1</span>');
    rx = new RegExp('\[v\](.+?)\[/v\]','ig');
    msg = msg.replace(rx, '<span style="font-size: 7pt">$1</span>');

Upload and rehash
Last edited by waiheke on Mon Oct 25, 2010 6:38 am, edited 1 time in total.
waiheke
Member
 
Posts: 126
Joined: Sun Sep 12, 2010 4:33 pm
Top

Postby waiheke » Thu Oct 21, 2010 3:41 pm

Intrigued by the code, I found that if you set the true)"/> to false, you can preselect clicking a button, then typing text, rather than typing and selecting by swiping the mouse

So I've set up an inelegant - but functional - system of click Style, type, click End.

I couldn't figure out how to get the argument accepted with just one [], in the regex, so have settled for :
(eg) onclick="pfc.insert_text('[u]','[]',false)" />

and then the closing button:
onclick="pfc.insert_text('[]','[/]',false)" />

the regex in the chat.js.tpl.php is now:
rx = new RegExp('\[u\]\[](.+?)\[]\[/\]','ig');
msg = msg.replace(rx, '<span style="text-decoration: underline">$1</span>');

This appears in the input box as a messy string, but it works

([u][]this line will be underlined[][/]

and so on ..
[s][]this line will be line-through[][/] etc
Last edited by waiheke on Thu Oct 28, 2010 10:57 am, edited 1 time in total.
waiheke
Member
 
Posts: 126
Joined: Sun Sep 12, 2010 4:33 pm
Top


Post a reply
2 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 12 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub