Changeset 738521
- Timestamp:
- 07/10/2013 01:55:21 AM (13 years ago)
- Location:
- conductrics-webactions/trunk
- Files:
-
- 6 edited
-
conductrics-webactions.php (modified) (1 diff)
-
css/wa-settings.css (modified) (1 diff)
-
includes/wa-settings.php (modified) (3 diffs)
-
js/agent-list-input.jquery.js (modified) (6 diffs)
-
js/link-list-input.jquery.js (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
conductrics-webactions/trunk/conductrics-webactions.php
r728383 r738521 3 3 Plugin Name: Conductrics Web Actions 4 4 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. 05 Version: 0.3.1 6 6 Author: Conductrics 7 7 Author URI: http://conductrics.com -
conductrics-webactions/trunk/css/wa-settings.css
r712473 r738521 10 10 margin: 0; 11 11 } 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 44 44 $agent_code = get_post_meta( $post->ID, '_wa_agent_code', true ); 45 45 $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>"; 48 47 echo "See also: <a href='$admin_page'>Agents to Use on Every Page</a>"; 49 48 } … … 140 139 add_settings_field( 141 140 'conductrics_globalagent', 142 ' Agents to Use on Every Page',141 'Global Agents', 143 142 array($this, 'create_input_globalagent'), 144 143 'conductrics-wa-settings-a', … … 253 252 $account_options = $this->admin_get_options(); 254 253 $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' /> <?php254 ?><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 256 255 /* ?><div><em>Use commas for multiple agents, like so:</em> agent-1,agent-2</div><?php */ 257 256 } -
conductrics-webactions/trunk/js/agent-list-input.jquery.js
r728383 r738521 6 6 options = $.extend({ 7 7 account: {}, 8 selector: '.agent-code-list' 8 selector: '.agent-code-list', 9 title: null 9 10 }, optionz); 10 11 if ( hasAdminAccountInfo() ) { … … 12 13 } else { 13 14 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') || ''; 14 18 } 15 19 $(options.selector).on('hover', tb_position_shim); … … 50 54 doAjax(url, 'GET', data, function(response, status) { 51 55 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 52 62 $(options.selector).linklistinput('enable', { 53 63 items : response.data.agents, 64 title: options.title, 54 65 itemLinkClass: 'thickbox', 55 66 itemLinksFn: function(val) { 67 var item = map[val]; 68 if (item == null) { 69 return []; 70 } 56 71 return [ 57 72 { href: thickboxUrl(getConsoleUrl([val, 'web-actions'], true, true), 900), label: 'Web Actions', class: 'thickbox thickbox-conductrics' }, … … 60 75 ] 61 76 }, 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 }, 63 85 optionLabelFn: function(item) {return item.name}, 64 86 optionValueFn: function(item) {return item.code}, … … 115 137 116 138 function receiveMessage(event) { 139 console.log(event.data.message) 117 140 if (event.data.message == 'agent-created') { 118 141 // A new agent was created, let's refresh the list of available agents … … 126 149 }); 127 150 } 151 if (event.data.message == 'agent-changed') { 152 refreshAgentList(); 153 } 128 154 if (event.data.message == 'web-actions-saved') { 129 155 // Web actions were saved, close modal for that if we have one 130 156 closeThickbox(); 157 refreshAgentList(); 131 158 } 132 159 } -
conductrics-webactions/trunk/js/link-list-input.jquery.js
r712473 r738521 15 15 itemLinkClass: '', 16 16 refresherFn: null, 17 refreshLabel: ' (refresh list)',17 refreshLabel: 'refresh', 18 18 newItemLabel: '(new item)', 19 items: [] 19 items: [], 20 title: '' 20 21 }, optionz); 21 22 … … 48 49 var values = split($el.val()); 49 50 $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'); 51 54 var listContainer = $('<ul></ul>').appendTo(container); 52 55 for (var i in values) { … … 55 58 $el.data('link-list-value', val); 56 59 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); 59 62 if (options.itemLinksFn) { 60 63 var links = options.itemLinksFn(val); … … 69 72 var content = []; 70 73 content.push('<option value="" disabled selected>(agent to add)</option>'); // parameteritize 71 if (options.refresherFn) {74 /*if (options.refresherFn) { 72 75 content.push('<option value="__refresh__">'+options.refreshLabel+'</option>'); 73 } 76 } */ 74 77 if (options.newItemHandlerFn) { 75 78 content.push('<option value="__new__">'+options.newItemLabel+'</option>'); // parameteritize … … 83 86 } 84 87 } 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 }); 87 92 // When user clicks "remove" link for a value 88 93 container.find('.link-list-remove').click(function() { -
conductrics-webactions/trunk/readme.txt
r728383 r738521 61 61 == Changelog == 62 62 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 63 71 = 0.3.0 = 64 72 * Added link to 'Agents to use on every page' from the configuration pane in the right rail when editing a page/post. … … 83 91 == Upgrade Notice == 84 92 93 = 0.3.1 = 94 * This version provides some minor usability improvements when setting up a test with web actions. 95 85 96 = 0.3.0 = 86 97 * 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.