From 2c37d0bd2864199409edbb520f674d1c93652b23 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Thu, 22 Dec 2016 22:06:59 -0500 Subject: [PATCH] Cleanups. - Remove trailing whitespace. - Remove tabs. - Change sys.puts to console.log. - Fix tls comment and add websocket server comment. --- LICENSE | 6 ++-- flash/policyserver.py | 2 +- tests/README.md | 2 +- tests/flash/Test.as | 16 ++++----- tests/legacy/form.js | 6 ++-- tests/legacy/loginDemo.js | 24 +++++++------- tests/legacy/tasks.js | 16 ++++----- tests/legacy/tls.html | 3 +- tests/legacy/webid.js | 56 ++++++++++++++++---------------- tests/legacy/ws-webid.js | 6 ++-- tests/websockets/server-webid.js | 34 +++++++++---------- tests/websockets/server.js | 43 ++++++++++++------------ tests/websockets/ws.js | 47 +++++++++++++-------------- webpack.config.js | 6 ++-- 14 files changed, 133 insertions(+), 134 deletions(-) diff --git a/LICENSE b/LICENSE index 1bba5cec8..2b48a95b2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,11 +1,11 @@ -You may use the Forge project under the terms of either the BSD License or the +You may use the Forge project under the terms of either the BSD License or the GNU General Public License (GPL) Version 2. -The BSD License is recommended for most projects. It is simple and easy to +The BSD License is recommended for most projects. It is simple and easy to understand and it places almost no restrictions on what you can do with the Forge project. -If the GPL suits your project better you are also free to use Forge under +If the GPL suits your project better you are also free to use Forge under that license. You don't have to do anything special to choose one license or the other and diff --git a/flash/policyserver.py b/flash/policyserver.py index bda8afe5f..09be2e05f 100755 --- a/flash/policyserver.py +++ b/flash/policyserver.py @@ -91,7 +91,7 @@ def main(): # log basic info logging.info("Flash Socket Policy Server. Use ctrl-c to exit.") - + # create policy server logging.info("Socket policy serving on %s:%d." % (options.host, options.port)) policyd = ThreadedTCPServer((options.host, options.port), PolicyHandler) diff --git a/tests/README.md b/tests/README.md index 41e0389ce..cd85067b1 100644 --- a/tests/README.md +++ b/tests/README.md @@ -35,7 +35,7 @@ To run legacy browser based tests the main forge build is required: The tests are run with a custom server that prints out the URL to use: npm run test-server - + Running other tests ------------------- diff --git a/tests/flash/Test.as b/tests/flash/Test.as index 7c03727bd..97308ad1e 100644 --- a/tests/flash/Test.as +++ b/tests/flash/Test.as @@ -1,20 +1,20 @@ /* * Copyright (c) 2010 Digital Bazaar, Inc. All rights reserved. - * + * * @author Dave Longley */ package { import flash.display.Sprite; - + public class Test extends Sprite { import flash.events.*; import flash.net.*; - + import flash.external.ExternalInterface; import flash.system.Security; - + public function Test() { try @@ -22,7 +22,7 @@ package // FIXME: replace 'localhost' with cross-domain host to hit var xhost:String = "localhost"; Security.loadPolicyFile("xmlsocket://" + xhost + ":80"); - + var loader:URLLoader = new URLLoader(); loader.addEventListener( Event.COMPLETE, completeHandler); @@ -36,7 +36,7 @@ package HTTPStatusEvent.HTTP_STATUS, httpStatusHandler); loader.addEventListener( IOErrorEvent.IO_ERROR, ioErrorHandler); - + var request:URLRequest = new URLRequest( "http://" + xhost + "/index.html"); loader.load(request); @@ -47,7 +47,7 @@ package throw e; } } - + private function log(obj:Object):void { if(obj is String) @@ -61,7 +61,7 @@ package log("error=" + e.errorID + "," + e.name + "," + e.message); } } - + private function completeHandler(event:Event):void { var loader:URLLoader = URLLoader(event.target); diff --git a/tests/legacy/form.js b/tests/legacy/form.js index abfbab02c..1788abc1a 100644 --- a/tests/legacy/form.js +++ b/tests/legacy/form.js @@ -10,10 +10,10 @@ $(document).ready(function() { // logging category var cat = 'forge.tests.form'; - + // local alias var forge = window.forge; - + $('form.ajax').each(function(i, form) { $(form).submit(function() @@ -23,7 +23,7 @@ $(document).ready(function() var f = forge.form.serialize($(this)); forge.log.debug(cat, 'result:', JSON.stringify(f)); $('#result').html(JSON.stringify(f)); - + /* dictionary test var f = forge.form.serialize($(this), '.', {'username':'user'}); forge.log.debug(cat, 'result:', JSON.stringify(f)); diff --git a/tests/legacy/loginDemo.js b/tests/legacy/loginDemo.js index ae2cd1adf..35dab6b18 100644 --- a/tests/legacy/loginDemo.js +++ b/tests/legacy/loginDemo.js @@ -23,7 +23,7 @@ var init = function($) { // logging category var cat = 'forge.tests.loginDemo'; - + // local alias var forge = window.forge; try @@ -38,11 +38,11 @@ var init = function($) if(domain) { $('#domain').html('`' + domain + '`'); - } - + } + // for chosen webid var chosen = null; - + // init forge xhr forge.xhr.init({ flashId: 'socketPool', @@ -67,15 +67,15 @@ var init = function($) return chosen.privateKey; } }); - + // get flash API var flashApi = document.getElementById('socketPool'); - + // get web ids collection var webids = forge.util.getItem( flashApi, 'forge.test.webid', 'webids'); webids = webids || {}; - + var id = 0; var list = $('