| 103 |
- |
1 |
var menuList = new Array();
|
|
|
2 |
var buttonList = new Array();
|
|
|
3 |
var scriptList = new Array();
|
|
|
4 |
var needPopup = false;
|
|
|
5 |
|
|
|
6 |
function scriptDoLoadPost(scriptUrl, scriptForm, scriptPos, scriptArgs, noLoading) {
|
|
|
7 |
if(needPopup) {
|
|
|
8 |
scriptDoLoadPostDialog(scriptUrl, scriptForm, scriptPos, scriptArgs, noLoading);
|
|
|
9 |
return;
|
|
|
10 |
}
|
|
|
11 |
|
|
|
12 |
if(!scriptArgs){ var scriptArgs = ''; }
|
|
|
13 |
|
|
|
14 |
scriptArgs = jQuery('#'+scriptForm).serialize() + scriptArgs;
|
|
|
15 |
showLoadingIcon(scriptPos, noLoading);
|
|
|
16 |
jQuery.ajax({
|
|
|
17 |
type: "POST",
|
|
|
18 |
url:scriptUrl,
|
|
|
19 |
data: scriptArgs,
|
|
|
20 |
success: function(data){
|
|
|
21 |
document.getElementById(scriptPos).innerHTML = data;
|
|
|
22 |
jQuery("#"+scriptPos).find("script").each(function(i) {
|
|
|
23 |
eval($(this).text());
|
|
|
24 |
});
|
|
|
25 |
}
|
|
|
26 |
});
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
function scriptDoLoad(scriptUrl, scriptPos, scriptArgs, noLoading) {
|
|
|
30 |
|
|
|
31 |
if(needPopup) {
|
|
|
32 |
scriptDoLoadGetDialog(scriptUrl, scriptPos, scriptArgs, noLoading);
|
|
|
33 |
return;
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
showLoadingIcon(scriptPos, noLoading);
|
|
|
37 |
jQuery.ajax({
|
|
|
38 |
type: "get",
|
|
|
39 |
url:scriptUrl,
|
|
|
40 |
data: scriptArgs,
|
|
|
41 |
success: function(data){
|
|
|
42 |
document.getElementById(scriptPos).innerHTML = data;
|
|
|
43 |
jQuery("#"+scriptPos).find("script").each(function(i) {
|
|
|
44 |
eval($(this).text());
|
|
|
45 |
});
|
|
|
46 |
}
|
|
|
47 |
});
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
function createCookie(name,value,days) {
|
|
|
51 |
if (days) {
|
|
|
52 |
var date = new Date();
|
|
|
53 |
date.setTime(date.getTime()+(days*24*60*60*1000));
|
|
|
54 |
var expires = "; expires="+date.toGMTString();
|
|
|
55 |
}
|
|
|
56 |
else var expires = "";
|
|
|
57 |
document.cookie = name+"="+value+expires+"; path=/";
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
function readCookie(name) {
|
|
|
61 |
var nameEQ = name + "=";
|
|
|
62 |
var ca = document.cookie.split(';');
|
|
|
63 |
for(var i=0;i < ca.length;i++) {
|
|
|
64 |
var c = ca[i];
|
|
|
65 |
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
|
|
66 |
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
|
|
67 |
}
|
|
|
68 |
return null;
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
function eraseCookie(name) {
|
|
|
72 |
createCookie(name,"",-1);
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
function sitemapDoLoadPost(scriptUrl, scriptForm, scriptPos, scriptArgs, noLoading) {
|
|
|
76 |
|
|
|
77 |
hideDiv('proceed');
|
|
|
78 |
showDiv('message');
|
|
|
79 |
if(!scriptArgs){ var scriptArgs = ''; }
|
|
|
80 |
scriptArgs = jQuery('#'+scriptForm).serialize() + scriptArgs;
|
|
|
81 |
showLoadingIcon(scriptPos, noLoading);
|
|
|
82 |
jQuery.ajax({
|
|
|
83 |
type: "POST",
|
|
|
84 |
url:scriptUrl,
|
|
|
85 |
data: scriptArgs,
|
|
|
86 |
success: function(data){
|
|
|
87 |
document.getElementById(scriptPos).innerHTML = data;
|
|
|
88 |
jQuery("#"+scriptPos).find("script").each(function(i) {
|
|
|
89 |
eval($(this).text());
|
|
|
90 |
});
|
|
|
91 |
}
|
|
|
92 |
});
|
|
|
93 |
}
|
|
|
94 |
|
|
|
95 |
function showLoadingIcon(scriptPos,noLoading){
|
|
|
96 |
loading = 0;
|
|
|
97 |
contentDiv = "";
|
|
|
98 |
switch (scriptPos){
|
|
|
99 |
|
|
|
100 |
case "content":
|
|
|
101 |
contentDiv = '<div id="loading_content"></div>';
|
|
|
102 |
loading = 1;
|
|
|
103 |
break;
|
|
|
104 |
|
|
|
105 |
case "subcontent":
|
|
|
106 |
contentDiv = '<div id="loading_subcontent"></div>';
|
|
|
107 |
loading = 1;
|
|
|
108 |
break;
|
|
|
109 |
|
|
|
110 |
case "ContentFrame":
|
|
|
111 |
contentDiv = '<div id="loading_content_frame"></div>';
|
|
|
112 |
loading = 1;
|
|
|
113 |
break;
|
|
|
114 |
|
|
|
115 |
case "subcontmed":
|
|
|
116 |
contentDiv = '<div id="loading_subcontmed"></div>';
|
|
|
117 |
loading = 1;
|
|
|
118 |
break;
|
|
|
119 |
|
|
|
120 |
case "newsalert":
|
|
|
121 |
contentDiv = '<div id="loading_longthin"></div>';
|
|
|
122 |
loading = 1;
|
|
|
123 |
break;
|
|
|
124 |
|
|
|
125 |
default :
|
|
|
126 |
contentDiv = '<div id="loading_rankarea"></div>';
|
|
|
127 |
loading = 1;
|
|
|
128 |
break;
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
if((loading == 1) && (noLoading != 1)){
|
|
|
132 |
if(needPopup) {
|
|
|
133 |
return contentDiv;
|
|
|
134 |
} else {
|
|
|
135 |
document.getElementById(scriptPos).innerHTML = contentDiv;
|
|
|
136 |
}
|
|
|
137 |
|
|
|
138 |
}
|
|
|
139 |
}
|
|
|
140 |
|
|
|
141 |
function confirmLoad(scriptUrl, scriptPos, scriptArgs) {
|
|
|
142 |
|
|
|
143 |
if (chkObject('wantproceed')) {
|
|
|
144 |
wantproceed = "Do you really want to proceed?";
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
var agree = confirm(wantproceed);
|
|
|
148 |
if (agree)
|
|
|
149 |
return scriptDoLoad(scriptUrl, scriptPos, scriptArgs);
|
|
|
150 |
else
|
|
|
151 |
return false;
|
|
|
152 |
}
|
|
|
153 |
|
|
|
154 |
function confirmSubmit(scriptUrl, scriptForm, scriptPos, scriptArgs) {
|
|
|
155 |
|
|
|
156 |
if(!scriptArgs){ var scriptArgs = ''; }
|
|
|
157 |
if (chkObject('wantproceed')) {
|
|
|
158 |
wantproceed = "Do you really want to proceed?";
|
|
|
159 |
}
|
|
|
160 |
var agree = confirm(wantproceed);
|
|
|
161 |
if (agree)
|
|
|
162 |
return scriptDoLoadPost(scriptUrl, scriptForm, scriptPos, scriptArgs);
|
|
|
163 |
else
|
|
|
164 |
return false;
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
function doAction(scriptUrl, scriptPos, scriptArgs, actionDiv) {
|
|
|
168 |
actVal = document.getElementById(actionDiv).value;
|
|
|
169 |
scriptArgs += "&sec=" + actVal;
|
|
|
170 |
switch (actVal) {
|
|
|
171 |
case "select":
|
|
|
172 |
break;
|
|
|
173 |
|
|
|
174 |
case "checkstatus":
|
|
|
175 |
case "edit":
|
|
|
176 |
case "reports":
|
|
|
177 |
case "viewreports":
|
|
|
178 |
case "pagedetails":
|
|
|
179 |
scriptDoLoad(scriptUrl, scriptPos, scriptArgs);
|
|
|
180 |
break;
|
|
|
181 |
|
|
|
182 |
default:
|
|
|
183 |
if(spdemo){
|
|
|
184 |
if((actVal == 'delete') || (actVal == 'Activate') || (actVal == 'Inactivate') || (actVal == 'recheckreport') || (actVal == 'addToWebmasterTools')
|
|
|
185 |
|| (actVal == 'showrunproject') || (actVal == 'checkscore') || (actVal == 'deletepage') || (actVal == 'upgrade') || (actVal == 'reinstall')
|
|
|
186 |
|| (actVal == 'deleteSitemap')){
|
|
|
187 |
alertDemoMsg();
|
|
|
188 |
return false;
|
|
|
189 |
}
|
|
|
190 |
}
|
|
|
191 |
confirmLoad(scriptUrl, scriptPos, scriptArgs);
|
|
|
192 |
break;
|
|
|
193 |
}
|
|
|
194 |
}
|
|
|
195 |
|
|
|
196 |
function doLoad(argVal, scriptUrl, scriptPos, scriptArgs) {
|
|
|
197 |
if(needPopup) {
|
|
|
198 |
actVal = $("#dialogContent #" + argVal).val();
|
|
|
199 |
} else {
|
|
|
200 |
actVal = document.getElementById(argVal).value;
|
|
|
201 |
}
|
|
|
202 |
scriptArgs += "&"+ argVal +"=" + actVal;
|
|
|
203 |
scriptDoLoad(scriptUrl, scriptPos, scriptArgs);
|
|
|
204 |
}
|
|
|
205 |
|
|
|
206 |
function doLoadUrl(argVal, scriptUrl) {
|
|
|
207 |
actVal = document.getElementById(argVal).value;
|
|
|
208 |
window.location = scriptUrl += "&"+ argVal +"=" + actVal;
|
|
|
209 |
}
|
|
|
210 |
|
|
|
211 |
function showMenu(button, scriptPos){
|
|
|
212 |
var downClass = 'fa-caret-down';
|
|
|
213 |
var upClass = 'fa-caret-up';
|
|
|
214 |
for (var i=0; i<menuList.length; i++) {
|
|
|
215 |
if(menuList[i] == scriptPos){
|
|
|
216 |
if ($('#' + button).hasClass(downClass ) ) {
|
|
|
217 |
$('#' + button).addClass(upClass).removeClass(downClass);
|
|
|
218 |
$('#' + scriptPos).show();
|
|
|
219 |
$('#' + scriptPos + " a:first").trigger("click");
|
|
|
220 |
$('#' + scriptPos + " a:first").addClass("menu_active");
|
|
|
221 |
} else {
|
|
|
222 |
$('#' + button).addClass(downClass).removeClass(upClass);
|
|
|
223 |
$('#' + scriptPos).hide();
|
|
|
224 |
}
|
|
|
225 |
}else{
|
|
|
226 |
$('#' + buttonList[i]).addClass(downClass).removeClass(upClass);
|
|
|
227 |
$('#' + menuList[i]).hide();
|
|
|
228 |
}
|
|
|
229 |
}
|
|
|
230 |
|
|
|
231 |
}
|
|
|
232 |
|
|
|
233 |
function updateArea(scriptPos, content) {
|
|
|
234 |
document.getElementById(scriptPos).innerHTML += content;
|
|
|
235 |
}
|
|
|
236 |
|
|
|
237 |
function updateInnerHtml(scriptPos, content) {
|
|
|
238 |
document.getElementById(scriptPos).innerHTML = content;
|
|
|
239 |
}
|
|
|
240 |
|
|
|
241 |
function chkObject(theVal) {
|
|
|
242 |
if (document.getElementById(theVal) != null) {
|
|
|
243 |
return true;
|
|
|
244 |
} else {
|
|
|
245 |
return false;
|
|
|
246 |
}
|
|
|
247 |
}
|
|
|
248 |
|
|
|
249 |
function checkSubmitInfo(scriptUrl, scriptForm, scriptPos, catCol) {
|
|
|
250 |
|
|
|
251 |
if(chkObject('captcha')){
|
|
|
252 |
value = document.getElementById('captcha').value;
|
|
|
253 |
if (value==null||value==""){
|
|
|
254 |
alert('Please enter the code shown');
|
|
|
255 |
return false;
|
|
|
256 |
}
|
|
|
257 |
}
|
|
|
258 |
|
|
|
259 |
var obj = document.getElementsByName(catCol).item(0);
|
|
|
260 |
value = obj.value;
|
|
|
261 |
if (value==null||value==""||value==0){
|
|
|
262 |
alert('Please select a category');
|
|
|
263 |
return false;
|
|
|
264 |
}
|
|
|
265 |
|
|
|
266 |
scriptDoLoadPost(scriptUrl, scriptForm, scriptPos);
|
|
|
267 |
}
|
|
|
268 |
|
|
|
269 |
function loadJsCssFile(filename, filetype){
|
|
|
270 |
if (filetype=="js"){
|
|
|
271 |
var fileref=document.createElement('script')
|
|
|
272 |
fileref.setAttribute("type","text/javascript")
|
|
|
273 |
fileref.setAttribute("src", filename)
|
|
|
274 |
}else if (filetype=="css"){
|
|
|
275 |
var fileref=document.createElement("link")
|
|
|
276 |
fileref.setAttribute("rel", "stylesheet")
|
|
|
277 |
fileref.setAttribute("type", "text/css")
|
|
|
278 |
fileref.setAttribute("href", filename)
|
|
|
279 |
}
|
|
|
280 |
if (typeof fileref!="undefined")
|
|
|
281 |
document.getElementsByTagName("head")[0].appendChild(fileref)
|
|
|
282 |
}
|
|
|
283 |
|
|
|
284 |
function hideDiv(scriptPos){
|
|
|
285 |
document.getElementById(scriptPos).style.display = 'none';
|
|
|
286 |
}
|
|
|
287 |
|
|
|
288 |
function showDiv(scriptPos){
|
|
|
289 |
document.getElementById(scriptPos).style.display = '';
|
|
|
290 |
}
|
|
|
291 |
|
|
|
292 |
function crawlMetaData(url,scriptPos) {
|
|
|
293 |
weburl = document.getElementById('weburl').value;
|
|
|
294 |
if(weburl==null||weburl==""||weburl==0){
|
|
|
295 |
alert('Website url is empty!');
|
|
|
296 |
}else{
|
|
|
297 |
var urlInfo = url.split("?");
|
|
|
298 |
scriptArgs = urlInfo[1] + "&url=" + urlencode(weburl);
|
|
|
299 |
scriptDoLoadPost(urlInfo[0], "tmp", scriptPos, scriptArgs);
|
|
|
300 |
}
|
|
|
301 |
}
|
|
|
302 |
|
|
|
303 |
function hideNewsBox(scriptPos, cookieVar, cookieVal) {
|
|
|
304 |
createCookie(cookieVar, cookieVal, 1);
|
|
|
305 |
}
|
|
|
306 |
|
|
|
307 |
function alertDemoMsg(){
|
|
|
308 |
if(spdemo){
|
|
|
309 |
alert('Some features are disabled in the demo system due to security threats. Please download and install seo panel to enjoy full features.');
|
|
|
310 |
return;
|
|
|
311 |
}
|
|
|
312 |
}
|
|
|
313 |
|
|
|
314 |
function checkDirectoryFilter(checkId, scriptUrl, scriptPos){
|
|
|
315 |
var noFilter = 0;
|
|
|
316 |
if(document.getElementById(checkId).checked){
|
|
|
317 |
noFilter = 1;
|
|
|
318 |
}
|
|
|
319 |
|
|
|
320 |
scriptUrl = scriptUrl + "&" + checkId + "=" + noFilter;
|
|
|
321 |
scriptDoLoad(scriptUrl, scriptPos);
|
|
|
322 |
}
|
|
|
323 |
|
|
|
324 |
function checkList(checkId) {
|
|
|
325 |
checkall = document.getElementById(checkId).checked;
|
|
|
326 |
for (i = 0; i < document.listform.elements.length; i++){
|
|
|
327 |
if(document.listform.elements[i].type=="checkbox") {
|
|
|
328 |
document.listform.elements[i].checked = checkall ? true : false;
|
|
|
329 |
}
|
|
|
330 |
}
|
|
|
331 |
}
|
|
|
332 |
|
|
|
333 |
function selectAllOptions(selectBoxId, selectAll) {
|
|
|
334 |
if (selectAll) {
|
|
|
335 |
document.getElementById("clear_all").checked=false;
|
|
|
336 |
} else {
|
|
|
337 |
document.getElementById("select_all").checked=false;
|
|
|
338 |
}
|
|
|
339 |
selectBox = document.getElementById(selectBoxId);
|
|
|
340 |
for (var i = 0; i < selectBox.options.length; i++) {
|
|
|
341 |
selectBox.options[i].selected = selectAll;
|
|
|
342 |
}
|
|
|
343 |
}
|
|
|
344 |
|
|
|
345 |
function urlencode(str) {
|
|
|
346 |
str = (str + '').toString();
|
|
|
347 |
return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
|
|
|
348 |
}
|
|
|
349 |
|
|
|
350 |
function checkMozConnection(scriptUrl, scriptPos, scriptArgs) {
|
|
|
351 |
accessId = $('input:text[name=SP_MOZ_API_ACCESS_ID]').val();
|
|
|
352 |
secretKey = $('input:text[name=SP_MOZ_API_SECRET]').val();
|
|
|
353 |
scriptArgs += "&access_id=" + accessId + "&secret_key=" + secretKey;
|
|
|
354 |
scriptDoLoad(scriptUrl, scriptPos, scriptArgs);
|
|
|
355 |
}
|
|
|
356 |
|
|
|
357 |
function checkGoogleAPIConnection(scriptUrl, scriptPos, scriptArgs) {
|
|
|
358 |
apiKey = $('input:text[name=SP_GOOGLE_API_KEY]').val();
|
|
|
359 |
scriptArgs += "&api_key=" + apiKey;
|
|
|
360 |
scriptDoLoad(scriptUrl, scriptPos, scriptArgs);
|
|
|
361 |
}
|
|
|
362 |
|
|
|
363 |
function openTab(tabName, dialog = false) {
|
|
|
364 |
dialogId = dialog ? "#dialogContent " : "";
|
|
|
365 |
$(dialogId + '.tabcontent').hide();
|
|
|
366 |
$(dialogId + '.tablinks').removeClass('active');
|
|
|
367 |
$(dialogId + '#' + tabName).show();
|
|
|
368 |
$(dialogId + '#' + tabName + "Link").addClass('active');
|
|
|
369 |
}
|
|
|
370 |
|
|
|
371 |
$(function() {
|
|
|
372 |
|
|
|
373 |
// submenu click function
|
|
|
374 |
$("#subui a").click(function() {
|
|
|
375 |
$("#subui a").removeClass("menu_active");
|
|
|
376 |
$(this).addClass("menu_active");
|
|
|
377 |
$('.navbar-collapse').collapse('hide');
|
|
|
378 |
});
|
|
|
379 |
|
|
|
380 |
});
|
|
|
381 |
|