Fixing android sense download issue

revert-dabc3590
Rasika Perera 8 years ago
parent d58b8f1f53
commit 6cbbb75c45

@ -35,27 +35,6 @@ function setPopupMaxHeight() {
function showPopup() { function showPopup() {
$(modalPopup).modal('show'); $(modalPopup).modal('show');
setPopupMaxHeight(); setPopupMaxHeight();
$('#downloadForm').validate({
rules: {
deviceName: {
minlength: 4,
required: true
}
},
highlight: function (element) {
$(element).closest('.control-group').removeClass('success').addClass('error');
},
success: function (element) {
$(element).closest('.control-group').removeClass('error').addClass('success');
$('label[for=deviceName]').remove();
}
});
var deviceType = "";
$('.deviceType').each(function () {
if (this.value != "") {
deviceType = this.value;
}
});
} }
/* /*
@ -81,22 +60,13 @@ function attachEvents() {
* when a user clicks on "Download" link * when a user clicks on "Download" link
* on Device Management page in WSO2 DC Console. * on Device Management page in WSO2 DC Console.
*/ */
$("a.download-link").click(function () { $(".download-link").click(function(){
$(modalPopupContent).html($('#download-device-modal-content').html()); toggleEnrollment();
showPopup();
var deviceName;
$("a#download-device-download-link").click(function () {
$('.new-device-name').each(function () {
if (this.value != "") {
deviceName = this.value;
}
});
$('label[for=deviceName]').remove();
});
$("a#download-device-cancel-link").click(function () {
hidePopup();
}); });
}); function toggleEnrollment(){
$(modalPopupContent).html($("#qr-code-modal").html());
generateQRCode(modalPopupContent + " .qr-code");
showPopup();
}
} }

@ -60,21 +60,6 @@
<i class="fw fw-mobile fw-inverse fw-lg"></i> Enroll Device</a> <i class="fw fw-mobile fw-inverse fw-lg"></i> Enroll Device</a>
<br/><br/> <br/><br/>
<div id="download-device-modal-content-links" class="hide">
<div class="modal-content">
<div class="row">
<div class="col-md-7 col-centered center-container">
<h3>Please download the file from following link(Press CTRL+C).</h3>
<br/>
<div>
<input id="download-device-url" style="color:#3f3f3f;padding:5px"
type="text" value="" placeholder="Type here" size="60">
</div>
</div>
</div>
</div>
</div>
<div id="device-400-content" class="hide"> <div id="device-400-content" class="hide">
<div class="modal-content"> <div class="modal-content">
<div class="row"> <div class="row">
@ -242,25 +227,75 @@
</div> </div>
<div id="qr-code-modal" data-enrollment-url="{{hostName}}{{@unit.publicUri}}/asset/androidsense.apk" class="hidden"> <div id="qr-code-modal" data-enrollment-url="{{hostName}}{{@unit.publicUri}}/asset/androidsense.apk" class="hidden">
<div class="content"> <div class="modal-header">
<div class="row"> <h4 class="pull-left modal-title">
<div class="col-lg-5 col-md-6 col-centered"> <span class="fw-stack">
<h3>Scan QR code to start enrollment</h3> <i class="fw fw-mobile fw-stack-2x"></i>
<p>Please scan the QR code using your mobile device to retrieve enrollment URL.</p> <span class="fw-stack fw-move-right fw-move-bottom">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle fw-stack-2x fw-stroke text-info"></i>
<i class="fw fw-add fw-stack-1x fw-inverse"></i>
</span>
</span>
&nbsp;&nbsp;Add your new mobile device to {{@app.conf.appName}}
</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<hr>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<div class="panel-body col-centered text-center">
<h5>
Please scan the following QR code using your new <b>Android</b>, <b>iPhone</b> or <b>Windows</b> mobile device.
</h5>
<br>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body col-centered"> <div class="panel-body">
<div class="qr-code"></div> <div class="qr-code"></div>
</div> </div>
</div> </div>
<form id="downloadForm" method="GET" <br>
action="{{hostName}}{{@unit.publicUri}}/asset/androidsense.apk"> <h5>
<div class="buttons" style="padding-bottom: 0px"> Not having a QR code scanner in your device?
<input class="btn btn-operations" type="submit" value="Download Now"> <br><br>
</div> Try following link
</form> <br><br>
<b>{{hostName}}{{@unit.publicUri}}/asset/androidsense.apk</b>
<br><br>
on your device's Internet browser instead.
</h5>
</div>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="javascript:hidePopup()" class="btn-operations btn-default">Ok</a>
</div> </div>
</div> </div>
</div> </div>
<!--<div class="content">-->
<!--<div class="row">-->
<!--<div class="col-lg-5 col-md-6 col-centered">-->
<!--<h3>Scan QR code to start enrollment</h3>-->
<!--<p>Please scan the QR code using your mobile device to retrieve enrollment URL.</p>-->
<!--<div class="panel panel-default">-->
<!--<div class="panel-body col-centered">-->
<!--<div class="qr-code"></div>-->
<!--<br>-->
<!--<h5>-->
<!--Not having a QR code scanner in your device?-->
<!--<br><br>-->
<!--Try following link-->
<!--<br><br>-->
<!--<b>{{hostName}}/{{@unit.publicUri}}/asset/androidsense.apk</b>-->
<!--<br><br>-->
<!--on your device's Internet browser instead.-->
<!--</h5>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div id="device-agent-downloading-content" class="hide"> <div id="device-agent-downloading-content" class="hide">
<div class="modal-content"> <div class="modal-content">
<div class="row"> <div class="row">

Loading…
Cancel
Save