-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmynawp-admin.js
54 lines (45 loc) · 1.51 KB
/
mynawp-admin.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
jQuery(document).ready(function() {
var curexpurl = jQuery('#newexpurl').attr('href');
var curexpuuids = jQuery('#updateuuid').attr('href');
jQuery('#optionspost').children('div').each(function(i) {
var thisuuid = jQuery(this).attr('class');
var curvarurl = jQuery(this).children('.newvarurl').attr('href');
jQuery(this).children('.mynawp_new_variant').bind('keyup', function(){
var newvar = jQuery(this).val();
jQuery(this).parent().children('.newvarurl').attr('href', curvarurl + newvar);
});
});
jQuery('#mynawp_new_experiment').keyup(function(){
var newexp = jQuery('#mynawp_new_experiment').val();
jQuery('#newexpurl').attr('href', curexpurl + newexp);
});
jQuery('#updateuuid').click(function(){
var curexpuuids = jQuery('#updateuuid').attr('href');
var updexp = jQuery('#mynawp_uuid_string').val();
jQuery('#updateuuid').attr('href', curexpuuids + updexp);
});
jQuery('.deleteexp').click(function(){
var answer = confirm('Are you sure you want to delete this experiment? This cannot be undone.');
if ( answer ) {
return true;
} else {
return false;
}
});
jQuery('.resetexp').click(function(){
var answer = confirm('Are you sure you want to reset this experiment? This cannot be undone.');
if ( answer ) {
return true;
} else {
return false;
}
});
jQuery('.delete_var').click(function(){
var answer = confirm('Are you sure you want to delete this variable? This cannot be undone.');
if ( answer ) {
return true;
} else {
return false;
}
});
});