Subversion Repositories DevTools

Rev

Rev 6971 | Rev 7022 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6971 Rev 7003
Line 189... Line 189...
189
}
189
}
190
 
190
 
191
//--------- Support to open modal dialog in an iFrame
191
//--------- Support to open modal dialog in an iFrame
192
//  Example: <a class="vixIframeDialog" href="aaa.asp" title="Some Title">Link Text</a>
192
//  Example: <a class="vixIframeDialog" href="aaa.asp" title="Some Title">Link Text</a>
193
//
193
//
-
 
194
var vixIframe;
-
 
195
if (typeof vixIframe === 'undefined') {
194
var vixIframe = {};
196
    vixIframe = {};
-
 
197
}
195
$(document).ready(function () {
198
$(document).ready(function () {
-
 
199
 
196
    $('.vixIframeDialog').on('click', function(e){
200
    $('.vixIframeDialog').on('click', function(e){
197
		if (!vixIframe.parent) {
201
		if (!vixIframe.parent) {
198
			e.preventDefault();
202
			e.preventDefault();
199
			vixIframe.parent = this;
203
			vixIframe.parent = this;
200
			vixIframe.pagetitle = $(this).attr("title");
204
			vixIframe.pagetitle = $(this).attr("title");
Line 238... Line 242...
238
	vixIframeDialogCommon();
242
	vixIframeDialogCommon();
239
}
243
}
240
 
244
 
241
function vixIframeDialogCommon()
245
function vixIframeDialogCommon()
242
{
246
{
243
	var iframe = $('<iframe onload="IframeLoaded(this);" id="iframe" style="border:0px; overflow: scroll;" src="' + vixIframe.url + '" width="100%" height="100%" ></iframe>');
247
	var iframe = $('<iframe onload="IframeLoaded(this);" id="iframe" style="border:0px; overflow: scroll;" src="' + vixIframe.url + '" height="50px" width="100%"" ></iframe>');
244
	var $dialog = $('<div></div>').html(iframe);
248
	var $dialog = $('<div></div>').html(iframe);
245
	var $dialog2 = $dialog.dialog({
249
	var $dialog2 = $dialog.dialog({
246
		autoOpen: true,
250
		autoOpen: true,
247
		modal: true,
251
		modal: true,
248
		height : 'auto,', 
252
		height : 'auto',
249
		width : 'auto',
253
		width : 'auto',
250
		resizable: false,
254
		resizable: false,
251
		position : { my:'top', at: 'top+100', of : window },
255
		position : { my:'top', at: 'top+100', of : window },
252
		dialogClass: "rounded_box",
256
		dialogClass: "rounded_box",
253
		title: 'Loading - ' + vixIframe.pagetitle,
257
		title: 'Loading - ' + vixIframe.pagetitle,
Line 290... Line 294...
290
//	Used if the iframe is too dynamic and extends itself from time to time
294
//	Used if the iframe is too dynamic and extends itself from time to time
291
//
295
//
292
function resizeIframe()
296
function resizeIframe()
293
{
297
{
294
    if (vixIframe.IFrame != null) {
298
    if (vixIframe.IFrame != null) {
-
 
299
        var iframe = vixIframe.IFrame;
295
		iframe.height = iframe.contentWindow.document.body.scrollHeight + "px";
300
		iframe.height = iframe.contentWindow.document.body.scrollHeight + "px";
296
		$(vixIframe.Dialog).height(iframe.height);
301
		$(vixIframe.Dialog).height(iframe.height);
297
		//console.log ("Resize Iframe:",iframe.height );
302
		//console.log ("Resize Iframe:",iframe.height );
298
 
303
 
299
		iframe.width = iframe.contentWindow.document.body.scrollWidth + "px";
304
		iframe.width = iframe.contentWindow.document.body.scrollWidth + "px";
Line 314... Line 319...
314
        vixIframe.Dialog.dialog('close');
319
        vixIframe.Dialog.dialog('close');
315
        vixIframe = {};
320
        vixIframe = {};
316
    }
321
    }
317
}
322
}
318
 
323
 
-
 
324
//  Load a dialog into a dialog element
-
 
325
//  Like iFrame, but without the iFrame
-
 
326
//
-
 
327
function vixDialog( theURL, winName ) {
-
 
328
	vixIframe.parent = this;
-
 
329
	vixIframe.pagetitle = winName;
-
 
330
	vixIframe.url = theURL;
-
 
331
 
-
 
332
    var $dialog = $('<div></div>');
-
 
333
    $(document.body).append($dialog);
-
 
334
    $dialog.load( theURL, function(){
-
 
335
        var $dialog2 = $dialog.dialog({
-
 
336
            autoOpen: true,
-
 
337
            modal: true,
-
 
338
            height : 'auto', 
-
 
339
            //width : 'auto',
-
 
340
            resizable: true,
-
 
341
            position : { my:'top', at: 'top+100', of : window },
-
 
342
            dialogClass: "rounded_box",
-
 
343
            title: 'Loading - ' + vixIframe.pagetitle,
-
 
344
            close: function(event, ui){
-
 
345
                //console.log('closing dialog');
-
 
346
                $(this).dialog("destroy");
-
 
347
                vixIframe = {};
-
 
348
                $(this).remove();
-
 
349
                window.onbeforeunload = null;
-
 
350
                window.onunload = null;
-
 
351
                },
-
 
352
            // Prevent Chrome from adding scrollbars when dragged
-
 
353
            dragStop: function( event, ui ){
-
 
354
                vixIframe.IFrame.parentElement.style.overflow = "";
-
 
355
                },
-
 
356
            dragStart: function( event, ui ){
-
 
357
                vixIframe.IFrame.parentElement.style.overflow = "hidden";
-
 
358
                }
-
 
359
        });
-
 
360
        vixIframe.Dialog = $dialog;
-
 
361
        vixIframe.DialogProps = $dialog2;
-
 
362
        //vixIframe.DialogWidget = $($dialog2).dialog('widget');
-
 
363
        //IframeLoaded($dialog);
-
 
364
 
-
 
365
        // Save to resize iframe
-
 
366
        vixIframe.IFrame = $dialog;
-
 
367
 
-
 
368
        // Reset the title
-
 
369
        vixIframe.Dialog.dialog('option','title', vixIframe.pagetitle);
-
 
370
 
-
 
371
        // Run init code for the frame
-
 
372
        vixFrameInit();
-
 
373
 
-
 
374
    });
-
 
375
}
-
 
376
 
319
//
377
//
320
//  Copy the HTML from an element into the clipboard
378
//  Copy the HTML from an element into the clipboard
321
//  Highlight the element clipped
379
//  Highlight the element clipped
322
//
380
//
323
function vixEl2Clip( el ) {
381
function vixEl2Clip( el ) {