foreveralone

foreveralone Commit Details


Date:2016-02-26 21:21:40 (8 years 9 months ago)
Author:Natalie Adams
Branch:master
Commit:8ec802535091c59ce755e90b218b8c126c1655c5
Parents: 34452aa60b99ec682e91c09170a970ad1bde0a1a
Message:Issue 123: Add ability to add custom interests

Changes:

File differences

web/application/views/info1.html
1313
1414
1515
16
16
1717
18
19
20
21
1822
1923
24
25
26
27
2028
2129
2230
......
3442
3543
3644
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
3770
3871
3972
<select class="form-control" id="interests" multiple>
<option value="running">Running</option>
<option value="anime">Anime</option>
<option value="programmer">Programming</option>
<option value="programming">Programming</option>
<option value="android">Android</option>
<option value="apple">Apple</option>
<option value="math">Math</option>
<option value="aliens">Aliens</option>
<option value="reddit">Reddit</option>
</select>
</div>
<div class="form-group">
<label>Or enter a custom interest:</label>
<input type="text" id="customInterest"> <button id="interestAdd" type="button" class="btn btn-primary">Add</button>
</div>
<nav>
<ul class="pager">
<li><a href="./main/info/2">Next</a></li>
$("#interests").on("change", function () {
$.post("./main/sessionset/interests/", {"interests": $(this).val()});
});
function addInterest() {
var value = $("#customInterest").val();
if (value) {
$("#interests").append($("<option/>", {
value: value.toLowerCase(),
text: value.toLowerCase(),
selected: "selected"
}));
var original = $("#interests").val();
var newval = $.merge([value], original);
$("#interests").val(newval).change();
$("#customInterest").val("");
}
}
$("#customInterest").keyup(function (e) {
if (e.which == $.ui.keyCode.ENTER) {
addInterest();
}
});
$("#interestAdd").click(function () {
addInterest();
});
});
</script>

Archive Download the corresponding diff file

Branches

Tags

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