[RC2]Fix QuoteSelection for quick reply (1.0.2)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
swatquest
Registered User
Posts: 30
Joined: Tue Jun 08, 2004 8:34 pm

[RC2]Fix QuoteSelection for quick reply (1.0.2)

Post by swatquest »

MOD Title: Fix QuoteSelection for quick reply
MOD Author: swatquest < N/A >
MOD Description: Fix the incompatibility with the Firefox 1.5.X.X
MOD Version: 1.0.1
Stable version: 2.0.X

Installation Level: Easy
Installation Time: 1 Minute
Files To Edit: templates/subSilver/quick_reply.tpl

Included Files: n/a

Code: Select all

##############################################################
## MOD Title: Fix QuoteSelection for quick reply
## MOD Author: swatquest < N/A >
## MOD Description: Fix the incompatibility with the Firefox 1.5.X.X
## MOD Version: 1.0.2
## Stable version: 2.0.X
##
## Installation Level: Easy
## Installation Time: 1 Minute
## Files To Edit: templates/subSilver/quick_reply.tpl
##
## Included Files: n/a
#############################################################
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: More Information < http://www.phpbbrasil.com.br/ >
## It is necessary to have Advanced Quick Reply or another Quick Reply who owns this function
##
##  When selecting it only appears
##
##   [quote][/quote]
##
##
##  And not
##
##
##  [quote]Example text[/quote]
##
##############################################################
## MOD History:
##
##   2006-04-23- Version 0.0.1
##      - initial release
##
##   2006-06-01- Version 1.0.0
##      - bug fix <FIX: When selecting inserted once and for all a line >
##
##   2006-08-01- Version 1.0.2
##      - BUG fix
##      
##
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/quick_reply.tpl

#
#-----[ FIND ]------------------------------------------
#

        function quoteSelection() {

                theSelection = false;
                theSelection = document.selection.createRange().text; // Get text selection

                if (theSelection) {
                        // Add tags around selection
                        emoticon( '[quote]\n' + theSelection + '\n[/quote]\n');
                        document.post.message.focus();
                        theSelection = '';
                        return;
                }else{
                        alert('{L_NO_TEXT_SELECTED}');
                }
        }

#
#-----[ REPLACE WITH ]-----------------------------------
#

 function quoteSelection() {

      theSelection = false;
         if (window.getSelection)
         {
            theSelection = window.getSelection();
         }
         else if (document.getSelection)
         {
            theSelection = document.getSelection();
         }
         else if (document.selection)
         {
            theSelection = document.selection.createRange().text;
         }

      if (theSelection) {
         // Add tags around selection
               emoticon('[quote]' + theSelection + '[/quote]\n');
         document.post.message.focus();
         theSelection = '';
         return;
         }
         else
         {
         alert('{L_NO_TEXT_SELECTED}');
      }
   } 


#
#-----[ FIND ]------------------------------------------
#
 <input type='button' name='quoteselected' class='liteoption' value='{L_QUOTE_SELECTED}' onclick='javascript:quoteSelection()'>

#
#-----[ REPLACE WITH ]------------------------------------
#
 <input type='button' name='quoteselected' class='liteoption' value='{L_QUOTE_SELECTED}' onmousedown='quoteSelection()' />

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 
MOD checked by the phpBB2 MOD validator tool
Last edited by swatquest on Fri Aug 25, 2006 8:28 pm, edited 13 times in total.

User avatar
IPlasma
Registered User
Posts: 101
Joined: Sun Jul 04, 2004 9:36 pm
Location: Bretagne Sud (France)

Post by IPlasma »

I just tested it, thank you very much swatquest :D

User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Post by christhatsme »

since the primary language here is english - can you post in english please?
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

swatquest
Registered User
Posts: 30
Joined: Tue Jun 08, 2004 8:34 pm

Post by swatquest »

Brazilian Portuguese

Oi pessoal

Corrige a incompatibilidade com o Firefox 1.5.0.2

English

Hi people..

Fix the incompatibility with the Firefox 1.5.0.2
Last edited by swatquest on Thu Jul 27, 2006 6:18 pm, edited 1 time in total.

User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Post by christhatsme »

is there an incompatibility? I havn't noticed - what is the affect?
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

swatquest
Registered User
Posts: 30
Joined: Tue Jun 08, 2004 8:34 pm

Post by swatquest »

christhatsme wrote: is there an incompatibility? I havn't noticed - what is the affect?


Yes.

It does not select the text , just inserts the tags.

Example:

text: Example text

When selecting it only appears

Code: Select all

 [quote][/quote]
And not

Code: Select all

 [quote]Example text[/quote]

daza
Registered User
Posts: 7
Joined: Mon Oct 18, 2004 7:12 am

Post by daza »

Awesome! Works great now, thank you.

This is especially useful for those who use phpBB Plus 1.53. Thanks!

swatquest
Registered User
Posts: 30
Joined: Tue Jun 08, 2004 8:34 pm

Post by swatquest »

Version update 0.0.1 to 1.0.0

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/quick_reply.tpl

#
#-----[ FIND ]------------------------------------------
#

			  emoticon( '[quote]' + theSelection + '[/quote]\n');


#
#-----[ REPLACE WITH ]-----------------------------------
#
 
               emoticon('[quote]' + theSelection + '[/quote]\n');
  

#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 
MOD checked by the phpBB2 MOD validator tool

mattlilly
Registered User
Posts: 13
Joined: Mon Jan 02, 2006 8:06 am
Location: USA

Post by mattlilly »

Thank you for this. But, could it be fixed to say who you are quoting as the non quick reply quoting does? As it is it just says Quote:. Usualy it says Username Wrote:

swatquest
Registered User
Posts: 30
Joined: Tue Jun 08, 2004 8:34 pm

Post by swatquest »

up 1.0.0 to 1.0.1

swatquest
Registered User
Posts: 30
Joined: Tue Jun 08, 2004 8:34 pm

Post by swatquest »

BUG FIX upgrade 1.0.2

Post Reply

Return to “[2.0.x] MODs in Development”