Skip to content
This repository was archived by the owner on Feb 16, 2019. It is now read-only.

Commit d83731c

Browse files
author
polygonplanet
committed
衝突を避けるためグローバル空間にPotのみ定義するよう変更。
Pot.globalize() の調整。 Pot.hasReturn() の実装。 Pot.System.isNotExtension を追加。 Pot.Net.loadScript() の実装。 typoを修正。
1 parent 13807e8 commit d83731c

File tree

4 files changed

+581
-102
lines changed

4 files changed

+581
-102
lines changed

README.markdown

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Will work with common ways.
1717
For Node.js.
1818

1919
// Example to define Pot object on Node.js.
20-
var Pot = require('./potlite.js').Pot;
20+
var Pot = require('./potlite.js');
2121
Pot.debug(Pot.VERSION);
2222

2323
Pot.Deferred.begin(function() {
@@ -32,12 +32,12 @@ Example of Greasemonkey (userscript).
3232
// @require https://github.com/polygonplanet/Pot.js/raw/master/potlite.min.js
3333
// ...
3434
// ==/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);
3838
});
3939
}).then(function(res) {
40-
debug(res);
40+
Pot.debug(res);
4141
// do something...
4242
});
4343
//...
@@ -106,6 +106,9 @@ Example
106106
Example:
107107
A simple iterate and Deferred object usage with asynchronous and synchronous.
108108

109+
// This example uses globalize for short function name.
110+
Pot.globalize();
111+
109112
begin(function() {
110113
debug('BEGIN example');
111114
}).then(function() {

pot.js.example.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
</script>
1919
<script type="text/javascript" src="potlite.min.js"></script>
2020
<script>
21+
// 関数名を短縮化
22+
Pot.globalize();
2123

2224
begin(function() {
2325
debug('BEGIN example');
@@ -119,7 +121,8 @@
119121
<h1>Pot.js - JavaScript Library</h1>
120122
</header>
121123
<article>
122-
<p>Demo</p>
124+
<h2>Demo</h2>
125+
<p>See console</p>
123126
<div id="status"></div>
124127
<p>
125128
<a href="http://polygonplanet.github.com/Pot.js/index.html"><strong>Pot.js + PotLite.js - ドキュメントリファレンス</strong></a>

0 commit comments

Comments
 (0)