Skip to content

Commit

Permalink
restart again
Browse files Browse the repository at this point in the history
  • Loading branch information
leungwensen committed Aug 24, 2016
1 parent c9ec37f commit 7d27fe7
Show file tree
Hide file tree
Showing 86 changed files with 3,494 additions and 18,442 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
@@ -0,0 +1,20 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 1

[*.md]
trim_trailing_whitespace = false
44 changes: 44 additions & 0 deletions .eslintrc
@@ -0,0 +1,44 @@
{
"env": {
"browser": true,
"node": true,
"mocha": true
},
"extends": [
"eslint-config-airbnb"
],
"globals": {
"chai": true,
"smartCharts": true
},
"rules": {
"comma-dangle": 0,
"func-names": 0,
"global-require": 1,
"import/no-unresolved": 1,
"key-spacing": 0,
"new-cap": 1,
"no-cond-assign": 1,
"no-fallthrough": 1,
"no-param-reassign": 1,
"no-restricted-syntax": 0,
"no-underscore-dangle": 0,
"object-curly-spacing": 0,
"prefer-rest-params": 0,
"strict": 0,
"max-len": [
2,
120,
4,
{
"ignoreUrls": true
}
],
"id-length": [
2,
{
"min": 1
}
]
}
}
22 changes: 22 additions & 0 deletions LICENSE
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2016

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

21 changes: 14 additions & 7 deletions Makefile
@@ -1,12 +1,19 @@
# grouped tasks
make:
make browser
make install
make test
all:
make browser
make preinstall
make
make publish

browser:
./node_modules/.bin/browserify ./index-browser.js > ./dist/xmind-browser.js
./node_modules/.bin/uglifyjs ./dist/xmind-browser.js > ./dist/xmind-browser.min.js

# tasks
preinstall:
npm install -g cnpm --registry=http://registry.npm.taobao.org
install:
cnpm install
npm install
test:
publish:
npm publish && cnpm sync xmind
npm publish
cnpm sync xmind
26 changes: 13 additions & 13 deletions test/browser/index.html → demo/index.html
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>xmind</title>
<style>
textarea {
width: 100%;
height: 200px;
}
</style>
<meta charset="UTF-8">
<title>XMind-sdk demo</title>
<style>
textarea {
width: 100%;
height: 200px;
}
</style>
</head>
<body>
<textarea id="code-to-run">
Expand All @@ -23,12 +23,12 @@
xmind.save(workbook, 'test.xmind');
</textarea>
<button onclick="runCode();">Run!</button>
<script src="../../dist/xmind-browser.min.js"></script>
<script src="../dist/xmind.js"></script>
<script>
function runCode() {
var codeElem = document.getElementById('code-to-run');
eval(codeElem.value);
}
function runCode() {
var codeElem = document.getElementById('code-to-run');
eval(codeElem.value);
}
</script>
</body>
</html>

0 comments on commit 7d27fe7

Please sign in to comment.