Forum:Toolbar buttons

I'm using some code based off of Porter21's code from dev but I can't seem to get one of my links to work. The code is

function addOasisToolbarButtons { var encodedPagename = encodeURIComponent(wgPageName); var toolbar = $('#WikiaFooter ul.tools'); var toolbarButtons = ''; // Function for adding a custom toolbar button if (wgAction = 'edit') { toolbarButtons += 'Cancel'; } else { 'B3' }     // Add buttons to toolbar $(function {        toolbar.prepend(toolbarButtons);      }); } jQuery(function($) {  if (skin == 'oasis' || skin == 'wikia') {      addOasisToolbarButtons ;   } });

My problem is that I want Cancel to only show while editing and the other link to show any time else hence the " if (wgAction = 'edit') but the cancel button seems to be shpwing no matter what. I'm getting nothing in console. Any ideas? -- Kangaroopowah  - Talk  19:07, November 26, 2011 (UTC)