co.js
4.67 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
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
/**
*
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
function nav(){
if(window.navigator.userAgent.indexOf("MSIE")>=1) return 'IE';
else if(window.navigator.userAgent.indexOf("Firefox")>=1) return 'FF';
else return "OT";
}
function myObj(oid){
return document.getElementById(oid);
}
function showHide(objname){
var obj = myObj(objname);
if(obj.style.display==null || obj.style.display=='none'){
if(nav()=='IE') obj.style.display = "block";
else obj.style.display = "table-row";
} else {
obj.style.display = "none";
}
}
function showTestWin(surl){
window.open(surl, "testWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=450,left=100, top=100");
}
function showItem(objname){
var obj = myObj(objname);
if(nav()=='IE') obj.style.display = "block";
else obj.style.display = "table";
}
function showItemM(objname){
var obj = myObj(objname);
if(nav()=='IE') obj.style.display = "block";
else obj.style.display = "table";
}
function showItem1(){
showItem('needset');
showItem('head1');
myObj('adset').style.display = "none";
myObj('head2').style.display = "none";
}
function showItem2(){
showItemM('adset');
showItemM('head2');
myObj('needset').style.display = "none";
myObj('head1').style.display = "none";
}
function testMore(){
if(myObj('usemore').checked) {
if(nav()=='IE') myObj('usemoretr').style.display = 'block';
else myObj('usemoretr').style.display = 'table-row';
myObj('handset').style.display = 'none';
} else {
myObj('usemoretr').style.display = 'none';
if(nav()=='IE') myObj('handset').style.display = 'block';
else myObj('handset').style.display = 'table-row';
}
}
function selSourceSet(){
if(myObj('source3').checked){
if(nav()=='IE') myObj('rssset').style.display = 'block';
else myObj('rssset').style.display = 'table-row';
myObj('batchset').style.display = 'none';
myObj('handset').style.display = 'none';
myObj('arturl').style.display = 'none';
} else if(myObj('source2').checked){
myObj('rssset').style.display = 'none';
myObj('batchset').style.display = 'none';
if(nav()=='IE') myObj('handset').style.display = 'block';
else myObj('handset').style.display = 'table-row';
if(nav()=='IE') myObj('arturl').style.display = 'block';
else myObj('arturl').style.display = 'table-row';
} else {
myObj('rssset').style.display = 'none';
if(nav()=='IE') myObj('batchset').style.display = 'block';
else myObj('batchset').style.display = 'table-row';
if(nav()=='IE') myObj('handset').style.display = 'block';
else myObj('handset').style.display = 'table-row';
if(nav()=='IE') myObj('arturl').style.display = 'block';
else myObj('arturl').style.display = 'table-row';
}
testMore();
}
function selListenSet(){
if(myObj('islisten1').checked) {
myObj('listentr').style.display = 'none';
} else {
if(nav()=='IE') myObj('listentr').style.display = 'block';
else myObj('listentr').style.display = 'table-row';
}
}
function selUrlRuleSet(){
if(myObj('urlrule2').checked) {
myObj('arearuletr').style.display = 'none';
if(nav()=='IE') myObj('regxruletr').style.display = 'block';
else myObj('regxruletr').style.display = 'table-row';
}
else
{
if(nav()=='IE') myObj('arearuletr').style.display = 'block';
else myObj('arearuletr').style.display = 'table-row';
myObj('regxruletr').style.display = 'none';
}
}
function testRss(){
var surl = '';
surl = escape(myObj('rssurl').value);
showTestWin("co_do.php?dopost=testrss&rssurl="+surl);
}
function testRegx(){
var surl = escape(myObj('regxurl').value);
var sstart = myObj('startid').value;
var send = myObj('endid').value;
var saddv = myObj('addv').value;
showTestWin("co_do.php?dopost=testregx®xurl="+surl+"&startid="+sstart+"&endid="+send+"&addv="+saddv);
}
function toHex( n ){
var digitArray = new Array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
var result = ''
var start = true;
for ( var i=32; i>0; ) {
i -= 4;
var digit = ( n >> i ) & 0xf;
if (!start || digit != 0) {
start = false;
result += digitArray[digit];
}
}
return ( result == '' ? '0' : result );
}
function selTrim(selfield){
var tagobj = myObj(selfield);
if(nav()=='IE'){ var posLeft = window.event.clientX-200; var posTop = window.event.clientY; }
else{ var posLeft = 100;var posTop = 100; }
window.open("templets/co_trimrule.html?"+selfield, "coRule", "scrollbars=no,resizable=yes,statebar=no,width=320,height=180,left="+posLeft+", top="+posTop);
}