forked from siteserver/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenWindow.html
More file actions
130 lines (126 loc) · 5.31 KB
/
openWindow.html
File metadata and controls
130 lines (126 loc) · 5.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<script type="text/javascript" language="javascript">
jQuery.fn.center = function () {
this.css("position", "absolute");
var t = ($(window).height() - this.height() - 150) / 2;
if (t <= 0) t = 10;
var top = t + $(window).scrollTop();
if (top < 0) top = $(window).height() >= this.height() ? 10 : 0;
this.css("top", top + "px");
var left = ($(window).width() - this.width()) / 2 + $(window).scrollLeft();
if ($(window).width() <= this.width() + 20) left = 0;
this.css("margin-left", "0");
this.css("left", left + "px");
return this;
}
function openWindow(title, url, width, height, isCloseOnly) {
if (width == '0') width = $(window).width() - 40;
if (height == '0') height = $(window).height() - 60;
if (!width) width = 450;
if (!height) height = 350;
$('#openWindowModal h3').html(title);
$('#openWindowBtn').show();
if (isCloseOnly == 'true') $('#openWindowBtn').hide();
$('#openWindowIFrame').attr('src', url);
$('#openWindowModal').width(width);
$('#openWindowModal .modal-body').css('max-height', '9999px');
$('#openWindowModal').height(height);
$('#openWindowModal .modal-body').height(height - 110);
$('#openWindowIFrame').height(height - 120);
$('#openWindowModal').center();
//$("body").eq(0).css("overflow","hidden");
$('#openWindowModal').modal({ keyboard: true });
return false;
}
function closeWindow() {
$('#openWindowModal').modal('hide');
}
$(document).ready(function () {
$('#openWindowBtn').click(function (e) {
//$('#openWindowBtn').button('loading');
var UE = document.getElementById("openWindowIFrame").contentWindow.UE;
if (UE) {
$.each(UE.instants, function (index, editor) {
editor.sync();
});
}
if ($('#openWindowIFrame').contents().find("#btnSubmit").length > 0) {
$('#openWindowIFrame').contents().find("#btnSubmit").click();
} else {
$('#openWindowIFrame').contents().find("form").submit();
}
});
$('#openWindowModal').bind('hidden', function () {
//$("body").eq(0).css("overflow","scroll");
$('#openWindowIFrame').attr('src', '');
//$('#openWindowBtn').button('reset');
});
});
function openTips(tips, type, isCloseOnly, btnValue, btnClick) {
$('#alertType').removeClass();
if (!type) type = "info";
if (type == "success") {
$('#alertType').addClass('alert alert-success');
} else if (type == "error") {
$('#alertType').addClass('alert alert-error');
} else if (type == "info") {
$('#alertType').addClass('alert alert-info');
} else if (type == "warn") {
$('#alertType').addClass('alert alert-block');
}
$('#alertType').html(tips);
$('#openTipsModal').modal();
//提示确认操作
$('#openTipsBtn').show();
if (isCloseOnly == undefined) isCloseOnly = "true";
if (isCloseOnly == "true") $('#openTipsBtn').hide();
if (!!btnValue) $("#openTipsBtn").html(btnValue);
$("#openTipsBtn").click(function (e) {
if (!!btnClick) {
eval("(" + btnClick + "())");
}
$("#Submit").attr("onclick", "").click();
});
}
function showTips(tips, type) {
$('.alert').hide();
$('#alert').removeClass();
if (!type) type = "info";
if (type == "success") {
$('#alert').addClass('alert alert-success');
} else if (type == "error") {
$('#alert').addClass('alert alert-error');
} else if (type == "info") {
$('#alert').addClass('alert alert-info');
} else if (type == "warn") {
$('#alert').addClass('alert alert-block');
}
$('#alertMessage').html(tips);
$('#alert').show();
}
</script>
<div id="openWindowModal" class="modal hide fade form-horizontal">
<div class="modal-header" style="height:30px;">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3></h3>
</div>
<div class="modal-body" style="width:100%; height:100%; padding:5px 0; margin:0;">
<iframe id="openWindowIFrame" style="width:100%;height:100%;background-color:#ffffff;" scrolling="auto" frameborder="0" width="100%" height="100%"></iframe>
</div>
<div class="modal-footer">
<button id="openWindowBtn" class="btn btn-primary" data-loading-text="提交中...">确 定</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">取 消</button>
</div>
</div>
<div id="openTipsModal" class="modal hide">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3>提示</h3>
</div>
<div class="modal-body">
<div id="alertType" class="alert alert-info"></div>
</div>
<div class="modal-footer">
<button id="openTipsBtn" class="btn btn-primary" data-loading-text="提交中...">确 定</button>
<button id="closeTipsBtn" class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
</div>
</div>