<?xml version="1.0" encoding="UTF-8" ?>
<!-- generated on <%= grunt.template.today() %> -->
<Module>
  <ModulePrefs
    title="<%= meta.title %>"
    description="<%= meta.description %>"
    author="<%= grunt.config('pkg.author.name') %>"
    author_email="<%= grunt.config('pkg.author.email') %>"
    width="<%= meta.width %>"
    height="<%= meta.height %>">

    <Require feature="opensocial-0.8" ></Require>
    <Require feature="openapp" ></Require>
    <Require feature="dynamic-height"></Require>
  </ModulePrefs>
  <Content type="html">
    <![CDATA[
    
    <script src="<%= grunt.config('baseUrl') %>/js/config.js"></script>
    <script src="<%= grunt.config('baseUrl') %>/js/lib/vendor/require.js"></script>    
    <%= partial(bodyPartial,null) %>
    <script src="<%= grunt.config('baseUrl') %>/js/shared.js"></script>    
    ]]>
  </Content>
</Module>

<?xml version="1.0" encoding="UTF-8" ?>
<!-- generated on <%= grunt.template.today() %> -->
<Module>
  <ModulePrefs
    title="<%= meta.title %>"
    description="<%= meta.description %>"
    author="<%= grunt.config('pkg.author.name') %>"
    author_email="<%= grunt.config('pkg.author.email') %>"
    width="<%= meta.width %>"
    height="<%= meta.height %>">

    <Require feature="opensocial-0.8" ></Require>
    <Require feature="openapp" ></Require>
    <Require feature="dynamic-height"></Require>
  </ModulePrefs>
  <Content type="html">
    <![CDATA[
    <script type="application/javascript">
        (function(){
          var cnt = 30; // 5 attempts per second => 6 seconds
          var timeout = function(){
              var btn = document.getElementById("oauthPersonalizeButton");
              var wrapper = document.getElementById("oauthPersonalize");
              if(wrapper && wrapper.offsetParent !== null && btn && btn.onclick){
                  var win = null;
                  var openWindow = window.open;
                  window.open = function(){return win = openWindow.apply(window,arguments);};
                  btn.onclick.call(btn);
                  if(win){
                      win.onload = function(){
                          win.document.getElementsByTagName("form")[0].submit();
                          setTimeout(function(){
                              window.location.reload();
                              if(win){
                                  win.close();
                              }
                          },1000);
                      };
                  }
              } else {
                  if(cnt > 0){
                      cnt -= 1;
                      setTimeout(timeout,200);
                  }
              }
          };
          timeout();
        })();
    </script>
    <script src="<%= grunt.config('baseUrl') %>/js/config.js"></script>
    <script src="<%= grunt.config('baseUrl') %>/js/lib/vendor/require.js"></script>    
    <%= partial(bodyPartial,null) %>
    <script src="<%= grunt.config('baseUrl') %>/js/shared.js"></script>    
    ]]>
  </Content>
</Module>

Revert "Removed the pop ups hack for authorization"
Revert "Removed the pop ups hack for authorization"

This reverts commit 3a431fd11fa4e7614455cc6d34c5a075a7000831.
