[ABD] BBcode shortcuts

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
hah
Registered User
Posts: 85
Joined: Sat Feb 13, 2010 11:49 am
Location: Pernik, Bulgaria
Name: Alex Georgiev
Contact:

[ABD] BBcode shortcuts

Post by hah » Thu Nov 11, 2010 7:20 am

Modification Name: BBcode shortcuts
Author: hah

Modification Description:
With this mod you can use shortcuts for BBcodes, with CTRL+B, CTRL+I, CTRL+U.
Notice that with this shortcuts there are already functions in your browser.In this mod, the functions are working CTRL+B (bookmarks) for example, but the bbcode shortcuts work only when you focus the textarea to write.When you are unfocused(blur), you can use your browser shortcuts again.
Inspired by http://area51.phpbb.com/phpBB/viewtopic ... 81&t=32913
The mod uses jquery and shortcut.js library (from openjs.com)
Tested with Firefox,IE,Google Chrome
Note that: This mod doesn't bug the default browser shortcuts.
Modification Version: 1.0.7

Features:
  • See above.
Planned features for future versions:
  • None yet.If someone wanna new shortcut, it may be added.
Screenshots:
Image

Demo URL: none yet

Modification Download: Download

Support only here or at http://phpbb.bg/issue.php/project/pbmods

Changelog
11/11/10 - Started topic

Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

Re: [RC] BBcode shortcuts

Post by Ather » Thu Nov 11, 2010 1:16 pm

A nice little addon, but why are you editing the includes/functions.php file?

you can easily use this code in your overall_header.html file

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/shortcut.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/jquery-1.4.3.min.js"></script>
then, the rest of the code goes like this :

Find :
</head>

Add Before :

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/shortcut.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/jquery-1.4.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() { 
   $("#t2").focus(function() {
        shortcut.add("Ctrl+B",function() {
         t2val = $("#t2").val()
          if(t2val == "") {
           $("#t2").val(t2val + "[b][/b]")
          } else {
           $("#t2").val(t2val + " [b][/b]")
          }
      });  
        shortcut.add("Ctrl+I",function() {
         t2val = $("#t2").val()
          if(t2val == "") {
           $("#t2").val(t2val + "[i][/i]")
          } else {
           $("#t2").val(t2val + " [i][/i]")
          }
      });  
        shortcut.add("Ctrl+U",function() {
         t2val = $("#t2").val()
          if(t2val == "") {
           $("#t2").val(t2val + "[u][/u]")
          } else {
           $("#t2").val(t2val + " [u][/u]")
          }
      });
   });
   $("#t2").blur(function() {
   shortcut.remove("Ctrl+B",function() {
   //
   });
   shortcut.remove("Ctrl+I",function() {
   //
   });
   shortcut.remove("Ctrl+U",function() {
   //
   });
   });
});
</script>
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets

User avatar
trickoff
Registered User
Posts: 513
Joined: Mon Jan 07, 2008 12:23 am

Re: [RC] BBcode shortcuts

Post by trickoff » Thu Nov 11, 2010 4:40 pm

Amazing! Thank you

whaturmuva
Registered User
Posts: 99
Joined: Thu Jun 19, 2008 3:09 pm
Contact:

Re: [RC] BBcode shortcuts

Post by whaturmuva » Fri Nov 12, 2010 6:30 pm

I had no idea it was so easy to add in shortcuts.

User avatar
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 24715
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: [RC] BBcode shortcuts

Post by Paul » Mon Sep 15, 2014 5:44 pm

This topic has been marked as [ABD] - Abandoned as the mod author has not been active recently. If the MOD author wishes to continue development, please PM anyone on the MOD Team to request this topic be unlocked.

Notice!
We do not recommend that a user of the phpBB software install this MOD, or any other mod that is marked as “abandoned” or “in development”, on a live forum. Doing so may cause your forum to not perform in the manner it should.


Thank you,
The phpBB Modifications Team
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

Locked

Return to “[3.0.x] Abandoned MODs”

Who is online

Users browsing this forum: No registered users and 16 guests