Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
klembot committed Apr 12, 2015
1 parent 00bc701 commit 86a484b
Show file tree
Hide file tree
Showing 41 changed files with 1,629 additions and 125 deletions.
20 changes: 11 additions & 9 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
syntax: glob
*.swp
index.html
node_modules/*
dist/*
doc/*
.tmp/*
*.DS_Store
.idea
syntax: glob
*.swp
index.html
node_modules/*
dist/*
doc/*
.tmp/*
*.DS_Store
.idea
cache
dist-apps
59 changes: 47 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = function (grunt)
pkg: grunt.file.readJSON('package.json'),

jshint: {
all: ['js/**'],
all: ['js/**/*.js'],
options: {
globals: {
// Libraries
Expand All @@ -18,9 +18,16 @@ module.exports = function (grunt)
saveAs: true,
SVG: true,
JSZip: true,
UUID: true,
XDate: true,
// Misc.
app: true,
global: true,
nwui: true,
process: true,
require: true,
ui: true,
EventedLocalStorage: true,
TransRegion: true,
TwineRouter: true,
// Collections
Expand Down Expand Up @@ -128,32 +135,55 @@ module.exports = function (grunt)
{
files:
[
{ expand: true, src: ['index.html'], dest: 'dist/' }
{ expand: true, src: ['index.html'], dest: 'dist/html/' }
]
},

resources:
{
files:
[
{ expand: true, src: ['img/*.ico'], dest: 'dist/rsrc/' },
{ expand: true, src: ['img/*.png'], dest: 'dist/rsrc/' },
{ expand: true, src: ['img/*.svg'], dest: 'dist/rsrc/' },
{ expand: true, cwd: 'fonts', src: ['*'], dest: 'dist/rsrc/fonts/' },
{ expand: true, cwd: 'storyformats', src: ['**'], dest: 'dist/storyformats' },
{ expand: true, cwd: 'lib/fontawesome/fonts', src: ['*'], dest: 'dist/rsrc/fonts/' }
{ expand: true, src: ['img/*.ico'], dest: 'dist/html/rsrc/' },
{ expand: true, src: ['img/*.png'], dest: 'dist/html/rsrc/' },
{ expand: true, src: ['img/*.svg'], dest: 'dist/html/rsrc/' },
{ expand: true, cwd: 'fonts', src: ['*'], dest: 'dist/html/rsrc/fonts/' },
{ expand: true, cwd: 'storyformats', src: ['**'], dest: 'dist/html/storyformats' },
{ expand: true, cwd: 'lib/fontawesome/fonts', src: ['*'], dest: 'dist/html/rsrc/fonts/' }
]
},

license:
{
files:
[
{ expand: true, src: ['LICENSE'], dest: 'dist/' }
{ expand: true, src: ['LICENSE'], dest: 'dist/html/' }
]
},

package:
{
files:
[
{ expand: true, src: ['package.json'], dest: 'dist/html/' }
]
}
},

nodewebkit:
{
src:
['dist/**/*'],
options:
{
buildDir: 'dist/apps/',
buildType: 'versioned',
'chromium-args': '--enable-threaded-compositing',
macIcns: 'img/logo.icns',
platforms: ['win', 'osx', 'linux'],
winIco: 'img/logo.ico'
},
},

replace:
{
blockUseminCdn:
Expand Down Expand Up @@ -181,12 +211,12 @@ module.exports = function (grunt)
useminPrepare:
{
html: 'index.html',
options: { dest: 'dist' }
options: { dest: 'dist/html/' }
},

usemin:
{
html: 'dist/index.html'
html: 'dist/html/index.html'
},

watch:
Expand Down Expand Up @@ -226,9 +256,10 @@ module.exports = function (grunt)
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-node-webkit-builder');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-usemin');
grunt.registerTask('default', ['bake']);
grunt.registerTask('default', ['jshint', 'bake']);
grunt.registerTask('release',
[
'clean', 'jshint', 'bake', 'yuidoc', 'copy', 'useminPrepare', 'concat', 'uglify', 'cssmin', 'usemin'
Expand All @@ -241,5 +272,9 @@ module.exports = function (grunt)
[
'bake', 'jshint', 'cdnify'
]);
grunt.registerTask('release-nw',
[
'clean', 'jshint', 'bake', 'yuidoc', 'copy', 'useminPrepare', 'concat', 'uglify', 'cssmin', 'usemin', 'nodewebkit'
]);
grunt.registerTask('server', ['connect']);
};
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ You need [Grunt](http://gruntjs.com) to continue. Run `npm install -g grunt-cli`
Run `grunt` to perform a basic build, including creating documentation in doc/;
`grunt watch` will perform the same tasks whenever you make changes to the
source code. `grunt release` will minify everything to as few files as possible
into dist/.
into dist/html/.

To build executable versions of Twine with [NW.js](http://nwjs.io/), run `grunt
release-nw`, which will publish the files to dist/apps/. In order to build
Windows apps on OS X or Linux, you will need to have
[Wine](https://www.winehq.org/) installed. **nb. NW.js builds are currently
considered experimental, and have not been well-tested or documented.**

### TESTING

Expand Down
5 changes: 5 additions & 0 deletions app.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,24 @@
<script src="lib/underscore.js"></script>
<script src="lib/backbone/backbone.js"></script>
<script src="lib/backbone/backbone.localstorage.js"></script>
<script src="js/eventedlocalstorage.js"></script>
<script src="lib/backbone/backbone.marionette.js"></script>

<script src="lib/blob.js"></script>
<script src="lib/filesaver.js"></script>
<script src="lib/fastclick.js"></script>
<script src="lib/jszip.js"></script>
<script src="lib/svg.js"></script>
<script src="lib/uuid.js"></script>
<script src="lib/xdate.js"></script>

<script src="lib/codemirror/js/codemirror.js"></script>
<script src="lib/codemirror/js/addon/display/placeholder.js"></script>
<script src="lib/codemirror/js/mode/javascript/javascript.js"></script>
<script src="lib/codemirror/js/mode/css/css.js"></script>

<script src="js/ui.js"></script>
<script src="js/nwui.js"></script>

<script src="js/models/apppref.js"></script>
<script src="js/models/passage.js"></script>
Expand Down Expand Up @@ -117,6 +121,7 @@
<script src="js/views/storyeditview/renamestorymodal.js"></script>
<script src="js/views/storyeditview/search.js"></script>
<script src="js/views/storyeditview/searchmodal.js"></script>
<script src="js/views/storyeditview/statsmodal.js"></script>
<script src="js/views/storyeditview/storyformatmodal.js"></script>

<script src="js/router.js"></script>
Expand Down
13 changes: 12 additions & 1 deletion css/storyeditview.css
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ body.iOS .editModal
width: 100%;
padding-bottom: 0.1em;
font-size: 125%;
line-height: 100%;
}

#passageEditModal .error
Expand Down Expand Up @@ -559,6 +558,18 @@ body.iOS .editModal
font-size: 90%;
}

#statsModal table
{
margin: 0 auto;
font-size: 120%;
}

#statsModal td:first-child
{
text-align: right;
font-weight: bold;
}

.CodeMirror
{
height: auto;
Expand Down
137 changes: 137 additions & 0 deletions img/logo-osx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/logo.icns
Binary file not shown.
Binary file added img/logo.ico
Binary file not shown.
Loading

0 comments on commit 86a484b

Please sign in to comment.