Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
192 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
coolie.config({ | ||
mainModulesDir: '/example/', | ||
nodeModulesDir: '/node_modules/', | ||
nodeModuleMainPath: 'src/index.js' | ||
}).use(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!doctype html> | ||
<!-- | ||
- 文件描述 | ||
- @author ydr.me | ||
- @create 2016-06-27 17:26 | ||
--> | ||
<html lang="zh-Hans"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<meta name="renderer" content="webkit"> | ||
<meta name="viewport" content="width=device-width,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0,minimal-ui"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-touch-fullscreen" content="yes"> | ||
<meta name="format-detection" content="telephone=no"> | ||
<meta name="author" content="云淡然;http://ydr.me"> | ||
<meta name="keywords" content="关键词1,关键词2"> | ||
<meta name="description" content="描述语句"> | ||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"> | ||
<title>index.html</title> | ||
<style> | ||
textarea { | ||
-webkit-box-sizing: border-box; | ||
-moz-box-sizing: border-box; | ||
box-sizing: border-box; | ||
display: block; | ||
width: 100%; | ||
font-size: 20px; | ||
margin-bottom: 20px; | ||
padding: 6px; | ||
} | ||
|
||
button { | ||
padding: 10px 20px; | ||
font-size: 20px; | ||
} | ||
</style> | ||
</head> | ||
<body ontouchstart=""> | ||
|
||
<h1>object.parsePath(path) example</h1> | ||
原始: | ||
<textarea id="source" rows="1">a["\""]</textarea> | ||
结果: | ||
<textarea id="target" rows="1"></textarea> | ||
|
||
<button id="parse">parsePath</button> | ||
|
||
|
||
<script src="/node_modules/coolie.js/coolie.js" | ||
data-config="/example/coolie-config.js" | ||
data-main="index.js"></script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* 文件描述 | ||
* @author ydr.me | ||
* @create 2016-06-27 17:34 | ||
*/ | ||
|
||
|
||
'use strict'; | ||
|
||
var object = require('../src/index'); | ||
|
||
var sourceEl = document.getElementById('source'); | ||
var targetEl = document.getElementById('target'); | ||
var parseEl = document.getElementById('parse'); | ||
|
||
parseEl.onclick = function () { | ||
targetEl.value = object.parsePath(sourceEl.value).join(' ==> '); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters