Skip to content

Commit 2fdac32

Browse files
committed
Merge branch 'release/fix_storage_heights'
2 parents 1635d24 + f815983 commit 2fdac32

File tree

18 files changed

+225
-454
lines changed

18 files changed

+225
-454
lines changed

assets/css/common.css

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ input[type="checkbox"]:checked + label span.chk {
196196
text-decoration: none;
197197
cursor: pointer;
198198
/* medium size is default */
199-
height: 35px;
200-
line-height: 35px;
199+
height: 40px;
200+
line-height: 40px;
201201
padding: 0px 32px;
202202
font-size: 14px;
203203
position: relative;
@@ -600,25 +600,25 @@ i.stooltip span {
600600
}
601601

602602
.print-si-close-light {
603-
background-position: -35px -5px;
603+
background-position: -34px -5px;
604604
width: 26px;
605605
height: 26px;
606606
}
607607

608608
.print-si-close-light:hover, .btn-simulator-container:hover .print-si-close-light {
609-
background-position: -35px -31px;
609+
background-position: -34px -31px;
610610
width: 26px;
611611
height: 26px;
612612
}
613613

614614
.print-si-pause-light {
615-
background-position: -65px -5px;
615+
background-position: -69px -5px;
616616
width: 26px;
617617
height: 26px;
618618
}
619619

620620
.print-si-pause-light:hover , .btn-simulator-container:hover .print-si-pause-light {
621-
background-position: -65px -31px;
621+
background-position: -69px -31px;
622622
width: 26px;
623623
height: 26px;
624624
}
@@ -659,6 +659,18 @@ i.stooltip span {
659659
height: 26px;
660660
}
661661

662+
.print-si-round-resume-light {
663+
background-position: -41px -66px;
664+
width: 26px;
665+
height: 26px;
666+
}
667+
668+
.print-si-round-resume-light:hover {
669+
background-position: -41px -95px;
670+
width: 26px;
671+
height: 26px;
672+
}
673+
662674

663675
.print-si-browse {
664676
background-position: -5px -30px;

assets/img/print_sprite.png

486 Bytes
Loading

assets/img/simulator_panel_bg.png

-276 Bytes
Loading

assets/scripts/config.example.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/scripts/init.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ var APP_KEY = APP_KEY || '',
33
GUEST_TOKEN_URL = GUEST_TOKEN_URL || 'http://localhost:3000/guest_token',
44
ACCESS_TOKEN_URL = ACCESS_TOKEN_URL || 'http://localhost:3000/access_token',
55
REFRESH_TOKEN_URL = REFRESH_TOKEN_URL || 'http://localhost:3000/refresh_token',
6-
API_URL = (typeof ENVIRONMENT !== 'undefined' && ENVIRONMENT === 'production') ?
7-
ADSKSpark.Constants.API_HOST_PROD :
8-
ADSKSpark.Constants.API_HOST_SANDBOX;
6+
API_URL = (typeof ENVIRONMENT !== 'undefined' && ENVIRONMENT === 'production') ? ADSKSpark.Constants.API_HOST_PROD :
7+
ADSKSpark.Constants.API_HOST_SANDBOX,
8+
REDIRECT_URI = REDIRECT_URI || ''
99

1010
ADSKSpark.Client.initialize(APP_KEY,// Your app key
1111
GUEST_TOKEN_URL,// The guest token endpoint that is implemented by your server (i.e. http://example.com/guest_token)
1212
ACCESS_TOKEN_URL,// The access token endpoint that is implemented by your server (i.e. http://example.com/access_token)
1313
REFRESH_TOKEN_URL,// The refresh access token endpoint that is implemented by your server (i.e. http://example.com/refresh_token)
14-
API_URL // api host
14+
API_URL, // api host
15+
REDIRECT_URI
1516
);

examples/print/choose-file.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
#files .table-container{
4848
overflow-y: auto;
49-
height: 390px;
49+
height: 290px;
5050
margin-bottom: 25px;
5151
}
5252

@@ -90,7 +90,6 @@
9090
<tr>
9191
<th>Name<br/><span>file_name</span></th>
9292
<th>ID<br/><span>file_id</span></th>
93-
<th></th>
9493
</tr>
9594
</thead>
9695
<tbody id="filesTbody">

examples/print/create-print-job.html

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
text-transform: uppercase;
3434
}
3535

36-
#fileURL{
36+
#fileId{
3737
width: 350px;
3838
}
3939

@@ -95,6 +95,17 @@
9595
margin-bottom: 0px;
9696
}
9797

98+
.footer-action
99+
{
100+
border-top: 1px solid #e5e5e5;
101+
padding: 18px 0;
102+
}
103+
104+
.form-group
105+
{
106+
margin-bottom: 19px;
107+
}
108+
98109
</style>
99110
</head>
100111

@@ -106,20 +117,20 @@
106117
<div class="sample-title">Create a 3D print job</div>
107118
<hr>
108119
<section class="form_field pull-left">
109-
<label for="fileURL">
120+
<label for="fileId">
110121
Choose file to print <span class="field-label">&nbsp;/&nbsp;printable_id</span><i class="required"></i>
111122
<i class="spark_icon si-help with_hover"></i>
112-
<i class="stooltip"><span style="display: none;width:400px;">Enter the URL of a printable 3D file, the Spark ID of a printable 3D file or browse to locate one on your desktop. Printable files can be STL, OBJ or BLT 3D files, or a printable file created by Spark.</span></i>
123+
<i class="stooltip"><span style="display: none;width:400px;">Enter the Spark ID of a printable 3D file or browse to select an existing file. Printable files can be gcode files, or a printable file created by Spark.</span></i>
113124
</label>
114125
<div class="clearfix"></div>
115126
<!--<input type="text" class="form-control" id="fileURL" placeholder="File URL" required value="http://cdn.spark.com/print/abcefg">-->
116127
<div class="pull-left">
117-
<input type="text" class="form-control" id="fileURL" placeholder="Enter file URL" required>
128+
<input type="text" class="form-control" id="fileId" placeholder="Enter printable file id" required>
118129
<div class="field_error hidden">
119130
<span>Required</span>
120131
</div>
121132
</div>
122-
<div class="pull-left or-browse">OR</div><a class="spark_btn empty browse_btn pull-left" href="#" onclick="eventBroadCaster.broadcastEvent('printIframe.chooseAsset')"><i class="spark_print_icon print-si-browse"></i><span>Browse...</span></a>
133+
<div class="pull-left or-browse">OR</div><a class="spark_btn empty browse_btn pull-left" href="#" onclick="eventBroadCaster.broadcastEvent('printIframe.chooseFile')"><i class="spark_print_icon print-si-browse"></i><span>Browse...</span></a>
123134
</section>
124135
<div class="spacer clearfix"></div>
125136
<section class="form_field">
@@ -147,8 +158,8 @@
147158
</div>
148159
<input type="hidden" id="assetId">
149160
</div>
150-
<div class="pull-right">
151-
<input class="spark_btn primary" type="submit" value="Print and continue" id="print">
161+
<div class="footer-action ">
162+
<input class="spark_btn primary pull-right" type="submit" value="Print and continue" id="print">
152163
</div>
153164
</form>
154165

@@ -158,10 +169,10 @@
158169
<div class="modal-content">
159170
<div class="modal-header">
160171
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
161-
<h4>WARNING</h4>
172+
<h4>ERROR</h4>
162173
</div>
163174
<div class="modal-body">
164-
An error occurred.
175+
165176
</div>
166177
<div class="modal-footer">
167178
<a class="spark_btn small cancel" type="button">Close</a>
@@ -207,7 +218,8 @@ <h4>WARNING</h4>
207218
var urlParams = spark.util.extractParamsFromURL();
208219
currentFileId = urlParams['fileId'] ? urlParams['fileId'] : "";
209220
if (currentFileId != "") {
210-
$("#fileURL").val(currentFileId);
221+
//sending a printable id from the tray since currently there is a bug and we cant print files from the drive
222+
$("#fileId").val("17223875");
211223
}
212224

213225
var getAllPrinters = function(){
@@ -237,19 +249,27 @@ <h4>WARNING</h4>
237249

238250
$("#print-job-form").on('submit', function (e) {
239251
e.preventDefault();
240-
if (common.validateInput($('#fileURL')) && common.validateInput($('#printers-select'))) {
252+
if (common.validateInput($('#fileId')) && common.validateInput($('#printers-select'))) {
241253

242-
var fileUrl = $('#fileURL').val();
254+
var fileId = $('#fileId').val();
243255
var printerId = $('#printers-select option:selected').val();
244-
var settings = JSON.parse($('#printer-settings').val());
245-
246-
sparkPrint.printJob(fileUrl, printerId, settings, function (response) {
247-
var printerId = response.printer_id;
248-
eventBroadCaster.broadcastEvent('printIframe.jobExist');
249-
},
250-
function (response) {
251-
$('#myModal').modal('show');
252-
});
256+
257+
try{
258+
var settings = JSON.parse($('#printer-settings').val());
259+
sparkPrint.printJob(fileId, printerId, settings, function (response) {
260+
var printerId = response.printer_id;
261+
eventBroadCaster.broadcastEvent('printIframe.jobExist');
262+
},
263+
function (response) {
264+
var res = JSON.parse(response);
265+
var message = res.message != undefined && res.message != "" ? res.message : "An error occurred.";
266+
$('#myModal').find(".modal-body").html("<span>" + message + "</span>");
267+
$('#myModal').modal('show');
268+
});
269+
}catch(e){
270+
$('#myModal').find(".modal-body").html("<span>The Settings parameter must be in JSON format!</span>");
271+
$('#myModal').modal('show');
272+
}
253273
}
254274
});
255275

examples/print/manage-printers.html

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,15 @@
2222
<link href="../../assets/css/common.css" rel="stylesheet">
2323

2424
<style>
25+
2526
.modal-header {
2627
position: relative;
2728
padding: 8px 20px;
2829
}
2930

30-
.modal-header .layouts {
31-
position: absolute;
32-
right: 0;
33-
background-color: #ffffff;
34-
padding-left: 10px;
35-
}
36-
37-
.modal-header .layouts a {
38-
border-left: 1px solid lightgrey;
39-
margin-left: 6px;
40-
padding: 4px 0 0 10px;
31+
.modal-dialog{
32+
width: 340px;
33+
margin-left: 170px;
4134
}
4235

4336
#empty-printers {
@@ -71,14 +64,25 @@
7164
}
7265

7366
.table tr.in-table:hover {
74-
background-color: #F7F7F7;
67+
background-color: transparent;
7568
cursor: default;
7669
}
7770

7871
.table tr.in-table .actions {
7972
cursor: pointer;
8073
}
8174

75+
.sub-title
76+
{
77+
margin-top: 7px;
78+
}
79+
80+
.footer-action
81+
{
82+
border-top: 1px solid #e5e5e5;
83+
padding: 18px 0;
84+
}
85+
8286
</style>
8387

8488

@@ -91,7 +95,7 @@
9195
<form id="manage-printers-form">
9296
<div class="sample-title">Manage your 3D Printers</div>
9397
<hr>
94-
<div class="pull-left">Manage your existing printers, or register a new printer.</div>
98+
<div class="sub-title pull-left">Manage your existing printers, or register a new printer.</div>
9599
<a class="spark_btn empty pull-right" onclick="eventBroadCaster.broadcastEvent('manageIframe.addClick')">
96100
<i class="spark_print_icon print-si-plus"></i> Register Printer
97101
</a>
@@ -120,8 +124,9 @@
120124
</form>
121125

122126

123-
<br>
127+
<div class="footer-action">
124128
<a id="continue" class="spark_btn primary pull-right" onclick="eventBroadCaster.broadcastEvent('manageIframe.continueClick')">Print job</a>
129+
</div>
125130
</div>
126131

127132
<!-- /container -->

0 commit comments

Comments
 (0)