|
@@ -7,48 +7,102 @@ function DisplayTrans() {
|
7
|
7
|
}
|
8
|
8
|
|
9
|
9
|
function Categories() {
|
10
|
|
- var save = {};
|
11
|
|
- var form_elements = $('#dynamic_form input[name], #dynamic_form select, #dynamic_form textarea');
|
12
|
|
- for (var i = 0; i < form_elements.length; i++) {
|
13
|
|
- if (["Preview", "---", ""].indexOf(form_elements[i].value) == -1) {
|
14
|
|
- if (form_elements[i].name.slice(-1) == '[]') {
|
15
|
|
- save[form_elements[i].name] = save[form_elements[i].name] || new Array()
|
16
|
|
- save[form_elements[i].name][form_elements[i].id.slice(form_elements[i].id.search(/[0-9]/))] = form_elements[i].value
|
17
|
|
- } else if (form_elements[i].type == 'checkbox') {
|
18
|
|
- save[form_elements[i].name] = form_elements[i].checked;
|
19
|
|
- } else {
|
20
|
|
- save[form_elements[i].name] = form_elements[i].value;
|
21
|
|
- }
|
22
|
|
- }
|
|
10
|
+ let def = ['title', 'title_rj', 'title_jp', 'year', 'lang', 'censored', 'tags', 'cover', 'group_desc', 'release_desc', 'anon']
|
|
11
|
+ let cats = [{
|
|
12
|
+ 'javdb': {},
|
|
13
|
+ 'idols': {name: 'Idol(s)'},
|
|
14
|
+ 'studio': {name: 'Studio'},
|
|
15
|
+ 'series': {name: 'Series'},
|
|
16
|
+ 'media': {},
|
|
17
|
+ 'container': {},
|
|
18
|
+ 'codec': {},
|
|
19
|
+ 'resolution': {},
|
|
20
|
+ 'audio': {},
|
|
21
|
+ 'sub': {},
|
|
22
|
+ 'mediainfo': {},
|
|
23
|
+ 'screenshots': {name: 'Screenshots'},
|
|
24
|
+ 'group_desc': {notes: 'Contains information such as a description of the movie, a link to a JAV catalogue, etc.'},
|
|
25
|
+ 'release_desc': {notes: 'Contains information such as encoder settings or watermarks'}
|
|
26
|
+ }, {
|
|
27
|
+ 'anidb': {},
|
|
28
|
+ 'idols': {name: 'Artist/Studio'},
|
|
29
|
+ 'studio': false,
|
|
30
|
+ 'series': {name: 'Circle (Optional)'},
|
|
31
|
+ 'media': {},
|
|
32
|
+ 'container': {},
|
|
33
|
+ 'codec': {},
|
|
34
|
+ 'resolution': {},
|
|
35
|
+ 'audio': {},
|
|
36
|
+ 'sub': {},
|
|
37
|
+ 'mediainfo': {},
|
|
38
|
+ 'tags': {notes: 'Remember to use the \'3d\' tag if your upload is 3DCG!'},
|
|
39
|
+ 'screenshots': {name: 'Screenshots'},
|
|
40
|
+ 'group_desc': {notes: 'Contains information such as a description of the anime, a link to AniDB, etc.'},
|
|
41
|
+ 'release_desc': {notes: 'Contains information such as encoder settings or episode source differences'}
|
|
42
|
+ }, {
|
|
43
|
+ 'ehentai': {},
|
|
44
|
+ 'idols': {name: 'Artist'},
|
|
45
|
+ 'studio': {name: 'Publisher (Optional)'},
|
|
46
|
+ 'series': {name: 'Circle (Optional)'},
|
|
47
|
+ 'pages': {},
|
|
48
|
+ 'media_manga': {},
|
|
49
|
+ 'archive_manga': {},
|
|
50
|
+ 'trans': {name: 'Translation Group (optional)'},
|
|
51
|
+ 'screenshots': {name: 'Samples'},
|
|
52
|
+ 'group_desc': {notes: 'Contains information such as a description of the doujin.'},
|
|
53
|
+ 'release_desc': {notes: 'Contains information such as formatting information.'}
|
|
54
|
+ }, {
|
|
55
|
+ 'idols': {name: 'Developer'},
|
|
56
|
+ 'series': {name: 'Circle (Optional)'},
|
|
57
|
+ 'studio': {name: 'Publisher (Optional)'},
|
|
58
|
+ 'dlsite': {},
|
|
59
|
+ 'media_games': {},
|
|
60
|
+ 'container_games': {},
|
|
61
|
+ 'archive': {},
|
|
62
|
+ 'trans': {name: 'Translation/Release Group (optional)'},
|
|
63
|
+ 'tags': {notes: 'Tags you should consider, if appropriate: <strong>visual.novel</strong>, <strong>nukige</strong>'},
|
|
64
|
+ 'screenshots': {name: 'Screenshots', notes: '<strong class="important_text">Promotional materials from a game\'s store page are NOT screenshots</strong>'},
|
|
65
|
+ 'group_desc': {notes: 'Contains information such as a description of the game, its mechanics, etc.'},
|
|
66
|
+ 'release_desc': {notes: 'Contains information such as <strong>version</strong>, install instructions, patching instructions, etc.'}
|
|
67
|
+ }, {
|
|
68
|
+ 'idols': {name: 'Creators/Authors (Optional)'},
|
|
69
|
+ 'studio': {name: 'Publisher (Optional)'},
|
|
70
|
+ 'year': false,
|
|
71
|
+ 'lang': false,
|
|
72
|
+ 'dlsite': {},
|
|
73
|
+ 'screenshots': {name: 'Screenshots'},
|
|
74
|
+ 'release_desc': false
|
|
75
|
+ }]
|
|
76
|
+ let active = {}
|
|
77
|
+ for (let field of def) active[field] = {}
|
|
78
|
+ let category = 0
|
|
79
|
+ if ($('input[name="type"]').raw()) category = $('input[name="type"]').raw().value
|
|
80
|
+ if ($('#categories').raw()) category = $('#categories').raw().value
|
|
81
|
+ active = Object.assign(active, cats[category])
|
|
82
|
+
|
|
83
|
+ let hide = el => {
|
|
84
|
+ Array.from($(`#${el.id} input, #${el.id} select, #${el.id} textarea`)).forEach(inp => inp.disabled = true)
|
|
85
|
+ $(el).ghide()
|
|
86
|
+ }
|
|
87
|
+ let show = el => {
|
|
88
|
+ Array.from($(`#${el.id} input, #${el.id} select, #${el.id} textarea`)).forEach(inp => inp.disabled = false)
|
|
89
|
+ $(el).gshow()
|
23
|
90
|
}
|
24
|
91
|
|
25
|
|
- ajax.get('ajax.php?action=upload_section&categoryid=' + $('#categories').raw().value, function (response) {
|
26
|
|
- $('#dynamic_form').raw().innerHTML = response;
|
27
|
|
- initMultiButtons();
|
28
|
|
- // Evaluate the code that generates previews.
|
29
|
|
- eval($('#dynamic_form script.preview_code').html());
|
30
|
|
-
|
31
|
|
- for (i in save) {
|
32
|
|
- if (Array.isArray(save[i])) {
|
33
|
|
- for (j in save[i]) {
|
34
|
|
- if (!($('#'+i.slice(0,-2)+'_'+j).raw())) AddArtistField()
|
35
|
|
- $('#'+i.slice(0,-2)+'_'+j).raw().value = save[i][j]
|
36
|
|
- }
|
37
|
|
- } else if (typeof(save[i]) == 'boolean') {
|
38
|
|
- if ($('[name="'+i+'"]').raw()) $('[name="'+i+'"]').raw().checked = save[i]
|
39
|
|
- } else {
|
40
|
|
- if ($('[name="'+i+'"]').raw()) $('[name="'+i+'"]').raw().value = save[i]
|
|
92
|
+ let trs = $('#dynamic_form tr')
|
|
93
|
+ for (let tr of trs) {
|
|
94
|
+ let field = tr.id.slice(0,-3)
|
|
95
|
+ if (active[field]) {
|
|
96
|
+ if (active[field].name) {
|
|
97
|
+ tr.children[0].innerHTML = active[field].name
|
41
|
98
|
}
|
|
99
|
+ let notes = $(`#${tr.id} p.notes`).raw()
|
|
100
|
+ if (notes) notes.innerHTML = active[field].notes||''
|
|
101
|
+ show(tr)
|
|
102
|
+ } else {
|
|
103
|
+ hide(tr)
|
42
|
104
|
}
|
43
|
|
- if ($('#categories').raw().value == "1") DisplayTrans()
|
44
|
|
- if ($('#ressel').raw() && $('#ressel').raw().value == "Other") {
|
45
|
|
- $('#resolution').raw().readOnly = false
|
46
|
|
- $('#resolution').gshow()
|
47
|
|
- }
|
48
|
|
- initAutocomplete()
|
49
|
|
- initAutofill()
|
50
|
|
- $('.bbcode_editor').each(function(i, el) { BBEditor(el) })
|
51
|
|
- });
|
|
105
|
+ }
|
52
|
106
|
}
|
53
|
107
|
|
54
|
108
|
function Bitrate() {
|
|
@@ -385,7 +439,7 @@ function JavAutofill() {
|
385
|
439
|
image: 'image',
|
386
|
440
|
tags: 'tags',
|
387
|
441
|
description: 'album_desc' }
|
388
|
|
- var cn = $('#catalogue').raw().value.toUpperCase()
|
|
442
|
+ var cn = $('#javdb_tr #catalogue').raw().value.toUpperCase()
|
389
|
443
|
$.getJSON('/ajax.php?action=javfill&cn='+cn, function(data) {
|
390
|
444
|
if (data.status != "success") {
|
391
|
445
|
$('#catalogue').raw().value = 'Failed'
|
|
@@ -428,7 +482,7 @@ function DoujAutofill() {
|
428
|
482
|
circle: 'series',
|
429
|
483
|
pages: 'pages',
|
430
|
484
|
description: 'release_desc' }
|
431
|
|
- var nh = $('#catalogue').raw().value
|
|
485
|
+ var nh = $('#ehentai_tr #catalogue').raw().value
|
432
|
486
|
$.getJSON('/ajax.php?action=doujin&url='+nh, function(data) {
|
433
|
487
|
if (data.status != "success") {
|
434
|
488
|
$('#catalogue').raw().value = 'Failed'
|
|
@@ -527,6 +581,7 @@ function initAutofill() {
|
527
|
581
|
}
|
528
|
582
|
|
529
|
583
|
$(function() {
|
|
584
|
+ Categories();
|
530
|
585
|
initAutofill();
|
531
|
586
|
$(document).on('click', '.add_artist_button', AddArtistField);
|
532
|
587
|
$(document).on('click', '.remove_artist_button', RemoveArtistField);
|