foreveralone

foreveralone Commit Details


Date:2016-02-26 21:36:31 (8 years 9 months ago)
Author:Natalie Adams
Branch:master
Commit:5b61d873fd2c9fc0e871627ecbd9ed3a4c8416bc
Parents: 8ec802535091c59ce755e90b218b8c126c1655c5
Message:Issue 124: Add ability to add custom genders

Changes:

File differences

web/application/views/info2.html
2323
2424
2525
26
2726
2827
28
29
30
31
2932
3033
3134
......
4447
4548
4649
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
4775
4876
4977
<option value="transfeminine">Transfeminine</option>
<option value="transmasculine">Transmasculine</option>
<option value="trigenderpyrofox">Tri-gender pyrofox (from the forest planet)</option>
</select>
</div>
<div class="form-group">
<label>Or enter a custom gender:</label>
<input type="text" id="customGender"> <button id="genderAdd" type="button" class="btn btn-primary">Set</button>
</div>
<nav>
<ul class="pager">
<li><a href="./main/info/1">Prev</a></li>
$("#gender").on("change", function () {
$.post("./main/sessionset/gender/", {"gender": $(this).val()});
});
function addGender() {
var value = $("#customGender").val();
if (value) {
$("#gender").append($("<option/>", {
value: value.toLowerCase(),
text: value.toLowerCase(),
selected: "selected"
}));
$("#gender").val(value).change();
$("#customGender").val("");
}
}
$("#customGender").keyup(function (e) {
if (e.which == $.ui.keyCode.ENTER) {
addGender();
}
});
$("#genderAdd").click(function () {
addGender();
});
});
</script>
web/application/views/info3.html
2525
2626
2727
28
29
30
31
2832
2933
3034
......
4347
4448
4549
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
4675
4776
4877
</select>
</div>
<div class="form-group">
<label>Or enter a custom gender:</label>
<input type="text" id="customGender"> <button id="genderAdd" type="button" class="btn btn-primary">Add</button>
</div>
<nav>
<ul class="pager">
<li><a href="./main/info/1">Prev</a></li>
$("#looking").on("change", function () {
$.post("./main/sessionset/looking/", {"looking": $(this).val()});
});
function addGender() {
var value = $("#customGender").val();
if (value) {
$("#looking").append($("<option/>", {
value: value.toLowerCase(),
text: value.toLowerCase(),
selected: "selected"
}));
var original = $("#looking").val();
var newval = $.merge([value], original);
$("#looking").val(newval).change();
$("#customGender").val("");
}
}
$("#customGender").keyup(function (e) {
if (e.which == $.ui.keyCode.ENTER) {
addGender();
}
});
$("#genderAdd").click(function () {
addGender();
});
});
</script>

Archive Download the corresponding diff file

Branches

Tags

Number of commits:
Page rendered in 0.06195s using 20 queries.