Coder Social home page Coder Social logo

joshfire / joshfire-framework Goto Github PK

View Code? Open in Web Editor NEW
230.0 230.0 32.0 11.83 MB

The Joshfire Framework

Home Page: http://framework.joshfire.com

License: Other

Python 1.02% JavaScript 57.27% Java 0.07% Shell 0.08% CSS 41.24% Objective-C 0.21% Processing 0.12%

joshfire-framework's Introduction

Joshfire framework

Open Source Multi-device JavaScript framework created and maintained by Joshfire.

The current version of the framework builds upon Backbone.js and require.js. Main features include:

  • common views at the core of each application (e.g. layout, list, slide panel)
  • an adapter mechanism to tweak the code of certain views when they are run on certain families of devices
  • a build system to compile the JavaScript code of an application
  • a logging system based on Woodman with a pre-compiler to remove logging code before compilation to save size.
  • a few utility classes for usual functionalities.

As opposed to previous versions of the framework, the current version does not impose a particular declaration mechanism for the structure of an app. The router/controller of the app is entirely up to the app developer.

Please note that, while the framework is actively being maintained, the "doc" and "examples" folders are leftovers of the previous version and do not match the current framework. In particular, the examples do not work. Documentation and examples will be updated when time allows...

The documentation of the deprecated previous version can still be checked in the v0.9 branch: https://github.com/joshfire/joshfire-framework/tree/old-master

License

The Joshfire framework is licensed under an MIT license (even the classes that still refer to a dual GPL and Commercial licenses which merely need to be updated)

joshfire-framework's People

Contributors

arthurjamain avatar codelahoma avatar damoun avatar floriancargoet avatar fradinni avatar jpvincent avatar mikaa123 avatar nathan-appere avatar nicolsc avatar stephan83 avatar steren avatar sylvinus avatar tbassetto avatar tidoust avatar tneullas avatar uucidl avatar whynotoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

joshfire-framework's Issues

Pubsub Infinite loop

When setting children: [] in a UI Tree, pubsub mechanism starts an infinite loop.

focusByIndex doesn't update grid coordinates.

the followingline doesn't work well: the grid coordinates are not updated
app.ui.element('/content/itemList').focusByIndex(gotoIndex);

For now, a hack is to do :
app.ui.element('/content/itemGrid').grid.goTo( [gotoIndex, 0] );

Express version issue

Hi, I'm having trouble using the simple helloworld example, here is what i got when I type

npm install 
npm ERR! Error: No compatible version found: express@'>=2.3.0- <2.4.0-'
npm ERR! Valid install targets:
npm ERR! ["0.14.0","0.14.1","1.0.0beta","1.0.0beta2","1.0.0rc","1.0.0rc2","1.0.0rc3","1.0.0rc4","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","2.5.0","2.5.1","2.5.2"]
npm ERR!     at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:429:10)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:411:17
npm ERR!     at Object.saved [as oncomplete] (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:136:7)
npm ERR! Report this *entire* log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>
npm ERR! 
npm ERR! System Linux 3.0.4-linode38
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /root/joshfire
npm ERR! node -v v0.6.5
npm ERR! npm -v 1.1.0-alpha-6
npm ERR! message No compatible version found: express@'>=2.3.0- <2.4.0-'
npm ERR! message Valid install targets:
npm ERR! message ["0.14.0","0.14.1","1.0.0beta","1.0.0beta2","1.0.0rc","1.0.0rc2","1.0.0rc3","1.0.0rc4","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","2.5.0","2.5.1","2.5.2"]
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /root/joshfire/npm-debug.log
npm not ok

I'm using

express -v
2.5.2

use the iframe Youtube player when possible

Youtube players used should be the "new" Youtube player (that uses an iframe, not the embed flash object).
With this new player, Youtube decides to une a flash version of an HTML5 version itself.

On my project, I changed this in the video.youtube element of the iOS adapter (that I use for Android too):

  // options.url : need to be the ID of the Youtube video
  // the src should be like src="http://www.youtube.com/embed/khWXdkryBE4?rel=0"
  this.htmlEl.innerHTML = '<iframe width="' + width + '" height="' + height + '" ' + 
      'src="http://www.youtube.com/embed/' + options.url + '?rel=0" frameborder="0" allowfullscreen></iframe>';

I guess this is obsolete since the new framework based on backbone.js is on its way.

VideoPlayer send the same event for onPlaying() and onPlay()

When playing a video, the framework should send us these events:

  • play (video asked to be played)
  • loading (video loading)
  • ready (video canPlay)
  • playing (at last, video started playing)

Problem: if you look at videoplayer.js, the same event ("playing") is sent for the first and last step... So when receiving 'playing' we can't be sure the video is really playing.

The fix is quite simple but the consequences could be dramatic.

ui/list: do not use data-joshfire-child

line 434:

var lastOffset = itemContainer.children().last().data('joshfire-child');

should be replaced (why not use this.items.length ?)

line 578:

var el = container.find('> ' + tagName + '[data-joshfire-child=' + offset + ']')[0];

should read something like

var el = container.find('> ' + tagName + ':eq(' + offset + ')')[0];

Control the minimum time interval between consecutive keypresses

We sometimes need to define a minimum time interval between consecutive keypresses.

On TV in particular, some applications react badly to repeated/extended keypresses on the remote. Doing so can sometimes cause refreshing issues, leading to manipulating DOM elements that aren't updated yet.

Making the application code more robust to unexpected DOM structure can become complex in large code bases. In that case, having a way to control the minimum interval between two keypresses might be useful.

One way to do so without impacting code on the framework side is to redefine the current adapter's processKey method on the client side:

var originalProcessKey = UIElement.prototype.processKey;

// Takes the originalProcessKey and calls it only if it is available.
// Each keypress will make it unavailable for 1s.

var available = true;
var myNewProcessKey = function(event) {

  if (available) {
    available = false;
    originalProcessKey.call(this, event);
    setTimeout(function() { available = true; }, 1000);
  }
}
UIElement.prototype.processKey = myNewProcessKey;

This approach has the benefit of not impacting any code on the framework, and very little on the client side.

However, this approach fails with some view elements.

UIElement#processKey method will call the corresponding action (navUp, navRight, etc.) only if the current view has it, if not, then it will call processKey on the view's origin (this.origin) and will do so until the action is either found or the view has no origin.

Since processKey has been redefined, the new version will be called, which will prevent further call to the original processKey method, making pressing the key ineffective.

A simple way to remedy to this situation would be to add an intermediate call in the framework on each keypresses:

Suppose we are in the UIElement module of an adapter (say googletv for instance):

// Dispatches an event to processKey.
// This can be redefined to allow a delay between
// key presses, often useful on TV.
keyDispatch: function(event) {
  this.processKey(event);
}

With this addition, the above solution would work: we'd only control access to keyDispatch, and processKey will be able to call itself recursively:

var originalKeyDispatch = UIElement.prototype.keyDispatch;

// Takes the originalProcessKey and calls it only if it is available.
// Each keypress will make it unavailable for 1s.

var available = true;
var newKeyDispatch = function(event) {

  if (available) {
    available = false;
    originalKeyDispatch.call(this, event);
    setTimeout(function() { available = true; }, 1000);
  }
}
UIElement.prototype.keyDispatch = newKeyDispatch;

As it currently stands, this little change would need to be rippled to each adapters since key bindings are defined in the adapters' UIElement modules.

Should this approach be kept? Should the framework provide an easier way to control the minimum time interval between consecutive keypresses (maybe as a general helper)?

Philips adapter, video controllers

Currently, we display the video & listen to remote events for play/pause/rewind, ...

We should
Display the videotime line, total time, elapsed time, ..
Display buttons to fire play/rewind, .. events. Some philips remotes don't have those buttons !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.