convert popup window function to ajax-driven div popup

I am interested in converting all the

<button type="button" name="btn_campaign_name" id="btn_campaign_name" tabindex="0" title="Select Campaign" class="button firstChild" value="Select Campaign" onclick="open_popup(
&quot;Campaigns&quot;, 
600, 
400, 
&quot;&quot;, 
true, 
false, 
{&quot;call_back_function&quot;:&quot;set_return&quot;,&quot;form_name&quot;:&quot;EditView&quot;,&quot;field_to_name_array&quot;:{&quot;id&quot;:&quot;campaign_id&quot;,&quot;name&quot;:&quot;campaign_name&quot;}}, 
&quot;single&quot;, 
true
);"><img src="themes/default/images/id-ff-select.png?v=LDyT4APwd4qAUE8ZgFFqDw"></button>

type functions to “div”-type pop-ups

in sugar_3.js:

function open_popup(module_name,width,height,initial_filter,close_popup,hide_clear_button,popup_request_data,popup_mode,create,metadata)......

the reason for this is that I want to embed sugarCRM in a dektop wrapper like Adobe-Air using webkit.

Adobe Air does not have a

window.open

method - that is native to a traditional web-client like ie, firefox, chrome, etc…

  • question -

before going down this road - how difficult do you think it will be?

I would think it would be easier to restyle the CSS for @media medium and large if you theme is using Bootstrap.

This is a js function that is called with other interdependent js functions to move the value selected in the pop-up back to the field in focus on the main window where the pop-up was initialised.

CSS in this case will not help…

I will have to spend a significant amount of time to see if I can override the call in js, instantiate the pop-up window content in a pop-up div as innerHTML or an IFrame, using ajax instead of POST (which is the reason for the popup - separate browser window page instance able to get data using POST and not ajax without main page having to be submitted to get data back from server), etc… - daunting task and testing to see if it will work in all circumstances -

Some stuff in Sugar uses AJAX and some uses this old pre-web2 method.

I just hoped someone else has done it before I venture down this path…