Repository navigation
Expand file tree
/
Copy pathjshapes.js
More file actions
119 lines (92 loc) · 2.63 KB
/
Copy pathjshapes.js
File metadata and controls
119 lines (92 loc) · 2.63 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
function showActions(action){
var el = document.getElementById("'"+action+"'");
el.style.display = "block";
}
function hideActions(action){
//$("#"+action).hide("slow");
var el = document.getElementById("'"+action+"'");
el.style.display = "none";
}
function addCat(){
var name = document.getElementById("name").value;
var des = document.getElementById("des").value;
name = Trim(name);
des = Trim(des);
if(name.length>0){
var params = {'name':name,'des':des};
ajaxJqueryPost(site+"Admin/articles/add-cat",params,rcAddCat);
}
}
function addCat2Form(){
var name = document.getElementById("name").value;
var des = "";
name = Trim(name);
des = Trim(des);
if(name.length>0){
var params = {'name':name,'des':des};
ajaxJqueryPost(site+"Admin/articles/add-new-cat",params,rcNewCat);
}
}
function rcNewCat(jsonRep){
var res = document.getElementById('newcat').innerHTML;
if(jsonRep!=null&&jsonRep!=""){
res +=addNewCats(jsonRep);
}
document.getElementById('newcat').innerHTML = res;
$("#name").val("");
}
function addNewCats(cat){
var tempcat = "";
tempcat = document.getElementById('templateNewCat').innerHTML;
tempcat = repS(tempcat,"CatName",cat.name);
tempcat = repS(tempcat,"CatValue",cat.id);
return tempcat;
}
/**
* Add new panel
*/
function addNewPanel(arr,j,tbncr){
var tempcat = "";
var tempThumb;
var cj = 0;
tempcat = document.getElementById('templatePanel').innerHTML;
tempcat = repS(tempcat,"Id",arr['idpn']);
if (tbncr!=1){
if (arr['typepn']=="start"){
tempThumb = "shops/images/startThumb.png";
}else if (arr['typepn']=="gmap"){
tempThumb = "shops/images/mapThumb.png";
}else if (arr['typepn']=="pdf"){
tempThumb = "shops/images/pdfThumb.png";
}else if (arr['typepn']=="chat"){
tempThumb = "shops/images/chatThumb.png";
}else if (arr['typepn']=="textEditor"){
tempThumb = "shops/images/texteditorThumb.png";
}else{
tempThumb = "shops/images/wbThumb.png";
}
}else{
cj = j+1;
tempThumb = tblink+scode+"_"+cj+".jpg";
}
tempcat = repS(tempcat,"IMG",tempThumb);
tempcat = repS(tempcat,"Order",(j+1));
return tempcat;
}
function rcAddCat(jsonRep){
var res = "";
var listCat = jsonRep;
if(listCat!=null&&listCat!=""){
for(var i=0;i<listCat.length;i++){
res +=addInfoCats(listCat[i]);
}
}
document.getElementById('listCat').innerHTML = res;
}
function addInfoCats(cat){
var tempcat = "";
tempcat = document.getElementById('templateListCat').innerHTML;
tempcat = repS(tempcat,"NAME",cat.name);
tempcat = repS(tempcat,"Cat",cat.id);
return tempcat;
}