@ -197,7 +197,7 @@ exports.default = _default;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = exports . POSTS_SYNCED = exports . POST _DELETED = exports . POST _UPDATED = exports . POST _ADDED = exports . POST _ERROR = exports . FEATURE _IMAGE _ADDED = exports . POST _IMAGE _ADDED = exports . PROJECTS _SORTED = exports . PROJECT _ADDED = exports . PROJECT _UPDATED = exports . ARCHIVES _ENTRY _LOADED = exports . ARCHIVES _PAGE _LOADED = exports . ARCHIVES _JSON _LOADED = exports . HTML _LOADED = exports . SETTINGS _LOADED = exports . IMG _REQUEST _LAME = exports . IMG _REQUEST _GOOD = exports . REQUEST _LAME = exports . REQUEST _GOOD = void 0 ;
exports . default = exports . LOCAL_DB _READY = exports . POSTS_SYNCED = exports . POST _DELETED = exports . POST _UPDATED = exports . POST _ADDED = exports . POST _ERROR = exports . FEATURE _IMAGE _ADDED = exports . POST _IMAGE _ADDED = exports . PROJECTS _SORTED = exports . PROJECT _ADDED = exports . PROJECT _UPDATED = exports . ARCHIVES _ENTRY _LOADED = exports . ARCHIVES _PAGE _LOADED = exports . ARCHIVES _JSON _LOADED = exports . HTML _LOADED = exports . SETTINGS _LOADED = exports . IMG _REQUEST _LAME = exports . IMG _REQUEST _GOOD = exports . REQUEST _LAME = exports . REQUEST _GOOD = void 0 ;
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
@ -239,6 +239,8 @@ var POST_DELETED = 'postImageAdded';
exports . POST _DELETED = POST _DELETED ;
var POSTS _SYNCED = 'postsSynced' ;
exports . POSTS _SYNCED = POSTS _SYNCED ;
var LOCAL _DB _READY = 'localDBReady' ;
exports . LOCAL _DB _READY = LOCAL _DB _READY ;
var DataEvent = function DataEvent ( ) {
_classCallCheck ( this , DataEvent ) ;
@ -37547,7 +37549,396 @@ function () {
} ( ) ;
exports . default = DashManager ;
} , { "./PostEditor" : "controllers/PostEditor.js" , "../../../../../brain/tools/effects/Animate" : "../../../../brain/tools/effects/Animate.js" , "./PostIndex" : "controllers/PostIndex.js" } ] , "Base.js" : [ function ( require , module , exports ) {
} , { "./PostEditor" : "controllers/PostEditor.js" , "../../../../../brain/tools/effects/Animate" : "../../../../brain/tools/effects/Animate.js" , "./PostIndex" : "controllers/PostIndex.js" } ] , "../../../default/src/com/tools/events/EventEmitter.jsx" : [ function ( require , module , exports ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = void 0 ;
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
function _defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } }
function _createClass ( Constructor , protoProps , staticProps ) { if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) _defineProperties ( Constructor , staticProps ) ; return Constructor ; }
var EventEmitter =
/*#__PURE__*/
function ( ) {
//--------------------------
// constructor
//--------------------------
function EventEmitter ( ) {
_classCallCheck ( this , EventEmitter ) ;
this . listeners = new Map ( ) ;
} //--------------------------
// methods
//--------------------------
_createClass ( EventEmitter , [ {
key : "addListener" ,
value : function addListener ( label , callback ) {
this . listeners . has ( label ) || this . listeners . set ( label , [ ] ) ;
this . listeners . get ( label ) . push ( callback ) ;
}
} , {
key : "removeListener" ,
value : function removeListener ( label , callback ) {
var isFunction = function isFunction ( obj ) {
return typeof obj == 'function' || false ;
} ;
var listeners = this . listeners . get ( label ) ,
index ;
if ( listeners && listeners . length ) {
index = listeners . reduce ( function ( i , listener , index ) {
return isFunction ( listener ) && listener === callback ? i = index : i ;
} , - 1 ) ;
if ( index > - 1 ) {
listeners . splice ( index , 1 ) ;
this . listeners . set ( label , listeners ) ;
return true ;
}
}
return false ;
}
} , {
key : "emitEvent" ,
value : function emitEvent ( label ) {
for ( var _len = arguments . length , args = new Array ( _len > 1 ? _len - 1 : 0 ) , _key = 1 ; _key < _len ; _key ++ ) {
args [ _key - 1 ] = arguments [ _key ] ;
}
var listeners = this . listeners . get ( label ) ;
if ( listeners && listeners . length ) {
listeners . forEach ( function ( listener ) {
listener . apply ( void 0 , args ) ;
} ) ;
return true ;
}
return false ;
} //--------------------------
// event handlers
//--------------------------
} ] ) ;
return EventEmitter ;
} ( ) ;
var _default = EventEmitter ;
exports . default = _default ;
} , { } ] , "../../../default/src/com/tools/events/DataEvent.jsx" : [ function ( require , module , exports ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = exports . PROJECTS _SORTED = exports . PROJECT _ADDED = exports . PROJECT _UPDATED = exports . ARCHIVES _ENTRY _LOADED = exports . ARCHIVES _PAGE _LOADED = exports . ARCHIVES _JSON _LOADED = exports . HTML _LOADED = exports . SETTINGS _LOADED = exports . IMG _REQUEST _LAME = exports . IMG _REQUEST _GOOD = exports . REQUEST _LAME = exports . REQUEST _GOOD = void 0 ;
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
var REQUEST _GOOD = 'requestGood' ;
exports . REQUEST _GOOD = REQUEST _GOOD ;
var REQUEST _LAME = 'requestLame' ;
exports . REQUEST _LAME = REQUEST _LAME ;
var IMG _REQUEST _GOOD = 'imgRequestGood' ;
exports . IMG _REQUEST _GOOD = IMG _REQUEST _GOOD ;
var IMG _REQUEST _LAME = 'imgRequestLame' ;
exports . IMG _REQUEST _LAME = IMG _REQUEST _LAME ;
var SETTINGS _LOADED = 'dataLoaded' ;
exports . SETTINGS _LOADED = SETTINGS _LOADED ;
var HTML _LOADED = 'htmlLoaded' ;
exports . HTML _LOADED = HTML _LOADED ;
var ARCHIVES _JSON _LOADED = 'archivesJSONLoaded' ;
exports . ARCHIVES _JSON _LOADED = ARCHIVES _JSON _LOADED ;
var ARCHIVES _PAGE _LOADED = 'archivesPAGELoaded' ;
exports . ARCHIVES _PAGE _LOADED = ARCHIVES _PAGE _LOADED ;
var ARCHIVES _ENTRY _LOADED = 'archivesEntryLoaded' ;
exports . ARCHIVES _ENTRY _LOADED = ARCHIVES _ENTRY _LOADED ;
var PROJECT _UPDATED = 'projectUpdated' ;
exports . PROJECT _UPDATED = PROJECT _UPDATED ;
var PROJECT _ADDED = 'projectAdded' ;
exports . PROJECT _ADDED = PROJECT _ADDED ;
var PROJECTS _SORTED = 'projectsSorted' ;
exports . PROJECTS _SORTED = PROJECTS _SORTED ;
var DataEvent = function DataEvent ( ) {
_classCallCheck ( this , DataEvent ) ;
} ;
var _default = new DataEvent ( ) ;
exports . default = _default ;
} , { } ] , "../../../default/src/com/tools/utilities/DataUtils.jsx" : [ function ( require , module , exports ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = exports . CONTENT _TYPE _FORM = exports . CONTENT _TYPE _JSON = exports . REQUEST _TYPE _DELETE = exports . REQUEST _TYPE _PUT = exports . REQUEST _TYPE _GET = exports . REQUEST _TYPE _POST = void 0 ;
var _EventEmitter2 = _interopRequireDefault ( require ( "../events/EventEmitter.jsx" ) ) ;
var DataEvent = _interopRequireWildcard ( require ( "../events/DataEvent.jsx" ) ) ;
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) { var desc = Object . defineProperty && Object . getOwnPropertyDescriptor ? Object . getOwnPropertyDescriptor ( obj , key ) : { } ; if ( desc . get || desc . set ) { Object . defineProperty ( newObj , key , desc ) ; } else { newObj [ key ] = obj [ key ] ; } } } } newObj . default = obj ; return newObj ; } }
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _typeof ( obj ) { if ( typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ) { _typeof = function _typeof ( obj ) { return typeof obj ; } ; } else { _typeof = function _typeof ( obj ) { return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ; } ; } return _typeof ( obj ) ; }
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
function _defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } }
function _createClass ( Constructor , protoProps , staticProps ) { if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) _defineProperties ( Constructor , staticProps ) ; return Constructor ; }
function _possibleConstructorReturn ( self , call ) { if ( call && ( _typeof ( call ) === "object" || typeof call === "function" ) ) { return call ; } return _assertThisInitialized ( self ) ; }
function _getPrototypeOf ( o ) { _getPrototypeOf = Object . setPrototypeOf ? Object . getPrototypeOf : function _getPrototypeOf ( o ) { return o . _ _proto _ _ || Object . getPrototypeOf ( o ) ; } ; return _getPrototypeOf ( o ) ; }
function _inherits ( subClass , superClass ) { if ( typeof superClass !== "function" && superClass !== null ) { throw new TypeError ( "Super expression must either be null or a function" ) ; } subClass . prototype = Object . create ( superClass && superClass . prototype , { constructor : { value : subClass , writable : true , configurable : true } } ) ; if ( superClass ) _setPrototypeOf ( subClass , superClass ) ; }
function _setPrototypeOf ( o , p ) { _setPrototypeOf = Object . setPrototypeOf || function _setPrototypeOf ( o , p ) { o . _ _proto _ _ = p ; return o ; } ; return _setPrototypeOf ( o , p ) ; }
function _assertThisInitialized ( self ) { if ( self === void 0 ) { throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ; } return self ; }
var REQUEST _TYPE _POST = "POST" ;
exports . REQUEST _TYPE _POST = REQUEST _TYPE _POST ;
var REQUEST _TYPE _GET = "GET" ;
exports . REQUEST _TYPE _GET = REQUEST _TYPE _GET ;
var REQUEST _TYPE _PUT = "PUT" ;
exports . REQUEST _TYPE _PUT = REQUEST _TYPE _PUT ;
var REQUEST _TYPE _DELETE = "DELETE" ;
exports . REQUEST _TYPE _DELETE = REQUEST _TYPE _DELETE ;
var CONTENT _TYPE _JSON = 'json' ;
exports . CONTENT _TYPE _JSON = CONTENT _TYPE _JSON ;
var CONTENT _TYPE _FORM = 'x-www-form-urlencoded' ;
exports . CONTENT _TYPE _FORM = CONTENT _TYPE _FORM ;
var DataUtils =
/*#__PURE__*/
function ( _EventEmitter ) {
_inherits ( DataUtils , _EventEmitter ) ;
//--------------------------
// constructor
//--------------------------
function DataUtils ( ) {
var _this ;
_classCallCheck ( this , DataUtils ) ;
_this = _possibleConstructorReturn ( this , _getPrototypeOf ( DataUtils ) . call ( this ) ) ;
var self = _assertThisInitialized ( _assertThisInitialized ( _this ) ) ;
return _this ;
} //--------------------------
// methods
//--------------------------
_createClass ( DataUtils , [ {
key : "request" ,
value : function request ( requestURL , eventType ) {
var requestType = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : REQUEST _TYPE _GET ;
var contentType = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : CONTENT _TYPE _JSON ;
var requestData = arguments . length > 4 && arguments [ 4 ] !== undefined ? arguments [ 4 ] : null ;
var self = this ;
return new Promise ( function ( resolve , reject ) {
var request = new XMLHttpRequest ( ) ;
request . upload . onprogress = self . handleLoadProgress ;
request . open ( requestType , requestURL , true ) ;
request . onload = function ( e ) {
if ( request . status == 200 ) {
resolve ( {
request : request ,
eventType : eventType
} ) ;
} else {
reject ( {
request : request ,
eventType : eventType
} ) ;
}
;
} ;
if ( requestType == REQUEST _TYPE _PUT || requestType == REQUEST _TYPE _POST ) {
switch ( contentType ) {
case CONTENT _TYPE _JSON :
request . setRequestHeader ( "Content-type" , "application/" + contentType ) ;
request . send ( JSON . stringify ( requestData ) ) ;
break ;
case CONTENT _TYPE _FORM :
request . send ( requestData ) ;
break ;
}
} else {
request . send ( ) ;
}
} ) ;
}
} , {
key : "imgLoad" ,
value : function imgLoad ( url ) {
'use strict' ; // Create new promise with the Promise() constructor;
// This has as its argument a function with two parameters, resolve and reject
return new Promise ( function ( resolve , reject ) {
// Standard XHR to load an image
var request = new XMLHttpRequest ( ) ;
request . open ( 'GET' , url ) ;
request . responseType = 'blob' ; // When the request loads, check whether it was successful
request . onload = function ( ) {
if ( request . status === 200 ) {
// If successful, resolve the promise by passing back the request response
resolve ( request . response ) ;
} else {
// If it fails, reject the promise with a error message
reject ( new Error ( 'Image didn\'t load successfully; error code:' + request . statusText ) ) ;
}
} ;
request . onerror = function ( ) {
// Also deal with the case when the entire request fails to begin with
// This is probably a network error, so reject the promise with an appropriate message
reject ( new Error ( 'There was a network error.' ) ) ;
} ; // Send the request
request . send ( ) ;
} ) ;
}
} , {
key : "loadImage" ,
value : function loadImage ( src ) {
'use strict' ;
var self = this ;
return new Promise ( function ( resolve , reject ) {
// Get a reference to the body element, and create a new image object
var body = document . querySelector ( 'body' ) ,
myImage = new Image ( ) ;
myImage . crossOrigin = "" ; // or "anonymous"
// Call the function with the URL we want to load, but then chain the
// promise then() method on to the end of it. This contains two callbacks
self . imgLoad ( src ) . then ( function ( response ) {
// The first runs when the promise resolves, with the request.reponse specified within the resolve() method.
var imageURL = window . URL . createObjectURL ( response ) ;
resolve ( imageURL ) ; //$('background-content').setStyle('background-image', 'url('+imageURL+')') //myImage.src = imageURL;
//console.log(imageURL);
//body.appendChild(myImage);
// The second runs when the promise is rejected, and logs the Error specified with the reject() method.
} , function ( Error ) {
reject ( Error ) ;
} ) ;
} ) ;
} //--------------------------
// event handlers
//--------------------------
} , {
key : "handleLoadProgress" ,
value : function handleLoadProgress ( e ) {
var percentComplete = Math . ceil ( e . loaded / e . total * 100 ) ; //console.log(percentComplete);
}
} ] ) ;
return DataUtils ;
} ( _EventEmitter2 . default ) ;
var _default = DataUtils ;
exports . default = _default ;
} , { "../events/EventEmitter.jsx" : "../../../default/src/com/tools/events/EventEmitter.jsx" , "../events/DataEvent.jsx" : "../../../default/src/com/tools/events/DataEvent.jsx" } ] , "../../../../brain/tools/utilities/DBUtils.js" : [ function ( require , module , exports ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = void 0 ;
var _DataUtils = _interopRequireDefault ( require ( "../../../themes/default/src/com/tools/utilities/DataUtils" ) ) ;
var _dexie = _interopRequireDefault ( require ( "dexie" ) ) ;
var DataEvent = _interopRequireWildcard ( require ( "../events/DataEvent" ) ) ;
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) { var desc = Object . defineProperty && Object . getOwnPropertyDescriptor ? Object . getOwnPropertyDescriptor ( obj , key ) : { } ; if ( desc . get || desc . set ) { Object . defineProperty ( newObj , key , desc ) ; } else { newObj [ key ] = obj [ key ] ; } } } } newObj . default = obj ; return newObj ; } }
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
function _defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } }
function _createClass ( Constructor , protoProps , staticProps ) { if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) _defineProperties ( Constructor , staticProps ) ; return Constructor ; }
var DBUtils =
/*#__PURE__*/
function ( ) {
//--------------------------
// constructor
//--------------------------
function DBUtils ( ) {
_classCallCheck ( this , DBUtils ) ;
this . dataUtils = new _DataUtils . default ( ) ;
this . db = new _dexie . default ( "fipamo_posts" ) ;
this . db . version ( 1 ) . stores ( {
postList : 'id,post'
} ) ;
} //--------------------------
// methods
//--------------------------
_createClass ( DBUtils , [ {
key : "resetLocal" ,
value : function resetLocal ( array ) {
var self = this ;
return new Promise ( function ( resolve , reject ) {
self . db . postList . clear ( ) . then ( function ( result ) {
self . db . postList . bulkAdd ( array ) . then ( function ( key ) {
self . db . postList . toArray ( function ( array ) {
var event = DataEvent . LOCAL _DB _READY ;
resolve ( {
event : event
} ) ;
} ) ;
} ) . catch ( _dexie . default . BulkError , function ( e ) {
reject ( {
e : e
} ) ;
} ) ;
} ) ;
} ) ;
} //--------------------------
// event handlers
//--------------------------
} ] ) ;
return DBUtils ;
} ( ) ;
exports . default = DBUtils ;
} , { "../../../themes/default/src/com/tools/utilities/DataUtils" : "../../../default/src/com/tools/utilities/DataUtils.jsx" , "dexie" : "../../../../node_modules/dexie/dist/dexie.es.js" , "../events/DataEvent" : "../../../../brain/tools/events/DataEvent.js" } ] , "Base.js" : [ function ( require , module , exports ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
@ -37561,7 +37952,7 @@ var DataEvent = _interopRequireWildcard(require("../../../../brain/tools/events/
var _DashManager = _interopRequireDefault ( require ( "./controllers/DashManager" ) ) ;
var _ dexie = _interopRequireDefault ( require ( "dexie ") ) ;
var _ DBUtils = _interopRequireDefault ( require ( "../../../../brain/tools/utilities/DBUtils ") ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
@ -37579,13 +37970,13 @@ function () {
//--------------------------
// constructor
//--------------------------
//TODO: Flip to unified structure defined in BMG, brah
function Base ( ) {
_classCallCheck ( this , Base ) ;
var self = this ;
this . dashManager = [ ] ;
this . dataUtils = new _DataUtils . default ( ) ;
this . dbUtils = new _DBUtils . default ( ) ;
this . settings = [ ] ;
this . cacheAssets ( ) ;
this . storeLocalData ( ) ;
@ -37614,18 +38005,10 @@ function () {
} ) ;
}
var fipamoPosts = new _dexie . default ( "fipamo_posts" ) ;
fipamoPosts . version ( 1 ) . stores ( {
postList : 'id, post'
} ) ;
fipamoPosts . postList . clear ( ) . then ( function ( result ) {
fipamoPosts . postList . bulkAdd ( list ) . then ( function ( key ) {
self . dbUtils . resetLocal ( list ) . then ( function ( r ) {
self . start ( ) ;
fipamoPosts . postList . toArray ( function ( array ) { //console.log(array[21].post.title);
} ) ;
} ) . catch ( _dexie . default . BulkError , function ( e ) {
console . log ( e ) ;
} ) ;
} ) . catch ( function ( err ) {
console . log ( err ) ;
} ) ;
} ) . catch ( function ( err ) {
console . log ( err ) ;
@ -37652,7 +38035,7 @@ function () {
} ( ) ;
exports . default = Base ;
} , { "../../../../brain/tools/utilities/DataUtils" : "../../../../brain/tools/utilities/DataUtils.js" , "../../../../brain/tools/events/DataEvent" : "../../../../brain/tools/events/DataEvent.js" , "./controllers/DashManager" : "controllers/DashManager.js" , " dexie": "../../../../node_modules/dexie/dist/dexie.e s.js"} ] , "Start.js" : [ function ( require , module , exports ) {
} , { "../../../../brain/tools/utilities/DataUtils" : "../../../../brain/tools/utilities/DataUtils.js" , "../../../../brain/tools/events/DataEvent" : "../../../../brain/tools/events/DataEvent.js" , "./controllers/DashManager" : "controllers/DashManager.js" , " ../../../../brain/tools/utilities/DBUtils": "../../../../brain/tools/utilities/DBUtil s.js"} ] , "Start.js" : [ function ( require , module , exports ) {
"use strict" ;
var _Base = _interopRequireDefault ( require ( "./Base" ) ) ;