Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-10677

{html} macro using javascript and "window.open" -> new window is created behind source window and even newWindow.focus() does not help

      Copy this code to any page and click the image ("empty") right of the input box. A new window will be opened but covered by the existing window. Needs to be moved in front by default and even NewWindow.focus( ) does not help.

      It looks like Confluence controls "window.open" (and ".focus" is not called) or blocks ".focus( )".

      ================

      {html}
      <script type="text/javascript">
      <!--
      function bab(a) { var obj; obj=new ActiveXObject("BabylonIEPI.BabylonProxy"); obj.translate(a, -1, -1, -1); }

      function navigate(form) {
      var lv_url = new String;
      var lv_my_input = new String;
      lv_url = form.provider.options[form.provider.selectedIndex].value;
      lv_my_input = form.lv_my_input.value;
      if ( lv_url == "Babylon6" ) { bab( lv_my_input )}
      else { lv_url = lv_url + lv_my_input; MyWindow = window.open(lv_url); MyWindow.focus( ); }
      }

      //-->
      </script>

      <form name="my_search" action="">
      <table>
      <tr>
      <td>
      <b><a href="http://www.google.com" target="_blank"><font color = #ffffff>Power Search:</font></a></b><br>
      <select name = "provider">
      <option value ="http://www.google.com/search?q=">Google</option>
      <option value ="http://www.ask.com/web?q=">AskX</option>
      <option value ="http://www.quintura.com/quintura_savelink.asp?http://www.quintura.com:/?request=">Quintura</option>
      <option value ="http://search.yahoo.com/search?p=">Yahoo</option>
      <option value ="http://search.msn.com/results.aspx?q=">Live Search</option>
      <option value ="http://yubnub.org/parser/parse?command=">YouNub</option>
      <option value ="http://del.icio.us/search/?fr=del_icio_us&p=">Del.icio.us</option>
      <option value ="http://www.youtube.com/results?search_query=">YouTube</option>
      </select>
      </td>
      </tr>
      <tr>
      <td>
      <input type="text" name="lv_my_input" size="14"></input>
      <input type="image" align="absbottom" width="20" height="20" onclick="navigate(this.form);"></input>
      </td>
      </tr>
      </table>
      </form>{html}

            [CONFSERVER-10677] {html} macro using javascript and "window.open" -> new window is created behind source window and even newWindow.focus() does not help

            Matt Ryall added a comment -

            Sorry for the delay in replying.

            This doesn't look like an issue with Confluence, but with your JavaScript. Sorry we couldn't be more helpful.

            Matt Ryall added a comment - Sorry for the delay in replying. This doesn't look like an issue with Confluence, but with your JavaScript. Sorry we couldn't be more helpful.

            If instead of

            <input type="image" align="absbottom" width="20" height="20" onclick="navigate(this.form);"></input>

            type="button" is used it works fine.

            But we need to use "image" to be in line with the branding of SAP Corporate Portal.

            Michael Biermann added a comment - If instead of <input type="image" align="absbottom" width="20" height="20" onclick="navigate(this.form);"></input> type="button" is used it works fine. But we need to use "image" to be in line with the branding of SAP Corporate Portal.

            Idea:
            ====

            It would be wonderful to have a search dropdown per default on the upper right corner of Confluence, left to the input box and search button.
            This could be maintained by the Wiki admin. It would be wonderful if space admin could add more search providers, which are space/topic specific.

            At SAP we have currently added similar code as above to many space navigations.

            Michael Biermann added a comment - Idea: ==== It would be wonderful to have a search dropdown per default on the upper right corner of Confluence, left to the input box and search button. This could be maintained by the Wiki admin. It would be wonderful if space admin could add more search providers, which are space/topic specific. At SAP we have currently added similar code as above to many space navigations.

              Unassigned Unassigned
              a86e40796820 Michael Biermann
              Affected customers:
              0 This affects my team
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: