Plugin Directory

Changeset 1847708


Ignore:
Timestamp:
03/27/2018 12:08:07 PM (8 years ago)
Author:
phankimi
Message:
  • version 1.0.3: add upcoming ICOs widget and code improve.
Location:
kades-crypto-widgets/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kades-crypto-widgets/trunk/js/kades-crypto.js

    r1795522 r1847708  
    22// where data come from
    33baseUrl = "https://widgets.cryptocompare.com/";
     4
    45
    56// Crypto market index
     
    1819    cryptoheader.appendChild(s);
    1920    })();
    20 
    2121}
    22 
    23 
    2422
    2523// Crypto converter
     
    3937}
    4038
    41 // Crypto tabbed widgets
     39// Crypto tabbed widget
    4240var cryptotabbed = document.getElementById("kadescrypto-tabbed");
    4341if( cryptotabbed !== null && cryptotabbed !== '' ) {
     
    5553}
    5654
     55// Crypto ICOs widget
     56
     57function add_iwl_list_widget(){
     58    var widget_divs = document.getElementsByClassName("icowatchlist_list_widget");
     59    for(var i = 0; i < widget_divs.length; i++)
     60    {
     61        if (!widget_divs.item(i).getElementsByTagName('iframe').length)
     62        {
     63        var link = "https://api.icowatchlist.com/widget/v1/";
     64        if (widget_divs.item(i).getAttribute("data-type")=='nolink') link += "widget2.php";
     65        link += "?items="+widget_divs.item(i).getAttribute("data-num")+"&color="+widget_divs.item(i).getAttribute("data-color");
     66   
     67        frame_height = (parseInt(widget_divs.item(i).getAttribute("data-num"))*75)+128;
     68        var iframe = document.createElement('iframe');
     69        iframe.style.cssText='width:100%;height:'+frame_height+'px;border:1px solid #000;border: 1px solid #b5b4b4;';
     70        iframe.setAttribute("src", link);     
     71       
     72        widget_divs.item(i).appendChild(iframe);
     73        }
     74    }   
     75}
     76if(window.addEventListener){
     77  window.addEventListener('load', add_iwl_list_widget)
     78}else{
     79  window.attachEvent('onload', add_iwl_list_widget)
     80}
    5781
    5882
     83
  • kades-crypto-widgets/trunk/kades-crypto-widgets.php

    r1795522 r1847708  
    22/*
    33Plugin Name: Kades Crypto Widgets
    4 Plugin URI: https://kadesthemes.com/wordpress-plugins/
    5 Description: Displays crypto currency widgets and chart
     4Plugin URI: https://kadesthemes.com/wordpress-plugins/kades-crypto-widgets/
     5Description: Displays Cryptocurrency widgets and chart
    66Author: Kimi
    77Author URI: http://phankimi.com
    8 Version: 1.0.2
     8Version: 1.0.3
    99Text Domain: kades-crypto-widgets
    1010License: GPL2
     
    2929        $widget_option = array(
    3030            'classname'     => 'kades_crypto_converter',
    31             'description'   => 'Display cryptocurrency converter widget'
     31            'description'   => esc_html__( 'Display cryptocurrency converter widget', 'kades-crypto-widgets' )
    3232        );
    3333        parent::__construct( 'kades_crypto_converter', 'Kades Crypto Converter', $widget_option );
     
    4949        $widget_option = array(
    5050            'classname'     => 'kades_crypto_header',
    51             'description'   => 'Display cryptocurrency header widget'
     51            'description'   => esc_html__( 'Display cryptocurrency header widget', 'kades-crypto-widgets' )
    5252        );
    5353        parent::__construct( 'kades_crypto_header', 'Kades Crypto Header', $widget_option );
     
    6969        $widget_option = array(
    7070            'classname'     => 'kades_crypto_tabbed',
    71             'description'   => 'Display cryptocurrency tabbed widget'
     71            'description'   => esc_html__( 'Display cryptocurrency tabbed widget', 'kades-crypto-widgets' )
    7272        );
    7373        parent::__construct( 'kades_crypto_tabbed', 'Kades Crypto Tabbed', $widget_option );
     
    8282        echo $args['after_widget'];
    8383    }
     84}
     85
     86class Kades_Crypto_ICO_Widgets extends WP_Widget {
     87
     88    public function __construct() {
     89        $widget_option = array(
     90            'classname'     => 'kades_crypto_icos',
     91            'description'   => esc_html__( 'Display Upcoming ICOs widget', 'kades-crypto-widgets' )
     92        );
     93        parent::__construct( 'kades_crypto_icos', 'Kades Crypto Upcoming ICO ', $widget_option );
     94    }
     95
     96    public function widget( $args, $instance ) {
     97        echo $args['before_widget'];
     98
     99        // display the widget
     100        echo '<div id="kadescrypto-ico"><div class="icowatchlist_list_widget" data-color="FF9F1C" data-num="5" data-type="regular"></div></div>';
     101
     102        echo $args['after_widget'];
     103    }
    84104}
    85105
     
    89109    register_widget( 'Kades_Crypto_Header_Widgets' );
    90110    register_widget( 'Kades_Crypto_Tabbed_Widgets' );
     111    register_widget( 'Kades_Crypto_ICO_Widgets' );
    91112}
  • kades-crypto-widgets/trunk/readme.txt

    r1795522 r1847708  
    22Contributors: phankimi, kadesthemes
    33Donate link: https://paypal.me/phankimi
    4 Tags: bitcoin, ethereum, crypto, cryptocurrency, widget
     4Tags: bitcoin, ethereum, crypto, cryptocurrency, widget, ico, cryptocurrencies, blockchain
    55Requires at least: 4.0
    6 Tested up to: 4.9.1
     6Tested up to: 4.9.4
    77Requires PHP: 5.2
    8 Stable tag: 1.0.2
     8Stable tag: 1.0.3
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1111   
    12 Displays crypto currency widgets. More widgets and chart to come. Crypto market data from https://www.cryptocompare.com/dev/widget/wizard/ You can make your own widgets as well.
     12Displays Cryptocurrency widgets. More widgets and chart to come. Crypto market data from https://www.cryptocompare.com/dev/widget/wizard/ and ICOs information from https://icowatchlist.com/. You can make your own widgets as well.
    1313
    1414== Description ==
    1515
    16 Displays crypto currency widgets. More widgets and chart to come. Crypto market data from https://www.cryptocompare.com/dev/widget/wizard/ You can make your own widgets as well.
     16Displays Cryptocurrency widgets. More widgets and chart to come. Crypto market data from https://www.cryptocompare.com/dev/widget/wizard/ and ICOs information from https://icowatchlist.com/. You can make your own widgets as well. Learn more at [KadesThemes.com](https://kadesthemes.com/wordpress-plugins/kades-crypto-widgets/).
    1717
     18
     19= Theme Compatible With KADES CRYPTO WIDGETS =
     20[Bitcoinee - free Cryptocurrency WordPress Theme](https://kadesthemes.com/wordpress-themes/bitcoinee/) by Kades Themes.
     21
     22Kades Crypto Widgets plugin will work with any theme, but it may require some styling to make it match. We always here to support you if any problems happen.
    1823
    1924== Installation ==
     
    3641== Changelog ==
    3742
     43= 1.0.3 =
     44* New widget: ICOs upcoming
     45* Fix: widget Header on small device responsive
     46* Update: plugin's description
    3847= 1.0.2 =
    3948* add Kades Crypto Tabbed widget & fix bug.
Note: See TracChangeset for help on using the changeset viewer.