forked from chilipeppr/workspace-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-en.html
493 lines (437 loc) · 20.1 KB
/
index-en.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Workspace / bastianf2</title>
<!-- ChiliPeppr is based on bootstrap CSS. -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> -->
<!-- Latest compiled JavaScript -->
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> -->
<!-- Customized version of require.js for ChiliPeppr. Please see require.js docs for how
ChiliPeppr's dependency system works as it's based on require.js. -->
<script type='text/javascript' src="lib/require.js"></script>
<style type='text/css'>
/* Workspace CSS */
.sample {
border:2px silver dashed;
border-radius:4px;
padding:10px;
}
.com-chilipeppr-ws-hdr {
padding:10px 15px;
}
.col-pad10 {
padding-left:5px;
padding-right:5px;
}
.col-nopadrt {
padding-right:0;
}
.col-nopadleft {
padding-left:0;
}
/* Feel free to remove this css tag to change the margin below the widgets */
.well, div.panel.panel-default {
margin-bottom:10px;
}
.billboard-content {
padding: 6px 20px;
}
.billboard-title {
margin-bottom:6px;
}
.billboard-url {
/* font-size: 9px; */
padding-top:0px;
margin-bottom:6px;
font-size:12px;
}
.billboard-img {
border:0px solid red;
border-radius: 5px;
position: relative;
width:100%;
height:160px;
background-position: center;
background-size: cover;
}
.billboard-imgcontain {
border:0px solid red;
position: relative;
}
.billboard-stats {
position: absolute;
top: 4px;
left: 10px;
}
.billboard-desc {
/* font-size:11px; */
}
.billboard-detail-title {
font-weight: bold;
}
.billboard-stats2 {
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
padding: 4px 10px 10px 10px;
background-color: rgba(255, 255, 255, 0.5);
}
.instructions-container {
border: 1px solid #ddd;
border-radius:5px;
margin-bottom:10px;
}
.instructions {
text-align: justify;
text-justify: inter-word;
padding-right: 10px;
}
.update {
text-align: justify;
text-justify: inter-word;
padding-right: 10px;
padding-left: 10px;
}
#instructions-title {
padding: 10px;
width: auto;
display: block;
border-bottom: 1px solid #ddd;
background-color: #f5f5f5;
}
#nvbr {
background-color:#444d5d;
padding-top: 0;
padding-bottom: 0;
}
.logo-img{
float: left;
margin: 0px 0px 0px 0px; /* fixed the spacing. */
}
.navbar-nav > li .active > a {
margin-right: 2px;
}
.navbar-default .navbar-nav > li > a {
color: #b2bbbd;
margin-right: 2px;
}
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
margin-top:10px;
line-height: 0px;
border-radius:3px;
margin-right: 2px;
}
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
color: #FFF;
}
.navbar-default .navbar-nav > li > a:hover {
margin-top:10px;
line-height: 0px;
border-radius:3px;
}
.navbar-default .navbar-nav > li > a:focus {
margin-top:10px;
line-height: 0px;
border-radius:3px;
}
</style>
<script type='text/javascript'>
//<![CDATA[
/* global cpdefine chilipeppr cprequire */
cprequire_test(["inline:com-chilipeppr-workspace-bastianf2"], function(ws) {
console.log("initting workspace");
/**
* The Root workspace (when you see the ChiliPeppr Header) auto Loads the Flash
* Widget so we can show the 3 second flash messages. However, in test mode we
* like to see them as well, so just load it from the cprequire_test() method
* so we have similar functionality when testing this workspace.
*/
var loadFlashMsg = function() {
chilipeppr.load("#com-chilipeppr-widget-flash-instance",
"http://fiddle.jshell.net/chilipeppr/90698kax/show/light/",
function() {
console.log("mycallback got called after loading flash msg module");
cprequire(["inline:com-chilipeppr-elem-flashmsg"], function(fm) {
//console.log("inside require of " + fm.id);
fm.init();
});
}
);
};
loadFlashMsg();
// Init workspace
ws.init();
// Do some niceties for testing like margins on widget and title for browser
$('title').html("JMA - Senscape Bootloader");
$('body').css('padding', '10px');
} /*end_test*/ );
// This is the main definition of your widget. Give it a unique name.
cpdefine("inline:com-chilipeppr-workspace-bastianf2", ["chilipeppr_ready"], function() {
return {
/**
* The ID of the widget. You must define this and make it unique.
*/
id: "com-chilipeppr-workspace-bastianf2", // Make the id the same as the cpdefine id
name: "Workspace / bastianf2", // The descriptive name of your widget.
desc: `A ChiliPeppr Workspace bastianf2.`,
url: "http://raw.githubusercontent.com/bastian-f/workspace-bastianf2/master/auto-generated-workspace.html", // The final URL of the working widget as a single HTML file with CSS and Javascript inlined. You can let runme.js auto fill this if you are using Cloud9.
fiddleurl: "http://ide.c9.io/undefined/undefined", // The edit URL. This can be auto-filled by runme.js in Cloud9 if you'd like, or just define it on your own to help people know where they can edit/fork your widget
githuburl: "http://github.com/bastian-f/workspace-bastianf2", // The backing github repo
testurl: "http://undefined-undefined.c9users.io/workspace.html", // The standalone working widget so can view it working by itself
foreignSubscribe: {
"/com-chilipeppr-elem-dragdrop/ondragover": "The Chilipeppr drag drop element will publish on channel /com-chilipeppr-elem-dragdrop/ondropped when a file is dropped so we subscribe to it so we can load a Gcode file when the user drags it onto the browser. It also adds a hover class to the bound DOM elem so we can add a CSS to hilite on hover",
"/com-chilipeppr-elem-dragdrop/ondragleave": "We need to know when the drag is over to remove the CSS hilites.",
"/com-chilipeppr-widget-gcode/resize": "We watch if the Gcode viewer resizes so that we can reposition or resize other elements in the workspace. Specifically we ask the Serial Port Console to resize. We also redraw the 3D Viewer so it fills the whole screen."
},
/**
* Contains reference to the Console widget object. Hang onto the reference
* so we can resize it when the window resizes because we want it to manually
* resize to fill the height of the browser so it looks clean.
*/
widgetConsole: null,
/**
* Contains reference to the Serial Port JSON Server object.
*/
widgetSpjs: null,
/**
* The workspace's init method. It loads the all the widgets contained in the workspace
* and inits them.
*/
init: function() {
// Most workspaces will instantiate the Serial Port JSON Server widget
// this.loadSpjsWidget();
this.loadCustSpjsWidget();
// Most workspaces will instantiate the Serial Port Console widget
this.loadSenscapeBootloaderWidget();
// this.loadDropTestWidget();
// Create our workspace upper right corner triangle menu
// this.loadWorkspaceMenu();
// Add our billboard to the menu (has name, url, picture of workspace)
// this.addBillboardToWorkspaceMenu();
// Setup an event to react to window resize. This helps since
// some of our widgets have a manual resize to cleanly fill
// the height of the browser window. You could turn this off and
// just set widget min-height in CSS instead
this.setupResize();
setTimeout(function() { $(window).trigger('resize'); }, 100);
},
/**
* Returns the billboard HTML, CSS, and Javascript for this Workspace. The billboard
* is used by the home page, the workspace picker, and the fork pulldown to show a
* consistent name/image/description tag for the workspace throughout the ChiliPeppr ecosystem.
*/
getBillboard: function() {
var el = $('#' + this.id + '-billboard').clone();
el.removeClass("hidden");
el.find('.billboard-desc').text(this.desc);
return el;
},
/**
* Inject the billboard into the Workspace upper right corner pulldown which
* follows the standard template for workspace pulldown menus.
*/
addBillboardToWorkspaceMenu: function() {
// get copy of billboard
var billboardEl = this.getBillboard();
$('#' + this.id + ' .com-chilipeppr-ws-billboard').append(billboardEl);
},
/**
* Listen to window resize event.
*/
setupResize: function() {
$(window).on('resize', this.onResize.bind(this));
},
/**
* When browser window resizes, forcibly resize the Console window
*/
onResize: function() {
if (this.widgetConsole) this.widgetConsole.resize();
},
/**
* Load the custom Serial Port JSON Server widget via chilipeppr.load()
*/
loadCustSpjsWidget: function(callback) {
var that = this;
chilipeppr.load(
"#com-chilipeppr-widget-serialport-instance",
"http://raw.githubusercontent.com/bastian-f/widget-spjs/master/auto-generated-widget.html",
function() {
console.log("mycallback got called after loading spjs module");
cprequire(["inline:com-chilipeppr-widget-serialport"], function(spjs) {
//console.log("inside require of " + fm.id);
spjs.setSingleSelectMode();
spjs.init({
isSingleSelectMode: true,
defaultBuffer: "default",
defaultBaud: 115200,
bufferEncouragementMsg: 'For your device please choose the "default" buffer in the pulldown and a 115200 baud rate before connecting.'
});
//spjs.showBody();
//spjs.consoleToggle();
that.widgetSpjs - spjs;
if (callback) callback(spjs);
});
}
);
},
/**
* Load Senscape Bootloader Widget via chilipeppr.load()
*/
loadSenscapeBootloaderWidget: function(callback) {
chilipeppr.load(
"#com-senscape-widget-bootloader-instance",
"http://raw.githubusercontent.com/bastian-f/widget-senscape-bootlader/master/auto-generated-widget.html",
function() {
// Callback after widget loaded into #myDivComSenscapeWidgetBootloader
// Now use require.js to get reference to instantiated widget
cprequire(
["inline:com-senscape-widget-bootloader"], // the id you gave your widget
function(myObjComSenscapeWidgetBootloader) {
// Callback that is passed reference to the newly loaded widget
console.log("Widget / Senscape Bootloader just got loaded.", myObjComSenscapeWidgetBootloader);
myObjComSenscapeWidgetBootloader.init();
}
);
}
);
},
}
});
//]]>
</script>
</head>
<body>
<nav class="navbar navbar-default" id="nvbr">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="img/logo.gif" alt="Logo">
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
</ul>
<form class="navbar-form navbar-left">
</form>
<ul class="nav navbar-nav navbar-right">
<!-- English -->
<li class="active"><a href="#">English <span class="sr-only">(current)</span></a></li>
<li><a href="index.html?forcerefresh=true">Castellano</a></li>
<!-- Castellano -->
<!--<li><a href="index-en.html?forcerefresh=true">English</a></li>-->
<!--<li class="active"><a href="#">Castellano <span class="sr-only">(current)</span></a></li>-->
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<!-- <div id="com-chilipeppr-widget-flash-instance"></div> -->
<div id="com-chilipeppr-workspace-bastianf2" class="xhidden">
<div class="container-fluid">
<div class="row">
<!-- Left Column -->
<!-- Change the width by adjusting col-md-4 to be col-md-3 for skinnier, or col-md-5 for wider -->
<!-- You must have all columns add up to 12 since we use bootstrap's col-md technique, i.e. col-md-2, col-md-7, col-md-3 adds to 12 -->
<div class="col-md-3 col-pad10">
</div>
<!-- Center Column -->
<div class="col-md-6 col-pad10">
<!--English -->
<div class="instructions-container"
<p> <span class="panel-title" id="instructions-title" data-toggle="popover" data-original-title="" title="">Instructions</span> </p>
<div class="instructions">
<p><ol>
<li>Connect your K-PROX and execute the launcher application.</li>
<li>Your K-PROX should now appear in the Serial Port Server list below. Please select it.</li>
<li>Click the 'Reprogram' button to upload the latest firmware version for your K-PROX.</li>
<li>Once the actualization is finished, you can disconnect the K-PROX.</li>
</ol></p>
</div>
</div>
<!--Castellano -->
<!--<div class="instructions-container"-->
<!--<p> <span class="panel-title" id="instructions-title" data-toggle="popover" data-original-title="" title="">Instrucciones</span> </p>-->
<!--<div class="instructions">-->
<!--<p><ol>-->
<!--<li>Conecte el dispositivo K-PROX a su ordenador y ejecute la aplicación anterior.</li>-->
<!--<li>Su K-PROX ahora debería aparecer en la lista de dispositivos. Por favor, selecciónelo.</li>-->
<!--<li>Haga clic en el botón 'Reprogram' para cargar la última versión de firmware para su K-PROX.</li>-->
<!--<li>Cuando se finalice la actualización, desconectar la máquina.</li>-->
<!--</ol></p>-->
<!--</div>-->
<!--</div>-->
<div id="com-chilipeppr-widget-serialport-instance">
Serial Port Widget goes here
</div>
<!-- English-->
<div class="instructions-container"
<p> <span class="panel-title" id="instructions-title" data-toggle="popover" data-original-title="" title="">Last Update: October 2018</span> </p>
<div class="update">
<p><strong>Version 7</strong></p>
<p>
This new update for the JMA K-Prox increases the range of RFiD tags that can be
duplicated. Certain tags, which could not be copied in the previous version, may now
be copied using the new “full-copy” option, which is invoked by pressing the COPY bottom
continuously for at least 5 seconds. But please note that this method does not allow the
tag to be reprogrammed. As before, most tags can be copied using a short (less than 5
second) press of the COPY button, which does allow them to be reprogrammed.
</p>
</div>
</div>
<!-- Castellano -->
<!--<div class="instructions-container"-->
<!--<p> <span class="panel-title" id="instructions-title" data-toggle="popover" data-original-title="" title="">Última actualización: Octubre 2018</span> </p>-->
<!--<div class="update">-->
<!--<p><strong>Versión 7</strong></p>-->
<!--<p>-->
<!--Esta nueva actualización para JMA K-Prox aumenta el rango de llaves de proximidad que se-->
<!--pueden duplicar. Algunas llaves que no podían ser copiadas en la versión anterior,-->
<!--pueden ahora ser copiadas utilizando la nueva opción de programación “full-copy”, la-->
<!--cual puede activarse presionado el botón COPY durante al menos 5 segundos.-->
<!--Este nuevo método alternativo de copia no permite que las llaves puedan ser-->
<!--reprogramadas. No obstante, al igual que la versión anterior, la reprogramación de las-->
<!--llaves de proximidad se mantiene mientras no se aplique el citado método, es decir,-->
<!--aplicando una pulsación corta (menos de 5 segundos) del botón COPY.-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
<div id="com-senscape-widget-bootloader-instance">
<p class="sample">Senscape Bootloader Widget goes here</p>
</div>
</div>
<!-- Right Column -->
<div class="col-md-3 col-pad10">
</div>
</div>
</div>
</div>
<!-- Keep this div hidden so it can be cloned and used by the Javascript -->
<div id="com-chilipeppr-workspace-sample-billboard" class="hidden">
<div class="billboard-content">
<h4 class="billboard-title" style="">Sample Workspace</h4>
<p class="billboard-url" style=""><a href="http://chilipeppr.com/sample">chilipeppr.com/sample</a>
</p>
<div class="billboard-imgcontain" style="">
<a href="http://chilipeppr.com/sample">
<div class="billboard-img" style="background-image: url('https://github.com/chilipeppr/workspace-sample/raw/master/billboard.png')" />
</a>
<div class="billboard-stats2">
</div>
</div>
<p class="billboard-desc">
A ChiliPeppr Workspace that lets you do stuff.
</p>
</div>
</div>
</body>
</html>