This repository has been archived by the owner on Jun 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add option to enable/disable auto removal and force networking
- Loading branch information
Cédric Verstraeten
committed
Jun 30, 2017
1 parent
d165d80
commit bd891f6
Showing
12 changed files
with
238 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#kios-configuration | ||
{ | ||
.tgl-ios:checked+.tgl-btn | ||
{ | ||
background-color: #943633; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/******************************************** | ||
* | ||
* KiOS Settings | ||
* | ||
**/ | ||
|
||
define(["jquery", "app/models/Settings", "app/views/SettingsKiOSView"], function($, Settings, SettingsKiOSView) | ||
{ | ||
return { | ||
initialize: function(autoremoval, forcenetwork, translations) | ||
{ | ||
this.kios = new SettingsKiOSView(autoremoval, forcenetwork, translations); | ||
this.kios.render(); | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/********************* | ||
* KiOS settings view. | ||
****/ | ||
|
||
define(["underscore", "backbone", "app/views/BaseView"], | ||
function (_, Backbone, BaseView) | ||
{ | ||
var SettingsKiOSView = BaseView.extend( | ||
{ | ||
el : '#web-settings .kios-content', | ||
view : 'settings-kios', | ||
|
||
events: | ||
{ | ||
"change #force-network": "updateToggle", | ||
"change #auto-removal": "updateToggle", | ||
}, | ||
initialize: function(autoremoval, forcenetwork, translations) | ||
{ | ||
this.model = {}; | ||
this.model.autoremoval = autoremoval; | ||
this.model.forcenetwork = forcenetwork; | ||
this.model.translation = translations; | ||
}, | ||
updateToggle: function(e) | ||
{ | ||
var input = $(e.target); | ||
var isChecked = input.is(':checked'); | ||
|
||
// We call the correct method in function | ||
// of the id attribute of the toggle. | ||
$.ajax({ | ||
url: _baseUrl + "/api/v1/" + input.attr('id'), | ||
type: 'PUT', | ||
data: {'active': isChecked}, | ||
success: function(data) | ||
{ | ||
console.log(data); | ||
} | ||
}); | ||
}, | ||
render: function(model) | ||
{ | ||
this.$el.html(this.template(this.model)); | ||
return this; | ||
} | ||
}); | ||
|
||
return SettingsKiOSView; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="with-tooltip element" style="clear: both; margin-bottom: 15px; display: table;"> | ||
<div class="button" style="float: left; margin-right: 20px;"> | ||
<input class="tgl tgl-ios" {{#forcenetwork}}checked{{/forcenetwork}} id="force-network" type="checkbox"/> | ||
<label class="tgl-btn label-ios" data-tg-off="off" data-tg-on="on" for="force-network"></label> | ||
</div> | ||
<div style="float: left; margin-top: 2px;">Force network mode</div> | ||
<span style="float: left; margin: 0; margin-top: -4px; margin-left: 10px;"> | ||
<i class="fa fa-question-circle" aria-hidden="true"></i> | ||
<span>{{translation.privacyInfo}}</span> | ||
</span> | ||
</div> | ||
|
||
<div class="with-tooltip element" style="clear: both; margin-bottom: 15px; display: table;"> | ||
<div class="button" style="float: left; margin-right: 20px;"> | ||
<input class="tgl tgl-ios" {{#autoremoval}}checked{{/autoremoval}} id="auto-removal" type="checkbox"/> | ||
<label class="tgl-btn label-ios" data-tg-off="off" data-tg-on="on" for="auto-removal"></label> | ||
</div> | ||
<div style="float: left; margin-top: 2px;">Auto removal media</div> | ||
<span style="float: left; margin: 0; margin-top: -4px; margin-left: 10px;"> | ||
<i class="fa fa-question-circle" aria-hidden="true"></i> | ||
<span>{{translation.privacyInfo}}</span> | ||
</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters