-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenmod_edit.js
224 lines (190 loc) · 10.9 KB
/
genmod_edit.js
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
/**
* Common javascript functions for editing
*
* Genmod: Genealogy Viewer
* Copyright (C) 2005 - 2007 Genmod Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @package Genmod
* @subpackage Display
* @version $Id: genmod_edit.js 29 2022-07-17 13:18:20Z Boudewijn $
*/
/**
* Opens a window to edit a name. Used in the edit this person menu
*/
function edit_name(pid, fact, count, change_type) {
if (!count) count = 1;
window.open('edit_interface.php?action=editname&pid='+pid+'&fact='+fact+'&count='+count+'&change_type='+change_type+'&pid_type=INDI&'+sessionname+'='+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
/**
* Copy, used in editing
*/
function copy_record(pid, fact, count, change_type, pid_type) {
window.open('edit_interface.php?action=copy&pid='+pid+'&fact='+fact+'&count='+count+'&pid_type='+pid_type+'&change_type='+change_type+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
/**
* Opens a window to link a spouse to a family. Used in the edit this person menu
*/
function linkspouse(pid, famtag, change_type) {
window.open('edit_interface.php?action=linkspouse&pid='+pid+'&change_type='+change_type+'&pid_type=INDI&famtag='+famtag+'&famid=new&'+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
/**
* Editing links that opens an edit window via edit_interface.php
*/
/**
* Delete
*/
function deleteperson(pid, change_type) {
window.open('edit_interface.php?action=deleteperson&pid='+pid+'&change_type='+change_type+"&pid_type=INDI&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function delete_family(famid, change_type) {
window.open('edit_interface.php?action=deletefamily&famid='+famid+'&change_type='+change_type+"&pid_type=FAM&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=600,resizable=1,scrollbars=1');
return false;
}
function deletesource(pid, change_type) {
window.open('edit_interface.php?action=deletesource&pid='+pid+'&change_type='+change_type+"&pid_type=SOUR&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function deletegnote(pid, change_type) {
window.open('edit_interface.php?action=deletegnote&pid='+pid+'&change_type='+change_type+"&pid_type=NOTE&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function deletemedia(mid, change_type) {
window.open('edit_interface.php?action=deletemedia&pid='+mid+'&change_type='+change_type+"&pid_type=OBJE&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function deleterepository(pid, change_type) {
window.open('edit_interface.php?action=deleterepo&pid='+pid+'&change_type='+change_type+"&pid_type=REPO&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function delete_record(pid, fact, count, change_type, pid_type) {
if (!count) count = 1;
window.open('edit_interface.php?action=delete&pid='+pid+'&pid_type='+pid_type+'&change_type='+change_type+'&fact='+fact+'&count='+count+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
/**
* Reorder
*/
function reorder_children(famid, change_type) {
window.open('edit_interface.php?action=reorder_children&pid='+famid+'&change_type='+change_type+"&pid_type=FAM&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function reorder_media(famid, change_type, pid_type) {
window.open('edit_interface.php?action=reorder_media&pid='+famid+'&pid_type='+pid_type+'&change_type='+change_type+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function reorder_families(pid, change_type) {
window.open('edit_interface.php?action=reorder_fams&pid='+pid+'&change_type='+change_type+"&pid_type=INDI&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function relation_families(pid, change_type) {
window.open('edit_interface.php?action=relation_fams&pid='+pid+'&change_type='+change_type+"&pid_type=INDI&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function change_family_members(famid, change_type) {
window.open('edit_interface.php?action=changefamily&famid='+famid+'&change_type='+change_type+"&pid_type=FAM&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=600,resizable=1,scrollbars=1');
return false;
}
/**
* Add
*/
function add_record(pid, fact, change_type, pid_type) {
factfield = document.getElementById(fact);
if (factfield) {
factvalue = factfield.options[factfield.selectedIndex].value;
if (factvalue.substr(0, 10)=="clipboard_") window.open('edit_interface.php?action=paste&pid='+pid+'&pid_type='+pid_type+'&change_type='+change_type+'&fact='+factvalue.substr(10)+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
else window.open('edit_interface.php?action=add&pid='+pid+'&pid_type='+pid_type+'&change_type='+change_type+'&fact='+factvalue+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
}
return false;
}
function add_new_record(pid, fact, change_type, pid_type) {
window.open('edit_interface.php?action=add&pid='+pid+'&pid_type='+pid_type+'&change_type='+change_type+'&fact='+fact+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function addnewchild(famid, change_type) {
window.open('edit_interface.php?action=addchild&famid='+famid+'&change_type='+change_type+"&pid_type=FAM&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function addspouse(pid, famtag, change_type) {
window.open('edit_interface.php?action=addspouse&pid_type=INDI&&pid='+pid+'&change_type='+change_type+'&famtag='+famtag+'&famid=new&'+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function add_famc(pid, change_type) {
window.open('edit_interface.php?action=addfamlink&pid='+pid+'&pid_type=INDI&change_type='+change_type+'&famtag=CHIL'+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function add_newfamc(pid, change_type) {
window.open('edit_interface.php?action=addnewfamlink&pid='+pid+'&pid_type=INDI&change_type='+change_type+'&famtag=CHIL'+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function add_fams(pid, famtag, change_type) {
window.open('edit_interface.php?action=addfamlink&pid='+pid+'&pid_type=INDI&change_type='+change_type+'&famtag='+famtag+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function add_newfams(pid, famtag, change_type) {
window.open('edit_interface.php?action=addnewfamlink&pid='+pid+'&pid_type=INDI&change_type='+change_type+'&famtag='+famtag+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function add_name(pid, change_type) {
window.open('edit_interface.php?action=addname&pid='+pid+'&pid_type=INDI&change_type='+change_type+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function addnewparent(pid, famtag, change_type) {
window.open('edit_interface.php?action=addnewparent&pid='+pid+'&pid_type=INDI&change_type='+change_type+'&famtag='+famtag+'&famid=new'+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function addnewparentfamily(pid, famtag, famid, change_type) {
window.open('edit_interface.php?action=addnewparent&pid='+pid+'&pid_type=FAM&change_type='+change_type+'&famtag='+famtag+'&famid='+famid+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function addnewsource(field, change_type) {
pastefield = field;
window.open('edit_interface.php?action=addnewsource&pid=newsour&pid_type=SOUR&change_type='+change_type, '', 'top=70,left=70,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function addnewrepository(field, change_type) {
pastefield = field;
window.open('edit_interface.php?action=addnewrepository&pid=newrepo&pid_type=REPO&change_type='+change_type, '', 'top=70,left=70,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function addnewmedia(field, change_type) {
pastefield = field;
window.open('edit_interface.php?action=add&pid=newmedia&fact=OBJE&pid_type=OBJE&change_type='+change_type, '' ,'top=70,left=70,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
function addnewgnote(field, change_type) {
pastefield = field;
window.open('edit_interface.php?action=addnewgnote&pid=newgnote&pid_type=NOTE&change_type='+change_type, '' ,'top=70,left=70,width=800,height=500,resizable=1,scrollbars=1');
return false;
}
/**
* Edit
*/
function edit_record(pid, fact, count, change_type, pid_type) {
window.open('edit_interface.php?action=edit&pid='+pid+'&pid_type='+pid_type+'&fact='+fact+'&count='+count+'&change_type='+change_type+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=900,height=650,resizable=1,scrollbars=1');
return false;
}
/**
* Opens a window to raw edit a record. Used in the edit menus of the various record types.
*/
function edit_raw(pid, change_type, pid_type) {
window.open('edit_interface.php?action=editraw&pid='+pid+'&pid_type='+pid_type+'&change_type='+change_type+"&"+sessionname+"="+sessionid, '', 'top=50,left=50,width=800,height=550,resizable=1,scrollbars=1');
return false;
}