Authored by lore-w

init

*.iml
.idea/
.ipr
.iws
*~
~*
*.diff
*.patch
*.bak
.DS_Store
Thumbs.db
.project
.*proj
.svn/
*.swp
*.swo
*.pyc
*.pyo
.build
node_modules
_site
sea-modules
spm_modules
.cache
dist
\ No newline at end of file
... ...
dist
_site
sea-modules
spm_modules
node_modules
.git
tests
examples
test
... ...
language: node_js
node_js:
- "0.10"
install:
- npm install spm coveralls
before_script:
- node_modules/spm/bin/spm-install
script:
- node_modules/spm/bin/spm-test
after_success:
- node_modules/spm/bin/spm-test --coveralls | node_modules/.bin/coveralls
... ...
# History
---
## 0.0.1
`new` It is the first version of yoho-tips.
... ...
# yoho-tips [![spm version](http://spm.yoho.cn/badge/yoho-tips)](http://spm.yoho.cn/package/yoho-tips)
---
提示框文本组件
## Install
```
$ spm install yoho-tips --save
```
## Usage
```js
var tips = require('yoho-tips');
```
## [单元测试](http://spm.yoho.cn/docs/yoho-tips/latest/tests/runner.html)
... ...
# Demo
---
## Normal usage
````javascript
seajs.use('index', function(yohoTips) {
});
````
... ...
{
"name": "yoho-tips",
"version": "0.0.1",
"description": "提示框文本组件",
"keywords": [],
"homepage": "",
"author": " ",
"repository": {
"type": "git",
"url": ""
},
"bugs": {
"url": ""
},
"licenses": "MIT",
"spm": {
"main": "yoho-tips.js",
"dependencies": {
"yoho-tips-dic":"0.0.x"
},
"devDependencies": {
"expect.js": "0.3.1"
}
}
}
... ...
var expect = require('expect.js');
var tips = require('../index');
describe('Yoho-tips', function() {
it('简繁体', function() {
if (window.location.host.indexOf("hk")>=0) {
expect(tips.getTips('relogin')).to.eql('請重新登錄!');
}else{
expect(tips.getTips('relogin')).to.eql('请重新登录!');
}
});
});
... ...
var dic = require("yoho-tips-dic");
exports.getTips=function(key){
if(isJian()){
return dic.Dic[key+"_jian"];
}else{
return dic.Dic[key+"_fan"];
}
};
exports.isJian=isJian;
function isJian () {
var currentDomain="http://"+window.location.host;
if(currentDomain.indexOf("hk")>=0){
return false;//false,繁体
}
return true;//简体,
}
\ No newline at end of file
... ...