Permalink
Commits on Jul 5, 2015
  1. Fixed CWDebug.err producing an error

    BlackWolf committed Jul 5, 2015
    On newer versions of Safari, console.err() is not available. CWDebug.err now uses CWDebug.error() instead and falls back to console.log() if that is not available as well
  2. Fixed remote attempting reconnect too often

    BlackWolf committed Jul 5, 2015
    Fixed a bug where remotes would constantly try to reconnect to the server. Now they try every 2.5 seconds as expected
  3. Fixed CWTemplates Caching

    BlackWolf committed Jul 5, 2015
    CWTemplates was supposed to not load the same file twice from the server, but did so. This was fixed. The same file represented by different paths (e.g. /template.html and ./template.html) will still be loaded twice, though
Commits on Jul 4, 2015
  1. Improved file autoload

    BlackWolf committed Jul 4, 2015
    - autoload doesn't listen to only the last file's status anymore, it waits for all JS files to load and execute before reporting a success
    - autoload will now also wait for CSS files to load
  2. Fixed bug in CWDatastore.set

    BlackWolf committed Jul 4, 2015
    Fixed a bug where CWDatastore.set would behave wrongly when writing to the default collection
  3. Fixed onLoad & Templating bugs

    BlackWolf committed Jul 4, 2015
    - Fixed a major bug in onLoad triggering on remotes - for some reason this was triggered immediately when the websocket opened instead of when the master acks our remoteinfo message (which means autoload files have been loaded, data store is synced etc.)
    - Fixed bug where onLoad was triggered too early on remote devices
    - Added "onBefore" callback to CWDevice.insertTemplate(). This function is triggered after the template file(s) was/were loaded but right before the template is inserted into the DOM
    - Fixed major bug in the templating engine that could cause templates to be parsed wrongly (for example when template expressions occured inside a <table> but outside of a <tr> or <td>). We switched from jQuery DOM parsing to manual Regexp parsing of <template> tags to solve this.
  4. Added master backlog to websocket server

    BlackWolf committed Jul 4, 2015
    It was possible that a quickly loading remote could send its remoteinfo message before the master websocket connection was established. The remote would then not be recognized. This happened particularly on auto-reload. To solve it, we re-introduce (-_-) the master backlog - messages that arrive for the master before its connection is ready are remembered and delivered when the master websocket ist established.
Commits on Jun 22, 2015
  1. Fixed bugs

    BlackWolf committed Jun 22, 2015
  2. Fixed identifier bug

    BlackWolf committed Jun 22, 2015
    Only the master web library now creates a UUID, which is then transmitted to the native's web library manager which in turn saves it to the native's app state. Remote libraries now use this identifier as well, so there is only a single UUID that identifies a device
  3. Removed weblib folder

    BlackWolf committed Jun 22, 2015
  4. Added weblib to gitignore

    BlackWolf committed Jun 22, 2015
  5. Minor bug fixes

    BlackWolf committed Jun 22, 2015
Commits on Jun 14, 2015
  1. Added Proximity Sensor Support

    BlackWolf committed Jun 14, 2015
    - Web applications can now request proximity sensor updates using CWProximity.startTracking(). This will cause "proximityStateChanged" events to be sent to the web application.
    - Updated docs
Commits on Jun 13, 2015
  1. Improved CWModule

    BlackWolf committed Jun 13, 2015
    CWModules.add() was removed. Instead, modules should now use CWModules.retrieve() to get back a module object. The module object is an object literal, but CWModules.init() will perform some magic on it: It will call its __constructor() and will make sure that "this" is available in all module methods.
  2. Changed connection process & message callback system

    BlackWolf committed Jun 13, 2015
    - Just like remotes, the master now immediately connects the websocket without a message from the native layer
      - The native layer does not care about the libraryDidLoad event anymore, we do everything as soon as the websocket connected
    
    - Device information and websocket server identification have been separated
      - The master now sends a "_master_identification" message and remotes "_remote_identification". The message does not contain device information anymore, but only an identifier key with the ID of the device. The message is consumed by the server and not forwarded to anyone.
    
      - Device information are now more dynamic and asynchronous
        - only identifier and launchDate are required - both are now always created by the web library on load, not the native layer
        - additional information (e.g. from the native layer) can be set later by passing localinfo messages to the weblibrary
        - TODO: updating device informations should trigger an event, in particular because we cannot rely on all device information being available in Connichiwa.onLoad() anymore
        - TODO: We should move device information to CWDatastore. This will also ensure they are available on all devices
    
    - Changed message callback system
      - .parse() in the all WebsocketParsers now returns a jQuery promise. Once that promise is fullfilled, an _ack message is sent back.
      - If no promise is returned, an _ack is sent back immediately. This means that every message is now acknowledged
      - CWDevice.send() and Connichiwa.send() now take a callback parameter that is called once the send message is acknowledged. Therefore, every sent message can now have a callback once the message was handled on the other device
      - TODO: Add callbacks to messages such as CWDevice.insert()
    
    - deviceConnected is now triggered after the CWDatastore was synced to a new device
    
    - Minor bugfixes & improvements
      - Connichiwa.off() was introduced
      - broadcast messages are not sent to the source device anymore if not necessary
      - CWServerManager's connectionIDForIdentifier now returns -1 for invalid identifiers instead of 0
    - Minor code cleanups & JS Documentation Update
    
    - I had to commit some code related to MultipeerConnectivityFramework. The code does nothing right now.
  3. Fixed libwebsocket bug

    BlackWolf committed Jun 13, 2015
    A bug in libwebsocket could cause messages not to be delivered in time: requesting the POLLOUT event via libwebsocket_callback_on_writable() while libwebsocket_service() was blocking had no effect and the request got lost. We introduced libwebsocket_cancel_service() to cancel the blocking and re-call libwebsocket_service(). Further, we now remember if libwebsocket_callback_on_writable() has been called while libwebsocket_service() blocked and if so re-request the POLLOUT event once libwebsocket_service() stops blocking
Commits on May 27, 2015
  1. Changes & Improvements to JS API

    BlackWolf committed May 27, 2015
    - Message ACK system has been overhauled
    	- Every message is now acknowledged
    	- original message is not sent in ACK
    	- Connichiwa.send() and CWDevice.send() have a callback parameter, which is called whenever the send was ACKed
    - Bug was fixed where template insertion sometimes failed due to $.when.all not being defined in time
    - When a new device connects, the CWDatastore is now synced to that device before the 'deviceConnected' event is fired on the master
    - CWTemplates.load() and CWTemplates.insert() now take an optional device parameter to load/insert on remote devices
    - Template insertion now takes an options object instead of multiple parameters
    - Introducing Connichiwa.off()
    - Documentation updated
Commits on May 22, 2015
Commits on May 18, 2015
  1. Bug fixes

    BlackWolf committed May 18, 2015
    - Added ractive.js to remote.html
    - Fixed bug with _distance (which we already fixed, but it still shows up as a change in git)
    - Fixed bug with CWTemplates.set() - in order to set multiple values, you know have to use .setMultiple()
Commits on May 13, 2015
  1. Introducing CWTemplates and CWDatastore

    BlackWolf committed May 13, 2015
    - Added cross-device datastore
        - You can store arbitrary data using CWDatastore.set. Data is automatically synced across all devices
        - CWDatastore supports collections, so basically "sub data stores"
    
    - Added RactiveJS-based templating
        - You can load templates from external files using CWTemplates.load
        - You can insert templates into the DOM using CWTemplates.insert
        - Templates are data-driven - you can use CWTemplates.set to set template data, which will automatically update the UI
        - Template data is based on CWDatastore, so it syncs across devices
        - CWDevice now has loadTemplates and insertTemplate so you can easily use templates on remote devices
    
    - Minor fixes
        - Fixed a bug that prevented device distance from updating
        - Added CWUtil.unescape to unescape HTML entities
        - We finally receive JS errors in the XCode console. Unfortunately, no stack trace yet :/
        - Errors are formatted in a way that you will recognize them in the console
Commits on May 8, 2015
  1. Added Templating

    BlackWolf committed May 8, 2015
    Based on some work by Roman Rädle (roman.raedle@uni-konstanz.de) Connichiwa now has templating based on Handlebars!
    
    - Create files containing Handlebar templates and add them to your web application
    - Load them locally using CWTemplates.load() or on a remote device using CWDevice's .loadTemplates()
    - Insert them into the DOM using CWTemplates.insert() or CWDevice's .insertTemplate()
    - Use the Handlebars helpers isMaster and ifIsMaster to check which device you are on right within a template
    
    The new templating system not only allows you to use templating and therefore reuse HTML code on a local device, but it also allows you to insert large portions of HTML into a remote device's DOM with a single method code. You can even pass data to the template so that Handlebars expressions, blocks, helpers etc. can be used
Commits on May 5, 2015
  1. Debug fixes

    BlackWolf committed May 5, 2015
    - The debug log level can now be set using CWWebApplication's setLogLevel. This means that projects using Connichiwa.framework can set the log level as they want to
  2. Bug fixes

    BlackWolf committed May 5, 2015
    - removed logs from libwebsockets
    - fixed bug in Web/Remote library manager where the connectWebsocket message could be sent before the JS callbacks were created
    - added a backlog to the CWServerManager that logs messages that arrive for the master before the master connection was established. As soon as the master websocket is established, the messages are delivered
    - Fixed a bug in CWServerManager that could lead to lost messages if the master websocket was not the first websocket that connected
    
    Numerous changes to the web library
    
    - native-less remote can now connect without appending '/remote' to the URL - they will be detected and redirected automatically
    - numerous methods that are part of CWDevice have been removed from the Connichiwa module - they should be accesses through CWDevice only (e.g. insert/replace/...). The logic for those methods has been moved to CWDevice
    - Added CWModules. Every Connichiwa module has to add itself to CWModules and CWModules will take care of loading all the modules. This makes sure that modules that depend on each other are loaded correctly. Our build script makes sure that CWModules is added at the very beginning of connichiwa.js and remote.js, and therefore CWModules is ensured to be available. Further, the build script makes sure that init.js is added ad the very end of these files, so the initialization process is started after all modules have been added to CWModules.
    - A number of bug fixes
    
    Updated docs & readme
Commits on Mar 13, 2015
  1. Documentation + Major JS Rewrite

    BlackWolf committed Mar 13, 2015
    - The JS library has been (almost) fully documented, so a sweet JSDoc3 documentation can be built
    - JSDoc is now only built for the public part of the JS library
    - We also did a major rewrite on the JS library to get rid of the OOP script dependency. While the OOP script was kind of nice, the code was too awkward and too non-standard. We now use simple Object Literals for singletons and rely on naming convention (_ prefix) and JSDoc comments for access levels
Commits on Feb 12, 2015
  1. Fixed large messages closing connection in Safari

    BlackWolf committed Feb 12, 2015
    This seems to have been an issue with x-webkit-deflate-frame. We commented out this extension on the server side. This will probably mean large messages are slower, but at least they seem to work and a lot of WebView crashes seem to be resolved by this.
  2. Started reworking debug

    BlackWolf committed Feb 12, 2015
    Finally got around to improve debugging a little:
    
    - log priority has been renamed to log level
    - the debug settings (DEBUG preprocessor flag and MAX_LOG_LEVEL in CWDebug) are passed to the web library
    - the web library passes the debug information to a remote once it has connected, so all devices use the same settings
    - the web library doesn't rely on the native layer to filter by level anymore, but rather does it itself. This prevents unnecessary log messages on native-less remotes
    - CWDebug.err is now forwareded to ErrLog() in Objective-C, this way we make sure errors are always logged regardless of settings
  3. Minor server fixes

    BlackWolf committed Feb 12, 2015
    - Changed server so that the messages we previously received over the JavaScriptCore from Nodelike are now received directly from the websocket server
  4. Updated readme

    BlackWolf committed Feb 12, 2015
  5. Objective-Clean adjustements

    BlackWolf committed Feb 12, 2015
    - Adjusted Objective-Clean StyleSettings file, because I'm sick of braces on new lines
    - Adjusted Objective-Clean run script so it ignores HTTP and WSS directory
  6. Removed Nodelike

    BlackWolf committed Feb 12, 2015
    The new servers seem ready, we can finally make the switch. This includes:
    - removing the Nodelike folder and submodule
    - removing the server code that starts the nodelike server
    - removing Nodelike from the project build phases
    - removing all node_modules
    
    We also:
    - sped up compilation by creating appledoc on release configuration only
    - removed binaries from the framework's compilation. we don't seem to need them for static libraries
    - removed warnings from GCDWebserver and BLWebsocket files by adding the -w compiler flag
  7. Further improved Websocket server

    BlackWolf committed Feb 12, 2015
    We now get notified immediately when a websocket event occurs, instead of polling for it every few milliseconds. This is done by using libwebsocket_service() with a large timeout, which will block until an event occurs and then immediately call the callback. SInce we do this on a seperate thread, the blocking behaviour is not a problem. Further, we changed the dispatch timer's so it fires instantly, which means that if an event occurs and libwebsocket_service() stops blocking, libwebsocket_service() will be called immediately after the event was handled and waits for new events.
Commits on Jan 23, 2015
  1. Renamed CWWebServerManager to CWServerManager

    BlackWolf committed Jan 23, 2015
    Since it now manages both the HTTP and Websocket server, it needs an appropiate name!
  2. Websocket Server Improvements

    BlackWolf committed Jan 23, 2015
    - BLWebSocketConnection now also contains the connections outgoing message queue. Therefore, the BLAsyncMessageQueue is no longer needed
    - Handlers for onClose events can be installed. Also, the websocket server and our CWWebserverManager class now cleanup on a close and also inform the weblib
    - Some refactoring and renaming in an attempt to make the server's code more readable
  3. Improved Websocket Server

    BlackWolf committed Jan 23, 2015
    This commit adds some important improvements to the websocket server
    	- The websocket can now handled framing. Websockets have a maximum frame size, if a message is larger than that it will be split into multiple frames (which, in turn, might be split into multiple chunks each). Previously, the webserver would call the onMessage callback on every chunk. Now, the server gathers the entire message first and then calls the onMessage callback for the entire message.
    	- The WS server now calls libwebsocket_callback_on_writable instead of libwebsocket_callback_on_writable_all_protocol where appropiate
    	- A little refactoring where we added BLWebsocketConnection that gathers everything related to a single WS connection
    	- CWWebServer has been refactored so the websocket callbacks are more readable