This patch adds a functionality (which can be disabled) that will make the quote link add the highlighted text to the comment and have it quoted.

Comments

kalman.hosszu’s picture

Status: Needs review » Needs work
  1. +++ b/quote.admin.inc
    @@ -55,6 +55,13 @@ function quote_settings_form() {
    +  $form['quote']['highlighted_text'] = array(
    

    You should delete the created variable during the uninstall process.

  2. +++ b/quote.js
    @@ -18,4 +18,74 @@ Drupal.behaviors.quote = {
    +Drupal.behaviors.highlighted = {
    

    Please use quoteHiglighted or something similar instead of "higlighted"

  3. +++ b/quote.js
    @@ -18,4 +18,74 @@ Drupal.behaviors.quote = {
    +  attach: function(context) {
    

    The attach function gets the settings variable too.

  4. +++ b/quote.js
    @@ -18,4 +18,74 @@ Drupal.behaviors.quote = {
    +      var settings = Drupal.settings.quote[this.id];
    

    You should use the settings param instead of Drupal.settings. In this case you have to modify the current settings variable's name.

  5. +++ b/quote.js
    @@ -18,4 +18,74 @@ Drupal.behaviors.quote = {
    +      var textarea = settings.textarea;
    

    Please use the new settings variable.

  6. +++ b/quote.js
    @@ -18,4 +18,74 @@ Drupal.behaviors.quote = {
    +function insertAtCursor(object, text) {
    

    I think this function should inside the behavior's class.

  7. +++ b/quote.js
    @@ -18,4 +18,74 @@ Drupal.behaviors.quote = {
    +// Get user selection text on page
    

    Please correct the function comment sesction.

  8. +++ b/quote.js
    @@ -18,4 +18,74 @@ Drupal.behaviors.quote = {
    +function getSelectedText() {
    

    This function should inside the behavior too.

After these modifications I will test the functionality. Thanks for the work @attila.fekete!

attila.fekete’s picture

Status: Needs work » Needs review
StatusFileSize
new6.59 KB

Hi Kalman, I fixed the issues you mentioned above, thanks for the review!

(Notice for the first one: it seems to me that we don't have to delete the variable, since all variables used in this module are merged into one variable ('quote') within the _quote_variable_get() function).

attila.fekete’s picture

StatusFileSize
new7.77 KB

Updated patch: highlighting feature now works with the 'Quote link' views field as well.

c470ip’s picture

Issue summary: View changes

Tried patch-0 and patch-2, none of them worked. The comments always get quoted completely, while nodes do not get quoted at all. Only [quote=*author*][/quote] tags are inserted and the following error occurs:

Notice: Undefined index: ru in the function _quote_get_quoted_data() (line 356 of file /home/***/www/sites/all/modules/quote/quote.module).

ivnish’s picture

Fixed in the new 2.x branch

ivnish’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.