Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Play around with getting icon description to select license feature
  • Loading branch information
Ari committed Jul 23, 2019
commit 1215a86c616f8892aca50c9f354fd5fec9eb96e7
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h1 class="title is-1">CC License Chooser</h1>
<div class="columns">
<div class="column">
<b style="margin-bottom: 5%">To change the selected license, click the icons below.</b>
<div class="columns">
<div class="columns chooser-icon-column" onclick="switch_callback('allow-commercial-switch')">
<div class="column is-narrow">
<div id="control-icon-container" class="control">
<input id="allow-commercial-switch" type="checkbox" class="css-checkbox is-commercial"
Expand Down
15 changes: 9 additions & 6 deletions src/scripts/choose-a-license.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ function set_license_link() {
* @param {object} check The HTML SA Checkbox object
*/
function sa_check_callback(check) {
console.log("Checkbox Toggled")
console.log(check.checked)
//console.log("Checkbox Toggled")
//console.log(check.checked)
app_state.chooser.inputs.share_alike = !app_state.chooser.inputs.share_alike
set_license()
}
Expand All @@ -128,10 +128,13 @@ function sa_check_callback(check) {
* @param {object} cb The HTML switch object
*/
function switch_callback(cb) {
console.log("Switch Toggled - " + cb.id)
var state = app_state.chooser.inputs
// If string is passed, id is string, else checkbox id is id
var id = typeof cb == "string" ? id = cb : id = cb.id
console.log("Switch Toggled - " + id)
state.selected_license = ""
switch (cb.id) {

switch (id) {
case "allow-adaptations-switch":
if (!cb.checked) { // If allow adaptations
console.log("Is Allow Adaptations - " + !cb.checked)
Expand Down Expand Up @@ -170,12 +173,12 @@ function toggle_license_icon(icon, is_show) {
}

function hide_sa_check() {
console.log("SA Hidden")
//console.log("SA Hidden")
document.getElementById("sa-control-container").style.display = "none"
}

function show_sa_check() {
console.log("SA Shown")
//console.log("SA Shown")
var element = document.getElementById("sa-control-container")
if (app_state.chooser.inputs.share_alike) {
element.checked = "true"
Expand Down
4 changes: 4 additions & 0 deletions src/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ h3 {
margin-bottom: 1em
}

.chooser-icon-column {
cursor: pointer;
}

input[type=checkbox].css-checkbox{ display: none; }

.css-label {
Expand Down