1
1
var chromeUtil = {
2
2
} ;
3
3
chromeUtil . getOS = function ( ) {
4
- console . verbose ( "getOS OS=" + navigator . appVersion ) ;
4
+ console . log ( "getOS OS=" + navigator . appVersion ) ;
5
5
return navigator . appVersion ;
6
6
} ;
7
7
chromeUtil . alert = function ( message ) {
8
- console . verbose ( "Alert " + message ) ;
8
+ console . log ( "Alert " + message ) ;
9
9
if ( ! chromeUtil . alertDialogInit ) {
10
10
chromeUtil . alertDialogInit = true ;
11
11
$ ( '#alert_dialog' ) . dialog ( {
@@ -71,7 +71,7 @@ chromeUtil.alertUpdate = function (currentVersion, latestVersion) {
71
71
var message = getLocalizedMessage ( 'firmwareUpdateAvailable' )
72
72
. replace ( "___LATEST_VERSION___" , latestVersion )
73
73
. replace ( "___INSTALLED_VERSION___" , currentVersion ) ;
74
- console . verbose ( message ) ;
74
+ console . log ( message ) ;
75
75
}
76
76
77
77
var Storage = function ( ) {
@@ -84,20 +84,20 @@ var STORAGE_KEY_EXPERIMENT_LIST = "experimentList";
84
84
var STORAGE_KEY_EXPERIMENT_PREFIX = "pcr_" ;
85
85
86
86
Storage . prototype . loadList = function ( callback ) {
87
- console . verbose ( "Storage.prototype.loadList" ) ;
87
+ console . log ( "Storage.prototype.loadList" ) ;
88
88
var self = this ;
89
89
chrome . storage . sync . get ( STORAGE_KEY_EXPERIMENT_LIST , function ( data ) {
90
- console . verbose ( "Load done. data=" + data ) ;
90
+ console . log ( "Load done. data=" + data ) ;
91
91
if ( data [ STORAGE_KEY_EXPERIMENT_LIST ] )
92
92
self . experiments = JSON . parse ( data [ STORAGE_KEY_EXPERIMENT_LIST ] ) ;
93
93
else
94
94
self . experiments = [ ] ;
95
95
if ( self . experiments && self . experiments . length > 0 ) {
96
- console . verbose ( "Storage.loadList Experiment List Found." ) ;
96
+ console . log ( "Storage.loadList Experiment List Found." ) ;
97
97
callback ( self . experiments ) ;
98
98
} else {
99
99
//Empty
100
- console . verbose ( "Empty. Add default experiment and save." ) ;
100
+ console . log ( "Empty. Add default experiment and save." ) ;
101
101
self . insertDefaultExperiment ( callback ) ;
102
102
}
103
103
} ) ;
@@ -114,7 +114,7 @@ Storage.prototype.loadExperiment = function (experimentId, callback) {
114
114
var self = this ;
115
115
chrome . storage . sync . get ( key , function ( data ) {
116
116
var dataStr = data [ key ] ;
117
- console . verbose ( "Data str=" + dataStr ) ;
117
+ console . log ( "Data str=" + dataStr ) ;
118
118
var experiment = null ;
119
119
120
120
if ( dataStr != null ) {
@@ -131,9 +131,9 @@ Storage.prototype.loadExperiment = function (experimentId, callback) {
131
131
132
132
} ;
133
133
Storage . prototype . clearAllData = function ( ) {
134
- console . verbose ( "clearAllData" ) ;
134
+ console . log ( "clearAllData" ) ;
135
135
chrome . storage . sync . clear ( function ( ) {
136
- console . verbose ( "Done." ) ;
136
+ console . log ( "Done." ) ;
137
137
} ) ;
138
138
} ;
139
139
Storage . prototype . generateId = function ( ) {
@@ -148,15 +148,15 @@ Storage.prototype.updateCurrentExperiment = function (name, newData, callback) {
148
148
for ( var i = 0 ; i < this . experiments . length ; i ++ ) {
149
149
var experiment = this . experiments [ i ] ;
150
150
if ( experiment . id == id ) {
151
- console . verbose ( "Old name=" + experiment . name ) ;
151
+ console . log ( "Old name=" + experiment . name ) ;
152
152
this . experiments [ i ] . name = name ;
153
153
}
154
154
}
155
155
var storageObj = { } ;
156
156
storageObj [ STORAGE_KEY_EXPERIMENT_LIST ] = JSON . stringify ( this . experiments , null , '' ) ;
157
157
var self = this ;
158
158
chrome . storage . sync . set ( storageObj , function ( ) {
159
- console . verbose ( 'Experiment "' + name + '" saved' ) ;
159
+ console . log ( 'Experiment "' + name + '" saved' ) ;
160
160
var detailStorageObj = { } ;
161
161
detailStorageObj [ key ] = JSON . stringify ( newData , null , '' ) ;
162
162
chrome . storage . sync . set ( detailStorageObj , function ( ) {
@@ -168,12 +168,12 @@ Storage.prototype.updateCurrentExperiment = function (name, newData, callback) {
168
168
} ) ;
169
169
} ;
170
170
Storage . prototype . deleteCurrentExperiment = function ( callback ) {
171
- console . verbose ( "deleteCurrentExperiment " + this . currentExperimentId ) ;
171
+ console . log ( "deleteCurrentExperiment " + this . currentExperimentId ) ;
172
172
173
173
for ( var i = 0 ; i < this . experiments . length ; i ++ ) {
174
174
var experiment = this . experiments [ i ] ;
175
175
if ( experiment . id == this . currentExperimentId ) {
176
- console . verbose ( "Remove " + i ) ;
176
+ console . log ( "Remove " + i ) ;
177
177
this . experiments . splice ( i , 1 ) ;
178
178
break ;
179
179
}
@@ -182,11 +182,11 @@ Storage.prototype.deleteCurrentExperiment = function (callback) {
182
182
storageObj [ STORAGE_KEY_EXPERIMENT_LIST ] = JSON . stringify ( this . experiments , null , '' ) ;
183
183
var self = this ;
184
184
chrome . storage . sync . set ( storageObj , function ( ) {
185
- console . verbose ( 'List saved.' ) ;
185
+ console . log ( 'List saved.' ) ;
186
186
var detailStorageObj = { } ;
187
187
var key = self . getKeyForId ( self . currentExperimentId ) ;
188
188
chrome . storage . sync . remove ( key , function ( ) {
189
- console . verbose ( 'Detail data removed.' ) ;
189
+ console . log ( 'Detail data removed.' ) ;
190
190
callback ( ) ;
191
191
} ) ;
192
192
} ) ;
@@ -202,7 +202,7 @@ Storage.prototype.insertExperiment = function (name, experiment, callback) {
202
202
storageObj [ STORAGE_KEY_EXPERIMENT_LIST ] = JSON . stringify ( this . experiments , null , '' ) ;
203
203
var self = this ;
204
204
chrome . storage . sync . set ( storageObj , function ( ) {
205
- console . verbose ( 'Experiment "' + name + '" saved' ) ;
205
+ console . log ( 'Experiment "' + name + '" saved' ) ;
206
206
var detailStorageObj = { } ;
207
207
var key = self . getKeyForId ( id ) ;
208
208
detailStorageObj [ key ] = JSON . stringify ( experiment , null , '' ) ;
@@ -215,7 +215,7 @@ Storage.prototype.insertExperiment = function (name, experiment, callback) {
215
215
} ) ;
216
216
} ;
217
217
Storage . prototype . updateExperiment = function ( experiment ) {
218
- console . verbose ( "Storage#updateExperiment" ) ;
218
+ console . log ( "Storage#updateExperiment" ) ;
219
219
} ;
220
220
221
221
Storage . prototype . getLogFileName = function ( ) {
0 commit comments