Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 947563 - [Settings] Wifi hotspot settings...
Browse files Browse the repository at this point in the history
...prevent users pressing OK w/o any error messages.

 - Removed password field in internet sharing panel.
 - Move security section before password.
 - Add password desc displayed when security option is NOT "open".
  • Loading branch information
joshthecoder committed Dec 20, 2013
1 parent 024357e commit b0a98d5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 32 deletions.
5 changes: 0 additions & 5 deletions apps/settings/elements/hotspot.html
Expand Up @@ -27,11 +27,6 @@ <h2 data-l10n-id="internetSharing-wifi"> Wi-Fi </h2>
<span data-name="tethering.wifi.ssid"></span>
</a>
</li>
<li class="password-item" hidden>
<a data-l10n-id="wifi-password">Password
<span data-name="tethering.wifi.security.password"></span>
</a>
</li>
<li>
<a data-l10n-id="wifi-security">Security
<span data-name="tethering.wifi.security.type"></span>
Expand Down
19 changes: 11 additions & 8 deletions apps/settings/elements/hotspot_wifi_settings.html
Expand Up @@ -15,14 +15,6 @@ <h1 data-l10n-id="hotspotSettings-header"> Hotspot Settings </h1>
<p data-l10n-id="ssid-name">SSID Network Name</p>
<input type="text" data-setting="tethering.wifi.ssid" />
</li>
<li class="password">
<label class="pack-checkbox">
<input type="checkbox" data-ignore name="show_password">
<span data-l10n-id="showPassword">Show password</span>
</label>
<p data-l10n-id="wifi-password">Password</p>
<input type="password" name="password" x-inputmode="verbatim" data-setting="tethering.wifi.security.password" />
</li>
<li>
<p data-l10n-id="wifi-security">Security</p>
<span class="button icon icon-dialog">
Expand All @@ -33,6 +25,17 @@ <h1 data-l10n-id="hotspotSettings-header"> Hotspot Settings </h1>
</select>
</span>
</li>
<li class="description password-description">
<p data-l10n-id="hotspot-password-desc">The password must have at least 8 characters.</p>
</li>
<li class="password">
<label class="pack-checkbox">
<input type="checkbox" data-ignore name="show_password">
<span data-l10n-id="showPassword">Show password</span>
</label>
<p data-l10n-id="wifi-password">Password</p>
<input type="password" name="password" x-inputmode="verbatim" data-setting="tethering.wifi.security.password" />
</li>
</ul>
</div>

Expand Down
18 changes: 0 additions & 18 deletions apps/settings/js/hotspot.js
Expand Up @@ -12,15 +12,11 @@ var Hotspot = {
var settings = window.navigator.mozSettings;
var hotspotSettingBtn =
document.querySelector('#hotspot-settings-section button');
var passwordItem = document.querySelector('#hotspot .password-item');

function setHotspotSettingsEnabled(enabled) {
// disable the setting button when internet sharing is enabled
hotspotSettingBtn.disabled = enabled;
}
function updatePasswordItemVisibility(securityType) {
passwordItem.hidden = (securityType == 'open');
}

// tethering enabled
settings.addObserver('tethering.wifi.enabled', function(event) {
Expand All @@ -36,20 +32,6 @@ var Hotspot = {
);
};

// security type
settings.addObserver('tethering.wifi.security.type', function(event) {
updatePasswordItemVisibility(event.settingValue);
});

var reqSecurityType =
settings.createLock().get('tethering.wifi.security.type');

reqSecurityType.onsuccess = function dt_getStatusSuccess() {
updatePasswordItemVisibility(
reqSecurityType.result['tethering.wifi.security.type']
);
};

hotspotSettingBtn.addEventListener('click',
openDialog.bind(window, 'hotspot-wifiSettings'));
}
Expand Down
3 changes: 2 additions & 1 deletion apps/settings/js/hotspot_wifi_settings.js
Expand Up @@ -57,7 +57,8 @@ var HotspotWifiSettings = {

updatePasswordItemVisibility: function(securityType) {
var passwordItem = this.dialog.querySelector('.password');
passwordItem.hidden = (securityType == 'open');
var passwordDesc = this.dialog.querySelector('.password-description');
passwordItem.hidden = passwordDesc.hidden = (securityType == 'open');
},

// initialize all setting fields in the panel
Expand Down
1 change: 1 addition & 0 deletions apps/settings/locales/settings.en-US.properties
Expand Up @@ -444,6 +444,7 @@ ssid-name=SSID network name
hotspot-open=open
hotspot-wpa-psk=WPA (TKIP)
hotspot-wpa2-psk=WPA2 (AES)
hotspot-password-desc=The password must have at least 8 characters.


#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
Expand Down

0 comments on commit b0a98d5

Please sign in to comment.