sideshow 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +7 -0
  2. data/.bowerrc +3 -0
  3. data/.csslintrc +37 -0
  4. data/.editorconfig +27 -0
  5. data/.gitattributes +1 -0
  6. data/.gitignore +23 -0
  7. data/BUILDING.md +4 -0
  8. data/CHANGELOG.md +47 -0
  9. data/Gulpfile.js +404 -0
  10. data/LICENSE +191 -0
  11. data/README.md +342 -0
  12. data/VERSION +1 -0
  13. data/bower.json +61 -0
  14. data/distr/dependencies/jazz.min.js +8 -0
  15. data/distr/dependencies/jquery.min.js +5 -0
  16. data/distr/dependencies/pagedown.min.js +1 -0
  17. data/distr/fonts/open-sans-family/opensans-bold.eot +0 -0
  18. data/distr/fonts/open-sans-family/opensans-bold.svg +1825 -0
  19. data/distr/fonts/open-sans-family/opensans-bold.ttf +0 -0
  20. data/distr/fonts/open-sans-family/opensans-bold.woff +0 -0
  21. data/distr/fonts/open-sans-family/opensans-bolditalic.eot +0 -0
  22. data/distr/fonts/open-sans-family/opensans-bolditalic.svg +1825 -0
  23. data/distr/fonts/open-sans-family/opensans-bolditalic.ttf +0 -0
  24. data/distr/fonts/open-sans-family/opensans-bolditalic.woff +0 -0
  25. data/distr/fonts/open-sans-family/opensans-extrabold.eot +0 -0
  26. data/distr/fonts/open-sans-family/opensans-extrabold.svg +1825 -0
  27. data/distr/fonts/open-sans-family/opensans-extrabold.ttf +0 -0
  28. data/distr/fonts/open-sans-family/opensans-extrabold.woff +0 -0
  29. data/distr/fonts/open-sans-family/opensans-extrabolditalic.eot +0 -0
  30. data/distr/fonts/open-sans-family/opensans-extrabolditalic.svg +1825 -0
  31. data/distr/fonts/open-sans-family/opensans-extrabolditalic.ttf +0 -0
  32. data/distr/fonts/open-sans-family/opensans-extrabolditalic.woff +0 -0
  33. data/distr/fonts/open-sans-family/opensans-italic.eot +0 -0
  34. data/distr/fonts/open-sans-family/opensans-italic.svg +1825 -0
  35. data/distr/fonts/open-sans-family/opensans-italic.ttf +0 -0
  36. data/distr/fonts/open-sans-family/opensans-italic.woff +0 -0
  37. data/distr/fonts/open-sans-family/opensans-light.eot +0 -0
  38. data/distr/fonts/open-sans-family/opensans-light.svg +1825 -0
  39. data/distr/fonts/open-sans-family/opensans-light.ttf +0 -0
  40. data/distr/fonts/open-sans-family/opensans-light.woff +0 -0
  41. data/distr/fonts/open-sans-family/opensans-lightitalic.eot +0 -0
  42. data/distr/fonts/open-sans-family/opensans-lightitalic.svg +1825 -0
  43. data/distr/fonts/open-sans-family/opensans-lightitalic.ttf +0 -0
  44. data/distr/fonts/open-sans-family/opensans-lightitalic.woff +0 -0
  45. data/distr/fonts/open-sans-family/opensans-regular.eot +0 -0
  46. data/distr/fonts/open-sans-family/opensans-regular.svg +1825 -0
  47. data/distr/fonts/open-sans-family/opensans-regular.ttf +0 -0
  48. data/distr/fonts/open-sans-family/opensans-regular.woff +0 -0
  49. data/distr/fonts/open-sans-family/opensans-semibold.eot +0 -0
  50. data/distr/fonts/open-sans-family/opensans-semibold.svg +1825 -0
  51. data/distr/fonts/open-sans-family/opensans-semibold.ttf +0 -0
  52. data/distr/fonts/open-sans-family/opensans-semibold.woff +0 -0
  53. data/distr/fonts/open-sans-family/opensans-semibolditalic.eot +0 -0
  54. data/distr/fonts/open-sans-family/opensans-semibolditalic.svg +1825 -0
  55. data/distr/fonts/open-sans-family/opensans-semibolditalic.ttf +0 -0
  56. data/distr/fonts/open-sans-family/opensans-semibolditalic.woff +0 -0
  57. data/distr/fonts/sideshow-fontface.min.css +1 -0
  58. data/distr/fonts/sideshow-icons/sideshow-icons.eot +0 -0
  59. data/distr/fonts/sideshow-icons/sideshow-icons.svg +16 -0
  60. data/distr/fonts/sideshow-icons/sideshow-icons.ttf +0 -0
  61. data/distr/fonts/sideshow-icons/sideshow-icons.woff +0 -0
  62. data/distr/sideshow.js +2510 -0
  63. data/distr/sideshow.min.js +10 -0
  64. data/distr/stylesheets/sideshow.min.css +1 -0
  65. data/docs/api.js +29 -0
  66. data/docs/assets/css/external-small.png +0 -0
  67. data/docs/assets/css/logo.png +0 -0
  68. data/docs/assets/css/main.css +783 -0
  69. data/docs/assets/favicon.png +0 -0
  70. data/docs/assets/img/spinner.gif +0 -0
  71. data/docs/assets/index.html +10 -0
  72. data/docs/assets/js/api-filter.js +52 -0
  73. data/docs/assets/js/api-list.js +251 -0
  74. data/docs/assets/js/api-search.js +98 -0
  75. data/docs/assets/js/apidocs.js +370 -0
  76. data/docs/assets/js/yui-prettify.js +17 -0
  77. data/docs/assets/vendor/prettify/CHANGES.html +130 -0
  78. data/docs/assets/vendor/prettify/COPYING +202 -0
  79. data/docs/assets/vendor/prettify/README.html +203 -0
  80. data/docs/assets/vendor/prettify/prettify-min.css +1 -0
  81. data/docs/assets/vendor/prettify/prettify-min.js +1 -0
  82. data/docs/classes/Arrow.html +541 -0
  83. data/docs/classes/Arrows.html +805 -0
  84. data/docs/classes/ControlVariables.html +1005 -0
  85. data/docs/classes/DetailsPanel.html +672 -0
  86. data/docs/classes/FadableItem.html +613 -0
  87. data/docs/classes/HidableItem.html +495 -0
  88. data/docs/classes/Mask.CloseButton.html +706 -0
  89. data/docs/classes/Mask.CompositeMask.html +721 -0
  90. data/docs/classes/Mask.CornerPart.html +613 -0
  91. data/docs/classes/Mask.Part.html +395 -0
  92. data/docs/classes/Mask.Polling.html +809 -0
  93. data/docs/classes/Mask.Subject.html +199 -0
  94. data/docs/classes/Mask.SubjectMask.html +417 -0
  95. data/docs/classes/Mask.WizardMenu.html +1401 -0
  96. data/docs/classes/SS.html +267 -0
  97. data/docs/classes/SSException.html +203 -0
  98. data/docs/classes/Screen.html +363 -0
  99. data/docs/classes/StepDescription.html +1025 -0
  100. data/docs/classes/StepDescriptionNextButton.html +746 -0
  101. data/docs/classes/VisualItem.html +339 -0
  102. data/docs/classes/Wizard.html +967 -0
  103. data/docs/files/c +0 -0
  104. data/docs/index.html +162 -0
  105. data/example.html +81 -0
  106. data/examples/images/clemenza.jpg +0 -0
  107. data/examples/images/doc_brown.png +0 -0
  108. data/examples/images/forkme.png +0 -0
  109. data/examples/images/fortes-logo.png +0 -0
  110. data/examples/images/sideshow-logo.png +0 -0
  111. data/examples/images/sideshow-logo.svg +155 -0
  112. data/examples/scripts/sideshow.config.js +2 -0
  113. data/examples/scripts/tutorials/introducing_sideshow.js +259 -0
  114. data/examples/stylesheets/example.min.css +1 -0
  115. data/examples/stylesheets/styl/example.styl +272 -0
  116. data/gulp/config.js +0 -0
  117. data/gulp/extensions/gulp-html-extend.js +151 -0
  118. data/gulp/tasks/.gitkeep +0 -0
  119. data/icons/iconfont.zip +0 -0
  120. data/package.json +56 -0
  121. data/sideshow.gemspec +20 -0
  122. data/sideshow.nuspec +72 -0
  123. data/sideshow.sublime-project +22 -0
  124. data/src/copyright_info.js +8 -0
  125. data/src/general/config.js +42 -0
  126. data/src/general/dictionary.js +42 -0
  127. data/src/general/exception.js +15 -0
  128. data/src/general/global_object.js +287 -0
  129. data/src/general/polling.js +151 -0
  130. data/src/general/screen.js +39 -0
  131. data/src/general/utility_functions.js +88 -0
  132. data/src/general/variables.js +42 -0
  133. data/src/interface_itens/fadable_item.js +55 -0
  134. data/src/interface_itens/hidable_item.js +32 -0
  135. data/src/interface_itens/visual_item.js +42 -0
  136. data/src/main.js +52 -0
  137. data/src/mask/composite_mask.js +193 -0
  138. data/src/mask/composite_mask_corner_part.js +105 -0
  139. data/src/mask/composite_mask_part.js +51 -0
  140. data/src/mask/mask.js +6 -0
  141. data/src/mask/subject_mask.js +34 -0
  142. data/src/step/arrow.js +88 -0
  143. data/src/step/arrows.js +155 -0
  144. data/src/step/step_description.js +165 -0
  145. data/src/step/step_description_next_button.js +55 -0
  146. data/src/step/step_details_panel.js +87 -0
  147. data/src/step/subject.js +100 -0
  148. data/src/wizard/wizard.js +395 -0
  149. data/src/wizard/wizard_control_variables.js +95 -0
  150. data/src/wizard/wizard_menu.js +101 -0
  151. data/stylesheets/_animations.styl +87 -0
  152. data/stylesheets/_font-face.styl +135 -0
  153. data/stylesheets/_icons.styl +27 -0
  154. data/stylesheets/_layout.styl +362 -0
  155. data/stylesheets/_mixins.styl +52 -0
  156. data/stylesheets/_variables.styl +35 -0
  157. data/stylesheets/sideshow-fontface.styl +4 -0
  158. data/stylesheets/sideshow.styl +7 -0
  159. data/yuidoc.json +15 -0
  160. metadata +246 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f7676b04e9e78fe701349274d1afd4c774a3820a
4
+ data.tar.gz: 00bb1933e79d298dca54726581f2fa1c98005463
5
+ SHA512:
6
+ metadata.gz: 25b46e11b23b60f893ae1e7cce1c61768151ac6ec26ee5833c056bc67cbe51d0fafaef9458324414ef3cb4bc69101e7a037efd054095058cd29add365e34b65a
7
+ data.tar.gz: 9516d1a113895f7a7d8fa10f1e61403e890b77250a7ecd8e9d8e7ec34b24d51c19cd3ee91f9b16ff273f3e532efdce1418165a28d36585b5e0a928828b5b3081
data/.bowerrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "directory": "bower_components"
3
+ }
data/.csslintrc ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "important": true,
3
+ "adjoining-classes": true,
4
+ "known-properties": true,
5
+ "box-sizing": true,
6
+ "box-model": true,
7
+ "overqualified-elements": true,
8
+ "display-property-grouping": true,
9
+ "bulletproof-font-face": true,
10
+ "compatible-vendor-prefixes": true,
11
+ "regex-selectors": true,
12
+ "errors": true,
13
+ "duplicate-background-images": true,
14
+ "duplicate-properties": true,
15
+ "empty-rules": true,
16
+ "selector-max-approaching": true,
17
+ "gradients": true,
18
+ "fallback-colors": true,
19
+ "font-sizes": true,
20
+ "font-faces": true,
21
+ "floats": true,
22
+ "star-property-hack": true,
23
+ "outline-none": true,
24
+ "import": true,
25
+ "ids": true,
26
+ "underscore-property-hack": true,
27
+ "rules-count": true,
28
+ "qualified-headings": true,
29
+ "selector-max": true,
30
+ "shorthand": true,
31
+ "text-indent": true,
32
+ "unique-headings": true,
33
+ "universal-selector": true,
34
+ "unqualified-attributes": true,
35
+ "vendor-prefix": true,
36
+ "zero-units": true
37
+ }
data/.editorconfig ADDED
@@ -0,0 +1,27 @@
1
+ # How could I live without http://EditorConfig.org ???
2
+ root = true
3
+
4
+ # All
5
+ [*]
6
+ charset = utf-8
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ indent_style = space
10
+ indent_size = 4
11
+
12
+ # Scripts
13
+ [*.js]
14
+ indent_size = 2
15
+
16
+ #JSON configuration files
17
+ [*.json]
18
+ indent_size = 2
19
+
20
+ # Ruby source files
21
+ [*.rb]
22
+ indent_size = 2
23
+
24
+ # Stylesheets
25
+ [*.css,*.scss]
26
+ indent_size = 2
27
+
data/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ * text=auto
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ #General
2
+ tmp/
3
+ sideshow.zip
4
+ sideshow.tar.gz
5
+
6
+ #Node/NPM related
7
+ node_modules
8
+ npm-debug.log
9
+
10
+ #Bower related
11
+ bower_components/
12
+
13
+ #Mac OS Files
14
+ .DS_Store
15
+
16
+ #Sublime specific
17
+ *.sublime-workspace
18
+
19
+ #NuGet Files
20
+ *.nupkg
21
+
22
+ #Ruby files
23
+ *.gem
data/BUILDING.md ADDED
@@ -0,0 +1,4 @@
1
+ #Building
2
+
3
+ *Important Note*
4
+ The entire build process has changed (from pure Shell script to Gulp, from Sass+Compass to Stylus, no more ruby, no more manual configuration...). I'll rewrite this markdown as soon as possible with a complete overview of the brand new build workflow.
data/CHANGELOG.md ADDED
@@ -0,0 +1,47 @@
1
+ #Version 0.4.1 the-hobbit (2014-11-27)
2
+
3
+ ##Fixes
4
+ After yanking the version 0.4.0 of the gem and removed the NuGet package too, I'm republishing them...
5
+
6
+ ------------------------------------------------------------
7
+
8
+ #Version 0.4.0 citizen-kane (2014-11-27)
9
+
10
+ ##General
11
+ Replaced old shell script build with Gulp
12
+ Replaced Sass+Compass with Stylus
13
+ Removed any Ruby dependency
14
+ Distributing Sideshow as a NuGet package, a Ruby Gem and a Bower component.
15
+
16
+ ##Fixes
17
+ Fixed a bug in the polling functions for monitoring subject and targets changes.
18
+
19
+ ------------------------------------------------------------
20
+
21
+ #Version 0.3.5 volver (2014-05-29)
22
+
23
+ ##General
24
+ - Added a translation to spanish (thanks for this translation Luis Alfaro de la Fuente!)
25
+
26
+ ##Fixes
27
+ - Fixing a bug with the option autoSkipIntro (when it's true), where in the end of a wizard an exception occurred and Sideshow couldn't close properly.
28
+ - Lifted up the target arrows, to avoid them to cover the target content.
29
+
30
+ ------------------------------------------------------------
31
+
32
+ #Version 0.3.4 the-untouchables (2014-05-28)
33
+
34
+ ##General
35
+ - Added a configuration option for skipping the intro screen (the tutorials list) if there's just one tutorial available for some context.
36
+
37
+ ------------------------------------------------------------
38
+
39
+ #Version 0.3.3 raging-bull (2014-01-10)
40
+
41
+ ##General
42
+ - Changed licensing to Apache License 2.0 (Now Sideshow is open source software bro! Yeah!!)
43
+ - Replaced Google Closure by UglifyJS; though Google Closure compress ratio is a higher (when in Advanced Mode), there are some issues with dead code detection and UglifyJS is considerably faster.
44
+ - Changed build script to resolve dependencies in a similar way as Sprocket does
45
+
46
+ ------------------------------------------------------------
47
+ There's no changelog before the 0.3.3 version since we became public in this version.
data/Gulpfile.js ADDED
@@ -0,0 +1,404 @@
1
+ //All Requires
2
+ var gulp = require('gulp'),
3
+ autoprefixer = require('gulp-autoprefixer'),
4
+ minifycss = require('gulp-minify-css'),
5
+ jshint = require('gulp-jshint'),
6
+ uglify = require('gulp-uglify'),
7
+ csslint = require('gulp-csslint'),
8
+ rename = require('gulp-rename'),
9
+ concat = require('gulp-concat'),
10
+ notify = require('gulp-notify'),
11
+ livereload = require('gulp-livereload'),
12
+ open = require('open'),
13
+ del = require('del'),
14
+ http = require('http'),
15
+ ecstatic = require('ecstatic'),
16
+ util = require('gulp-util'),
17
+ prettify = require('gulp-prettify'),
18
+ beautify = require('gulp-beautify'),
19
+ stylus = require('gulp-stylus'),
20
+ include = require('gulp-include'),
21
+ fs = require('fs'),
22
+ path = require('path'),
23
+ prompt = require('gulp-prompt'),
24
+ yuidoc = require('gulp-yuidoc'),
25
+ bower = require('gulp-bower'),
26
+ unzip = require('gulp-unzip'),
27
+ zip = require('gulp-zip'),
28
+ gzip = require('gulp-gzip'),
29
+ tar = require('gulp-tar'),
30
+ run = require('gulp-run'),
31
+ git = require('gift'),
32
+ repo = git('./'),
33
+ webserverPort = 8080,
34
+ isWin = /^win/.test(process.platform),
35
+ appRoot = path.resolve('.');
36
+ //config = require('./gulp/config');
37
+
38
+
39
+
40
+ /* Tasks (will be extracted to separated files) */
41
+
42
+ //Sideshow's main stylesheet
43
+ gulp.task('style', function(){
44
+ compileSideshowStylesheets()
45
+ });
46
+
47
+ //Examples pages Style task
48
+ gulp.task('examples-style', function(){
49
+ compileExamplesStylesheet();
50
+ });
51
+
52
+ //Bundle Nexit modules with Browserify
53
+ gulp.task('bundle-scripts', function(){
54
+ bundleScripts();
55
+ });
56
+
57
+ //Clean task
58
+ gulp.task('clean', function(cb) {
59
+ cleanFiles(cb);
60
+ });
61
+
62
+ //Watch Task
63
+ gulp.task('watch', function() {
64
+ pollForChanges();
65
+ });
66
+
67
+ //Webserver task
68
+ gulp.task('webserver', function(){
69
+ runDevelopmentWebServer();
70
+ });
71
+
72
+ //Default task
73
+ gulp.task('default', function() {
74
+ compileSideshowStylesheets();
75
+ compileExamplesStylesheet();
76
+ // gulp.start('examples-partials');
77
+ runDevelopmentWebServer();
78
+ pollForChanges();
79
+
80
+ setTimeout(function(){
81
+ openInBrowser(util.env.browser);
82
+ }, 3000);
83
+ });
84
+
85
+ gulp.task('update-version', function(){
86
+ updateVersionNumberReferences();
87
+ });
88
+
89
+ gulp.task('update-bower', function(){
90
+ updateBowerDependencies();
91
+ });
92
+
93
+ gulp.task('generate-docs', function() {
94
+ generateDocumentation();
95
+ });
96
+
97
+ gulp.task('prepare-build', ['update-version', 'update-bower','clean'], function() {
98
+ console.log('Remember to edit the CHANGELOG file before doing a complete build.');
99
+ });
100
+
101
+ gulp.task('complete-build', function() {
102
+ if(prompt.confirm('Did you run the prepare-build before this?')){
103
+ compileSideshowStylesheets();
104
+ compileExamplesStylesheet();
105
+ bundleScripts(function(){
106
+ generateDocumentation();
107
+ });
108
+ }
109
+ });
110
+
111
+
112
+ gulp.task('pack', function() {
113
+ zipDistributableFiles();
114
+ generatePackages();
115
+ });
116
+
117
+ function zipDistributableFiles(){
118
+ var distr = gulp.src(['./distr*/**/*', './examples*/**/*', 'example.html']);
119
+
120
+ distr
121
+ .pipe(zip('sideshow.zip'))
122
+ .pipe(gulp.dest('./'));
123
+
124
+ distr
125
+ .pipe(tar('sideshow.tar'))
126
+ .pipe(gzip())
127
+ .pipe(gulp.dest('./'));
128
+ }
129
+
130
+ function generatePackages(){
131
+ del(['*.gem', '*.nupkg'], function(){
132
+ repo.status(function(err, status){
133
+ if(Object.keys(status.files).length === 0){
134
+ var versionFilePath = path.join(appRoot, 'VERSION');
135
+
136
+ fs.readFile(versionFilePath, 'utf8', function(err, version) {
137
+ var versionNumber = version.match(/[\d.]+/);
138
+
139
+ gulp.src('./')
140
+ .pipe(run('git tag -a ' + version + ' -m \'' + version + '\''))
141
+ .pipe(run('git push --all origin'));
142
+
143
+
144
+ console.log('Building and pushing Sideshow gem');
145
+ gulp.src('./')
146
+ .pipe(run('gem build sideshow.gemspec'))
147
+ .pipe(run('gem push sideshow-' + versionNumber + '.gem'));
148
+
149
+ if(isWin){
150
+ console.log('Packing and pushing Sideshow nuget package');
151
+ gulp.src('./')
152
+ .pipe(run('nuget pack sideshow.nuspec'))
153
+ .pipe(run('nuget push sideshow.' + versionNumber + '.nupkg'));
154
+ }
155
+ });
156
+ } else {
157
+ console.log('Before packing a new version you must commit your changes.')
158
+ }
159
+ });
160
+ });
161
+ }
162
+
163
+ function updateBowerDependencies(){
164
+ bower()
165
+ .on('end', function(){
166
+ gulp.src('./bower_components/pagedown/index.zip')
167
+ .pipe(unzip())
168
+ .pipe(gulp.dest('./bower_components/pagedown'))
169
+ .on('end', function(){
170
+ gulp.src('./bower_components/pagedown/pagedown-*/Markdown.Converter.js')
171
+ .pipe(uglify())
172
+ .pipe(rename('pagedown.min.js'))
173
+ .pipe(gulp.dest('./distr/dependencies'));
174
+ });
175
+
176
+ gulp.src('./bower_components/jquery/dist/jquery.min.js')
177
+ .pipe(gulp.dest('./distr/dependencies'));
178
+ });
179
+ }
180
+
181
+ function compileSideshowStylesheets(){
182
+ return gulp.src('stylesheets/sideshow.styl')
183
+ .pipe(stylus())
184
+ .on('error', errorHandler('sideshow_stylesheet_compiling_error'))
185
+ .pipe(autoPrefixerConfig())
186
+ .on('error', errorHandler('sideshow_stylesheet_autoprefixing_error'))
187
+ .pipe(rename('sideshow.css'))
188
+ .pipe(gulp.dest('tmp'))
189
+ .pipe(csslint('.csslintrc'))
190
+ .pipe(csslint.reporter())
191
+ .pipe(rename({suffix: '.min'}))
192
+ .pipe(minifycss())
193
+ .pipe(gulp.dest('distr/stylesheets'));
194
+
195
+ //Font face stylesheet
196
+ gulp.src('stylesheets/sideshow-fontface.styl')
197
+ .pipe(stylus())
198
+ .on('error', errorHandler('fontface_stylesheet_compiling_error'))
199
+ .pipe(autoPrefixerConfig())
200
+ .on('error', errorHandler('fontface_stylesheet_autoprefixing_error'))
201
+ .pipe(rename('sideshow-fontface.min.css'))
202
+ .pipe(minifycss())
203
+ .pipe(gulp.dest('distr/fonts'));
204
+ }
205
+
206
+ function compileExamplesStylesheet(){
207
+ return gulp.src('examples/stylesheets/styl/example.styl')
208
+ .pipe(stylus())
209
+ .on('error', errorHandler('examples_stylesheet_compiling_error'))
210
+ .pipe(autoPrefixerConfig())
211
+ .on('error', errorHandler('examples_stylesheet_autoprefixing_error'))
212
+ .pipe(rename('example.css'))
213
+ .pipe(gulp.dest('tmp'))
214
+ .pipe(csslint('.csslintrc'))
215
+ .pipe(csslint.reporter())
216
+ .pipe(rename({suffix: '.min'}))
217
+ .pipe(minifycss())
218
+ .pipe(gulp.dest('examples/stylesheets'));
219
+ }
220
+
221
+ function bundleScripts(endCallback){
222
+ return gulp.src('./src/main.js')
223
+ .pipe(include())
224
+ .on('error', errorHandler('jsbuild_error'))
225
+ .pipe(rename('sideshow.js'))
226
+ .pipe(beautify({indentSize: 2}))
227
+ .pipe(gulp.dest('distr/'))
228
+ .pipe(rename({suffix: '.min'}))
229
+ .pipe(uglify())
230
+ .pipe(gulp.dest('./distr/'))
231
+ .on('end', function(){
232
+ //adding copyright message in the expanded version
233
+ gulp.src(['./src/copyright_info.js', './distr/sideshow.js'])
234
+ .pipe(concat('sideshow.js'))
235
+ .pipe(gulp.dest('./distr/'));
236
+
237
+ //adding copyright message in the minified version
238
+ gulp.src(['./src/copyright_info.js', './distr/sideshow.min.js'])
239
+ .pipe(concat('sideshow.min.js'))
240
+ .pipe(gulp.dest('./distr/'));
241
+
242
+ if(endCallback) endCallback();
243
+ });
244
+ }
245
+
246
+ function cleanFiles(cb){
247
+ del(['distr/*.js', 'tmp/*', 'docs/**/*'], cb);
248
+ }
249
+
250
+ function pollForChanges(){
251
+ gulp.watch('src/**/*.js', ['bundle-scripts']);
252
+ gulp.watch('stylesheets/**/*.styl', ['style', 'examples-style']);
253
+ gulp.watch('examples/stylesheets/styl/**/*.styl', ['examples-style']);
254
+ gulp.watch('examples/partials/**/*.html', ['examples-partials']);
255
+
256
+ // Create LiveReload server
257
+ livereload.listen();
258
+
259
+ // Watch any files in distr/, reload on change
260
+ gulp.watch(['examples/stylesheets/example.min.css', 'distr/**']).on('change', function(){
261
+ livereload.changed();
262
+ notify('Changed.');
263
+ });
264
+
265
+ notify('Running livereload.');
266
+ }
267
+
268
+ function runDevelopmentWebServer(){
269
+ http.createServer(
270
+ ecstatic({ root: __dirname })
271
+ ).listen(webserverPort);
272
+
273
+ notify('Web server started. Listening on port ' + webserverPort + '.');
274
+ }
275
+
276
+ function openInBrowser(browser){
277
+ function go(browser){
278
+ return open('http://localhost:' + webserverPort + '/example.html', browser);
279
+ }
280
+
281
+ if (browser != 'none'){
282
+ if(browser == 'all'){
283
+ go('firefox');
284
+ go('opera');
285
+ go('safari');
286
+ go('chrome');
287
+ } else if (browser)
288
+ go(browser);
289
+ else
290
+ go('firefox');
291
+ }
292
+ }
293
+
294
+ function updateVersionNumberReferences(){
295
+ var version = util.env.version || (function(){ throw "A version number must be passed. Please inform the '--version' argument."; })(),
296
+ name = util.env.name || (function(){ throw "A version name must be passed. Please inform the '--name' argument."; })(),
297
+ appRoot = path.resolve('.'),
298
+ versionFilePath = path.join(appRoot, 'VERSION'),
299
+ yuidocFilePath = path.join(appRoot, 'yuidoc.json'),
300
+ bowerFilePath = path.join(appRoot, 'bower.json'),
301
+ gemspecFilePath = path.join(appRoot, 'sideshow.gemspec'),
302
+ nuspecFilePath = path.join(appRoot, 'sideshow.nuspec'),
303
+ packageJsonFilePath = path.join(appRoot, 'package.json'),
304
+ changelogFilePath = path.join(appRoot, 'CHANGELOG.md'),
305
+ copyrightInfoFilePath = path.join(appRoot, 'src', 'copyright_info.js'),
306
+ variablesFilePath = path.join(appRoot, 'src', 'general', 'variables.js'),
307
+ releaseDate = new Date().toISOString().slice(0,10);
308
+
309
+ //VERSION file
310
+ fs.readFile(versionFilePath, 'utf8', function(err, data) {
311
+ if (err) throw err;
312
+
313
+ fs.writeFile(versionFilePath, 'v' + version + '-' + name);
314
+ });
315
+
316
+ //yuidoc.json
317
+ fs.readFile(yuidocFilePath, 'utf8', function(err, data) {
318
+ if (err) throw err;
319
+
320
+ var json = JSON.parse(data);
321
+ json.version = version;
322
+
323
+ fs.writeFile(yuidocFilePath, JSON.stringify(json, null, 4));
324
+ });
325
+
326
+ //bower.json
327
+ fs.readFile(bowerFilePath, 'utf8', function(err, data) {
328
+ if (err) throw err;
329
+
330
+ var json = JSON.parse(data);
331
+ json.version = version;
332
+
333
+ fs.writeFile(bowerFilePath, JSON.stringify(json, null, 4));
334
+ });
335
+
336
+ //package.json
337
+ fs.readFile(packageJsonFilePath, 'utf8', function(err, data) {
338
+ if (err) throw err;
339
+
340
+ var json = JSON.parse(data);
341
+ json.version = version;
342
+
343
+ fs.writeFile(packageJsonFilePath, JSON.stringify(json, null, 4));
344
+ });
345
+
346
+ //sideshow.gemspec
347
+ fs.readFile(gemspecFilePath, 'utf8', function(err, data) {
348
+ if (err) throw err;
349
+
350
+ fs.writeFile(gemspecFilePath, data.replace(/(s.version\s+=\s+)('[\d.]+')/, "$1'" + version + "'"));
351
+ });
352
+
353
+ //copyright_info.js
354
+ fs.readFile(copyrightInfoFilePath, 'utf8', function(err, data) {
355
+ if (err) throw err;
356
+
357
+ fs.writeFile(copyrightInfoFilePath, data
358
+ .replace(/(Version: )([\d.]+)/, '$1' + version)
359
+ .replace(/(Date: )([\d-]+)/, '$1' + releaseDate));
360
+ });
361
+
362
+ //CHANGELOG file
363
+ fs.readFile(changelogFilePath, 'utf8', function(err, data) {
364
+ if (err) throw err;
365
+
366
+ if(data.indexOf('#Version '+ version) == -1){
367
+ var versionChangelogText = '#Version ' + version + ' ' + name + ' (' + releaseDate + ')' +
368
+ '\n\n##General' +
369
+ '\n\n##Fixes\n\n' +
370
+ Array(61).join('-') + '\n\n';
371
+
372
+ fs.writeFile(changelogFilePath, versionChangelogText + data);
373
+ }
374
+ });
375
+
376
+ fs.readFile(variablesFilePath, 'utf8', function(err, data) {
377
+ if (err) throw err;
378
+
379
+ fs.writeFile(variablesFilePath, data.replace(/(get VERSION\(\) {\s+return )("[\d.]+")/, '$1"' + version + '"'));
380
+ });
381
+
382
+ fs.readFile(nuspecFilePath, 'utf8', function(err, data) {
383
+ if (err) throw err;
384
+
385
+ fs.writeFile(nuspecFilePath, data.replace(/(<version>)([\d.]+)(<\/version>)/, '$1' + version + '$3'));
386
+ });
387
+ }
388
+
389
+ function generateDocumentation(){
390
+ return gulp.src("./distr/sideshow.js")
391
+ .pipe(yuidoc())
392
+ .pipe(gulp.dest("./docs"));
393
+ }
394
+
395
+ function errorHandler(title){
396
+ return function(error){
397
+ console.log((title || 'Error') + ': ' + error.message);
398
+ notify((title || 'Error') + ': ' + error.message);
399
+ };
400
+ }
401
+
402
+ function autoPrefixerConfig(){
403
+ return autoprefixer('last 2 version', 'safari 5', 'ie 9', 'opera 12.1', 'ios 6', 'android 4');
404
+ }