Plugin Directory

Changeset 738521


Ignore:
Timestamp:
07/10/2013 01:55:21 AM (13 years ago)
Author:
conductrics
Message:

Version 0.3.1

Location:
conductrics-webactions/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • conductrics-webactions/trunk/conductrics-webactions.php

    r728383 r738521  
    33    Plugin Name: Conductrics Web Actions
    44    Description: Includes Conductrics Web Actions scripts in your pages, which makes it easy to test changes to your pages, track their success, and do dynamic targeting.
    5     Version: 0.3.0
     5    Version: 0.3.1
    66    Author: Conductrics
    77    Author URI: http://conductrics.com
  • conductrics-webactions/trunk/css/wa-settings.css

    r712473 r738521  
    1010    margin: 0;
    1111}
     12.link-list-item-label {
     13    padding: 5px 0;
     14}
     15.link-list-item-label strong {
     16    font-size: 110%;
     17}
     18.link-list-item-links {
     19}
     20.agent-list-refresh {
     21    background-image: url('./refresh-icon.png');
     22    background-repeat: no-repeat;
     23    min-height: 20px;
     24    min-width: 20px;
     25    float:right;
     26    background-position: center bottom;
     27}
     28.agent-status {
     29    min-width: 55px;
     30    text-align: center;
     31    color: white;
     32    border-radius: 3px;
     33    padding: 2px;
     34    float:right;
     35}
     36.agent-status.agent-status-enabled {
     37    background-color: #468847;
     38}
     39.agent-status.agent-status-paused {
     40    background-color: #f89406;
     41}
     42.agent-status.agent-status-stopped {
     43    background-color: #b94a48;
     44}
     45.agent-status.agent-status-deleted {
     46    background-color: #888;
     47}
  • conductrics-webactions/trunk/includes/wa-settings.php

    r728383 r738521  
    4444            $agent_code = get_post_meta( $post->ID, '_wa_agent_code', true );
    4545            $admin_page = "options-general.php?page=conductrics-wa-settings";
    46             echo "<p>Agents to use on this page:</p>";
    47             echo "<div><input type='hidden' name='wa_agent_code' value='$agent_code' class='agent-code-list'/></div>";
     46            echo "<div><input type='hidden' name='wa_agent_code' value='$agent_code' class='agent-code-list' title='Agents to use on this page:' title='Agents to use on this page:'/></div>";
    4847            echo "See also: <a href='$admin_page'>Agents to Use on Every Page</a>";
    4948        }
     
    140139            add_settings_field(
    141140                'conductrics_globalagent',
    142                 'Agents to Use on Every Page',
     141                'Global Agents',
    143142                array($this, 'create_input_globalagent'),
    144143                'conductrics-wa-settings-a',
     
    253252            $account_options = $this->admin_get_options();
    254253            $value = $account_options['globalagent'];
    255             ?><input type="hidden" id="conductrics_globalagent" name="conductrics_options[globalagent]" value="<?= $value; ?>" placeholder="agent code(s)" class='regular-text agent-code-list'/> <?php
     254            ?><input type="hidden" id="conductrics_globalagent" name="conductrics_options[globalagent]" value="<?= $value; ?>" placeholder="agent code(s)" class='regular-text agent-code-list' title='Agents to use on every page:'/> <?php
    256255            /* ?><div><em>Use commas for multiple agents, like so:</em> agent-1,agent-2</div><?php */
    257256        }
  • conductrics-webactions/trunk/js/agent-list-input.jquery.js

    r728383 r738521  
    66            options = $.extend({
    77                account: {},
    8                 selector: '.agent-code-list'
     8                selector: '.agent-code-list',
     9                title: null
    910            }, optionz);
    1011            if ( hasAdminAccountInfo() ) {
     
    1213            } else {
    1314                showMessage('<strong>Plugin not set up.</strong> Please go to the Conductrics Account tab under Settings > Conductrics Actions and provide your account details.');
     15            }
     16            if (options.title == null) {
     17                options.title = $(options.selector).attr('title') || '';
    1418            }
    1519            $(options.selector).on('hover', tb_position_shim);
     
    5054        doAjax(url, 'GET', data, function(response, status) {
    5155            if (response && response.data.agents) {
     56                var map = {}
     57                for (var i in response.data.agents) {
     58                    var item = response.data.agents[i];
     59                    map[item.code] = item;
     60                }
     61
    5262                $(options.selector).linklistinput('enable', {
    5363                    items : response.data.agents,
     64                    title: options.title,
    5465                    itemLinkClass: 'thickbox',
    5566                    itemLinksFn: function(val) {
     67                        var item = map[val];
     68                        if (item == null) {
     69                            return [];
     70                        }
    5671                        return [
    5772                            { href: thickboxUrl(getConsoleUrl([val, 'web-actions'], true, true), 900), label: 'Web Actions', class: 'thickbox thickbox-conductrics' },
     
    6075                        ]
    6176                    },
    62                     itemLabelFn: function(val) { return "<img src='"+options.account.adminurl+"/favicon.ico' align='absmiddle'/> <strong>" + val + "</strong>"},
     77                    itemLabelFn: function(val) {
     78                        var item = map[val] || {};
     79                        var itemName = item.name || val;
     80                        var itemStatus = item.status || 'deleted';
     81                        var str = "<strong>" + itemName + "</strong> "
     82                            + "<span class='agent-status agent-status-"+itemStatus+"'>"+itemStatus+"</span>";
     83                        return str;
     84                    },
    6385                    optionLabelFn: function(item) {return item.name},
    6486                    optionValueFn: function(item) {return item.code},
     
    115137
    116138    function receiveMessage(event) {
     139        console.log(event.data.message)
    117140        if (event.data.message == 'agent-created') {
    118141            // A new agent was created, let's refresh the list of available agents
     
    126149            });
    127150        }
     151        if (event.data.message == 'agent-changed') {
     152            refreshAgentList();
     153        }
    128154        if (event.data.message == 'web-actions-saved') {
    129155            // Web actions were saved, close modal for that if we have one
    130156            closeThickbox();
     157            refreshAgentList();
    131158        }
    132159    }
  • conductrics-webactions/trunk/js/link-list-input.jquery.js

    r712473 r738521  
    1515                itemLinkClass: '',
    1616                refresherFn: null,
    17                 refreshLabel: '(refresh list)',
     17                refreshLabel: 'refresh',
    1818                newItemLabel: '(new item)',
    19                 items: []
     19                items: [],
     20                title: ''
    2021            }, optionz);
    2122
     
    4849        var values = split($el.val());
    4950        $el.parent().find('.link-list-container').remove();
    50         var container = $('<div class="link-list-container postbox"></div>').appendTo( $el.parent() );
     51        var refreshContent = options.refresherFn == null ? '' : '<a href="#" class="agent-list-refresh" title='+options.refreshLabel+'></a>';
     52        $('<div class="link-list-container"><p>'+options.title + refreshContent+'</p><div class="postbox"></div></div>').appendTo( $el.parent() );
     53        var container = $el.parent().find('.postbox');
    5154        var listContainer = $('<ul></ul>').appendTo(container);
    5255        for (var i in values) {
     
    5558            $el.data('link-list-value', val);
    5659            var itemContainer = $('<div class="reveal-on-hover misc-pub-section"></div>').appendTo(listContainer);
    57             itemContainer.append('<span>'+options.itemLabelFn(val)+'</span><br />');
    58             var linksContainer = $('<span class="revealed-on-hover"></span>').appendTo(itemContainer);
     60            itemContainer.append('<div class="link-list-item-label"><span>'+options.itemLabelFn(val)+'</span></div>');
     61            var linksContainer = $('<div class="link-list-item-links"><span class="revealed-on-hover"></span></div>').appendTo(itemContainer);
    5962            if (options.itemLinksFn) {
    6063                var links = options.itemLinksFn(val);
     
    6972        var content = [];
    7073        content.push('<option value="" disabled selected>(agent to add)</option>'); // parameteritize
    71         if (options.refresherFn) {
     74        /*if (options.refresherFn) {
    7275            content.push('<option value="__refresh__">'+options.refreshLabel+'</option>');
    73         }
     76        } */
    7477        if (options.newItemHandlerFn) {
    7578            content.push('<option value="__new__">'+options.newItemLabel+'</option>'); // parameteritize
     
    8386            }
    8487        }
    85         container.append('<div class="misc-pub-section">Add: <select>'+content.join('')+'</select>');
    86 
     88        container.append('<div class="misc-pub-section">Add <select>'+content.join('')+'</select> ');
     89        $el.parent().find('.agent-list-refresh').click(function() {
     90            refreshList();
     91        });
    8792        // When user clicks "remove" link for a value
    8893        container.find('.link-list-remove').click(function() {
  • conductrics-webactions/trunk/readme.txt

    r728383 r738521  
    6161== Changelog ==
    6262
     63= 0.3.1 =
     64* Added status display to list of agents at page level, post level, and global level
     65* Refresh list of agents when the status changes
     66* Show friendly agent name rather than code in agent list
     67* Display "deleted" next to agent if agent no longer exists in the Conductrics account
     68* Added refresh icon
     69* Minor cosmetic improvements
     70
    6371= 0.3.0 =
    6472* Added link to 'Agents to use on every page' from the configuration pane in the right rail when editing a page/post.
     
    8391== Upgrade Notice ==
    8492
     93= 0.3.1 =
     94* This version provides some minor usability improvements when setting up a test with web actions.
     95
    8596= 0.3.0 =
    8697* This version provides some minor usability improvements when setting up a test with web actions.
Note: See TracChangeset for help on using the changeset viewer.