Added all basic components and services

This commit is contained in:
2019-01-31 02:05:05 +05:30
parent fc3c4e1542
commit 1ae7addd72
4 changed files with 16 additions and 105 deletions

View File

@@ -0,0 +1,12 @@
:host {
/* height: 100%; */
display: flex;
flex-direction: column;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}

View File

@@ -1,5 +1,9 @@
@import "./src/sass/_variables.scss"; @import "./src/sass/_variables.scss";
:host {
height: 100%;
}
a, a,
a:hover, a:hover,
a:focus { a:focus {

View File

@@ -10,103 +10,3 @@ if (environment.production) {
platformBrowserDynamic().bootstrapModule(AppModule) platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err)); .catch(err => console.log(err));
$(document).ready(() => {
$('#sidebarCollapse').on('click', () => {
$('#sidebar').toggleClass('active');
$('.hideable').toggleClass('hide');
});
$('#content nav div.collapse li a.nav-link i.far.fa-star').hover(() => {
$('#content nav div.collapse li a.nav-link i.far.fa-star').toggleClass('fas');
});
$('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').hover(() => {
$('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').toggleClass('fas');
});
$('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').hover(() => {
$('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').toggleClass('fas');
});
// $('#command').keyup((e) => {
// const code = (e.keyCode ? e.keyCode : e.which);
// if (code === 13) {
// $('#widgets').children().addClass('hide');
// $('#successAlert').addClass('hide');
// $('#dangetAlert').addClass('hide');
// $('#intentBox').addClass('hide');
// const command = document.getElementById('command').value;
// if (command) {
// const text = { text: command };
// recastclient.getAndCallProcessIntent(command, text);
// } else {
// dom.showEmptyCommandMessage('Please type some relevant words in the command box.');
// }
// }
// });
$('#btnFavorites').click(() => {
});
$('#btnClearCommand').click(() => {
$('#command').val('');
$('#command').focus();
});
function hitEnter(command) {
const commandInputField = $('#command');
if (command) commandInputField.val(command);
const e = $.Event('keyup');
e.which = 13;
commandInputField.focus();
commandInputField.trigger(e);
}
$('#btnFireCommand').click(() => {
hitEnter();
});
$('#btnSubmitConfirm').on('click', () => {
$('#submitConfirm').removeClass('hide');
});
$('#submitGitData').on('click', () => {
const data = dom.getDataFromFormAsJSON();
const intent = $(`#${$config.constants.hiddenIntentFieldId}`).val();
if (intent) {
data.intent = intent;
var action = $config.intentSlugToOperations[intent].action;
action.payload = data;
store.dispatch(action);
const operation = $config.intentSlugToOperations[intent].githubOperation;
app[operation](data);
}
});
$('#hideInfoAlert').on('click', () => {
$('#intentBox').addClass('hide');
});
$('#hideSuccessAlert').on('click', () => {
$('#successAlert').addClass('hide');
});
$('#conversations').on('click', '.close', function () {
const $target = $(this).closest('.card');
const line = $target.next();
$target.hide('slow', () => { $target.remove(); });
line.hide('slow', () => { line.remove(); });
});
$('#conversations').on('click', '.btn.btn-info.float-right', function () {
const parentText = $(this).closest('.card-text').text();
const command = parentText.substring(0, parentText.indexOf('Repeat'));
hitEnter(command);
});
$('#hideDangerAlert').on('click', () => {
$('#dangerAlert').addClass('hide');
});
// $('#git_bridge').on('click', () => {
// window.location.href = 'https://github.com/login/oauth/authorize?scope=user:email:repo&client_id=f6f649a1fe2dfea082ba';
// });
const localHistory = JSON.parse(window.localStorage.getItem('currentState'));
window.onload = initOps();
function initOps() {
$('#command').focus();
dom.loadConversations(helper.concatenateAndSort(localHistory));
}
if (window.location.href.match(/\?code=(.*)/)) {
const code = window.location.href.match(/\?code=(.*)/)[1];
app.getToken(code);
}
});

View File

@@ -1,13 +1,8 @@
@import "./src/sass/_variables.scss"; @import "./src/sass/_variables.scss";
html {
height: 100%;
}
body { body {
font-family: 'Poppins', sans-serif; font-family: 'Poppins', sans-serif;
background-color: $themeColor-Dark; background-color: $themeColor-Dark;
min-height: 100%;
} }
p { p {