Skip to content

Commit

Permalink
fixed basic examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Cerem Cem ASLAN committed Aug 23, 2017
1 parent e92addb commit e6348e8
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 62 deletions.
2 changes: 1 addition & 1 deletion scada.js
5 changes: 3 additions & 2 deletions webapps/html-js/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Compile with `gulp --app template --webapp html-js`
Open {{scada_path}}/template/html-js with your browser.
Compile with `gulp --webapp html-js`

Open `scada.js/build/html-js/index.html` with your browser.
17 changes: 10 additions & 7 deletions webapps/html-js/app.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<p> Hello world!</p>
<h1 class="ui centered header"> Hello {{name}}!</h1>

<p> You can use Ractive here. Type your name <input value="{{ name }}" placeholder="here" /> </p>
<div class="ui segment">
You can use Ractive here. Type your name <div class="ui input" >
<input value="{{ name }}" placeholder="here" /></div>
</div>

<h3> Hello {{ name }}! </h3>
<p>
<i class="large icon dashboard" />
Any built-in components (look at scada.js/components) will also work as usual
</p>

<panel>
<p> <icon-dashboard /> Any built-in components (look at /src/client/components) will also work as usual </p>
<example-component></example-component>
</panel>
<slider inline value="{{x}}" /> <progress type="circle" value="{{x}}"></progress>
7 changes: 4 additions & 3 deletions webapps/html-js/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
require('components');

var ractive = new Ractive({
el: '#main-output',
new Ractive({
el: 'body',
template: RACTIVE_PREPARSE('app.html'),
data: {
name: "guest"
name: "world",
x: 35
}
});
12 changes: 3 additions & 9 deletions webapps/html-js/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
<!DOCTYPE html>
<html lang="en-GB" moznomarginboxes mozdisallowselectionprint>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
<link rel="icon" href="/favicon.ico">
<title>bare html javascript example</title>
<title>ScadaJS html-js example</title>
<script src="js/vendor.js"></script>
<link rel="stylesheet" href="css/vendor.css">
</head>
<body>
<div id="main-output">Loading...</div>
<h2 class="ui centered header">Loading...</h2>
<script src="app.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions webapps/html-ls/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Compile with `gulp --app template --webapp html-ls`
Open {{scada_path}}/template/html-ls with your browser.
Compile with `gulp --webapp html-ls`

Open `scada.js/build/html-ls/index.html` with your browser.
17 changes: 10 additions & 7 deletions webapps/html-ls/app.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<p> Hello world!</p>
<h1 class="ui centered header"> Hello {{name}}!</h1>

<p> You can use Ractive here. Type your name <input value="{{ name }}" placeholder="here" /> </p>
<div class="ui segment">
You can use Ractive here. Type your name <div class="ui input" >
<input value="{{ name }}" placeholder="here" /></div>
</div>

<h3> Hello {{ name }}! </h3>
<p>
<i class="large icon dashboard" />
Any built-in components (look at scada.js/components) will also work as usual
</p>

<panel>
<p> <icon-dashboard /> Any built-in components (look at /src/client/components) will also work as usual </p>
<example-component></example-component>
</panel>
<slider inline value="{{x}}" /> <progress type="circle" value="{{x}}"></progress>
7 changes: 4 additions & 3 deletions webapps/html-ls/app.ls
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require! components

ractive = new Ractive do
el: '#main-output'
new Ractive do
el: \body
template: RACTIVE_PREPARSE('app.html')
data:
name: "guest"
name: "world"
x: 35
12 changes: 3 additions & 9 deletions webapps/html-ls/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
<!DOCTYPE html>
<html lang="en-GB" moznomarginboxes mozdisallowselectionprint>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
<link rel="icon" href="/favicon.ico">
<title>html livescript template</title>
<title>ScadaJS html-ls example</title>
<script src="js/vendor.js"></script>
<link rel="stylesheet" href="css/vendor.css">
</head>
<body>
<div id="main-output">Loading...</div>
<h2 class="ui centered header">Loading...</h2>
<script src="app.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions webapps/pug-ls/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Compile with `gulp --app template --webapp pug-ls`
Open {{scada_path}}/template/pug-ls with your browser.
Compile with `gulp --webapp pug-ls`

Open `scada.js/build/pug-ls/index.html` with your browser.
7 changes: 4 additions & 3 deletions webapps/pug-ls/app.ls
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require! components

ractive = new Ractive do
el: '#main-output'
new Ractive do
el: \body
template: RACTIVE_PREPARSE('app.pug')
data:
name: "guest"
name: "world"
x: 35
21 changes: 9 additions & 12 deletions webapps/pug-ls/app.pug
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
h1 Livescript + Pug example
h2.ui.centered.header Hello {{name}}!

p Hello world!
.ui.segment
| You can use Ractive here. Type your name
.ui.input: input(value="{{name}}" placeholder="here")

p You can use Ractive here. Type your name #[input(value="{{ name }}" placeholder="here")]
p
i.large.icon.dashboard
| Any built-in components (look at scada.js/components) will also work as usual

h3 Hello {{ name }}!


panel
p.
#[icon-dashboard] Any built-in components (look at /src/client/components)
will also work as usual if you #[code require! components]

example-component
slider(inline value="{{x}}")
progress(type="circle" value="{{x}}")
8 changes: 6 additions & 2 deletions webapps/pug-ls/index.pug
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
extends ../../../../src/client/templates/template.pug
extends ../../scada.js/templates/template.pug

block title
title #{app}
title pug + ls example

block app
script(src="app.js")

0 comments on commit e6348e8

Please sign in to comment.