Plugin Directory

Changeset 925806


Ignore:
Timestamp:
06/03/2014 05:31:47 PM (12 years ago)
Author:
carlgrundberg
Message:

Updated to work with TinyMCE 4

Location:
eliteprospects-player-link/trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • eliteprospects-player-link/trunk/ep_player_dialog.css

    r668870 r925806  
    1 #ep-player-dialog-list a {
    2     display: block;
    3     padding: 10px;
    4     background: #f9f9f9;
    5     background-image: -webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));
    6     background-image: -webkit-linear-gradient(bottom,#ececec,#f9f9f9);
    7     background-image: -moz-linear-gradient(bottom,#ececec,#f9f9f9);
    8     background-image: -o-linear-gradient(bottom,#ececec,#f9f9f9);
    9     background-image: linear-gradient(to top,#ececec,#f9f9f9);
     1#ep-player-dialog-list li {
     2    margin: 3px 0;
    103}
    114
    12 #ep-player-dialog-list a:hover {
    13     background: #ececec;
    14     background-image: -webkit-gradient(linear,left bottom,left top,from(#f9f9f9),to(#ececec));
    15     background-image: -webkit-linear-gradient(bottom,#f9f9f9,#ececec);
    16     background-image: -moz-linear-gradient(bottom,#f9f9f9,#ececec);
    17     background-image: -o-linear-gradient(bottom,#f9f9f9,#ececec);
    18     background-image: linear-gradient(to top,#f9f9f9,#ececec);
     5#ep-player-dialog-list img {
     6    vertical-align: baseline;
    197}
  • eliteprospects-player-link/trunk/ep_player_link.js

    r668870 r925806  
    77
    88var epPlayerLinkPopup;
    9 var disabled = true;
     9var disabled = false;
    1010var running = false;
    1111var sources = {
     
    5252
    5353            // Add a node change handler, selects the button in the UI when a text is selected
    54             ed.onNodeChange.add(function(ed, cm, n, co) {
    55                 disabled = co && n.nodeName != 'A';
    56             });
     54            /*ed.on('NodeChange', function(e) {
     55                disabled = e.element.nodeName != 'A';
     56            });*/
    5757        },
    5858
     
    6868                author : 'Carl Grundberg, Menmo',
    6969                authorurl : 'http://www.menmo.se',
    70                 version : 0.2
     70                version : 0.4
    7171            };
    7272        }
     
    9494                } else {
    9595                    ed.windowManager.open({
    96                         id : 'ep-player-dialog',
    97                         width : 480,
    98                         height : "auto",
    99                         wpDialog : true,
    100                         title : 'Eliteprospects Player Profile'
    101                     }, {
    102                         plugin_url : url,
    103                         data: data,
    104                         source: source
     96                        title : 'Eliteprospects Player Profile',
     97                        body: [{
     98                            type: 'label',
     99                            label: 'Multiple players found. Please select one.'
     100                        }, {
     101                            type: 'container',
     102                            html: playerList(data.players)
     103                        }]
     104                    });
     105                    $('#ep-player-dialog-list a').click(function(e) {
     106                        e.preventDefault();
     107                        insertLink(ed, source, this.rel);
     108                        ed.windowManager.close();
    105109                    });
    106110                }
     
    120124    };
    121125
    122     epPlayerLinkPopup = {
    123 
    124         init : function() {
    125             inputs.dialog = $('#ep-player-dialog');
    126             inputs.list = $('#ep-player-dialog-list');
    127 
    128             inputs.dialog.bind('wpdialogbeforeopen', epPlayerLinkPopup.beforeOpen);
    129         },
    130 
    131         beforeOpen : function() {
    132             var data = tinyMCEPopup.getWindowArg('data');
    133             var source = tinyMCEPopup.getWindowArg('source');
    134             inputs.list.empty();
    135             for(i in data.players) {
    136                 inputs.list.append(jQuery('<li><a href="#" rel="' + data.players[i].id +'"><img src="http://www.eliteprospects.com/layout/flags/' + data.players[i].nationId + '.gif"/> ' + data.players[i].firstname + ' ' + data.players[i].lastname + ' (' + data.players[i].pos + ') ' + data.players[i].team.name + '</a></li>'));
    137             }
    138             jQuery('a', inputs.list).click(function(e) {
    139                 e.preventDefault();
    140                 insertLink(tinyMCEPopup.editor, source, this.rel);
    141                 tinyMCEPopup.close();
    142             })
     126    var playerList = function(players) {
     127        var list = $('<ul>', { id: 'ep-player-dialog-list'});
     128        for(i in players) {
     129            list.append($('<li><a href="#" rel="' + players[i].id +'"><img src="http://www.eliteprospects.com/layout/flags/' + players[i].nationId + '.gif"/> ' + players[i].firstname + ' ' + players[i].lastname + ' (' + players[i].pos + ') ' + players[i].team.name + '</a></li>'));
    143130        }
     131        return $('<div>').append(list).html();
    144132    };
    145 
    146     $(document).ready( epPlayerLinkPopup.init );
    147133})(jQuery);
  • eliteprospects-player-link/trunk/index.php

    r668916 r925806  
    66Plugin URI:   http://eliteprospects.com
    77Description:  Link to player profiles on Eliteprospects.com
    8 Version:      0.3.1
     8Version:      0.4.0
    99Author:       Carl Grundberg, Menmo
    1010Author URI:   http://www.menmo.se
     
    2424    }
    2525
    26     add_action('after_wp_tiny_mce', 'ep_player_dialog');
    2726    wp_enqueue_script('jquery');
     27    wp_enqueue_script('wpdialogs');
    2828    wp_enqueue_style('ep_player_dialog', plugins_url( 'ep_player_dialog.css' , __FILE__ ));
    2929}
    30 
    31 include 'ep_player_dialog.php';
    3230
    3331function register_ep_button($buttons) {
  • eliteprospects-player-link/trunk/readme.txt

    r668916 r925806  
    33Donate link:
    44Tags: eliteprospects, hockey, football, sports, player, profile
    5 Requires at least: 3.0
    6 Tested up to: 3.5.1
    7 Stable tag: 0.3.1
     5Requires at least: 3.9
     6Tested up to: 3.9
     7Stable tag: 0.4.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3030== Changelog ==
    3131
     32= 0.4 =
     33* Updated to work with TinyMCE 4
    3234= 0.3 =
    3335* Added Elitefootball button.
Note: See TracChangeset for help on using the changeset viewer.