minor doc revision...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-06-04 05:46:57 +04:00
parent 60e7b695a7
commit 7ead8cfeb4

View File

@ -107,6 +107,19 @@ var DataClassPrototype = {
// //
var DataPrototype = { var DataPrototype = {
/*****************************************************************/
//
// Base Terminology:
// - gen1 methods
// - use the data API/Format
// - use other gen1 methods
// - gen2 methods
// - do NOT use the data API/Format
// - use other methods from any of gen1 and gen2
//
// NOTE: only gen2 methods are marked.
//
//
/****************************************************** Format ***/ /****************************************************** Format ***/
// //
// .current (gid) // .current (gid)
@ -145,7 +158,7 @@ var DataPrototype = {
// Make a sparse list of image gids... // Make a sparse list of image gids...
// //
// This will use this.order as the base for ordering the list. // This uses .order as the base for ordering the list.
// //
// If target is given then it will get updated with the input gids. // If target is given then it will get updated with the input gids.
// //
@ -288,7 +301,6 @@ var DataPrototype = {
// NOTE: null is returned if there is no image at given offset. // NOTE: null is returned if there is no image at given offset.
// NOTE: offset is calculated within the same ribbon... // NOTE: offset is calculated within the same ribbon...
// //
//
// NOTE: If gid|order is not given, current image is assumed. // NOTE: If gid|order is not given, current image is assumed.
// Similarly, if list|ribbon is not given then the current // Similarly, if list|ribbon is not given then the current
// ribbon is used. // ribbon is used.
@ -344,7 +356,7 @@ var DataPrototype = {
return null return null
} }
// nirmalize target... // normalize target...
if(target in this.ribbons || target.constructor.name == 'Array'){ if(target in this.ribbons || target.constructor.name == 'Array'){
list = target list = target
target = this.current target = this.current
@ -686,6 +698,7 @@ var DataPrototype = {
// Shorthand methods... // Shorthand methods...
// //
// XXX should these be here??? // XXX should these be here???
focusBaseRibbon: function(){ return this.focusImage(this.base) },
focusImageOffset: function(offset){ focusImageOffset: function(offset){
offset = offset == null ? 0 : offset offset = offset == null ? 0 : offset
@ -696,10 +709,10 @@ var DataPrototype = {
return this.focusImage('current', offset) return this.focusImage('current', offset)
}, },
nextImage: function(){ return this.focusImageOffset(1) }, nextImage: function(){ return this.focusImageOffset(1) }, // Gen2
prevImage: function(){ return this.focusImageOffset(-1) }, prevImage: function(){ return this.focusImageOffset(-1) }, // Gen2
firstImage: function(){ return this.focusImageOffset(-this.getImages('current').length) }, firstImage: function(){ return this.focusImageOffset(-this.getImages('current').length) }, // Gen2
lastImage: function(){ return this.focusImageOffset(this.getImages('current').length) }, lastImage: function(){ return this.focusImageOffset(this.getImages('current').length) }, // Gen2
focusRibbonOffset: function(offset){ focusRibbonOffset: function(offset){
var c = this.getRibbonOrder() var c = this.getRibbonOrder()
var t = c+offset var t = c+offset
@ -709,9 +722,8 @@ var DataPrototype = {
// up/down navigation... // up/down navigation...
return this.focusImage('current', (t < c ? 'after' : 'before'), t) return this.focusImage('current', (t < c ? 'after' : 'before'), t)
}, },
nextRibbon: function(){ return this.focusRibbonOffset(1) }, nextRibbon: function(){ return this.focusRibbonOffset(1) }, // Gen2
prevRibbon: function(){ return this.focusRibbonOffset(-1) }, prevRibbon: function(){ return this.focusRibbonOffset(-1) }, // Gen2
focusBaseRibbon: function(){ return this.focusImage(this.base) },
// Set base ribbon... // Set base ribbon...
// //
@ -922,8 +934,8 @@ var DataPrototype = {
// NOTE: none of these change .current // NOTE: none of these change .current
// //
// XXX should these be here?? // XXX should these be here??
shiftImageLeft: function(gid){ return this.shiftImage(gid, -1, 'offset') }, shiftImageLeft: function(gid){ return this.shiftImage(gid, -1, 'offset') }, // Gen2
shiftImageRight: function(gid){ return this.shiftImage(gid, 1, 'offset') }, shiftImageRight: function(gid){ return this.shiftImage(gid, 1, 'offset') }, // Gen2
// XXX test... // XXX test...
shiftImageUp: function(gid){ shiftImageUp: function(gid){
var g = gid.constructor.name == 'Array' ? gid[0] : gid var g = gid.constructor.name == 'Array' ? gid[0] : gid
@ -984,8 +996,8 @@ var DataPrototype = {
// Shorthand actions... // Shorthand actions...
// //
// XXX should these be here?? // XXX should these be here??
shiftRibbonUp: function(gid){ return this.shiftRibbon(gid, -1, 'offset') }, shiftRibbonUp: function(gid){ return this.shiftRibbon(gid, -1, 'offset') }, // Gen2
shiftRibbonDown: function(gid){ return this.shiftRibbon(gid, 1, 'offset') }, shiftRibbonDown: function(gid){ return this.shiftRibbon(gid, 1, 'offset') }, // Gen2