Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

Remove FTL and FTL references in components and gulp build/tasks #173

Merged
merged 3 commits into from
Nov 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions gulp/ComponentJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ gulp.task('ComponentJS-copyLib', function() {
.pipe(gulp.dest(Config.paths.distLibPath));
});



gulp.task('ComponentJS-typescript', ['Documentation-template'], function() {
var tscResult = gulp.src([Config.paths.src + '/**/*.ts', Config.paths.distJS + "/fabric.templates.ts"])
gulp.task('ComponentJS-typescript', function() {
var tscResult = gulp.src([Config.paths.src + '/**/*.ts'])
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Typescriptingz the file"
})))
Expand Down
24 changes: 0 additions & 24 deletions gulp/Documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ var Plugins = require('./modules/Plugins');
var ComponentHelper = require('./modules/ComponentHelper');
var folderList = Utilities.getFolders(Config.paths.componentsPath);
var demoPagesList = Utilities.getFolders(Config.paths.srcDocsPages);
var Template = require('./modules/Template');
var reload = require('require-reload')(require);
var BuildConfig = require('./modules/BuildConfig');

Expand Down Expand Up @@ -86,27 +85,6 @@ gulp.task('Documentation-handlebars', function(cb) {
cb();
});

gulp.task('Documentation-template', ["Documentation-handlebars"], function(cb) {
var _template = new Template(folderList, Config.paths.distJS, Config.paths.componentsPath, function() {
gulp.src(Config.paths.distJS + "/fabric.templates.ts")
.pipe(Plugins.header(Banners.getBannerTemplate(), Banners.getBannerData()))
.pipe(Plugins.header(Banners.getJSCopyRight()))
.pipe(Plugins.tsc(Config.typescriptProject))
.js.pipe(gulp.dest(Config.paths.distJS))
.on('end', function() {
cb();
});
}.bind(this));
_template.init();
});

gulp.task('Documentation-templateAddHeader', ['Documentation-template'], function(){
gulp.src(Config.paths.distJS + "/fabric.templates.ts")
.pipe(Plugins.header(Banners.getBannerTemplate(), Banners.getBannerData()))
.pipe(Plugins.header(Banners.getJSCopyRight()))
.pipe(gulp.dest(Config.paths.distJS));
});

//
// Sample Component Building
// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -277,8 +255,6 @@ var DocumentationTasks = [
'Documentation-copyAssets',
'ComponentJS',
'Documentation-copyIgnoredFiles',
"Documentation-template",
"Documentation-templateAddHeader",
"Documentation-buildStyles",
"Documentation-convertMarkdown"
];
Expand Down
190 changes: 0 additions & 190 deletions gulp/modules/Template.js

This file was deleted.

1 change: 0 additions & 1 deletion src/components/Callout/Callout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/// <reference path="../Button/Button.ts"/>
/// <reference path="../Button/IButton.ts"/>
/// <reference path="../../../dist/js/fabric.templates.ts"/>

/**
* Callout
Expand Down
1 change: 0 additions & 1 deletion src/components/CommandButton/CommandButton.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.

/// <reference path="../../../dist/js/fabric.templates.ts"/>
/// <reference path="../ContextualHost/ContextualHost.ts"/>

/**
Expand Down
29 changes: 21 additions & 8 deletions src/components/ContextualHost/ContextualHost.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.

/// <reference path="../../../dist/js/fabric.templates.ts"/>

/**
* ContextualHost
*
Expand All @@ -22,8 +20,8 @@ namespace fabric {

const CONTEXT_STATE_CLASS = "is-open";
const MODAL_STATE_POSITIONED = "is-positioned";
const CONTEXT_HOST_MAIN_CLASS = ".ms-ContextualHost-main";
const CONTEXT_HOST_BEAK_CLASS = ".ms-ContextualHost-beak";
const CONTEXT_HOST_MAIN_CLASS = "ms-ContextualHost-main";
const CONTEXT_HOST_BEAK_CLASS = "ms-ContextualHost-beak";
const ARROW_LEFT_CLASS = "ms-ContextualHost--arrowLeft";
const ARROW_TOP_CLASS = "ms-ContextualHost--arrowTop";
const ARROW_BOTTOM_CLASS = "ms-ContextualHost--arrowBottom";
Expand All @@ -47,7 +45,6 @@ namespace fabric {
private _disposalCallback: Function;
private _targetElement;
private _matchTargetWidth;
private _ftl = new FabricTemplateLibrary();
private _contextualHostMain: Element;
private _children: Array<ContextualHost>;
private _hasArrow: boolean;
Expand All @@ -66,12 +63,12 @@ namespace fabric {
this._dismissAction = this._dismissAction.bind(this);
this._matchTargetWidth = matchTargetWidth || false;
this._direction = direction;
this._container = this._ftl.ContextualHost();
this._container = this.createContainer();
this._contextualHost = this._container;
this._contextualHostMain = this._contextualHost.querySelector(CONTEXT_HOST_MAIN_CLASS);
this._contextualHostMain = this._contextualHost.getElementsByClassName(CONTEXT_HOST_MAIN_CLASS)[0];
this._contextualHostMain.appendChild(content);
this._hasArrow = hasArrow;
this._arrow = this._container.querySelector(CONTEXT_HOST_BEAK_CLASS);
this._arrow = this._container.getElementsByClassName(CONTEXT_HOST_BEAK_CLASS)[0];

this._targetElement = targetElement;
this._openModal();
Expand Down Expand Up @@ -126,6 +123,22 @@ namespace fabric {
return this._container.contains(value);
}

private createContainer() {
let ContextualHost0 = document.createElement("div");
ContextualHost0.setAttribute("class", "ms-ContextualHost");
ContextualHost0.innerHTML += " ";
let ContextualHost0c1 = document.createElement("div");
ContextualHost0c1.setAttribute("class", CONTEXT_HOST_MAIN_CLASS);
ContextualHost0c1.innerHTML += " ";
ContextualHost0.appendChild(ContextualHost0c1);
ContextualHost0.innerHTML += " ";
let ContextualHost0c3 = document.createElement("div");
ContextualHost0c3.setAttribute("class", CONTEXT_HOST_BEAK_CLASS);
ContextualHost0.appendChild(ContextualHost0c3);
ContextualHost0.innerHTML += "";
return ContextualHost0;
}

private _openModal(): void {
this._copyModalToBody();
this._saveModalSize();
Expand Down
1 change: 0 additions & 1 deletion src/components/ContextualMenu/ContextualMenu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.

/// <reference path="../../../dist/js/fabric.templates.ts"/>
/// <reference path="../ContextualHost/ContextualHost.ts"/>
/// <reference path="../Button/Button.ts"/>

Expand Down
7 changes: 3 additions & 4 deletions src/components/Overlay/Overlay.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.

/// <reference path="../../../dist/js/fabric.templates.ts"/>

namespace fabric {

export class Overlay {
public overlayElement: HTMLElement;
private _ftl = new FabricTemplateLibrary();

constructor(overlayElement?: HTMLElement) {
if (overlayElement) {
this.overlayElement = overlayElement;
} else {
this.overlayElement = this._ftl.Overlay();
let overlayContainer = document.createElement("div");
overlayContainer.setAttribute("class", "ms-Overlay");
this.overlayElement = overlayContainer;
}
this.overlayElement.addEventListener("click", this.hide.bind(this), false);
}
Expand Down
1 change: 0 additions & 1 deletion src/documentation/templates/componentDemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="../../../js/fabric.js"></script>
<script type="text/javascript" src="../../../js/fabric.templates.js"></script>
<script type="text/javascript" src="../../../lib/pickadate.js"></script>
</head>

Expand Down