Skip to content

Commit

Permalink
Update to styling and checking of information
Browse files Browse the repository at this point in the history
  • Loading branch information
jasperchua99 committed Sep 19, 2020
1 parent f9b704d commit 384f2a5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
12 changes: 6 additions & 6 deletions source/includes/_equipment.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ Same with the ships API, this sections contains all the functions and results th
"largeCruiser": "String",
"battleship": "String",
"battlecruiser": "String",
"aviationBattleship": null,
"aircraftCarrier": null,
"lightCarrier": null,
"repairShip": null,
"aviationBattleship": "String",
"aircraftCarrier": "String",
"lightCarrier": "String",
"repairShip": "String",
"submarine": "String",
"submarineCarrier": null
"submarineCarrier": "String"
},
"misc": {
"obtainedFrom": "String",
Expand Down Expand Up @@ -68,4 +68,4 @@ api.getEquipment('Quadruple 130mm (Mle 1932)')
| English | getEquipmentByEnglishName | getEquipmentByNameEn |
| Japanese | getEquipmentByJapaneseName | getEquipmentByNameJp |
| Chinese | getEquipmentByChineseName | getEquipmentByNameCn |
| Korean | getEquipmentByKoreanName | getEquipmentByNameKr |
| Korean | getEquipmentByKoreanName | getEquipmentByNameKr |
17 changes: 6 additions & 11 deletions source/includes/_ship.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,16 @@ This section contains the results and functions developers need to use for fetch
"Project Code (A-Z)": {
"name": "String",
"attributes": [
"\"Health\" +45"
],
"materials": [
"2x \"DestroyerT1BP\""
"Object Format"
],
"materials": ["String in Array"],
"coins": Number,
"level": Number,
"levelBreakLevel": Number,
"levelBreakStars": "★★☆☆☆",
"levelBreakStars": "String",
"recurrence": Number,
"require": [
"Required Projects",
"A"
]
}, "B": {...}
"require": ["Object in Array"]
}
},
"retrofit_hullType": "String",

Expand Down Expand Up @@ -68,7 +63,7 @@ This section contains the results and functions developers need to use for fetch
],
"fleetTech": {
"statsBonus": { "collection": [Object], "maxLevel": [Object] },
"techPoints": { "collection": 14, "maxLimitBreak": 28, "maxLevel": 21, "total": 63 }
"techPoints": { "collection": Number, "maxLimitBreak": Number, "maxLevel": Number, "total": Number }
},
"construction": {
"constructionTime": "String",
Expand Down
23 changes: 16 additions & 7 deletions source/javascripts/app/_lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
*/
;(function () {
;
(function() {
'use strict';

var languages = [];
Expand All @@ -30,9 +31,15 @@ under the License.

$(".lang-selector a").removeClass('active');
$(".lang-selector a[data-language-name='" + language + "']").addClass('active');
for (var i=0; i < languages.length; i++) {
for (var i = 0; i < languages.length; i++) {
$(".highlight.tab-" + languages[i]).hide();
$(".lang-specific." + languages[i]).hide();

$('.highlight.tab-' + languages[i]).each(function(i, obj) {
if ($(this).parent().prev().hasClass('center-column')) {
$(this).show();
}
});
}
$(".highlight.tab-" + language).show();
$(".lang-specific." + language).show();
Expand All @@ -59,7 +66,7 @@ under the License.
return {};
}

return str.split('&').reduce(function (ret, param) {
return str.split('&').reduce(function(ret, param) {
var parts = param.replace(/\+/g, ' ').split('=');
var key = parts[0];
var val = parts[1];
Expand All @@ -82,11 +89,11 @@ under the License.
};

function stringifyURL(obj) {
return obj ? Object.keys(obj).sort().map(function (key) {
return obj ? Object.keys(obj).sort().map(function(key) {
var val = obj[key];

if (Array.isArray(val)) {
return val.sort().map(function (val2) {
return val.sort().map(function(val2) {
return encodeURIComponent(key) + '=' + encodeURIComponent(val2);
}).join('&');
}
Expand Down Expand Up @@ -121,7 +128,9 @@ under the License.

// if a button is clicked, add the state to the history
function pushURL(language) {
if (!history) { return; }
if (!history) {
return;
}
var hash = window.location.hash;
if (hash) {
hash = hash.replace(/^#+/, '');
Expand Down Expand Up @@ -161,4 +170,4 @@ under the License.
return false;
});
});
})();
})();
2 changes: 1 addition & 1 deletion source/layouts/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ under the License.
<title><%= current_page.data.title || "API Documentation" %></title>

<style media="screen">
<%= Rouge::Themes::MonokaiSublimeSlate.render(:scope => '.highlight') %>
<%= Rouge::Theme.find('thankful_eyes').render(scope: '.highlight') %>
</style>
<style media="print">
* {
Expand Down

0 comments on commit 384f2a5

Please sign in to comment.