-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWin.html
369 lines (329 loc) · 12.8 KB
/
Win.html
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<link rel="stylesheet" href="css/asdui1.4b.css" type="text/css" media="all" />
<style type="text/css">
a:link,a:visited{color:#f00; text-decoration:underline}
fieldset{margin:20px 10px}
pre{border:1px solid #fc0;background:#ffd;padding:5px}
fieldset{margin:20px;padding:20px;text-align:left}
fieldset legend{padding:5px 10px;font-weight:700;font-size:16px}
table{color:#333;background:#E8F5FE;border-collapse:collapse;width:100%;text-align:left;}
thead{}
thead th{padding:1em 1em .5em;border:1px solid #5C9CC0;font-size:120%;background:#5C9CC0;text-align:left}
thead tr{}
td{padding:.5em 1em;border:1px solid #BBE1F1}
tbody td{background:#EEFAFF;}
tfoot{background-color:#A9C9E2;}
tfoot td{padding-bottom:1.5em;border:1px solid #BBE1F1}
dl{padding:10px 5px}
dl dt{font-weight:700;font-sie:14px;padding:5px 0;}
dl dt span{color:#f60;padding:0 8px}
pre{border:1px solid #ADCD3C;background-color:#F2FDDB;padding:5px;white-space: pre-wrap;
word-wrap: break-word;}
</style>
</head>
<body>
<fieldset>
<legend>ASDUI.Win Class</legend>
<a href="javascript:void(0)" class="wins" title="1">windows1</a><a href="javascript:void(0)" class="wins" title="2">windows2</a><a href="javascript:void(0)" class="wins" title="3">windows3</a><a href="javascript:void(0)" class="wins" title="4">windows4</a><a href="javascript:void(0)" class="wins" title="5">windows5</a>
<br /><a href="javascript:void(0)" id="diawin">windows innerHTML by dialog</a>
<br /><a href="javascript:void(0)" id="changeWin">获取窗体frame并改变路径</a>
<br /><a href="javascript:void(0)" id="cPanel">创建panel并改变路径</a>
<div id="ouput"></div>
<a href="javascript:void(0)" onClick="WinManager.getObjTop().fullSize()">通过获取对象改变窗体</a>
<hr/>
<h2>操作窗体</h2>
<a href="javascript:void(0)" onClick="winStack()">获取计数器状态</a><br />
<a href="javascript:void(0)" onClick="getwinTop()">获取激活窗体ID和对象</a><br />
<a href="javascript:void(0)" onClick="getWinF('Ywin0')">获取指定ID(win01)的窗体对象</a><br />
<a href="javascript:void(0)" onClick="clearAll()">清空计数器内所有窗体</a><br />
<a href="javascript:void(0)" onClick="lastOne()">清空计数器内所有窗体且保留最后一个打开的窗体</a><br />
<a href="javascript:void(0)" onClick="getFrame()">获取激活窗体frame页面的元素</a>
</fieldset>
<div id="showme" style="border:1px solid #f00" >
<div>
<table width="200" border="1">
<tr>
<td><label>
<input type="text" name="textfield" id="num" />
</label></td>
<td><a href="javascript:void(0)" onClick="Sexy.alert('Nice!',{boxtitle:'系统提示啊'}); return false;">Show a JavaScript alert with a new look!</a></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<br />111213<br />111213<br />111213<br />111213<br />111213<br />111213<br />111213<br />oop
</div>
</div>
<!--@taskBar-->
<div id="mytask">
</div>
<!--}}taskBar-->
<fieldset><legend>ASDUI.Win.Class</legend>
<dl>
<dt>调用方法:</dt>
<dd>
<pre>var Sexy5 = new ASDUI.Win([, options]);</pre>
</dd>
<dt>一个藏袍:</dt>
<dd>
<pre>
Sexy5 = new YafullyBox.win({winId:winNum,winHeight:300,winWidth:400,Yicon:'Yicon01',taskbar:'mytask',winTitle:'Google engine',data:'frame',winSrc:'http://www.google.com'}); //普通窗口
new YafullyBox.win({name:'yinan',Plugin:true,winId:'oka',winHeight:500,winWidth:400,winTitle:'88888',data:'frame',winSrc:'http://www.baidu.com',dialogWin:true,Undistroy:true}); //创建一个只有关闭的插件式窗口并且重定义样式
</pre>
</dd>
</dl>
<table>
<col id="middle" />
<col />
<col />
<thead>
<tr><th>Option</th>
<th>参数描述</th></tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr><td>winId</td>
<td>窗口Id必须唯一可为空,为空时为自动随机GUID</td>
</tr>
<tr>
<td>winTitle</td>
<td>提示窗口标题(文本)</td>
</tr>
<tr>
<td>winHeight</td>
<td>提示窗口高度,默认值200</td>
</tr>
<tr>
<td>winWidth</td>
<td>提示窗口宽度,默认值280</td>
</tr>
<tr>
<td>winTop</td>
<td>窗口弹出初始化top,默认值200</td>
</tr>
<tr>
<td>winLeft</td>
<td>窗口弹出初始化left,默认值100</td>
</tr>
<tr>
<td>winZindex</td>
<td>窗口zindex,默认值1000</td>
</tr>
<tr>
<td>data</td>
<td>窗口数据类型(frame,ajax,html可选依次为载入iframe,ajax载入页面,载入页面内HTML)</td>
</tr>
<tr>
<td>winSrc</td>
<td>窗口数据路径(当为frame和ajax时为请求页面地址,html时为所载入html父级元素Id引用或html字符串)</td>
</tr>
<tr>
<td>winClass</td>
<td>窗口class名称,最好不要随便更改此参数</td>
</tr>
<tr>
<td>taskbar</td>
<td>最小化托盘Id,当为空时则以Document为容器</td>
</tr>
<tr>
<td>Yicon</td>
<td>最小化时Icon样式,,默认值为空(允许为空)</td>
</tr>
<tr>
<td>winMax</td>
<td>打开窗口最大数目,默认值4</td>
</tr>
<tr>
<td>Useoverlay</td>
<td>是否使用遮罩层,默认值false</td>
</tr>
<tr>
<td>Tocenter</td>
<td>窗口是否居中弹出,默认值true,当为false时窗口按照options里面的top,left弹出</td>
</tr>
<tr>
<td>drag</td>
<td>是否允许拖动,有ghost(模拟拖动),drag(基本拖动)2种拖动模式可选,默认值为false不允许拖动;</td>
</tr>
<tr>
<td>Undistroy</td>
<td>是否允许关闭窗口时执行内容清空操作,默认值false</td>
</tr>
<tr>
<td>Plugin(暂时废弃)</td>
<td>是否允许以插件模式生成窗体,默认值false。当为true时创建出的窗体不会参与窗体置顶逻辑(即窗体是否在最顶层)</td>
</tr>
<tr>
<td>dialogWin</td>
<td>是否允许以模态窗口形式现实,默认值false,当为true时则窗体上不显示"最小化"和"最大化"按钮</td>
</tr>
<tr>
<td>Panel</td>
<td>是否在窗体内创建Panel组件,默认值false</td>
</tr>
<tr>
<td>Pwidth</td>
<td><p>创建Panel的宽度,默认值为20%(注意:此参数必须为带单位的数值或百分比;ex:"100px" or"20%")</p> </td>
</tr>
<tr>
<td>Pdata</td>
<td>创建Panel的数据流,暂时只支持frame</td>
</tr>
<tr>
<td>Pxpos</td>
<td>创建Panel的水平位置,('left''right'可选)默认为'right'</td>
</tr>
<tr>
<td>panelResize</td>
<td>是否允许resize Panel 默认为true开启</td>
</tr>
<tr>
<td>panelMin</td>
<td>panel resize最小宽度,默认值250</td>
</tr>
<tr>
<td>Resize</td>
<td>是否允许拖动改变窗体大小,默认为false;</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<th colspan="2">WinStack窗体计数器</th>
</tr>
<tr>
<td>null</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<dl>
<dt>外置方法:<span>clean();</span>关闭</dt>
<dt>外置方法:<span>fullSize();</span>窗体全屏尺寸</dt>
<dt>外置方法:<span>norSize();</span>窗体默认尺寸</dt>
<dt>外置方法:<span>minSize();</span>窗体最小化</dt>
<dt>外置方法:<span>makePanel(options);</span>创建Panel或重新构建Panel</dt>
<dt>外置方法:<span>getSatus();</span>返回当前窗体状态;'true'为打开,'false'为关闭;</dt>
<dt>外置方法:<span>getPanSatus();</span>返回当前窗体状态;'true'为打开,'false'为关闭;</dt>
<dt>外置方法:<span>getFrame();</span>返回当前frame模式下的frame对象;(注:若用此方法改变frame路径是不支持跨域页面的;)</dt>
<dt>外置方法:<span>getPFrame();</span>返回当前makePanel的frame对象;(注:若用此方法改变frame路径是不支持跨域页面的;)</dt>
<dt>外置方法:<span>showPanel();</span>显示Panel</dt>
<dd><hr/><br/><h2>窗体计数器</h2><br/><hr/></dd>
<dt>外置方法:<span>getWinTop();</span>获取当前置顶激活的那一个窗体的ID</dt>
<dt>外置方法:<span>getStack();</span>返回当前打开的所有窗体的ID数组</dt>
<dt>外置方法:<span>getObjStack();</span>返回当前打开的所有窗体的DOM对象数组</dt>
<dt>外置方法:<span>getObjTop();</span>获取当前置顶激活的那一个窗体的DOM对象</dt>
<dt>外置方法:<span>doTop();</span>清空对象计数器,以及ID计数器仅保留最后一个打开的窗体</dt>
<dt>外置方法:<span>doEmpty();</span>清空对象计数器,以及ID计数器</dt>
<dt>外置方法:<span>findWin();</span>查找指定ID名的窗体并返回该窗体对象</dt>
<dt>附加说明:</dt>
<dd>
<pre>
当打开多个窗口时,当前置顶窗口会以Atop标记,1.3.7.3以后版本Atop不再用作获取置顶窗体的标记,而是执行窗体点击切换时的标记。且在当前页面内只会存在一个,register返回该窗体Id,直接调用全局函数YafullyTop即可;<br />StackLength为开窗个数返回值(ps:窗体全部最小化时如果传入参数为true则register返回值为null,否则为最后一个执行操作的窗体)
</pre>
</dd>
</dl>
</fieldset>
<script type="text/javascript" src="js/jquery1.91.min.js"></script>
<script src="js/asdui.js" type="text/javascript"></script>
<script type="text/javascript">
function winStack(){
alert('当前窗口个数'+WinManager.getStack().length+'当前对象个数'+WinManager.getObjStack().length);
}//
function getwinTop(){
winObjs = WinManager.getObjStack();
if(winObjs.length <= 0) return ;
alert('当前激活窗体ID' + WinManager.getWinTop()+'当前激活窗体对象' + WinManager.getObjTop())
}
function getFrame(){
var p = WinManager.getObjTop().getFrameDoc();
//p.body.innerHTML = '<p id="test">Test!</p>';
//p.toDOM();
//alert(typeOf(p))
p.find('.photo').eq(0).css({'color':'#f00','font-size':'20px'})
}
function clearAll(){
winObjs = WinManager.getObjStack();
winObjs.length > 0 && $.each(winObjs,function(i,el){
el.clean();
});//关闭计数器内所有窗体
WinManager.doEmpty();//清空计数器
}
function lastOne(){
winObjs = WinManager.getObjStack();
winObjs.length > 0 && $.each(winObjs,function(i,el){
if(i < winObjs.length -1)el.clean();
});//关闭计数器内所有窗体
WinManager.doTop();//清空计数器并保留最后一个
}
function getWinF(id){
var win = WinManager.findWin(id);
console.log(win.getFrameDoc());
//win && win.getFrame().set('src','index.html');
//win && alert(win.getFrame().contentDocument.getElement('body').get('html'));//此方法不可跨域
//var pgHTML = win.getFrameDoc();
// var els = Elements.from(pgHTML);
// els.each(function(paragraph){
// console.log(paragraph); //logs each paragraph
// });
// $(document.body).append(pgHTML);
//alert(pgHTML.innerHTML);
//pgHTML.find('h1').css('border','1px solid #f00').html('change value!')
}//获取指定id窗体并改变相应页面路径
$(function() {
var wins = $('.wins');
wins.each(function(i,el){
var winNum = $.array.indexOf(wins,el);
var winName = 'Sexy' + winNum;
$(el).on('click',function(){
var src = $(this).attr('title');
winName = new ZUI.Win({winId:winNum,winHeight:300,winWidth:400,Yicon:'Yicon02',taskbar:'mytask',winTitle:'任务窗口' + winNum,data:'frame',winSrc:'Img.html',drag:'drag'});
});
});
$('#diawin').on('click',function(){
//new YafullyBox.win({name:'yinan',Plugin:true,winId:'oka',winHeight:500,winWidth:400,winTitle:'88888',data:'html',winSrc:'showme',dialogWin:true,Undistroy:true});
new ZUI.Win({winId:'oka',winHeight:200,winWidth:400,winTop:0,winLeft:0,winTitle:'88888',taskbar:'mytask',data:'html',winSrc:$('showme'),dialogWin:true,Undistroy:true});
});
var winP = new ZUI.Win({winId:'3344',winHeight:300,winWidth:400,Yicon:'Yicon02',taskbar:'mytask',winTitle:'a1122',data:'frame',winSrc:'Img.html',Panel:true,Pwidth:'50%',Pxpos:'right',Pdata:'frame',drag:'ghost',Resize:true});
$('#cPanel').on('click',function(){
winP.showPanel('http://www.126.com')
});
$('#changeWin').on('click',function(){
if(winP.getSatus()){
winP.getFrame().src='table.html';
winP.getTitle().html('xxoo');
}
});
//=======Windows=======
//spAni && alert(1)
});
</script>
</body>
</html>