IHM/assets/js/m3d_db.js
/**
 * Create ObjectStore of attributes with contain of bin/attributes.xml.
 * @see Object.M3D.DB.setAttributes
 * @private
 */
Create ObjectStore of attributes with contain of bin/attributes.xml.
Create ObjectStore of attributes with contain of bin / attributes . xml .
function idbCreate_attributes(){
	var request = db.setVersion('1');
	request.onerror = function(e){log("Error: IndexedDB create attributes");};
	request.onsuccess = function(e) {
		if (!db.objectStoreNames.contains('attributes')) {
			try {
				db.createObjectStore('attributes', {keyPath: 'id'});
				var key = '__default_attributes__';
				$.ajax({
					url:'bin/xml_to_json.php',
					type:'POST',
					dataType:'json',
					data:{filename:'attributes.xml'},
					success:function(d){
						M3D.DB.setAttributes({name:key, value:d.attributes});
					},
					error:function(){
						alert('Could not load Models attributes! A server error has occured!');
					}
				});
				log("Object store attributes created");
			} catch (err) {
				log("Error: IndexedDB create attributes");
			}
		} else {
			log("Object store attributes already exists");
		}
	}
}
function idbCreate_attributes ( ) { var request = db . setVersion ( '1' ) ; request . onerror = function ( e ) { log ( "Error: IndexedDB create attributes" ) ; } ; request . onsuccess = function ( e ) { if ( ! db . objectStoreNames . contains ( 'attributes' ) ) { try { db . createObjectStore ( 'attributes' , { keyPath : 'id' } ) ; var key = '__default_attributes__' ; $ . ajax ( { url : 'bin/xml_to_json.php' , type : 'POST' , dataType : 'json' , data : { filename : 'attributes.xml' } , success : function ( d ) { M3D . DB . setAttributes ( { name : key , value : d . attributes } ) ; } , error : function ( ) { alert ( 'Could not load Models attributes! A server error has occured!' ) ; } } ) ; log ( "Object store attributes created" ) ; } catch ( err ) { log ( "Error: IndexedDB create attributes" ) ; } } else { log ( "Object store attributes already exists" ) ; } } }
Create ObjectStore of attributes with contain of bin/attributes.xml.
Create ObjectStore of attributes with contain of bin / attributes . xml .