File tree Expand file tree Collapse file tree 4 files changed +39
-3
lines changed Expand file tree Collapse file tree 4 files changed +39
-3
lines changed Original file line number Diff line number Diff line change @@ -507,12 +507,21 @@ exports.createSharingDiv = function(options) {
507
507
} ) ;
508
508
}
509
509
510
- // SMS-to-phone feature
510
+ var sharingShapeways = sharingDiv . querySelector ( '#sharing-shapeways' ) ;
511
+ if ( sharingShapeways ) {
512
+ dom . addClickTouchEvent ( sharingShapeways , function ( ) {
513
+ $ ( '#send-to-phone' ) . hide ( ) ;
514
+ $ ( '#shapeways-message' ) . toggle ( ) ;
515
+ } ) ;
516
+ }
517
+
518
+ // SMS-to-phone feature
511
519
var sharingPhone = sharingDiv . querySelector ( '#sharing-phone' ) ;
512
520
if ( sharingPhone && options . sendToPhone ) {
513
521
dom . addClickTouchEvent ( sharingPhone , function ( ) {
514
522
var sendToPhone = sharingDiv . querySelector ( '#send-to-phone' ) ;
515
523
if ( $ ( sendToPhone ) . is ( ':hidden' ) ) {
524
+ $ ( '#shapeways-message' ) . hide ( ) ;
516
525
sendToPhone . setAttribute ( 'style' , 'display:inline-block' ) ;
517
526
var phone = $ ( sharingDiv . querySelector ( "#phone" ) ) ;
518
527
var submitted = false ;
Original file line number Diff line number Diff line change 49
49
< img src= ' <%= BlocklyApps.assetUrl("media/phone_purple.png") %>' / >
50
50
< / a>
51
51
< % } -% >
52
- < % if (options .level .shapewaysUrl ) { -% >
53
- < a href= ' <%= options.level.shapewaysUrl %> ' target = " _blank " >
52
+ < % if (options .level .shapewaysUrl && ! options . onMainPage && options . sendToPhone ) { -% >
53
+ < a id = " sharing-shapeways " href= " " onClick = " return false; " >
54
54
< img src= ' <%= BlocklyApps.assetUrl("media/shapeways_purple.png") %>' / >
55
55
< / a>
56
56
< % } -% >
63
63
<button id =" phone-submit" onClick =" return false;" >Send</button >
64
64
<div id =" phone-charges" >A text message will be sent via <a href =" http://twilio.com" >Twilio</a >. Charges may apply to the recipient.</div >
65
65
</div >
66
+ <% if (options .response && options .response .level_source && options .level .shapewaysUrl ) { -% >
67
+ < div id= " shapeways-message" class = " sharing" style= " display: none" >
68
+ < div id= " shapeways-message-body" > You' ll be redirected to Shapeways.com to order and purchase a 3D print.</div>
69
+ <button id="shapeways-print-go-button" onclick="location.href=' < %= options .level .shapewaysUrl % > ' ">Go to Shapeways</button>
70
+ <div id="shapeways-message-body-disclaimer">Students under 13 years need a parent or guardian to do 3D printing.</div>
71
+ </div>
72
+ <% } -%>
Original file line number Diff line number Diff line change @@ -853,6 +853,26 @@ $modal-image-margin-gap: 10px;
853
853
text-align : center ;
854
854
}
855
855
856
+ #shapeways-print-go-button {
857
+ margin-bottom : 10px ;
858
+ }
859
+
860
+ #shapeways-message-body {
861
+ font-size : 15px ;
862
+ margin-bottom : 7px ;
863
+ line-height : 26px ;
864
+ }
865
+
866
+ #shapeways-message-body-disclaimer {
867
+ font-size : 11px ;
868
+ margin-bottom : -11px ;
869
+ }
870
+
871
+ #shapeways-message {
872
+ display : block ;
873
+ text-align : center ;
874
+ }
875
+
856
876
.modal-image {
857
877
width : $modal-image-width ;
858
878
height : auto ;
You can’t perform that action at this time.
0 commit comments