Browse files

Intial Import

  • Loading branch information...
0 parents commit 3ff2b3da473e4ada886f85249dc9223db2387f31 @davglass committed Dec 16, 2008
Showing with 124 additions and 0 deletions.
  1. +1 −0 README
  2. +49 −0 src/service/JSLint.rb
  3. +8 −0 src/service/dav.rb
  4. +16 −0 src/service/manifest.json
  5. +50 −0 tests/one.html
1 README
@@ -0,0 +1 @@
+TODO
49 src/service/JSLint.rb
@@ -0,0 +1,49 @@
+#require 'uri'
+#require 'net/http'
+
+#bp_require 'JSONRequestInstance'
+
+
+#
+#
+class JSLint
+
+ def jslint(bp, args)
+ #
+ bp.complete(args)
+ end
+
+end
+
+rubyCoreletDefinition = {
+ 'class' => "JSLint",
+ 'name' => "JSLint",
+ 'major_version' => 0,
+ 'minor_version' => 0,
+ 'micro_version' => 1,
+ 'documentation' =>
+ 'TODO',
+
+ 'functions' =>
+ [
+ {
+ 'name' => 'jslint',
+ 'documentation' => "TODO",
+ 'arguments' =>
+ [
+ {
+ 'name' => 'scripts',
+ 'type' => 'array',
+ 'required' => true,
+ 'documentation' => 'todo'
+ },
+ {
+ 'name' => 'callback',
+ 'type' => 'callback',
+ 'required' => false,
+ 'documentation' => 'the callback to send a hello message to'
+ }
+ ]
+ }
+ ]
+}
8 src/service/dav.rb
@@ -0,0 +1,8 @@
+require 'uri'
+require 'net/http'
+
+bp_require 'json/json'
+
+res = Net::HTTP.get_response(URI.parse('http://yui.yahooapis.com/2.5.2/build/editor/editor-beta.js'))
+
+
16 src/service/manifest.json
@@ -0,0 +1,16 @@
+{
+ "type": "dependent",
+ "uses": {
+ "corelet": "RubyInterpreter",
+ "version": "4"
+ },
+ "arguments": {
+ "ScriptFile": "JSLint.rb"
+ },
+ "strings": {
+ "en": {
+ "title": "JSLint",
+ "summary": "TODO."
+ }
+ }
+}
50 tests/one.html
@@ -0,0 +1,50 @@
+<html>
+<head>
+ <title>Using BrowserPlus Services</title>
+ <style type="text/css" media="screen">
+ #result {border:1px solid #999; background:#ccc; font-size:8pt;padding:5px;}
+ </style>
+</head>
+<body>
+
+ <p>
+ </p>
+
+ <pre id="result">Samples displayed here...</pre>
+
+ <script type="text/javascript" src="http://bp.yahooapis.com/2.1.11/browserplus.js"></script>
+ <script type="text/javascript">
+
+
+ var mycb = function(r) {
+ console.log(r);
+ };
+
+ var err = function(f, result) {
+ console.log(f + " Error: " + result.error + (result.verboseError ? (": " + result.verboseError) : ""));
+ };
+
+ BrowserPlus.init(function(res) {
+ if (res.success) {
+ BrowserPlus.require({
+ services: [
+ {
+ service: "JSLint",
+ version: "0",
+ minversion: "0.0.1"
+ }
+ ]
+ }, function(r) {
+ if (r.success) {
+ BrowserPlus.JSLint.jslint({ callback: mycb, scripts: ['one', 'two'] }, function(x){});
+ } else {
+ err("REQUIRE", r);
+ }
+ });
+ } else {
+ err("INIT", res);
+ }
+ });
+ </script>
+</body>
+</html>

0 comments on commit 3ff2b3d

Please sign in to comment.