Skip to content

Commit

Permalink
Merge pull request #313 from IgniteUI/hPopov/slingshot-template
Browse files Browse the repository at this point in the history
Create Slingshot docfx theme
  • Loading branch information
Hristo Popov authored Jun 11, 2021
2 parents c36f403 + 522c178 commit a12f723
Show file tree
Hide file tree
Showing 77 changed files with 3,517 additions and 2,343 deletions.
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ const generateBundlingGlobalMetadata = (done, dev=false) => {
{name:"main", ext: "js"},
{name:"lunr-search", ext: "js"},
{name:"runtime", ext: "js"},
{name:"styles", ext: "css"}]
{name:"igniteui", ext: "css"},
{name:"slingshot", ext: "css"}]
if(!dev) {
outputBuildFiles = fs.readdirSync(path.join(__dirname, WEBPACK_BUILD_DIST));
}
metadata["_timestamp"] = new Date().getTime();
bundlesToObserve.forEach(bundle => {

let bundleFileName = outputBuildFiles != null ? outputBuildFiles.find((file) => file.startsWith(bundle.name) && file.endsWith(bundle.ext)) : `${bundle.name}.${bundle.ext}`;
metadata[`_${bundle.name}`] = bundleFileName;
});
Expand Down
5 changes: 2 additions & 3 deletions src/app/docfx.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '../styles/main.scss';
import 'babel-polyfill';
import 'bootstrap';
import 'jquery-ui';
Expand Down Expand Up @@ -61,7 +60,7 @@ $(() => {
});

if (util.isOnIndexPage()) {
$("#_article-wrapper").removeClass("null-opacity");
$("#_article-content-wrapper").removeClass("null-opacity");
router.navigateTo($("meta[name=index]").attr("content")!);
} else {
(async () => {
Expand All @@ -70,7 +69,7 @@ $(() => {
affixService.render();
resolve();
}).then(() => {
$("#_article-wrapper").removeClass("null-opacity");
$("#_article-content-wrapper").removeClass("null-opacity");
if (util.hasLocationHash()) {
setTimeout(() => util.scroll(location.hash), 500);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/rendering/affix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class AffixRenderingService extends RenderingService implements Resizable
}

public reset() {
this.initialDimension = document.body.clientHeight - 160;
this.initialDimension = document.body.clientHeight - (util.offset + 36);
}

public handleChange(changeType: DimensionChangeType, newValue: number) {
Expand Down
9 changes: 5 additions & 4 deletions src/app/services/rendering/article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ export class ArticleRenderingService extends RenderingService {
relPpath = $("meta[name=data-docfx-rel]").attr("content")!,
platform = $("meta[property='docfx:platform']").attr("content"),
imgTag = $('<img>');


if(productLink.toLocaleLowerCase().includes("slingshot")) return;

if (productLink.includes("indigo")) {
productLink = "https://cloud.indigo.design";
Expand All @@ -265,11 +266,11 @@ export class ArticleRenderingService extends RenderingService {

if ($(".article-container h2")[2]) {
let thirdHeader = $(".article-container h2")[2], divTag = $('<div>');
$(imgTag).css({ "width": "100%", "display": "block", "margin": "auto", "cursor": "pointer" });
divTag.addClass('dfx-seo-banner')
$(imgTag).on('click', () => window.location.href = productLink);
$(divTag).append(imgTag);
$(thirdHeader).before(divTag);
}
}
}

private anchorJs() {
Expand Down Expand Up @@ -309,4 +310,4 @@ export class ArticleRenderingService extends RenderingService {
});
}
}
}
}
2 changes: 1 addition & 1 deletion src/app/services/rendering/toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class TocRenderingService extends RenderingService implements ResizableOb
}

public reset() {
this.initialDimension = document.body.clientHeight - 160;
this.initialDimension = document.body.clientHeight - (util.offset + 36);
}

public handleChange(changeType: DimensionChangeType, newValue: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class UtilityService {
public isIE = !((window as any).ActiveXObject) && "ActiveXObject" in window;
public isEdge = navigator.userAgent.indexOf('Edge') !== -1;
public baseDir: string;
public offset: number;
public removeHTMLExtensionFromUrl: boolean;
private offset: number;

constructor() {
this.offset = $('.navbar').first().height()!;
Expand Down
80 changes: 80 additions & 0 deletions src/assets/images/ss-logo-m-w.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/images/ss-search-Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/static/alert_icon1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/assets/static/alert_icon2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 0 additions & 19 deletions src/styles/_variables.scss

This file was deleted.

Loading

0 comments on commit a12f723

Please sign in to comment.