Skip to content

Commit

Permalink
fix(dashboard): Do not autofill ssid and password (#301)
Browse files Browse the repository at this point in the history
Do not autofill ssid and password fields if password is saved for website

fixes #295
  • Loading branch information
mpfeil committed Apr 5, 2019
1 parent 4aaa633 commit 1b55c9a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
44 changes: 25 additions & 19 deletions app/views/account.box.edit.script.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ <h2 style="margin-top: 0px; margin-bottom: 0px">{{'EDIT_SCRIPT'|translate}}</h2>
<div ng-if="script.showConfiguration">
<h3>{{'CONFIGURATION'|translate}}</h3>
<form class="form-inline">
<!-- Firefox workaround https://github.com/sensebox/openSenseMap/issues/295-->
<input type="password" style="display:none;">
<!-- Firefox workaround end -->
<div class="form-group" ng-if="script.showSerialPort">
<label for="serialport">{{'PORT'|translate}}</label>
<div class="input-group"
uib-tooltip-template="'tooltip_serialports.html'"
tooltip-placement="bottom"
<div class="input-group" uib-tooltip-template="'tooltip_serialports.html'" tooltip-placement="bottom"
tooltip-trigger="'mouseenter'">
<select type="text" class="form-control" id="serialport" ng-model="script.serialPort" ng-change="script.generateScript()">
<select type="text" class="form-control" id="serialport" ng-model="script.serialPort"
ng-change="script.generateScript()">
<option value="Serial1">Serial 1</option>
<option value="Serial2">Serial 2</option>
</select>
Expand All @@ -21,30 +23,31 @@ <h3>{{'CONFIGURATION'|translate}}</h3>
</div>
<div class="form-group">
<label for="ssid">WiFi SSID</label>
<div class="input-group"
uib-tooltip="{{'DATA_NOT_STORED'|translate}}"
tooltip-placement="top"
<div class="input-group" uib-tooltip="{{'DATA_NOT_STORED'|translate}}" tooltip-placement="top"
tooltip-trigger="'mouseenter'">
<input type="text" class="form-control" id="ssid" ng-model="script.wifi.ssid" ng-model-options="{ debounce: 500 }" ng-change="script.generateScript()">
<input type="textarea" class="form-control" id="ssid" ng-model="script.wifi.ssid"
ng-model-options="{ debounce: 500 }" ng-change="script.generateScript()">
<div class="input-group-addon">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="form-group" >
<div class="form-group">
<label for="password">WiFi {{'ACCOUNT_PASSWORD'|translate}}</label>
<div class="input-group"
uib-tooltip="{{'DATA_NOT_STORED'|translate}}"
tooltip-placement="top"
<div class="input-group" uib-tooltip="{{'DATA_NOT_STORED'|translate}}" tooltip-placement="top"
tooltip-trigger="'mouseenter'">
<input type="password" class="form-control" id="password" ng-model="script.wifi.password" ng-model-options="{ debounce: 500 }" ng-change="script.generateScript()">
<input type="password" class="form-control" id="password" ng-model="script.wifi.password"
ng-model-options="{ debounce: 500 }" ng-change="script.generateScript()" name="whatever"
autocomplete="new-password">
<!-- Chrome workaround https://github.com/sensebox/openSenseMap/issues/295 -->
<!-- Set name attribute and autocomplete https://stackoverflow.com/a/15917221 -->
<div class="input-group-addon">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true" ></span>
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</div>
</div>
</div>
<button type="button" class="btn btn-success" ng-click="script.compile()" ng-disabled="script.compiling">
<i class="fa fa-circle-o-notch fa-spin fa-fw" ng-if="script.compiling"></i> {{'COMPILE'|translate}}
<i class="fa fa-circle-o-notch fa-spin fa-fw" ng-if="script.compiling"></i> {{'COMPILE'|translate}}
</button>
</form>
<hr>
Expand All @@ -54,7 +57,8 @@ <h3>{{'CONFIGURATION'|translate}}</h3>

<div class="row">
<div class="col-lg-12">
<textarea class="form-control" ng-model="script.boxScript" onclick="this.select()" style="height:350px;font-family:monospace;font-size:80%;resize: vertical;"></textarea>
<textarea class="form-control" ng-model="script.boxScript" onclick="this.select()"
style="height:350px;font-family:monospace;font-size:80%;resize: vertical;"></textarea>
</div>
</div>

Expand All @@ -67,14 +71,16 @@ <h3>{{'CONFIGURATION'|translate}}</h3>
<!-- List group -->
<ul class="list-group">
<li class="list-group-item">
<div uib-alert class="alert-warning" ng-bind-html="'EDIT_SCRIPT_MANUAL'|translate" style="margin-bottom: 0px;"></div>
<div uib-alert class="alert-warning" ng-bind-html="'EDIT_SCRIPT_MANUAL'|translate" style="margin-bottom: 0px;">
</div>
</li>
<li class="list-group-item">
<div uib-alert class="alert-warning" ng-bind-html="'EDIT_SCRIPT_DOWNLOAD_RESOURCES'|translate" style="margin-bottom: 0px;"></div>
<div uib-alert class="alert-warning" ng-bind-html="'EDIT_SCRIPT_DOWNLOAD_RESOURCES'|translate"
style="margin-bottom: 0px;"></div>
</li>
</ul>
</div>

<script type="text/ng-template" id="tooltip_serialports.html">
<img src="/images/serialports.png" alt="" srcset="">
</script>
</script>
8 changes: 7 additions & 1 deletion app/views/account.box.register.html
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,9 @@ <h3>{{'SENSORS' | translate}}</h3>
<wz-step wz-title="{{'STEP4' | translate}}" wz-data="{translation: 'STEP4'}">
<hr>
<form class="tab-pane" id="last" name="lastForm" rc-step>
<!-- Firefox workaround https://github.com/sensebox/openSenseMap/issues/295-->
<input type="password" style="display:none;">
<!-- Firefox workaround end -->
<div uib-alert ng-repeat="alert in register.alerts" ng-class="'alert-' + (alert.type)">{{alert.msg}}</div>

<h3>senseBox</h3>
Expand Down Expand Up @@ -1164,7 +1167,10 @@ <h5 ng-bind-html="'COMPILE_SKETCH'|translate"></h5>
<div class="input-group" uib-tooltip="{{'DATA_NOT_STORED'|translate}}" tooltip-placement="top"
tooltip-trigger="'mouseenter'">
<input type="password" class="form-control" id="password" ng-model="register.wifi.password"
ng-model-options="{ debounce: 500 }" ng-change="register.generateScript()">
ng-model-options="{ debounce: 500 }" ng-change="register.generateScript()" name="whatever"
autocomplete="new-password">
<!-- Chrome workaround https://github.com/sensebox/openSenseMap/issues/295 -->
<!-- Set name attribute and autocomplete https://stackoverflow.com/a/15917221 -->
<div class="input-group-addon">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</div>
Expand Down

0 comments on commit 1b55c9a

Please sign in to comment.