Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit 18317b7

Browse files
committed
feat(demo): update demo to Angular UI Publisher 1.2.x
Merge branch 'douglasduteil-feat-publisher-1.2' Closes #34
2 parents 0de1417 + a856e08 commit 18317b7

File tree

5 files changed

+68
-70
lines changed

5 files changed

+68
-70
lines changed

bower.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"codemirror": "~3.19.0"
2626
},
2727
"devDependencies": {
28-
"angular-mocks": ">=1.0.x",
29-
"angular-ui-bootstrap-bower": "~0.5.0"
28+
"angular-mocks": ">=1.0.x"
3029
}
3130
}

demo/demo.html

+60-62
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,57 @@
11
<section id="codemirror" ng-app="doc.ui-codeMirror">
22

3-
43
<!-- =Minimal code
54
--------------------------------------------------------------------------- -->
6-
<div id="demo-mini" class="row">
7-
<div class="span12">
8-
<div class="page-header">
9-
<h1>Minimal code</h1>
5+
<div id="demo-mini">
6+
<div class="page-header">
7+
<h1>Minimal code</h1>
8+
</div>
9+
<div class="row">
10+
<div class="col-md-6">
11+
<div ui-codemirror>Code mirror here</div>
1012
</div>
11-
<div class="row">
12-
<div class="span6">
13-
<div ui-codemirror>Code mirror here</div>
14-
</div>
1513

16-
<div class="span6" ng-controller="PlunkerCtrl"
17-
ng-init="
14+
<div class="col-md-6" ng-controller="PlunkerCtrl"
15+
ng-init="
1816
vendor_css=['http://codemirror.net/lib/codemirror.css'];
1917
vendor_js=['http://codemirror.net/lib/codemirror.js'];
20-
"
21-
>
22-
<div class="pull-right">
23-
<button class="btn btn-info" ng-click="edit('1.0.7', 'UI.Codemirror', 'ui-codemirror')">
24-
<i class="icon-edit icon-white"></i> Edit in plunker
25-
</button>
26-
</div>
18+
"
19+
>
20+
<div class="pull-right">
21+
<button class="btn btn-info" ng-click="edit('1.2.6', 'UI.Codemirror', 'ui-codemirror')">
22+
<i class="glyphicon glyphicon-edit"></i> Edit in plunker
23+
</button>
24+
</div>
2725

28-
<tabset>
29-
<tab heading="Markup">
30-
<div plunker-content="markup">
26+
<tabset>
27+
<tab heading="Markup">
28+
<div plunker-content="markup">
3129
<pre class="prettyprint">&lt;section&gt;
32-
3330
&lt;div ui-codemirror &gt;Code mirror here&lt;/div&gt;
34-
3531
&lt;/section&gt;</pre>
36-
</div>
37-
</tab>
38-
</tabset>
39-
</div>
32+
</div>
33+
</tab>
34+
</tabset>
4035
</div>
4136
</div>
4237
</div>
4338

4439

4540
<!-- =General options demo
4641
--------------------------------------------------------------------------- -->
47-
<div id="demo-general" class="row">
48-
<div class="span12">
49-
<div class="page-header">
50-
<h1>General options</h1>
51-
</div>
52-
<div class="row">
53-
<div class="span6">
54-
<div ui-codemirror="{
55-
lineNumbers: true,
56-
theme:'twilight',
57-
readOnly: 'nocursor',
58-
lineWrapping : true,
59-
mode: 'xml'
60-
}">&lt;html style=&quot;color: green&quot;&gt;
42+
<div id="demo-general">
43+
<div class="page-header">
44+
<h1>General options</h1>
45+
</div>
46+
<div class="row">
47+
<div class="col-md-6">
48+
<div ui-codemirror="{
49+
lineNumbers: true,
50+
theme:'twilight',
51+
readOnly: 'nocursor',
52+
lineWrapping : true,
53+
mode: 'xml'
54+
}">&lt;html style=&quot;color: green&quot;&gt;
6155
&lt;!-- this is a comment --&gt;
6256
&lt;head&gt;
6357
&lt;title&gt;HTML Example&lt;/title&gt;
@@ -67,23 +61,23 @@ <h1>General options</h1>
6761
I mean&amp;quot;&lt;/em&gt;... but might not match your style.
6862
&lt;/body&gt;
6963
&lt;/html&gt;</div>
70-
</div>
64+
</div>
7165

72-
<div class="span6" ng-controller="PlunkerCtrl"
73-
ng-init="
66+
<div class="col-md-6" ng-controller="PlunkerCtrl"
67+
ng-init="
7468
vendor_css=['http://codemirror.net/lib/codemirror.css', 'http://codemirror.net/theme/twilight.css'];
7569
vendor_js=['http://codemirror.net/lib/codemirror.js', 'http://codemirror.net/mode/xml/xml.js'];
76-
"
77-
>
78-
<div class="pull-right">
79-
<button class="btn btn-info" ng-click="edit('1.0.7', 'UI.Codemirror', 'ui-codemirror')">
80-
<i class="icon-edit icon-white"></i> Edit in plunker
81-
</button>
82-
</div>
70+
"
71+
>
72+
<div class="pull-right">
73+
<button class="btn btn-info" ng-click="edit('1.2.6', 'UI.Codemirror', 'ui-codemirror')">
74+
<i class="glyphicon glyphicon-edit"></i> Edit in plunker
75+
</button>
76+
</div>
8377

84-
<tabset>
85-
<tab heading="Markup">
86-
<div plunker-content="markup">
78+
<tabset>
79+
<tab heading="Markup">
80+
<div plunker-content="markup">
8781
<pre class="prettyprint">&lt;section&gt;
8882
&lt;div ui-codemirror=&quot;{
8983
lineNumbers: true,
@@ -101,26 +95,28 @@ <h1>General options</h1>
10195
I mean&amp;amp;quot;&amp;lt;/em&amp;gt;... but might not match your style.
10296
&amp;lt;/body&amp;gt;
10397
&amp;lt;/html&amp;gt;&lt;/div&gt;
104-
10598
&lt;/section&gt;</pre>
10699
</div>
107100
</tab>
108101
</tabset>
109102
</div>
110103
</div>
111-
</div>
112104
</div>
113105

114106

115107
<!-- =Mode-Changing demo
116108
--------------------------------------------------------------------------- -->
117-
<div id="demo-mode-changing" class="row">
118-
<div class="span12" ng-controller="CodemirrorCtrl">
109+
<div id="demo-mode-changing">
119110
<div class="page-header">
120111
<h1>Mode-Changing demo</h1>
121112
</div>
122-
<textarea ui-codemirror="cmOption" ng-model="cmModel"></textarea>
123-
Mode : <select ng-model="mode" ng-options="m for m in modes" ng-change="modeChanged()"></select>
113+
<div class="row" ng-controller="CodemirrorCtrl">
114+
<div class="col-md-12">
115+
<textarea ui-codemirror="cmOption" ng-model="cmModel"></textarea>
116+
</div>
117+
<div class="col-md-6">
118+
Mode : <select class="form-control" ng-model="mode" ng-options="m for m in modes" ng-change="modeChanged()"></select>
119+
</div>
124120
</div>
125121
</div>
126122

@@ -135,8 +131,8 @@ <h1>Mode-Changing demo</h1>
135131
"
136132
>
137133
<div class="pull-right">
138-
<button class="btn btn-info" ng-click="edit('1.0.7', 'UI.Codemirror', 'ui-codemirror')">
139-
<i class="icon-edit icon-white"></i> Edit in plunker
134+
<button class="btn btn-info" ng-click="edit('1.2.6', 'UI.Codemirror', 'ui-codemirror')">
135+
<i class="glyphicon glyphicon-edit"></i> Edit in plunker
140136
</button>
141137
</div>
142138

@@ -150,6 +146,8 @@ <h1>Mode-Changing demo</h1>
150146
Mode : &lt;select ng-model=&quot;mode&quot; ng-options=&quot;m for m in modes&quot; ng-change=&quot;modeChanged()&quot;&gt;&lt;/select&gt;
151147

152148
&lt;/section&gt;</pre>
149+
150+
<div style="margin-top: 450px;"></div>
153151
</div>
154152
</tab>
155153
<tab heading="JavaScript">

gruntFile.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ module.exports = function (grunt) {
6060
demo: {
6161
files: ['demo/*', 'publish.js'],
6262
tasks: ['jshint', 'build:gh-pages']
63+
},
64+
livereload: {
65+
files: ['out/built/gh-pages/**/*'],
66+
options: { livereload: true }
6367
}
6468
},
6569

@@ -72,10 +76,8 @@ module.exports = function (grunt) {
7276
connect: {
7377
options: {
7478
base : 'out/built/gh-pages',
75-
port: grunt.option('port') || '8000',
76-
hostname: grunt.option('host') || 'localhost',
77-
open: 'http://<%= connect.options.hostname %>:<%= connect.options.port %>',
78-
livereload: grunt.option('port') || '8000'
79+
open: true,
80+
livereload: true
7981
},
8082
server: { options: { keepalive: true } },
8183
continuous: { options: { keepalive: false } }

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"main": "./ui-codemirror.js",
99
"dependencies": {},
1010
"devDependencies": {
11-
"angular-ui-publisher": "~1.x",
11+
"angular-ui-publisher": "1.2.x",
1212
"grunt": "~0.4.2",
1313
"grunt-contrib-connect": "~0.5.0",
1414
"grunt-contrib-copy": "~0.4.1",

publish.js

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var path = require('path');
88
module.exports = function() {
99

1010
var js_dependencies =[
11-
'bower_components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.min.js',
1211
'bower_components/codemirror/lib/codemirror.js',
1312
'bower_components/codemirror/mode/scheme/scheme.js',
1413
'bower_components/codemirror/mode/javascript/javascript.js',

0 commit comments

Comments
 (0)