mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 02:40:08 +00:00
made the Data constructor more generic + started migration process...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
f4edf858e9
commit
b3d6fee2ed
29
ui/data4.js
29
ui/data4.js
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
|
||||||
var DataClassProto = {
|
var DataClassPrototype = {
|
||||||
// NOTE: we consider the list sorted...
|
// NOTE: we consider the list sorted...
|
||||||
fromList: function(list){
|
fromList: function(list){
|
||||||
var res = new Data()
|
var res = new Data()
|
||||||
@ -754,14 +754,27 @@ var DataPrototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var Data = function(){
|
function Data(json){
|
||||||
this.base = null
|
if(this.constructor.name != 'Data'){
|
||||||
this.current = null
|
obj = new Data
|
||||||
this.order = []
|
} else {
|
||||||
this.ribbon_order = []
|
obj = this
|
||||||
this.ribbons = {}
|
}
|
||||||
|
|
||||||
this._gid_cache = []
|
obj.base = null
|
||||||
|
obj.current = null
|
||||||
|
obj.order = []
|
||||||
|
obj.ribbon_order = []
|
||||||
|
obj.ribbons = {}
|
||||||
|
|
||||||
|
obj._gid_cache = []
|
||||||
|
|
||||||
|
// load initial state...
|
||||||
|
if(json != null){
|
||||||
|
obj.loadJSON(json)
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj
|
||||||
}
|
}
|
||||||
Data.__proto__ = DataClassPrototype
|
Data.__proto__ = DataClassPrototype
|
||||||
Data.prototype = DataPrototype
|
Data.prototype = DataPrototype
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
<script src="ribbons.js"></script>
|
<script src="ribbons.js"></script>
|
||||||
<script src="data.js"></script>
|
<script src="data.js"></script>
|
||||||
|
<script src="data4.js"></script>
|
||||||
<script src="formats.js"></script>
|
<script src="formats.js"></script>
|
||||||
<!--script src="cache.js"></script-->
|
<!--script src="cache.js"></script-->
|
||||||
<script src="files.js"></script>
|
<script src="files.js"></script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user