Adam Shaw 7 ani în urmă
părinte
comite
0c26873e21

+ 11 - 11
demos/themes.html

@@ -158,21 +158,26 @@
         </select>
       </div>
 
-      <div data-theme-system="bootstrap3" class='selector' style='display:none'>
+      <div data-theme-system="bootstrap4" class='selector' style='display:none'>
         Theme Name:
 
         <select>
           <option value='' selected>Default</option>
+          <option value='cerulean'>Cerulean</option>
           <option value='cosmo'>Cosmo</option>
           <option value='cyborg'>Cyborg</option>
           <option value='darkly'>Darkly</option>
           <option value='flatly'>Flatly</option>
           <option value='journal'>Journal</option>
+          <option value='litera'>Litera</option>
           <option value='lumen'>Lumen</option>
-          <option value='paper'>Paper</option>
-          <option value='readable'>Readable</option>
+          <option value='lux'>Lux</option>
+          <option value='materia'>Materia</option>
+          <option value='minty'>Minty</option>
+          <option value='pulse'>Pulse</option>
           <option value='sandstone'>Sandstone</option>
           <option value='simplex'>Simplex</option>
+          <option value='sketchy'>Sketchy</option>
           <option value='slate'>Slate</option>
           <option value='solar'>Solar</option>
           <option value='spacelab'>Spacelab</option>
@@ -182,26 +187,21 @@
         </select>
       </div>
 
-      <div data-theme-system="bootstrap4" class='selector' style='display:none'>
+      <div data-theme-system="bootstrap3" class='selector' style='display:none'>
         Theme Name:
 
         <select>
           <option value='' selected>Default</option>
-          <option value='cerulean'>Cerulean</option>
           <option value='cosmo'>Cosmo</option>
           <option value='cyborg'>Cyborg</option>
           <option value='darkly'>Darkly</option>
           <option value='flatly'>Flatly</option>
           <option value='journal'>Journal</option>
-          <option value='litera'>Litera</option>
           <option value='lumen'>Lumen</option>
-          <option value='lux'>Lux</option>
-          <option value='materia'>Materia</option>
-          <option value='minty'>Minty</option>
-          <option value='pulse'>Pulse</option>
+          <option value='paper'>Paper</option>
+          <option value='readable'>Readable</option>
           <option value='sandstone'>Sandstone</option>
           <option value='simplex'>Simplex</option>
-          <option value='sketchy'>Sketchy</option>
           <option value='slate'>Slate</option>
           <option value='solar'>Solar</option>
           <option value='spacelab'>Spacelab</option>

+ 9 - 10
plugins/gcal/GcalEventSource.ts

@@ -49,16 +49,15 @@ export default class GcalEventSource extends EventSource {
 
         this.calendar.popLoading()
 
-        if (!error) {
-          let resData = res.body
-          if (resData.error) {
-            this.reportError('Google Calendar API: ' + resData.error.message, resData.error.errors)
-          } else if (resData.items) {
-            rawEventDefs = this.gcalItemsToRawEventDefs(
-              resData.items,
-              requestParams.timeZone
-            )
-          }
+        if (res.body && res.body.error) {
+          this.reportError('Google Calendar API: ' + res.body.error.message, res.body.error.errors)
+        } else if (error) {
+          this.reportError('Google Calendar API', error)
+        } else {
+          rawEventDefs = this.gcalItemsToRawEventDefs(
+            res.body.items,
+            requestParams.timeZone
+          )
         }
 
         if (rawEventDefs) {

+ 2 - 1
src/models/event-source/JsonFeedEventSource.ts

@@ -51,9 +51,10 @@ export default class JsonFeedEventSource extends EventSource {
       this.calendar.popLoading()
 
       if (!error) {
-        if (res.body) {
+        if (res.body) { // parsed JSON
           rawEventDefs = res.body
         } else if (res.text) {
+          // if the server doesn't set Content-Type, won't be parsed as JSON. parse anyway.
           rawEventDefs = JSON.parse(res.text)
         }
       }

+ 1 - 1
tasks/lint.js

@@ -38,7 +38,7 @@ gulp.task('lint:js:built', [ 'webpack' ], function() {
         parserOptions: { 'ecmaVersion': 3 }, // for IE9
         envs: [ 'browser', 'commonjs', 'amd' ],
         rules: { 'no-undef': 2 },
-        globals: [ 'ActiveXObject' ] // for reqwest
+        globals: [ 'Promise', 'ActiveXObject' ] // for superagent
       })
     )
     .pipe(eslint.format())