Skip to content

Commit

Permalink
Bump version number, fix a few build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
klembot committed Feb 28, 2016
0 parents commit 1e81176
Show file tree
Hide file tree
Showing 193 changed files with 32,825 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = tab
trim_trailing_whitespace = true
16 changes: 16 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax: glob
*.swp
index.html
node_modules/*
dist/*
doc/*
.tmp/*
*.DS_Store
.idea
cache
dist-apps
twine.js
build
nwbuilder-cache
nsis/*
phantomjsdriver.log
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contributing

Please give [Chris a holler on Bitbucket](https://bitbucket.org/klembot) if you
have a feature you would like to add or a change you'd like to make to existing
functionality, so we can come to agreement on the change itself before you
spend time writing code. Bugfixes don't require discussion, though -- we can
hash things out in the comments of your pull request as needed.

Pull requests should be accompanied by [Selenium IDE
tests](http://docs.seleniumhq.org/projects/ide/) where possible; there are some
things related to uploaded or downloaded files that Selenium isn't able to
test. If you're adding a new JavaScript file, please make sure it has ["use
strict";]() at the top, and passes the `grunt jslint` task, and that methods
and classes are documented properly (we use
[YUIDoc](https://yui.github.io/yuidoc/syntax/) -- use `grunt doc` to regenerate
documentation).
8 changes: 8 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = function (grunt)
{
require('jit-grunt')(grunt, {
'nwjs': 'grunt-nw-builder'
});
grunt.initConfig({});
grunt.loadTasks('grunt/');
};
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
twinejs
-------

by Chris Klimas, Leon Arnott, Daithi O Crualaoich, Ingrid Cheung, Thomas
Michael Edwards, Micah Fitch, Juhana Leinonen, and Ross Smith

### SYNOPSIS

This is a port of Twine to a local browser-based app. See
[twinery.org](http://twinery.org) for more info.

The story formats in minified format under `storyformats/` exist in separate
repositories:

* [Harlowe](https://bitbucket.org/_L_/harlowe)
* [Snowman](https://bitbucket.org/klembot/snowman-2)
* [Paperthin](https://bitbucket.org/klembot/paperthin)

### INSTALL

Run `npm install` at the top level of the directory to install all goodies.

You'll also need [Grunt](http://gruntjs.com) to continue. Run `npm install -g grunt-cli`
(you will need to have administrator privileges to achieve this task).

### BUILDING

Run `grunt` to perform a basic build under `build/standalone`; `grunt dev` will
perform the same tasks whenever you make changes to the source code. `grunt nw`
will create executable app versions of Twine from this directory and place them
under `build/nwjs/`. `grunt build:cdn` will build a version of Twine that makes
as much use of CDN resources as possible, and place it under `build/cdn`.

To create downloadable versions of Twine, run `grunt package`. These will be
placed in the `dist/` directory. An additional file named `2.json` is created
under `dist/`. This contains information relevant to the autoupdater process, and
is currently posted to http://twinery.org/latestversion/2.json.

In order to build Windows apps on OS X or Linux, you will need to have
[Wine](https://www.winehq.org/) and [makensis](http://nsis.sourceforge.net/) installed.

### TESTING

Run `grunt test` to run through Selenium-based tests (for now, these only run on
Firefox). To quit a test run as soon as any error is encountered, run `grunt
test --bail`. To run a subset of tests, run `grunt test --grep=mysearch`. Only
tests whose name match the argument you pass will be run.

### LOCALIZATION

Would you like to help localize Twine for another language? Awesome! You don't
need to know JavaScript to do so. Here's how it works:

1. Download
[template.pot](https://bitbucket.org/klembot/twinejs/raw/4b64592fd47dd6678d9d0ebb0f07067f1bfaeabb/locale/po/template.pot)
from the repository.

2. Use a translation application like [Poedit](http://poedit.net/) to create a
.po file with the source text translated. If you are using Poedit, get started
by choosing **New from POT/PO File** from the **File** menu. Make sure to name
your po file according to the [IETF locale naming
convention](https://en.wikipedia.org/wiki/IETF_language_tag) -- Poedit can help
suggest that as well. For example, a generic French translation should be named
`fr.po`, while an Australian English one would be named `en-au.po`.

3. Finally, two other things are needed: an SVG-formatted image of the flag
that should be associated with your language, and what native speakers call the
language you are localizing to (e.g. Français for French speakers).
[Wikimedia
Commons](https://commons.wikimedia.org/wiki/Category:SVG_flags_by_country) is
your best bet for nice-looking SVG flags. Obviously, whatever image you provide
must either be in the public domain or otherwise OK to use in Twine without any
compensation.

4. If you're comfortable using Mercurial, then you can open a pull request to
have your localization added. Please place it in the `src/locale/po` directory. If
you aren't, you can instead open a bug tracker issue and attach your PO file,
flag image, and language name and we'll take it from there.
13 changes: 13 additions & 0 deletions browserify/cdn-shims.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports =
{
'backbone': { exports: 'global:Backbone' },
'backbone.localstorage': { exports: 'global:Backbone.LocalStorage' },
'backbone.marionette': { exports: 'global:Backbone.Marionette' },
'codemirror': { exports: 'global:CodeMirror' },
'fastclick': { exports: 'global:FastClick' },
'jquery': { exports: 'global:$' },
'jszip': { exports: 'global:JSZip' },
'moment': { exports: 'global:moment' },
'svg.js': { exports: 'global:SVG' },
'underscore': { exports: 'global:_' }
};
16 changes: 16 additions & 0 deletions eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"rules": {
"semi": [
2,
"always"
],
"no-extra-semi": 0,
"no-mixed-spaces-and-tabs": 0
},
"env": {
"browser": true,
"commonjs": true,
"node": true
},
"extends": "eslint:recommended"
}
13 changes: 13 additions & 0 deletions grunt/build-number.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This sets the correct format for a build number, and ensures it
// doesn't change during a single grunt run.

var grunt = require('grunt');
var buildNumber;

module.exports = function()
{
if (buildNumber === undefined)
buildNumber = grunt.template.date(new Date(), 'yyyymmddhhMM');

return buildNumber;
};
Loading

0 comments on commit 1e81176

Please sign in to comment.