From bdcbded0bb114043010ad00a90ea7bd93eb9ec31 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Fri, 25 Sep 2015 02:46:34 -0500 Subject: [PATCH] Update Font Awesome to 4.4.0 Font Awesome 3 -> 4 was a backwards-incompatible change, so this update is pretty invasive. I tested everything we use it for and it still works, though. Including supporting both Font Awesome versions in battle.js. --- index.template.html | 2 +- js/battle.js | 2 +- js/client-battle.js | 6 +- js/client-ladder.js | 6 +- js/client-mainmenu.js | 12 +- js/client-rooms.js | 4 +- js/client-teambuilder.js | 52 +- js/client.js | 52 +- style/client.css | 6 +- style/font-awesome.css | 2480 ++++++++++++++++++++----- style/font/FontAwesome.otf | Bin 48748 -> 0 bytes style/font/fontawesome-webfont.eot | Bin 25395 -> 0 bytes style/font/fontawesome-webfont.svg | 284 --- style/font/fontawesome-webfont.ttf | Bin 55096 -> 0 bytes style/font/fontawesome-webfont.woff | Bin 29380 -> 0 bytes style/fonts/FontAwesome.otf | Bin 0 -> 106260 bytes style/fonts/fontawesome-webfont.eot | Bin 0 -> 68875 bytes style/fonts/fontawesome-webfont.svg | 640 +++++++ style/fonts/fontawesome-webfont.ttf | Bin 0 -> 138204 bytes style/fonts/fontawesome-webfont.woff | Bin 0 -> 81284 bytes style/fonts/fontawesome-webfont.woff2 | Bin 0 -> 64464 bytes testclient.html | 2 +- 22 files changed, 2695 insertions(+), 853 deletions(-) delete mode 100755 style/font/FontAwesome.otf delete mode 100755 style/font/fontawesome-webfont.eot delete mode 100755 style/font/fontawesome-webfont.svg delete mode 100755 style/font/fontawesome-webfont.ttf delete mode 100755 style/font/fontawesome-webfont.woff create mode 100644 style/fonts/FontAwesome.otf create mode 100644 style/fonts/fontawesome-webfont.eot create mode 100644 style/fonts/fontawesome-webfont.svg create mode 100644 style/fonts/fontawesome-webfont.ttf create mode 100644 style/fonts/fontawesome-webfont.woff create mode 100644 style/fonts/fontawesome-webfont.woff2 diff --git a/index.template.html b/index.template.html index 603eeae7b..606856fd6 100644 --- a/index.template.html +++ b/index.template.html @@ -107,7 +107,7 @@ ga('send', 'pageview');
-

Latest News

+

Latest News

diff --git a/js/battle.js b/js/battle.js index ac8cbc3d6..b62f42b79 100644 --- a/js/battle.js +++ b/js/battle.js @@ -5874,7 +5874,7 @@ var Battle = (function () { this.paused = true; this.playbackState = 3; if (this.resumeButton) { - this.frameElem.append('
'); + this.frameElem.append('
'); this.frameElem.find('div.playbutton button').click(this.resumeButton); } this.soundPause(); diff --git a/js/client-battle.js b/js/client-battle.js index 560f8dfb1..6579dbf4b 100644 --- a/js/client-battle.js +++ b/js/client-battle.js @@ -189,7 +189,7 @@ } else if (this.battle.playbackState === 2 || this.battle.playbackState === 3) { // battle is playing or paused - this.$controls.html('

'); + this.$controls.html('

'); return; } @@ -223,9 +223,9 @@ // battle has ended if (this.side) { // was a player - this.$controls.html('

'); + this.$controls.html('

'); } else { - this.$controls.html('

'); + this.$controls.html('

'); } } else if (!this.battle.mySide.initialized || !this.battle.yourSide.initialized) { diff --git a/js/client-ladder.js b/js/client-ladder.js index e6df3e906..59873d0d1 100644 --- a/js/client-ladder.js +++ b/js/client-ladder.js @@ -8,7 +8,7 @@ app.on('init:formats', this.update, this); this.update(); app.on('response:laddertop', function (data) { - var buf = '

'; + var buf = '

'; if (!data) { this.$el.html(buf + '

error

'); return; @@ -44,7 +44,7 @@ } else { var format = this.curFormat; var self = this; - this.$el.html('

Loading...

'); + this.$el.html('

Loading...

'); if (app.localLadder) { app.send('/cmd laddertop ' + format); } else { @@ -54,7 +54,7 @@ output: 'html' }, function (data) { if (self.curFormat !== format) return; - var buf = '

'; + var buf = '

'; buf += '

' + Tools.escapeFormat(format) + ' Top 500

'; buf += data + '
'; self.$el.html(buf); diff --git a/js/client-mainmenu.js b/js/client-mainmenu.js index f0cee3289..b28d5f6d7 100644 --- a/js/client-mainmenu.js +++ b/js/client-mainmenu.js @@ -88,7 +88,7 @@ options.append = options.append || false; options.noMinimize = options.noMinimize || false; - this.$pmBox[options.append ? 'append' : 'prepend']('

' + (!options.noMinimize ? '' : '') + options.title + '

' + + this.$pmBox[options.append ? 'append' : 'prepend']('

' + (!options.noMinimize ? '' : '') + options.title + '

' + options.html + '
'); }, @@ -161,8 +161,8 @@ group = '' + Tools.escapeHTML(group) + ''; } var buf = '
'; - buf += '

'; - buf += ''; + buf += '

'; + buf += ''; buf += group + Tools.escapeHTML(name.substr(1)) + '

'; buf += '
'; buf += '
'; @@ -455,7 +455,7 @@ } else { $formatButton.addClass('preselected')[0].disabled = true; $teamButton.addClass('preselected')[0].disabled = true; - $searchForm.find('button.big').html(' Searching...').addClass('disabled'); + $searchForm.find('button.big').html(' Searching...').addClass('disabled'); var searchEntries = $.isArray(this.searching) ? this.searching : [this.searching]; for (var i = 0; i < searchEntries.length; i++) { var format = searchEntries[i].format || searchEntries[i]; @@ -753,7 +753,7 @@ $formatButton.addClass('preselected')[0].disabled = true; $teamButton.addClass('preselected')[0].disabled = true; - $searchForm.find('button.big').html(' Connecting...').addClass('disabled'); + $searchForm.find('button.big').html(' Connecting...').addClass('disabled'); $searchForm.append('

'); app.sendTeam(team); @@ -920,7 +920,7 @@ var BattleListPopup = this.BattleListPopup = Popup.extend({ type: 'modal', initialize: function () { - var buf = '

'; + var buf = '

'; buf += '

'; this.$el.html(buf); this.$('.teamedit textarea').focus().select(); @@ -152,14 +152,14 @@ if (Storage.cantSave) buf += '
  • == CAN\'T SAVE ==
    You hit your browser\'s limit for team storage! Please backup them and delete some of them. Your teams won\'t be saved until you\'re under the limit again.
  • '; if (!teams.length) { if (this.deletedTeamLoc >= 0) { - buf += '
  • '; + buf += '
  • '; } buf += '
  • you don\'t have any teams lol
  • '; } else { - buf += '
  • '; + buf += '
  • '; for (var i = 0; i < teams.length + 1; i++) { if (i === this.deletedTeamLoc) { - buf += '
  • '; + buf += '
  • '; } if (i >= teams.length) break; @@ -183,16 +183,16 @@ buf += '
  • ' + formatText + '' + Tools.escapeHTML(team.name) + '
    '; buf += Storage.getTeamIcons(team); - buf += '
  • '; + buf += '
    '; } } - buf += '
  • '; + buf += '
  • '; buf += ''; if (window.nodewebkit) { - buf += ' '; + buf += ' '; } else { - buf += ''; + buf += ''; buf += '

    Clearing your cookies (specifically, localStorage) will delete your teams.

    If you want to clear your cookies or localStorage, you can use the Backup/Restore feature to save your teams as text first.

    '; } @@ -482,10 +482,10 @@ var buf = ''; if (this.exportMode) { - buf = '
    '; + buf = '
    '; buf += '
    '; } else { - buf = '
    '; + buf = '
    '; buf += '
    '; buf += '
      '; buf += '
    1. ' + this.clipboardHTML() + '
    2. '; @@ -509,25 +509,25 @@ } } if (curSection) buf += ''; - buf += ''; + buf += ''; } if (!this.curSetList.length) { buf += '
    3. you have no pokemon lol
    4. '; } for (i = 0; i < this.curSetList.length; i++) { if (this.curSetList.length < 6 && this.deletedSet && i === this.deletedSetLoc) { - buf += '
    5. '; + buf += '
    6. '; } buf += this.renderSet(this.curSetList[i], i); } if (this.deletedSet && i === this.deletedSetLoc) { - buf += '
    7. '; + buf += '
    8. '; } if (i === 0) { - buf += '
    9. '; + buf += '
    10. '; } if (i < 6) { - buf += '
    11. '; + buf += '
    12. '; } buf += '
    '; buf += '
    '; @@ -541,13 +541,13 @@ var buf = '
  • '; if (!set.species) { if (this.deletedSet) { - buf += '
    '; + buf += '
    '; } buf += '
    '; buf += '
  • '; return buf; } - buf += '
    '; + buf += '
    '; buf += '
    '; buf += ''; buf += '
    '; @@ -698,9 +698,9 @@ buf += '
    ' + this.clipboardInnerHTML() + '
    '; buf += '
    '; if (this.curTeam && this.curSetList.length < 6) { - buf += ''; + buf += ''; } - buf += ''; + buf += ''; buf += '
    '; buf += '
    '; @@ -892,7 +892,7 @@ updateSetView: function () { // pokemon var buf = '
    '; - buf += '
    '; + buf += '
    '; buf += '
    '; buf += this.renderTeambar(); buf += '
    '; @@ -910,7 +910,7 @@ // import/export buf += '
    '; - buf += '
    '; + buf += '
    '; buf += ''; buf += '
    '; @@ -932,16 +932,16 @@ var set = this.curSetList[i]; var pokemonicon = ''; if (!set.name) { - buf += ' '; + buf += ' '; isAdd = true; } else if (i == this.curSetLoc) { - buf += ' '; + buf += ' '; } else { buf += ' '; } } if (this.curSetList.length < 6 && !isAdd) { - buf += ' '; + buf += ' '; } return buf; }, @@ -2270,12 +2270,12 @@ for (var i = 0; i < data.team.length; i++) { var set = data.team[i]; if (i !== data.i && i !== data.i + 1) { - buf += '
  • '; + buf += '
  • '; } buf += ' ' + Tools.escapeHTML(set.name) + ''; } if (i !== data.i && i !== data.i + 1) { - buf += '
  • '; + buf += '
  • '; } buf += ''; this.$el.html(buf); diff --git a/js/client.js b/js/client.js index 8fd0ea564..1cf3c3b1a 100644 --- a/js/client.js +++ b/js/client.js @@ -1682,9 +1682,9 @@ var name = ' ' + app.user.get('name'); var color = hashColor(app.user.get('userid')); if (app.user.get('named')) { - buf = ' ' + Tools.escapeHTML(name) + ' '; + buf = ' ' + Tools.escapeHTML(name) + ' '; } else { - buf = ' '; + buf = ' '; } this.$userbar.html(buf); }, @@ -1710,13 +1710,13 @@ var buf = '
  • '; switch (id) { case '': - return buf + ' Home
  • '; + return buf + ' Home'; case 'teambuilder': - return buf + ' Teambuilder'; + return buf + ' Teambuilder'; case 'ladder': - return buf + ' Ladder'; + return buf + ' Ladder'; case 'rooms': - return buf + '  '; + return buf + '  '; default: if (id.substr(0, 7) === 'battle-') { var name = Tools.escapeHTML(room.title); @@ -1732,9 +1732,9 @@ name = '(empty room)'; } } - return buf + '' + formatid + '' + name + ''; + return buf + '' + formatid + '' + name + ''; } else { - return buf + ' ' + (Tools.escapeHTML(room.title) || (id === 'lobby' ? 'Lobby' : id)) + ''; + return buf + ' ' + (Tools.escapeHTML(room.title) || (id === 'lobby' ? 'Lobby' : id)) + ''; } } }, @@ -1746,9 +1746,9 @@ var curId = (app.curRoom ? app.curRoom.id : ''); var curSideId = (app.curSideRoom ? app.curSideRoom.id : ''); - var buf = '