mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
started work on wrapping the thing as a jQuery plugin (might stall as this is not a priority)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
c28f22ea64
commit
94d7438822
@ -6,6 +6,59 @@ $(document).ready(setup);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************** jQuery Plugin **/
|
||||||
|
/* TODO:
|
||||||
|
* - basic functionality
|
||||||
|
* - setup / options
|
||||||
|
* - navigation
|
||||||
|
* - events
|
||||||
|
* - onPromote
|
||||||
|
* - onDemote
|
||||||
|
*
|
||||||
|
* This will do the folowing:
|
||||||
|
* - build the basic elemnt tree needed for the viewer
|
||||||
|
* we will need a seporate component to:
|
||||||
|
* - init the visual controls
|
||||||
|
* ImageGridUIButtons
|
||||||
|
* - init the keyboard controls
|
||||||
|
* ImageGridUIKeyboard
|
||||||
|
* - init the touch/swipe controls
|
||||||
|
* ImageGridUITouch
|
||||||
|
*
|
||||||
|
* the other components must be usable independently
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* see: ImageGridUI.js for a generated scafold example...
|
||||||
|
*/
|
||||||
|
(function($){$.fn.ImageGridUI = function(options) {
|
||||||
|
// NOTE: this refers to the element this was ivoked on...
|
||||||
|
|
||||||
|
var options = $.extend({
|
||||||
|
// default options...
|
||||||
|
}, options)
|
||||||
|
|
||||||
|
// XXX chose the method architecture...
|
||||||
|
// possible options:
|
||||||
|
// - use jQuery style message passing...
|
||||||
|
// $.ImageGridUI(<message-name>, <arguments> ...)
|
||||||
|
// - too singleton-ish
|
||||||
|
// - use a constructor and native methods...
|
||||||
|
// var ui = $(...).ImageGridUI(<options>)
|
||||||
|
// ui.method(<arguments>)
|
||||||
|
// - ui may be a collection...
|
||||||
|
// - need to query by ImageGridUI to get the objects again
|
||||||
|
// instead of re-constructing...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// jQuery chainability...
|
||||||
|
// XXX do we use this or return construct and an ImageGridUI object instead?
|
||||||
|
return this
|
||||||
|
}})(jQuery)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************************************************************ Setup **/
|
/************************************************************ Setup **/
|
||||||
|
|
||||||
function setup(){
|
function setup(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user