Plugin Directory

Changeset 2723793


Ignore:
Timestamp:
05/14/2022 04:54:22 PM (4 years ago)
Author:
eggnstone
Message:

v1.0.7: Added mandatory Amazon note.

Location:
widgets-for-amazon/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • widgets-for-amazon/trunk

    • Property svn:ignore
      •  

        old new  
        77TODO.txt
        88*.zip
         9OldAmazonWidgets
  • widgets-for-amazon/trunk/CHANGELOG.md

    r2723425 r2723793  
    11# Changelog
     2
     3#### 1.0.7 - 2022-05-14
     4
     5- Added mandatory Amazon note.
    26
    37#### 1.0.5 - 2022-05-13
  • widgets-for-amazon/trunk/README.md

    r2723425 r2723793  
    66Requires PHP: 7.0 
    77Tested up to: 5.9 
    8 Stable tag: 1.0.5 
     8Stable tag: 1.0.7 
    99License: GPLv3 or later 
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
  • widgets-for-amazon/trunk/css/amazon-search.css

    r2722456 r2723793  
    66    border-top-right-radius: 4px;
    77    overflow: hidden;
     8    margin-bottom: 0;
    89}
    910
     
    155156    overflow: hidden;
    156157}
     158
     159.amazon-search .footer
     160{
     161    font-size: 8pt;
     162    font-family: Arial, sans-serif;
     163    color: gray;
     164    text-align: center;
     165    padding-top: 0;
     166}
  • widgets-for-amazon/trunk/includes/Plugin.php

    r2723425 r2723793  
    146146            $base_url = $base_url_europe_west_1;
    147147
    148         $url = $base_url . '?Version=' . $plugin_version . '&Tag=' . $affiliateTag;
     148        $url = $base_url . '?Source=WP&Version=' . $plugin_version . '&Tag=' . $affiliateTag;
    149149        if ($domain_code)
    150150            $url .= '&DomainCode=' . $domain_code;
     
    154154            $url .= '&Category=' . $category;
    155155
     156        /** @noinspection SpellCheckingInspection */
     157        $footerMessage = $language == 'de'
     158            ? 'Als Amazon-Partner verdienen wir an qualifizierten Verkäufen.'
     159            : 'As an Amazon Associate we earn from qualifying purchases.';
     160
    156161        //Tools::log_debug('URL: ' . $url);
    157162
    158         $output = 'eggnstone_widgets_fill_amazon_search_box("__INDEX__", "__URL__", "__KEYWORDS__");' . "\n";
     163        $output = 'eggnstone_widgets_fill_amazon_search_box("__INDEX__", "__URL__", "__KEYWORDS__", "' . $footerMessage . '");' . "\n";
    159164
    160165        $output = str_replace('__URL__', $url, $output);
     
    185190    {
    186191        // Add common CSS
    187         wp_enqueue_style('WidgetsForAmazonFontAwesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');
    188192        wp_enqueue_style('WidgetsForAmazonSB',
    189193            plugin_dir_url(__DIR__) . 'css/amazon-search.css',
  • widgets-for-amazon/trunk/js/amazon-search.js

    r2723425 r2723793  
    1 function eggnstone_widgets_fill_amazon_search_box_for_search_forms(index, url, keywords)
     1function eggnstone_widgets_fill_amazon_search_box_for_search_forms(index, url, keywords, footerMessage)
    22{
    33    const element = document.getElementById("amazon-search-" + index);
     
    66        return;
    77
    8     eggnstone_widgets_fill_amazon_search_box(index, url, keywords);
     8    eggnstone_widgets_fill_amazon_search_box(index, url, keywords, footerMessage);
    99}
    1010
    11 function eggnstone_widgets_fill_amazon_search_box(index, url, keywords)
     11function eggnstone_widgets_fill_amazon_search_box(index, url, keywords, footerMessage)
    1212{
    1313    const element = document.getElementById("amazon-search-" + index);
     
    2525            const items = parsedJson["Items"];
    2626            if (!items || items.length === 0)
    27                 element.innerHTML = eggnstone_widgets_create_search_box_table_with_message(index, url, keywords, "Nothing found.");
     27                element.innerHTML = eggnstone_widgets_create_search_box_table_with_message(index, url, keywords, "Nothing found.", footerMessage);
    2828            else
    29                 element.innerHTML = eggnstone_widgets_create_search_box_table_with_result(index, url, keywords, items, maxTitleWidth);
     29                element.innerHTML = eggnstone_widgets_create_search_box_table_with_result(index, url, keywords, items, maxTitleWidth, footerMessage);
    3030        }
    3131        else
    32             element.innerHTML = eggnstone_widgets_create_search_box_table_with_message(index, url, keywords, "Nothing found.");
     32            element.innerHTML = eggnstone_widgets_create_search_box_table_with_message(index, url, keywords, "Nothing found.", footerMessage);
    3333    });
    3434
    35     element.innerHTML = eggnstone_widgets_create_search_box_table_with_message(index, url, keywords, "Loading ...");
     35    element.innerHTML = eggnstone_widgets_create_search_box_table_with_message(index, url, keywords, "Loading ...", footerMessage);
    3636
    3737    req.send(null);
     
    5555}
    5656
    57 function eggnstone_widgets_create_search_box_table_with_message(index, url, keywords, message)
     57function eggnstone_widgets_create_search_box_table_with_message(index, url, keywords, message, footerMessage)
    5858{
    5959    let html = eggnstone_widgets_create_search_box_table_start(index, url, keywords);
     
    6868        "</tr>";
    6969
    70     html += eggnstone_widgets_create_search_box_table_end();
     70    html += eggnstone_widgets_create_search_box_table_end(footerMessage);
    7171
    7272    return html;
    7373}
    7474
    75 function eggnstone_widgets_create_search_box_table_with_result(index, url, keywords, items, maxTitleWidth)
     75function eggnstone_widgets_create_search_box_table_with_result(index, url, keywords, items, maxTitleWidth, footerMessage)
    7676{
    7777    let html = eggnstone_widgets_create_search_box_table_start(index, url, keywords);
     
    120120    }
    121121
    122     html += eggnstone_widgets_create_search_box_table_end();
     122    html += eggnstone_widgets_create_search_box_table_end(footerMessage);
    123123
    124124    return html;
     
    140140        "          <td class='right-cell'>" +
    141141        "            <button onclick='eggnstone_widgets_on_search_button_click(" + index + ", \"" + url + "\");'/>" +
    142         "              <i class='fa fa-search'></i>" +
     142        "              <svg width='12' height='12' http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z' style='fill:#ffffff'/></svg>" +
    143143        "            </button>" +
    144144        "          </td>" +
     
    149149}
    150150
    151 function eggnstone_widgets_create_search_box_table_end()
     151function eggnstone_widgets_create_search_box_table_end(footerMessage)
    152152{
    153     return "</table>";
     153    return "</table>" + '<div class="footer">' + footerMessage + "</div>";
     154
    154155}
    155156
  • widgets-for-amazon/trunk/widgets-for-amazon.php

    r2723425 r2723793  
    33/**
    44 * Plugin Name: Widgets for Amazon
    5  * Plugin URI: https://eggnstone.dev/wordpress/plugins/widgets-for-amazon
     5 * Plugin URI: https://blog.eggnstone.com/wordpress/widgets-for-amazon-for-wordpress
    66 * Description: Widgets for Amazon by eggnstone
    7  * Version: 1.0.5
     7 * Version: 1.0.7
    88 * Author: eggnstone
    9  * Author URI: https://eggnstone.dev
     9 * Author URI: https://eggnstone.com
    1010 */
    1111
Note: See TracChangeset for help on using the changeset viewer.