Commit 3d4e045345a7f672ef01bfa3deb0eb950066ebdd
1 parent
2151b22b
arbeite daran ueber zu und aufklappen die bereiche zu de/aktivieren
Showing
4 changed files
with
87 additions
and
54 deletions
... | ... | @@ -22,7 +22,7 @@ function c_person (personId, photographerId, ownerId, firstname, surname, |
22 | 22 | this.personForm = personForm; |
23 | 23 | } |
24 | 24 | |
25 | - this.reset = function () | |
25 | + this.empty = function () | |
26 | 26 | { |
27 | 27 | if (this.personId != -1) |
28 | 28 | { |
... | ... | @@ -45,6 +45,26 @@ function c_person (personId, photographerId, ownerId, firstname, surname, |
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | + this.reset = function () | |
49 | + { | |
50 | + this.personId = -1; | |
51 | + this.photographerId = -1; | |
52 | + this.ownerId = -1; | |
53 | + this.firstname = ''; | |
54 | + this.surname = ''; | |
55 | + this.company = ''; | |
56 | + this.email = ''; | |
57 | + this.url = ''; | |
58 | + this.cameraId = -1; | |
59 | + this.wmWidth = ''; | |
60 | + this.wmHeight = ''; | |
61 | + this.wmXPos = ''; | |
62 | + this.wmYPos = ''; | |
63 | + | |
64 | + if (this.personForm != null) | |
65 | + this.personForm.updateForm (); | |
66 | + } | |
67 | + | |
48 | 68 | this.update = function (p) |
49 | 69 | { |
50 | 70 | if (this.personId != p.personId) | ... | ... |
... | ... | @@ -28,6 +28,57 @@ function personInUp ( |
28 | 28 | |
29 | 29 | person.connect (this); |
30 | 30 | |
31 | + this.showHideBlock = function (titleId) | |
32 | + { | |
33 | + var titleElement = document.getElementById (titleId); | |
34 | + var imgElement = titleElement.getElementsByTagName ('img')[0]; | |
35 | + var blockElement = titleElement.parentNode; | |
36 | + var dataElement = blockElement.getElementsByTagName ('div')[1]; | |
37 | + | |
38 | + if (dataElement.style.display == 'none') | |
39 | + { | |
40 | + dataElement.style.display = 'block'; | |
41 | + imgElement.src = arrDown.getImgUrl (titleElement); | |
42 | + | |
43 | + switch (titleId) | |
44 | + { | |
45 | + case 'title_photographer': | |
46 | + if (this.person._photographerId != -1) | |
47 | + this.person.photographerId = this.person._photographerId; | |
48 | + else | |
49 | + this.person.photographerId = 0; | |
50 | + break; | |
51 | + | |
52 | + case 'title_owner': | |
53 | + if (this.person._ownerId != -1) | |
54 | + this.person.ownerId = this.person._ownerId; | |
55 | + else | |
56 | + this.person.ownerId = 0; | |
57 | + } | |
58 | + } | |
59 | + else | |
60 | + { | |
61 | + dataElement.style.display = 'none'; | |
62 | + imgElement.src = arrRight.getImgUrl (titleElement); | |
63 | + | |
64 | + switch (titleId) | |
65 | + { | |
66 | + case 'title_photographer': | |
67 | + if (this.person._photographerId != -1) | |
68 | + this.person.photographerId = this.person._photographerId; | |
69 | + else | |
70 | + this.person.photographerId = 0; | |
71 | + break; | |
72 | + | |
73 | + case 'title_owner': | |
74 | + if (this.person._ownerId != -1) | |
75 | + this.person.ownerId = this.person._ownerId; | |
76 | + else | |
77 | + this.person.ownerId = 0; | |
78 | + } | |
79 | + } | |
80 | + } | |
81 | + | |
31 | 82 | this.de_activate = function (field) |
32 | 83 | { |
33 | 84 | var updBox = document.getElementById (this.updBox); |
... | ... | @@ -166,46 +217,26 @@ function personInUp ( |
166 | 217 | |
167 | 218 | this.setCameraId = function (value) |
168 | 219 | { |
169 | - var person = this.selectPerson (); | |
170 | - | |
171 | - person.cameraId = value; | |
172 | - if (person == this.newPerson) | |
173 | - person.photographerId = 0; | |
220 | + this.selectPerson ().cameraId = value; | |
174 | 221 | } |
175 | 222 | |
176 | 223 | this.setWmWidth = function (value) |
177 | 224 | { |
178 | - var person = this.selectPerson (); | |
179 | - | |
180 | - person.wmWidth = value; | |
181 | - if (person == this.newPerson) | |
182 | - person.ownerId = 0; | |
225 | + this.selectPerson ().wmWidth = value; | |
183 | 226 | } |
184 | 227 | |
185 | 228 | this.setWmHeight = function (value) |
186 | 229 | { |
187 | - var person = this.selectPerson (); | |
188 | - | |
189 | - person.wmHeight = value; | |
190 | - if (person == this.newPerson) | |
191 | - person.ownerId = 0; | |
230 | + this.selectPerson ().wmHeight = value; | |
192 | 231 | } |
193 | 232 | |
194 | 233 | this.setWmXPos = function (value) |
195 | 234 | { |
196 | - var person = this.selectPerson (); | |
197 | - | |
198 | - person.wmXPos = value; | |
199 | - if (person == this.newPerson) | |
200 | - person.ownerId = 0; | |
235 | + this.selectPerson ().wmXPos = value; | |
201 | 236 | } |
202 | 237 | |
203 | 238 | this.setWmYPos = function (value) |
204 | 239 | { |
205 | - var person = this.selectPerson (); | |
206 | - | |
207 | - person.wmYPos = value; | |
208 | - if (person == this.newPerson) | |
209 | - person.ownerId = 0; | |
240 | + this.selectPerson ().wmYPos = value; | |
210 | 241 | } |
211 | 242 | } | ... | ... |
... | ... | @@ -138,13 +138,13 @@ function c_personSearch1 (fname, sname, fnameAlt, snameAlt, names, person) |
138 | 138 | this.person.update ( |
139 | 139 | this.persons[this.sNameBest[2]][this.fNameBest[2]]); |
140 | 140 | else |
141 | - this.person.reset (); | |
141 | + this.person.empty (); | |
142 | 142 | } |
143 | 143 | else |
144 | 144 | { |
145 | 145 | this.fNameBest = new Array (-1, -1, null); |
146 | 146 | if (this.person != null) |
147 | - this.person.reset (); | |
147 | + this.person.empty (); | |
148 | 148 | } |
149 | 149 | |
150 | 150 | return false; |
... | ... | @@ -172,7 +172,7 @@ function c_personSearch1 (fname, sname, fnameAlt, snameAlt, names, person) |
172 | 172 | this.person.update ( |
173 | 173 | this.persons[this.sNameBest[2]][this.fNameBest[2]]); |
174 | 174 | else |
175 | - this.person.reset (); | |
175 | + this.person.empty (); | |
176 | 176 | |
177 | 177 | return false; |
178 | 178 | } | ... | ... |
... | ... | @@ -3,30 +3,11 @@ |
3 | 3 | pInUp = new personInUp ( |
4 | 4 | 'update', 'insert', 'submit', person, newPerson, arrRight, arrDown); |
5 | 5 | |
6 | - function showHideBlock (titleId) | |
7 | - { | |
8 | - var titleElement = document.getElementById (titleId); | |
9 | - var imgElement = titleElement.getElementsByTagName ('img')[0]; | |
10 | - var blockElement = titleElement.parentNode; | |
11 | - var dataElement = blockElement.getElementsByTagName ('div')[1]; | |
12 | - | |
13 | - if (dataElement.style.display == 'none') | |
14 | - { | |
15 | - dataElement.style.display = 'block'; | |
16 | - imgElement.src = arrDown.getImgUrl (titleElement); | |
17 | - } | |
18 | - else | |
19 | - { | |
20 | - dataElement.style.display = 'none'; | |
21 | - imgElement.src = arrRight.getImgUrl (titleElement); | |
22 | - } | |
23 | - } | |
24 | - | |
25 | 6 | function personInUpInit () |
26 | 7 | { |
27 | - var tCam = document.getElementById ('_title_camera'); | |
8 | + var tCam = document.getElementById ('title_photographer'); | |
28 | 9 | var tCamImg = tCam.getElementsByTagName ('img')[0]; |
29 | - var tWat = document.getElementById ('_title_watermark'); | |
10 | + var tWat = document.getElementById ('title_owner'); | |
30 | 11 | var tWatImg = tWat.getElementsByTagName ('img')[0]; |
31 | 12 | |
32 | 13 | tCamImg.src = arrRight.getImgUrl (tCam); |
... | ... | @@ -111,13 +92,14 @@ |
111 | 92 | </div> |
112 | 93 | |
113 | 94 | <div class="bgc-grp1 d-grp1" style="margin-top: 2px"> |
114 | - <div class="bgc-grp-head1 f-grp-head1 d-grp-head1" id="_title_camera"> | |
95 | + <div class="bgc-grp-head1 f-grp-head1 d-grp-head1" | |
96 | + id="title_photographer"> | |
115 | 97 | <img style=" |
116 | 98 | position: relative; |
117 | 99 | float: right; |
118 | 100 | margin-right: 3px; |
119 | 101 | cursor: pointer" |
120 | - onClick="showHideBlock ('_title_camera')" /> | |
102 | + onClick="pInUp.showHideBlock ('title_photographer')" /> | |
121 | 103 | <?=_('photographer')?> |
122 | 104 | </div> |
123 | 105 | <div style="display: none"> |
... | ... | @@ -135,13 +117,13 @@ |
135 | 117 | |
136 | 118 | <div class="bgc-grp1 d-grp1" style="margin-top: 2px"> |
137 | 119 | <div class="bgc-grp-head1 f-grp-head1 d-grp-head1" |
138 | - id="_title_watermark"> | |
120 | + id="title_owner"> | |
139 | 121 | <img style=" |
140 | 122 | position: relative; |
141 | 123 | float: right; |
142 | 124 | margin-right: 3px; |
143 | 125 | cursor: pointer" |
144 | - onClick="showHideBlock ('_title_watermark')" /> | |
126 | + onClick="pInUp.showHideBlock ('title_owner')" /> | |
145 | 127 | <?=_('owner')?> |
146 | 128 | </div> |
147 | 129 | <div style="display: none"> | ... | ... |
Please
register
or
login
to post a comment