This repository was archived by the owner on Feb 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +581
-102
lines changed Expand file tree Collapse file tree 4 files changed +581
-102
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ Will work with common ways.
17
17
For Node.js.
18
18
19
19
// Example to define Pot object on Node.js.
20
- var Pot = require('./potlite.js').Pot ;
20
+ var Pot = require('./potlite.js');
21
21
Pot.debug(Pot.VERSION);
22
22
23
23
Pot.Deferred.begin(function() {
@@ -32,12 +32,12 @@ Example of Greasemonkey (userscript).
32
32
// @require https://github.com/polygonplanet/Pot.js/raw/master/potlite.min.js
33
33
// ...
34
34
// ==/UserScript==
35
- begin(function() {
36
- return request('http://www.example.com/data.json').then(function(res) {
37
- return parseFromJSON(res.responseText);
35
+ Pot.Deferred. begin(function() {
36
+ return Pot. request('http://www.example.com/data.json').then(function(res) {
37
+ return Pot. parseFromJSON(res.responseText);
38
38
});
39
39
}).then(function(res) {
40
- debug(res);
40
+ Pot. debug(res);
41
41
// do something...
42
42
});
43
43
//...
@@ -106,6 +106,9 @@ Example
106
106
Example:
107
107
A simple iterate and Deferred object usage with asynchronous and synchronous.
108
108
109
+ // This example uses globalize for short function name.
110
+ Pot.globalize();
111
+
109
112
begin(function() {
110
113
debug('BEGIN example');
111
114
}).then(function() {
Original file line number Diff line number Diff line change 18
18
</ script >
19
19
< script type ="text/javascript " src ="potlite.min.js "> </ script >
20
20
< script >
21
+ // 関数名を短縮化
22
+ Pot . globalize ( ) ;
21
23
22
24
begin ( function ( ) {
23
25
debug ( 'BEGIN example' ) ;
119
121
< h1 > Pot.js - JavaScript Library</ h1 >
120
122
</ header >
121
123
< article >
122
- < p > Demo</ p >
124
+ < h2 > Demo</ h2 >
125
+ < p > See console</ p >
123
126
< div id ="status "> </ div >
124
127
< p >
125
128
< a href ="http://polygonplanet.github.com/Pot.js/index.html "> < strong > Pot.js + PotLite.js - ドキュメントリファレンス</ strong > </ a >
You can’t perform that action at this time.
0 commit comments