forked from mozilla-b2g/gaia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mozilla-b2g#7106 from sriramkrish85/roaming_changes
Bug 823450 - Data Connection warning dialog
- Loading branch information
Showing
6 changed files
with
157 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* -*- Mode: js; js-indent-level: 2; indent-tabs-mode: nil -*- */ | ||
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||
|
||
'use strict'; | ||
|
||
onLocalized(function() { | ||
var turnOnButton = document.getElementById('button-ok'); | ||
var notNowButton = document.getElementById('button-canncel'); | ||
turnOnButton.addEventListener('click', function(e) { | ||
var warningDisabled = true; | ||
window.opener.gDataConnect.setDataConnectionWarningState(warningDisabled); | ||
window.close(); | ||
}); | ||
notNowButton.addEventListener('click', function(e) { | ||
var warningDisabled = false; | ||
window.opener.gDataConnect.setDataConnectionWarningState(warningDisabled); | ||
window.opener.gDataConnect.setDataConnectionState(false); | ||
window.close(); | ||
}); | ||
}); | ||
|
||
|
||
/** | ||
* Fire a callback when as soon as all l10n resources are ready and the UI has | ||
* been translated. | ||
* Note: this could be exposed as `navigator.mozL10n.onload'... | ||
*/ | ||
|
||
function onLocalized(callback) { | ||
if (navigator.mozL10n.readyState == 'complete' || | ||
navigator.mozL10n.readyState == 'interactive') { | ||
callback(); | ||
} else { | ||
window.addEventListener('localized', callback); | ||
} | ||
} |
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,38 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<title>Data Connection Warning</title> | ||
<meta name="description" content="Prompts user to take action, first time data connection is enabled"> | ||
|
||
<!-- Common style --> | ||
<link rel="stylesheet" type="text/css" href="shared/style/confirm.css"> | ||
|
||
<!-- Specific style --> | ||
<link rel="stylesheet" type="text/css" href="style/ondataconnect.css"/> | ||
|
||
<!-- Localization --> | ||
<link rel="resource" type="application/l10n" href="locales/locales.ini"/> | ||
<script type="application/javascript" src="shared/js/l10n.js"></script> | ||
|
||
<!-- Specific code --> | ||
<script type="application/javascript" defer src="js/ondataconnect.js"></script> | ||
|
||
</head> | ||
|
||
<body role="application"> | ||
|
||
<form role="dialog" data-type="confirm" id="pair-view"> | ||
<section> | ||
<h1 class="heading" data-l10n-id="dataConnection-warning-head">Turn ON data connection?</h1> | ||
<p class="message" data-l10n-id="dataConnection-warning-message">Applications will automatically fetch data via data connection when required. Additional data charges may apply.</p> | ||
</section> | ||
<menu> | ||
<button id="button-canncel" data-l10n-id="dataConnection-warning-cancel">Not now</button> | ||
<button id="button-ok" class="recommend" data-l10n-id="dataConnection-warning-ok">Turn ON</button> | ||
</menu> | ||
</form> | ||
|
||
</body> | ||
</html> |
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,18 @@ | ||
form[role="dialog"] h1.heading { | ||
background: -moz-image-rect(url(images/icons_sprite.png), 0, 120, 30, 90) no-repeat scroll 0 50% transparent; | ||
border: 0; | ||
font-size: 1.1rem; | ||
line-height: 30px; | ||
font-weight: bold; | ||
text-indent: 30px; | ||
white-space: nowrap; | ||
} | ||
|
||
form[role="dialog"] p.message { | ||
border: 5px solid #fff; | ||
border-left: 0; | ||
border-right: 0; | ||
font-size: 1.1rem; | ||
margin: 10px 0; | ||
padding: 10px 0; | ||
} |