Skip to content

Commit 624502e

Browse files
committed
Switch to using the new steal
This makes Syn use the new steal, which will allow us to use the new Pluginify for builds, as well as use an alternative syntax if we want. Fixes #58
1 parent cc965bd commit 624502e

29 files changed

+2357
-6521
lines changed

Gruntfile.js

+14-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,18 @@ module.exports = function (grunt) {
1010
}
1111
}
1212
},
13-
exec: {
14-
pluginify: {
15-
command: 'node build.js'
13+
stealPluginify: {
14+
src: {
15+
options: {
16+
system: {
17+
config: __dirname + "/stealconfig.js",
18+
main: 'src/syn'
19+
},
20+
ignore: []
21+
},
22+
files: [{
23+
dest: __dirname + "/build/syn.js"
24+
}]
1625
}
1726
},
1827
concat: {
@@ -69,11 +78,11 @@ module.exports = function (grunt) {
6978
grunt.loadNpmTasks('grunt-contrib-concat');
7079
grunt.loadNpmTasks('grunt-contrib-jshint');
7180
grunt.loadNpmTasks('grunt-contrib-uglify');
72-
grunt.loadNpmTasks('grunt-exec');
7381
grunt.loadNpmTasks('grunt-jsbeautifier');
7482
grunt.loadNpmTasks('testee');
83+
grunt.loadNpmTasks('steal-tools');
7584

7685
grunt.registerTask('quality', ['jsbeautifier', 'jshint']);
77-
grunt.registerTask('build', ['exec:pluginify', 'concat', 'uglify']);
86+
grunt.registerTask('build', ['stealPluginify', 'concat', 'uglify']);
7887
grunt.registerTask('test', ['connect:server', 'testee']);
7988
};

bower.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
"jquerypp": "1.0.x",
2424
"qunit": "1.10.x",
2525
"canjs": "2.0.x",
26-
"bootstrap": "3.0.x"
26+
"bootstrap": "3.0.x",
27+
"steal": "~0.2.2"
2728
},
2829
"ignore": [
29-
"/build.js",
3030
"stealconfig.js",
3131
"/test",
32-
"/steal",
3332
"/drag",
3433
"/demo",
3534
"/*.js",

build.js

-30
This file was deleted.

demo/demo.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
</div>
9393
</div>
9494

95-
<script src="../steal/steal.js?demo"></script>
95+
<script src="../lib/steal/steal.js?demo"
96+
data-config="../stealconfig.js"></script>
9697
</body>
97-
</html>
98+
</html>

demo/demo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ function($, Drag, Control) {
5555
});
5656

5757
new Demo(document);
58-
});
58+
});

demo/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
<pre id="code">Click the tabs above to create replay code.</pre>
7070
</div>
7171

72-
<script src="../steal/steal.js?demo/record.js"></script>
72+
<script src="../lib/steal/steal.js?demo/record.js"
73+
data-config="../stealconfig.js"></script>
7374
</body>
74-
</html>
75+
</html>

demo/record.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
steal('jquery', 'can/control', 'src/syn.js', function($, Control, Syn) {
1+
steal('jquery', 'can/control', 'src/syn.js', function($, Control, syn) {
22
var Resize = can.Control.extend({
33
init: function() {
44
this.resize();
@@ -17,7 +17,7 @@ steal('jquery', 'can/control', 'src/syn.js', function($, Control, Syn) {
1717

1818
//Safari doesn't send mouse/click on option
1919
$(function() {
20-
Syn.autoDelay = true;
20+
syn.autoDelay = true;
2121
REPLAY = false;
2222
ADD = true;
2323

@@ -61,7 +61,7 @@ steal('jquery', 'can/control', 'src/syn.js', function($, Control, Syn) {
6161
func && args.push('Recorder.cb('+i+')');
6262

6363
text.push(func ? '':'<div>',
64-
i > 0 ? ' .' : 'Syn.',
64+
i > 0 ? ' .' : 'syn.',
6565
command.type,
6666
'(',
6767
args.join(', '),
@@ -95,8 +95,8 @@ steal('jquery', 'can/control', 'src/syn.js', function($, Control, Syn) {
9595
},
9696

9797
getKey: function(code) {
98-
for(var key in Syn.keycodes) {
99-
if(Syn.keycodes[key] === code) {
98+
for(var key in syn.keycodes) {
99+
if(syn.keycodes[key] === code) {
100100
return key;
101101
}
102102
}
@@ -136,7 +136,7 @@ steal('jquery', 'can/control', 'src/syn.js', function($, Control, Syn) {
136136

137137
keyup: function(ev) {
138138
var key = h.getKey(ev.keyCode);
139-
if(Syn.key.isSpecial(ev.keyCode)) {
139+
if(syn.key.isSpecial(ev.keyCode)) {
140140
h.showChar(key+'-up', ev.target);
141141
}
142142

@@ -170,7 +170,7 @@ steal('jquery', 'can/control', 'src/syn.js', function($, Control, Syn) {
170170
selector += '.'+target.className.split(' ')[0];
171171
}
172172

173-
var others = jQuery(selector, Syn.helpers.getWindow(target).document);
173+
var others = jQuery(selector, syn.helpers.getWindow(target).document);
174174

175175
if(others.length > 1) {
176176
return selector+':eq('+others.index(target)+')';
@@ -254,4 +254,4 @@ steal('jquery', 'can/control', 'src/syn.js', function($, Control, Syn) {
254254
$('#code div').css('color','gray')
255255
});
256256
});
257-
});
257+
});

0 commit comments

Comments
 (0)