Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
0b10cbd7
Commit
0b10cbd7
authored
Oct 28, 2014
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http renamed to httprpc
parent
3119be90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
httprpc.js
httprpc.js
+7
-6
index.html
index.html
+1
-1
No files found.
http.js
→
http
rpc
.js
View file @
0b10cbd7
(
function
()
{
(
function
()
{
var
HttpProvider
=
function
(
host
)
{
var
Http
Rpc
Provider
=
function
(
host
)
{
this
.
handlers
=
[];
this
.
handlers
=
[];
this
.
host
=
host
;
this
.
host
=
host
;
};
};
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
};
};
};
};
HttpProvider
.
prototype
.
sendRequest
=
function
(
payload
,
cb
)
{
Http
Rpc
Provider
.
prototype
.
sendRequest
=
function
(
payload
,
cb
)
{
var
data
=
formatJsonRpcObject
(
payload
);
var
data
=
formatJsonRpcObject
(
payload
);
var
request
=
new
XMLHttpRequest
();
var
request
=
new
XMLHttpRequest
();
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
}
}
};
};
HttpProvider
.
prototype
.
send
=
function
(
payload
)
{
Http
Rpc
Provider
.
prototype
.
send
=
function
(
payload
)
{
var
self
=
this
;
var
self
=
this
;
this
.
sendRequest
(
payload
,
function
(
request
)
{
this
.
sendRequest
(
payload
,
function
(
request
)
{
self
.
handlers
.
forEach
(
function
(
handler
)
{
self
.
handlers
.
forEach
(
function
(
handler
)
{
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
});
});
};
};
HttpProvider
.
prototype
.
poll
=
function
(
payload
,
id
)
{
Http
Rpc
Provider
.
prototype
.
poll
=
function
(
payload
,
id
)
{
var
self
=
this
;
var
self
=
this
;
this
.
sendRequest
(
payload
,
function
(
request
)
{
this
.
sendRequest
(
payload
,
function
(
request
)
{
var
parsed
=
JSON
.
parse
(
request
.
responseText
);
var
parsed
=
JSON
.
parse
(
request
.
responseText
);
...
@@ -57,13 +57,14 @@
...
@@ -57,13 +57,14 @@
});
});
};
};
Object
.
defineProperty
(
HttpProvider
.
prototype
,
"onmessage"
,
{
Object
.
defineProperty
(
Http
Rpc
Provider
.
prototype
,
"onmessage"
,
{
set
:
function
(
handler
)
{
set
:
function
(
handler
)
{
this
.
handlers
.
push
(
handler
);
this
.
handlers
.
push
(
handler
);
}
}
});
});
if
(
typeof
(
web3
)
!==
"undefined"
&&
web3
.
providers
!==
undefined
)
{
if
(
typeof
(
web3
)
!==
"undefined"
&&
web3
.
providers
!==
undefined
)
{
web3
.
providers
.
Http
Provider
=
Http
Provider
;
web3
.
providers
.
Http
RpcProvider
=
HttpRpc
Provider
;
}
}
})();
})();
index.html
View file @
0b10cbd7
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<script
type=
"text/javascript"
src=
"main.js"
></script>
<script
type=
"text/javascript"
src=
"main.js"
></script>
<script
type=
"text/javascript"
src=
"websocket.js"
></script>
<script
type=
"text/javascript"
src=
"websocket.js"
></script>
<script
type=
"text/javascript"
src=
"qt.js"
></script>
<script
type=
"text/javascript"
src=
"qt.js"
></script>
<script
type=
"text/javascript"
src=
"http.js"
></script>
<script
type=
"text/javascript"
src=
"http
rpc
.js"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
function
registerName
()
{
function
registerName
()
{
var
name
=
document
.
querySelector
(
"#name"
).
value
;
var
name
=
document
.
querySelector
(
"#name"
).
value
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment