import { Component } from '@angular/core' ; import { HsCoreService } from '../core/core.service' ; import { HsLanguageService } from '../language/language.service' ; import { HsLayoutService } from '../layout/layout.service' ; import { HsPanelBaseComponent } from '../layout/panels/panel-base.component' ; import { HsShareService } from './share.service' ; import { HsSidebarService } from '../sidebar/sidebar.service' ; @ Component ( { selector : 'hs-share' , templateUrl : './partials/share.component.html' , } ) export class HsShareComponent extends HsPanelBaseComponent { new_share = false ; name = 'permalink' ; constructor ( public HsShareService , public HsCore , HsLayoutService , hsLanguageService , hsSidebarService ) { super ( HsLayoutService ) ; hsSidebarService . buttons . push ( { panel : 'permalink' , module : 'hs.permalink' , order : 11 , fits : true , title : ( ) => hsLanguageService . getTranslation ( 'PANEL_HEADER.PERMALINK' ) , description : ( ) => hsLanguageService . getTranslation ( 'SIDEBAR.descriptions.PERMALINK' ) , icon : 'icon-share-alt' , } ) ; } returns { string } description updateEmbedCode ( ) { return this . HsShareService . getEmbedCode ( ) ; } returns { string } description getShareUrl ( ) { return this . HsShareService . getShareUrl ( ) ; } description invalidateShareUrl ( ) { this . HsShareService . invalidateShareUrl ( ) ; } description shareOnSocial ( ) { this . HsShareService . shareOnSocial ( this . new_share ) ; } }