Skip to content
Commits on Source (6)
......@@ -36,3 +36,4 @@ node_modules
!/.drone.yml
!/.gitlab
!/.githooks
!/.prettierrc
......@@ -4,7 +4,7 @@ services:
- docker:dind
stages:
- test:unit
- test
- build
- prepare
- review
......@@ -21,11 +21,19 @@ variables:
test:
image: circleci/node:8-browsers
stage: test:unit
stage: test
script:
- npm ci
- npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
lint:
stage: test
script:
- npm i -g prettier
- prettier --check "src/**/*.ts"
- prettier --check "src/**/*.scss"
- prettier --check "src/**/*.html"
e2e:chrome:
image: cypress/browsers:chrome67
stage: test:e2e
......
# .prettierrc
# Use this file to define your defaults for prettier
# For a list of all available options:
# https://prettier.io/docs/en/options.html
trailingComma: 'es5'
printWidth: 80
singleQuote: true
semi: true
......@@ -14658,6 +14658,12 @@
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
},
"prettier": {
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz",
"integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==",
"dev": true
},
"pretty-hrtime": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",
......
......@@ -3,56 +3,56 @@ import {
style,
animate,
transition,
keyframes
} from "@angular/animations";
keyframes,
} from '@angular/animations';
export const animations: any[] = [
trigger("foolishIn", [
transition("* => *", [
trigger('foolishIn', [
transition('* => *', [
style({ opacity: 0 }),
animate(
2000,
keyframes([
style({
opacity: 0,
transformOrigin: "50% 50%",
transform: "scale(0, 0) rotate(360deg)",
offset: 0.0
transformOrigin: '50% 50%',
transform: 'scale(0, 0) rotate(360deg)',
offset: 0.0,
}),
style({
opacity: 1,
transformOrigin: "0% 100%",
transform: "scale(0.5, 0.5) rotate(0deg)",
offset: 0.066
transformOrigin: '0% 100%',
transform: 'scale(0.5, 0.5) rotate(0deg)',
offset: 0.066,
}),
style({
opacity: 1,
transformOrigin: "100% 100%",
transform: "scale(0.5, 0.5) rotate(0deg)",
offset: 0.132
transformOrigin: '100% 100%',
transform: 'scale(0.5, 0.5) rotate(0deg)',
offset: 0.132,
}),
style({
opacity: 1,
transformOrigin: "0%",
transform: "scale(0.5, 0.5) rotate(0deg)",
offset: 0.198
transformOrigin: '0%',
transform: 'scale(0.5, 0.5) rotate(0deg)',
offset: 0.198,
}),
style({
opacity: 1,
transformOrigin: "0% 0%",
transform: "scale(0.5, 0.5) rotate(0deg)",
offset: 0.264
transformOrigin: '0% 0%',
transform: 'scale(0.5, 0.5) rotate(0deg)',
offset: 0.264,
}),
style({
opacity: 1,
transformOrigin: "50% 50%",
transform: "scale(1, 1) rotate(0deg)",
offset: 0.33
transformOrigin: '50% 50%',
transform: 'scale(1, 1) rotate(0deg)',
offset: 0.33,
}),
style({ opacity: 1, offset: 0.66 }),
style({ opacity: 0, offset: 1.0 })
style({ opacity: 0, offset: 1.0 }),
])
)
])
])
),
]),
]),
];
......@@ -4,7 +4,9 @@
</ng-container>
<ng-container icons>
<m-notifications--topbar-toggle *ngIf="session.isLoggedIn()"></m-notifications--topbar-toggle>
<m-notifications--topbar-toggle
*ngIf="session.isLoggedIn()"
></m-notifications--topbar-toggle>
</ng-container>
</m-v2-topbar>
<ng-template #legacyTopbar>
......@@ -20,15 +22,18 @@
</m-topbar>
</ng-template>
<m-sidebar--markers [class.has-v2-navbar]="featuresService.has('top-feeds')"></m-sidebar--markers>
<m-sidebar--markers
[class.has-v2-navbar]="featuresService.has('top-feeds')"
></m-sidebar--markers>
<m-body [class.has-v2-navbar]="featuresService.has('top-feeds')">
<m-announcement [id]="'blockchain:sale'" *ngIf="false">
<span class="m-blockchain--wallet-address-notice--action"
<span
class="m-blockchain--wallet-address-notice--action"
routerLink="/tokens"
i18n="@@BLOCKCHAIN__SALE__NOTICE"
>
The MINDS token is now live. Learn more here.
The MINDS token is now live. Learn more here.
</span>
</m-announcement>
<m-blockchain--wallet-address-notice></m-blockchain--wallet-address-notice>
......@@ -42,11 +47,12 @@
<m-overlay-modal></m-overlay-modal>
<m--blockchain--transaction-overlay></m--blockchain--transaction-overlay>
<m-modal--tos-updated *ngIf="session.isLoggedIn()"></m-modal--tos-updated>
<m-juryDutySession__summons *ngIf="session.isLoggedIn()"></m-juryDutySession__summons>
<m-juryDutySession__summons
*ngIf="session.isLoggedIn()"
></m-juryDutySession__summons>
<m-modal-signup-on-scroll></m-modal-signup-on-scroll>
<m-channel--onboarding *ngIf="showOnboarding"></m-channel--onboarding>
<m-cookies-notice *ngIf="!session.isLoggedIn()">
</m-cookies-notice>
<m-cookies-notice *ngIf="!session.isLoggedIn()"> </m-cookies-notice>
@import "defaults";
@import "themes";
@import 'defaults';
@import 'themes';
html, body {
html,
body {
font-family: 'Roboto', Helvetica, sans-serif !important;
}
m-app {
//width: 100%;
//min-width: $min-mobile;
//height: 100%;
......@@ -15,8 +15,8 @@ m-app {
//overflow: visible;
//position: relative;
.initial-loading{
width:100%;
.initial-loading {
width: 100%;
}
.m-initial-loading-centred {
......@@ -24,20 +24,20 @@ m-app {
}
m-body {
@include m-theme(){
@include m-theme() {
background-color: themed($m-body-bg);
}
// display: inline-block;
// overflow:visible;
// flex-grow: 1;
// z-index: 1;
// margin-top: $layout-header-height;
// margin-left: $layout-sidebar-width;
// width: 100%;
//
// @media screen and (max-width: $min-tablet){
// margin-left:0;
// }
// display: inline-block;
// overflow:visible;
// flex-grow: 1;
// z-index: 1;
// margin-top: $layout-header-height;
// margin-left: $layout-sidebar-width;
// width: 100%;
//
// @media screen and (max-width: $min-tablet){
// margin-left:0;
// }
}
p {
......@@ -51,12 +51,11 @@ m-app {
font-size: 20px;
line-height: 20px;
overflow: visible;
@include m-theme(){
@include m-theme() {
color: rgba(themed($m-black), 0.75);
}
}
.mdl-card__supporting-text{
.mdl-card__supporting-text {
font-family: 'Roboto', Helvetica, sans-serif;
}
}
......@@ -68,10 +67,12 @@ m-app {
flex-direction: column;
width: 100%;
height: 100%;
.m-page--main, .m-page__main {
.m-page--main,
.m-page__main {
overflow: visible !important;
}
.m-page--sidebar, .m-page__sidebar {
.m-page--sidebar,
.m-page__sidebar {
width: initial !important;
min-width: 300px;
padding: 16px !important;
......@@ -84,13 +85,15 @@ m-app {
margin: auto;
}
.m-page--main, .m-page__main {
.m-page--main,
.m-page__main {
padding: 16px;
flex: 1;
overflow: auto;
}
.m-page--sidebar, .m-page__sidebar {
.m-page--sidebar,
.m-page__sidebar {
padding: 16px 0 16px 16px;
width: 300px;
}
......@@ -106,18 +109,19 @@ m-app {
text-decoration: none;
font-size: 13px;
@include m-theme(){
@include m-theme() {
background-color: themed($m-white);
border: 1px solid themed($m-grey-50);
}
&.m-page--sidebar--navigation--item-active {
@include m-theme(){
@include m-theme() {
color: themed($m-blue);
}
}
i, span {
i,
span {
vertical-align: middle;
}
......@@ -127,7 +131,7 @@ m-app {
}
}
.m-loader {
width: 100% ;
width: 100%;
padding: 16px;
text-align: center;
}
import { ChangeDetectorRef, Component, NgZone } from "@angular/core";
import { NotificationService } from "./modules/notifications/notification.service";
import { AnalyticsService } from "./services/analytics";
import { SocketsService } from "./services/sockets";
import { Session } from "./services/session";
import { LoginReferrerService } from "./services/login-referrer.service";
import { ScrollToTopService } from "./services/scroll-to-top.service";
import { ContextService } from "./services/context.service";
import { BlockchainService } from "./modules/blockchain/blockchain.service";
import { Web3WalletService } from "./modules/blockchain/web3-wallet.service";
import { Client } from "./services/api/client";
import { WebtorrentService } from "./modules/webtorrent/webtorrent.service";
import { ActivatedRoute, Router } from "@angular/router";
import { ChannelOnboardingService } from "./modules/onboarding/channel/onboarding.service";
import { BlockListService } from "./common/services/block-list.service";
import { FeaturesService } from "./services/features.service";
import { ThemeService } from "./common/services/theme.service";
import { BannedService } from "./modules/report/banned/banned.service";
import { ChangeDetectorRef, Component, NgZone } from '@angular/core';
import { NotificationService } from './modules/notifications/notification.service';
import { AnalyticsService } from './services/analytics';
import { SocketsService } from './services/sockets';
import { Session } from './services/session';
import { LoginReferrerService } from './services/login-referrer.service';
import { ScrollToTopService } from './services/scroll-to-top.service';
import { ContextService } from './services/context.service';
import { BlockchainService } from './modules/blockchain/blockchain.service';
import { Web3WalletService } from './modules/blockchain/web3-wallet.service';
import { Client } from './services/api/client';
import { WebtorrentService } from './modules/webtorrent/webtorrent.service';
import { ActivatedRoute, Router } from '@angular/router';
import { ChannelOnboardingService } from './modules/onboarding/channel/onboarding.service';
import { BlockListService } from './common/services/block-list.service';
import { FeaturesService } from './services/features.service';
import { ThemeService } from './common/services/theme.service';
import { BannedService } from './modules/report/banned/banned.service';
@Component({
moduleId: module.id,
selector: "m-app",
templateUrl: "app.component.html"
selector: 'm-app',
templateUrl: 'app.component.html',
})
export class Minds {
name: string;
......@@ -52,7 +52,7 @@ export class Minds {
public themeService: ThemeService,
private bannedService: BannedService
) {
this.name = "Minds";
this.name = 'Minds';
}
async ngOnInit() {
......@@ -63,7 +63,7 @@ export class Minds {
this.showOnboarding = await this.onboardingService.showModal();
if (this.minds.user.language !== this.minds.language) {
console.log(
"[app]:: language change",
'[app]:: language change',
this.minds.user.language,
this.minds.language
);
......@@ -82,11 +82,11 @@ export class Minds {
this.loginReferrer
.avoid([
"/login",
"/logout",
"/logout/all",
"/register",
"/forgot-password"
'/login',
'/logout',
'/logout/all',
'/register',
'/forgot-password',
])
.listen();
......
......@@ -2,79 +2,79 @@ import {
CUSTOM_ELEMENTS_SCHEMA,
NgModule,
Injectable,
ErrorHandler
} from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { RouterModule } from "@angular/router";
import { CaptchaModule } from "./modules/captcha/captcha.module";
import { environment } from "../environments/environment";
ErrorHandler,
} from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { CaptchaModule } from './modules/captcha/captcha.module';
import { environment } from '../environments/environment';
import { Minds } from "./app.component";
import { Minds } from './app.component';
import {
MINDS_APP_ROUTING_DECLARATIONS,
MindsAppRoutes,
MindsAppRoutingProviders
} from "./router/app";
MindsAppRoutingProviders,
} from './router/app';
import { MINDS_DECLARATIONS } from "./declarations";
import { MINDS_PLUGIN_DECLARATIONS } from "./plugin-declarations";
import { MINDS_PROVIDERS } from "./services/providers";
import { MINDS_PLUGIN_PROVIDERS } from "./plugin-providers";
import { MINDS_DECLARATIONS } from './declarations';
import { MINDS_PLUGIN_DECLARATIONS } from './plugin-declarations';
import { MINDS_PROVIDERS } from './services/providers';
import { MINDS_PLUGIN_PROVIDERS } from './plugin-providers';
import { CommonModule } from "./common/common.module";
import { MonetizationModule } from "./modules/monetization/monetization.module";
import { WalletModule } from "./modules/wallet/wallet.module";
import { CheckoutModule } from "./modules/checkout/checkout.module";
import { PlusModule } from "./modules/plus/plus.module";
import { I18nModule } from "./modules/i18n/i18n.module";
import { CommonModule } from './common/common.module';
import { MonetizationModule } from './modules/monetization/monetization.module';
import { WalletModule } from './modules/wallet/wallet.module';
import { CheckoutModule } from './modules/checkout/checkout.module';
import { PlusModule } from './modules/plus/plus.module';
import { I18nModule } from './modules/i18n/i18n.module';
import { AdsModule } from "./modules/ads/ads.module";
import { BoostModule } from "./modules/boost/boost.module";
import { WireModule } from "./modules/wire/wire.module";
import { ReportModule } from "./modules/report/report.module";
import { ChannelsModule } from "./modules/channels/channels.module";
import { MindsFormsModule } from "./modules/forms/forms.module";
import { LegacyModule } from "./modules/legacy/legacy.module";
import { ModalsModule } from "./modules/modals/modals.module";
import { PaymentsModule } from "./modules/payments/payments.module";
import { ThirdPartyNetworksModule } from "./modules/third-party-networks/third-party-networks.module";
import { TranslateModule } from "./modules/translate/translate.module";
import { SettingsModule } from "./modules/settings/settings.module";
import { OnboardingModule } from "./modules/onboarding/onboarding.module";
import { NotificationModule } from "./modules/notifications/notification.module";
import { AdsModule } from './modules/ads/ads.module';
import { BoostModule } from './modules/boost/boost.module';
import { WireModule } from './modules/wire/wire.module';
import { ReportModule } from './modules/report/report.module';
import { ChannelsModule } from './modules/channels/channels.module';
import { MindsFormsModule } from './modules/forms/forms.module';
import { LegacyModule } from './modules/legacy/legacy.module';
import { ModalsModule } from './modules/modals/modals.module';
import { PaymentsModule } from './modules/payments/payments.module';
import { ThirdPartyNetworksModule } from './modules/third-party-networks/third-party-networks.module';
import { TranslateModule } from './modules/translate/translate.module';
import { SettingsModule } from './modules/settings/settings.module';
import { OnboardingModule } from './modules/onboarding/onboarding.module';
import { NotificationModule } from './modules/notifications/notification.module';
import { GroupsModule } from "./modules/groups/groups.module";
import { PostMenuModule } from "./common/components/post-menu/post-menu.module";
import { BanModule } from "./modules/ban/ban.module";
import { BlogModule } from "./modules/blogs/blog.module";
import { SearchModule } from "./modules/search/search.module";
import { MessengerModule } from "./modules/messenger/messenger.module";
import { HomepageModule } from "./modules/homepage/homepage.module";
import { NewsfeedModule } from "./modules/newsfeed/newsfeed.module";
import { MediaModule } from "./modules/media/media.module";
import { AuthModule } from "./modules/auth/auth.module";
import { BlockchainModule } from "./modules/blockchain/blockchain.module";
import { BlockchainMarketingModule } from "./modules/blockchain/marketing/marketing.module";
import { BrandingModule } from "./modules/branding/branding.module";
import { CommentsModule } from "./modules/comments/comments.module";
import { NodesMarketingModule } from "./modules/nodes/nodes.module";
import { JobsMarketingModule } from "./modules/jobs/jobs.module";
import { HelpdeskModule } from "./modules/helpdesk/helpdesk.module";
import { MobileModule } from "./modules/mobile/mobile.module";
import { IssuesModule } from "./modules/issues/issues.module";
import { CanaryModule } from "./modules/canary/canary.module";
import { HttpClientModule } from "@angular/common/http";
import { AnalyticsModule } from "./modules/analytics/analytics.module";
import { GroupsModule } from './modules/groups/groups.module';
import { PostMenuModule } from './common/components/post-menu/post-menu.module';
import { BanModule } from './modules/ban/ban.module';
import { BlogModule } from './modules/blogs/blog.module';
import { SearchModule } from './modules/search/search.module';
import { MessengerModule } from './modules/messenger/messenger.module';
import { HomepageModule } from './modules/homepage/homepage.module';
import { NewsfeedModule } from './modules/newsfeed/newsfeed.module';
import { MediaModule } from './modules/media/media.module';
import { AuthModule } from './modules/auth/auth.module';
import { BlockchainModule } from './modules/blockchain/blockchain.module';
import { BlockchainMarketingModule } from './modules/blockchain/marketing/marketing.module';
import { BrandingModule } from './modules/branding/branding.module';
import { CommentsModule } from './modules/comments/comments.module';
import { NodesMarketingModule } from './modules/nodes/nodes.module';
import { JobsMarketingModule } from './modules/jobs/jobs.module';
import { HelpdeskModule } from './modules/helpdesk/helpdesk.module';
import { MobileModule } from './modules/mobile/mobile.module';
import { IssuesModule } from './modules/issues/issues.module';
import { CanaryModule } from './modules/canary/canary.module';
import { HttpClientModule } from '@angular/common/http';
import { AnalyticsModule } from './modules/analytics/analytics.module';
import * as Sentry from "@sentry/browser";
import * as Sentry from '@sentry/browser';
Sentry.init({
dsn: "https://3f786f8407e042db9053434a3ab527a2@sentry.io/1538008", // TODO: do not hardcard
dsn: 'https://3f786f8407e042db9053434a3ab527a2@sentry.io/1538008', // TODO: do not hardcard
release: environment.version,
environment: (<any>window.Minds).environment || "development"
environment: (<any>window.Minds).environment || 'development',
});
@Injectable()
......@@ -92,7 +92,7 @@ export class SentryErrorHandler implements ErrorHandler {
Minds,
MINDS_APP_ROUTING_DECLARATIONS,
MINDS_DECLARATIONS,
MINDS_PLUGIN_DECLARATIONS
MINDS_PLUGIN_DECLARATIONS,
],
imports: [
BrowserModule,
......@@ -100,7 +100,7 @@ export class SentryErrorHandler implements ErrorHandler {
ReactiveFormsModule,
FormsModule,
HttpClientModule,
RouterModule.forRoot(MindsAppRoutes, { onSameUrlNavigation: "reload" }),
RouterModule.forRoot(MindsAppRoutes, { onSameUrlNavigation: 'reload' }),
CaptchaModule,
CommonModule,
AnalyticsModule,
......@@ -144,14 +144,14 @@ export class SentryErrorHandler implements ErrorHandler {
CanaryModule,
//last due to :username route
ChannelsModule
ChannelsModule,
],
providers: [
{ provide: ErrorHandler, useClass: SentryErrorHandler },
MindsAppRoutingProviders,
MINDS_PROVIDERS,
MINDS_PLUGIN_PROVIDERS
MINDS_PLUGIN_PROVIDERS,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class MindsModule {}
import { Cookie } from "../../services/cookie";
import { HttpClient, HttpHeaders } from "@angular/common/http";
import { Cookie } from '../../services/cookie';
import { HttpClient, HttpHeaders } from '@angular/common/http';
/**
* API Class
*/
export class MindsHttpClient {
base: string = "/";
base: string = '/';
cookie: Cookie = new Cookie();
static _(http: HttpClient) {
......@@ -18,7 +18,7 @@ export class MindsHttpClient {
* Return a GET request
*/
get(endpoint: string, data: Object = {}, options: Object = {}) {
endpoint += "?" + this.buildParams(data);
endpoint += '?' + this.buildParams(data);
return this.http.get(this.base + endpoint, this.buildOptions(options));
// .map(response => response.json());
}
......@@ -55,26 +55,26 @@ export class MindsHttpClient {
private buildParams(object: Object) {
return Object.keys(object)
.map(k => {
return encodeURIComponent(k) + "=" + encodeURIComponent(object[k]);
return encodeURIComponent(k) + '=' + encodeURIComponent(object[k]);
})
.join("&");
.join('&');
}
/**
* Build the options
*/
private buildOptions(options: Object) {
const XSRF_TOKEN = this.cookie.get("XSRF-TOKEN") || "";
const XSRF_TOKEN = this.cookie.get('XSRF-TOKEN') || '';
const headers = new HttpHeaders({
"X-XSRF-TOKEN": XSRF_TOKEN
'X-XSRF-TOKEN': XSRF_TOKEN,
});
return Object.assign(options, {
headers: headers,
cache: true
cache: true,
});
}
}
export { Client } from "../../services/api/client";
export { Client } from '../../services/api/client';
import { NgModule } from "@angular/core";
import { CommonModule as NgCommonModule } from "@angular/common";
import { RouterModule } from "@angular/router";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { MINDS_PIPES } from "./pipes/pipes";
import { TopbarComponent } from "./layout/topbar/topbar.component";
import { SidebarMarkersComponent } from "./layout/sidebar/markers.component";
import { TopbarNavigationComponent } from "./layout/topbar/navigation.component";
import { SidebarNavigationComponent } from "./layout/sidebar/navigation.component";
import { TopbarOptionsComponent } from "./layout/topbar/options.component";
import { TooltipComponent } from "./components/tooltip/tooltip.component";
import { FooterComponent } from "./components/footer/footer.component";
import { InfiniteScroll } from "./components/infinite-scroll/infinite-scroll";
import { CountryInputComponent } from "./components/forms/country-input/country-input.component";
import { DateInputComponent } from "./components/forms/date-input/date-input.component";
import { CityFinderComponent } from "./components/forms/city-finder/city-finder.component";
import { StateInputComponent } from "./components/forms/state-input/state-input.component";
import { ReadMoreDirective } from "./read-more/read-more.directive";
import { ReadMoreButtonComponent } from "./read-more/button.component";
import { ChannelBadgesComponent } from "./components/badges/badges.component";
import { NSFWSelectorComponent } from "./components/nsfw-selector/nsfw-selector.component";
import { NgModule } from '@angular/core';
import { CommonModule as NgCommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MINDS_PIPES } from './pipes/pipes';
import { TopbarComponent } from './layout/topbar/topbar.component';
import { SidebarMarkersComponent } from './layout/sidebar/markers.component';
import { TopbarNavigationComponent } from './layout/topbar/navigation.component';
import { SidebarNavigationComponent } from './layout/sidebar/navigation.component';
import { TopbarOptionsComponent } from './layout/topbar/options.component';
import { TooltipComponent } from './components/tooltip/tooltip.component';
import { FooterComponent } from './components/footer/footer.component';
import { InfiniteScroll } from './components/infinite-scroll/infinite-scroll';
import { CountryInputComponent } from './components/forms/country-input/country-input.component';
import { DateInputComponent } from './components/forms/date-input/date-input.component';
import { CityFinderComponent } from './components/forms/city-finder/city-finder.component';
import { StateInputComponent } from './components/forms/state-input/state-input.component';
import { ReadMoreDirective } from './read-more/read-more.directive';
import { ReadMoreButtonComponent } from './read-more/button.component';
import { ChannelBadgesComponent } from './components/badges/badges.component';
import { NSFWSelectorComponent } from './components/nsfw-selector/nsfw-selector.component';
import {
NSFWSelectorService,
NSFWSelectorConsumerService,
NSFWSelectorCreatorService,
NSFWSelectorEditingService
} from "./components/nsfw-selector/nsfw-selector.service";
import { Scheduler } from "./components/scheduler/scheduler";
import { Modal } from "./components/modal/modal.component";
import { MindsRichEmbed } from "./components/rich-embed/rich-embed";
import { MDL_DIRECTIVES } from "./directives/material";
import { AutoGrow } from "./directives/autogrow";
import { InlineAutoGrow } from "./directives/inline-autogrow";
import { Emoji } from "./directives/emoji";
import { Hovercard } from "./directives/hovercard";
import { ScrollLock } from "./directives/scroll-lock";
import { TagsLinks } from "./directives/tags";
import { Tooltip } from "./directives/tooltip";
import { MindsAvatar } from "./components/avatar/avatar";
import { CaptchaComponent } from "./components/captcha/captcha.component";
import { Textarea } from "./components/editors/textarea.component";
import { TagcloudComponent } from "./components/tagcloud/tagcloud.component";
import { DropdownComponent } from "./components/dropdown/dropdown.component";
import { DynamicHostDirective } from "./directives/dynamic-host.directive";
import { MindsCard } from "./components/card/card.component";
import { MindsButton } from "./components/button/button.component";
import { OverlayModalComponent } from "./components/overlay-modal/overlay-modal.component";
import { ChartComponent } from "./components/chart/chart.component";
import { DateSelectorComponent } from "./components/date-selector/date-selector.component";
import { AdminActionsButtonComponent } from "./components/button/admin-actions/admin-actions.component";
import { InlineEditorComponent } from "./components/editors/inline-editor.component";
import { AttachmentService } from "../services/attachment";
import { MaterialBoundSwitchComponent } from "./components/material/bound-switch.component";
import { IfFeatureDirective } from "./directives/if-feature.directive";
import { MindsEmoji } from "./components/emoji/emoji";
import { CategoriesSelectorComponent } from "./components/categories/selector/selector.component";
import { CategoriesSelectedComponent } from "./components/categories/selected/selected.component";
import { TreeComponent } from "./components/tree/tree.component";
import { AnnouncementComponent } from "./components/announcements/announcement.component";
import { MindsTokenSymbolComponent } from "./components/cypto/token-symbol.component";
import { PhoneInputComponent } from "./components/phone-input/phone-input.component";
import { PhoneInputCountryComponent } from "./components/phone-input/country.component";
import { Session } from "../services/session";
import { Client, Upload } from "../services/api";
import { MindsHttpClient } from "./api/client.service";
import { SafeToggleComponent } from "./components/safe-toggle/safe-toggle.component";
import { NotificationsToasterComponent } from "../modules/notifications/toaster.component";
import { ThumbsUpButton } from "./components/thumbs/thumbs-up.component";
import { ThumbsDownButton } from "./components/thumbs/thumbs-down.component";
import { DismissableNoticeComponent } from "./components/notice/notice.component";
import { AnalyticsImpressions } from "./components/analytics/impressions";
import { LineGraph } from "./components/graphs/line-graph";
import { PieGraph } from "./components/graphs/pie-graph";
import { GraphSVG } from "./components/graphs/svg";
import { GraphPoints } from "./components/graphs/points";
import { DynamicFormComponent } from "./components/forms/dynamic-form/dynamic-form.component";
import { SortSelectorComponent } from "./components/sort-selector/sort-selector.component";
import { UpdateMarkersService } from "./services/update-markers.service";
import { SocketsService } from "../services/sockets";
import { Storage } from "../services/storage";
import { HttpClient } from "@angular/common/http";
import { AndroidAppDownloadComponent } from "./components/android-app-download-button/button.component";
import { SwitchComponent } from "./components/switch/switch.component";
import { V2TopbarComponent } from "./layout/v2-topbar/v2-topbar.component";
import { UserMenuComponent } from "./layout/v2-topbar/user-menu.component";
import { FeaturedContentComponent } from "./components/featured-content/featured-content.component";
import { FeaturedContentService } from "./components/featured-content/featured-content.service";
import { BoostedContentService } from "./services/boosted-content.service";
import { FeedsService } from "./services/feeds.service";
import { EntitiesService } from "./services/entities.service";
import { BlockListService } from "./services/block-list.service";
import { SettingsService } from "../modules/settings/settings.service";
import { ThemeService } from "./services/theme.service";
import { HorizontalInfiniteScroll } from "./components/infinite-scroll/horizontal-infinite-scroll.component";
import { ReferralsLinksComponent } from "../modules/wallet/tokens/referrals/links/links.component";
import { PosterDateSelectorComponent } from "./components/poster-date-selector/poster-date-selector.component";
import { ShareModalComponent } from "../modules/modals/share/share";
NSFWSelectorEditingService,
} from './components/nsfw-selector/nsfw-selector.service';
import { Scheduler } from './components/scheduler/scheduler';
import { Modal } from './components/modal/modal.component';
import { MindsRichEmbed } from './components/rich-embed/rich-embed';
import { MDL_DIRECTIVES } from './directives/material';
import { AutoGrow } from './directives/autogrow';
import { InlineAutoGrow } from './directives/inline-autogrow';
import { Emoji } from './directives/emoji';
import { Hovercard } from './directives/hovercard';
import { ScrollLock } from './directives/scroll-lock';
import { TagsLinks } from './directives/tags';
import { Tooltip } from './directives/tooltip';
import { MindsAvatar } from './components/avatar/avatar';
import { CaptchaComponent } from './components/captcha/captcha.component';
import { Textarea } from './components/editors/textarea.component';
import { TagcloudComponent } from './components/tagcloud/tagcloud.component';
import { DropdownComponent } from './components/dropdown/dropdown.component';
import { DynamicHostDirective } from './directives/dynamic-host.directive';
import { MindsCard } from './components/card/card.component';
import { MindsButton } from './components/button/button.component';
import { OverlayModalComponent } from './components/overlay-modal/overlay-modal.component';
import { ChartComponent } from './components/chart/chart.component';
import { DateSelectorComponent } from './components/date-selector/date-selector.component';
import { AdminActionsButtonComponent } from './components/button/admin-actions/admin-actions.component';
import { InlineEditorComponent } from './components/editors/inline-editor.component';
import { AttachmentService } from '../services/attachment';
import { MaterialBoundSwitchComponent } from './components/material/bound-switch.component';
import { IfFeatureDirective } from './directives/if-feature.directive';
import { MindsEmoji } from './components/emoji/emoji';
import { CategoriesSelectorComponent } from './components/categories/selector/selector.component';
import { CategoriesSelectedComponent } from './components/categories/selected/selected.component';
import { TreeComponent } from './components/tree/tree.component';
import { AnnouncementComponent } from './components/announcements/announcement.component';
import { MindsTokenSymbolComponent } from './components/cypto/token-symbol.component';
import { PhoneInputComponent } from './components/phone-input/phone-input.component';
import { PhoneInputCountryComponent } from './components/phone-input/country.component';
import { Session } from '../services/session';
import { Client, Upload } from '../services/api';
import { MindsHttpClient } from './api/client.service';
import { SafeToggleComponent } from './components/safe-toggle/safe-toggle.component';
import { NotificationsToasterComponent } from '../modules/notifications/toaster.component';
import { ThumbsUpButton } from './components/thumbs/thumbs-up.component';
import { ThumbsDownButton } from './components/thumbs/thumbs-down.component';
import { DismissableNoticeComponent } from './components/notice/notice.component';
import { AnalyticsImpressions } from './components/analytics/impressions';
import { LineGraph } from './components/graphs/line-graph';
import { PieGraph } from './components/graphs/pie-graph';
import { GraphSVG } from './components/graphs/svg';
import { GraphPoints } from './components/graphs/points';
import { DynamicFormComponent } from './components/forms/dynamic-form/dynamic-form.component';
import { SortSelectorComponent } from './components/sort-selector/sort-selector.component';
import { UpdateMarkersService } from './services/update-markers.service';
import { SocketsService } from '../services/sockets';
import { Storage } from '../services/storage';
import { HttpClient } from '@angular/common/http';
import { AndroidAppDownloadComponent } from './components/android-app-download-button/button.component';
import { SwitchComponent } from './components/switch/switch.component';
import { V2TopbarComponent } from './layout/v2-topbar/v2-topbar.component';
import { UserMenuComponent } from './layout/v2-topbar/user-menu.component';
import { FeaturedContentComponent } from './components/featured-content/featured-content.component';
import { FeaturedContentService } from './components/featured-content/featured-content.service';
import { BoostedContentService } from './services/boosted-content.service';
import { FeedsService } from './services/feeds.service';
import { EntitiesService } from './services/entities.service';
import { BlockListService } from './services/block-list.service';
import { SettingsService } from '../modules/settings/settings.service';
import { ThemeService } from './services/theme.service';
import { HorizontalInfiniteScroll } from './components/infinite-scroll/horizontal-infinite-scroll.component';
import { ReferralsLinksComponent } from '../modules/wallet/tokens/referrals/links/links.component';
import { PosterDateSelectorComponent } from './components/poster-date-selector/poster-date-selector.component';
import { ShareModalComponent } from '../modules/modals/share/share';
@NgModule({
imports: [NgCommonModule, RouterModule, FormsModule, ReactiveFormsModule],
......@@ -192,7 +192,7 @@ import { ShareModalComponent } from "../modules/modals/share/share";
FeaturedContentComponent,
PosterDateSelectorComponent
PosterDateSelectorComponent,
],
exports: [
MINDS_PIPES,
......@@ -277,35 +277,35 @@ import { ShareModalComponent } from "../modules/modals/share/share";
NSFWSelectorComponent,
FeaturedContentComponent,
PosterDateSelectorComponent
PosterDateSelectorComponent,
],
providers: [
{
provide: AttachmentService,
useFactory: AttachmentService._,
deps: [Session, Client, Upload, HttpClient]
deps: [Session, Client, Upload, HttpClient],
},
{
provide: UpdateMarkersService,
useFactory: (_http, _session, _sockets) => {
return new UpdateMarkersService(_http, _session, _sockets);
},
deps: [MindsHttpClient, Session, SocketsService]
deps: [MindsHttpClient, Session, SocketsService],
},
{
provide: MindsHttpClient,
useFactory: MindsHttpClient._,
deps: [HttpClient]
deps: [HttpClient],
},
{
provide: NSFWSelectorCreatorService,
useFactory: _storage => new NSFWSelectorCreatorService(_storage),
deps: [Storage]
deps: [Storage],
},
{
provide: NSFWSelectorConsumerService,
useFactory: _storage => new NSFWSelectorConsumerService(_storage),
deps: [Storage]
deps: [Storage],
},
{
provide: BoostedContentService,
......@@ -328,20 +328,20 @@ import { ShareModalComponent } from "../modules/modals/share/share";
Session,
EntitiesService,
BlockListService,
SettingsService
]
SettingsService,
],
},
{
provide: FeaturedContentService,
useFactory: boostedContentService =>
new FeaturedContentService(boostedContentService),
deps: [FeedsService]
}
deps: [FeedsService],
},
],
entryComponents: [
NotificationsToasterComponent,
ReferralsLinksComponent,
ShareModalComponent
]
ShareModalComponent,
],
})
export class CommonModule {}
import { Component } from "@angular/core";
import { Component } from '@angular/core';
import { Client } from "../../../services/api";
import { Client } from '../../../services/api';
@Component({
selector: "minds-analytics-impressions",
inputs: ["_key: key", "span", "unit"],
selector: 'minds-analytics-impressions',
inputs: ['_key: key', 'span', 'unit'],
template: `
<minds-graph-line [data]="data"></minds-graph-line>
......@@ -14,15 +14,15 @@ import { Client } from "../../../services/api";
*ngFor="let point of data"
>
{{ point.total }}
<b>{{ point.timestamp * 1000 | date: "MMMd" }}</b>
<b>{{ point.timestamp * 1000 | date: 'MMMd' }}</b>
</div>
</div>
`
`,
})
export class AnalyticsImpressions {
key;
span: number = 5;
unit: string = "day";
unit: string = 'day';
data: Array<any> = [];
......@@ -36,9 +36,9 @@ export class AnalyticsImpressions {
get() {
var self = this;
this.client
.get("api/v1/analytics/" + this.key, {
.get('api/v1/analytics/' + this.key, {
span: this.span,
unit: this.unit
unit: this.unit,
})
.then((response: any) => {
self.data = response.data;
......
.m-androidApp__download {
box-sizing: border-box;
border-radius: 8px;
@include m-theme(){
@include m-theme() {
border: 1px solid rgba(themed($m-white-always), 0.7);
background: themed($m-black-always);
}
......@@ -33,13 +33,13 @@
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
@include m-theme(){
@include m-theme() {
color: themed($m-white-always);
}
}
i.material-icons {
@include m-theme(){
@include m-theme() {
color: themed($m-white-always);
}
}
......
import { Component } from "@angular/core";
import { Router } from "@angular/router";
import { Component } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: "m-androidApp__download",
selector: 'm-androidApp__download',
template: `
<a routerLink="/mobile" class="m-androidApp__download">
<i class="material-icons">android</i>
......@@ -10,7 +10,7 @@ import { Router } from "@angular/router";
Android App
</h2>
</a>
`
`,
})
export class AndroidAppDownloadComponent {
minds = window.Minds;
......
@import "defaults";
@import 'defaults';
$m-announcment-height: 50px;
m-announcement{
m-announcement {
display: block;
position: relative;
width: 100%;
min-height: $m-announcment-height;
height: $m-announcment-height;
.m-announcement{
position:fixed;
.m-announcement {
position: fixed;
width: 100%;
height: $m-announcment-height;
z-index: 9999;
display:flex;
display: flex;
flex-direction: row;
align-items:center;
align-items: center;
@include m-theme(){
@include m-theme() {
background-color: themed($m-blue);
}
@media screen and (max-width: 770px){
width: 100%;
@media screen and (max-width: 770px) {
width: 100%;
}
}
.m-announcement--content{
.m-announcement--content {
text-align: center;
letter-spacing: 1.2px;
font-weight: 300;
......@@ -38,33 +36,33 @@ m-announcement{
text-rendering: optimizeLegibility;
font-size: 16px;
flex: 1;
@include m-theme(){
@include m-theme() {
color: themed($m-white);
}
@media screen and (max-width:770px){
font-size:10px;
padding-right: 50px;
@media screen and (max-width: 770px) {
font-size: 10px;
padding-right: 50px;
}
a {
text-decoration:none;
@include m-theme(){
text-decoration: none;
@include m-theme() {
color: themed($m-white);
}
display:block;
display: block;
font-weight: 300;
}
}
.m-announcement--close{
cursor:pointer;
padding:12px;
position:absolute;
.m-announcement--close {
cursor: pointer;
padding: 12px;
position: absolute;
right: 0;
i {
@include m-theme(){
@include m-theme() {
color: themed($m-white);
}
}
......
import { Component, EventEmitter, Input } from "@angular/core";
import { Component, EventEmitter, Input } from '@angular/core';
import { Storage } from "../../../services/storage";
import { Client } from "../../../services/api";
import { Storage } from '../../../services/storage';
import { Client } from '../../../services/api';
@Component({
selector: "m-announcement",
selector: 'm-announcement',
host: {
"[hidden]": "hidden"
'[hidden]': 'hidden',
},
template: `
<div class="m-announcement">
......@@ -18,21 +18,21 @@ import { Client } from "../../../services/api";
<i class="material-icons">close</i>
</div>
</div>
`
`,
})
export class AnnouncementComponent {
minds: Minds = window.Minds;
hidden: boolean = false;
@Input() id: string = "default";
@Input() id: string = 'default';
constructor(private storage: Storage) {}
ngOnInit() {
if (this.storage.get("hide-announcement:" + this.id)) this.hidden = true;
if (this.storage.get('hide-announcement:' + this.id)) this.hidden = true;
}
close() {
this.storage.set("hide-announcement:" + this.id, true);
this.storage.set('hide-announcement:' + this.id, true);
this.hidden = true;
}
}
export * from "./text-input-autocomplete.module";
export * from './text-input-autocomplete.module';
export {
TextInputAutocompleteMenuComponent
} from "./text-input-autocomplete-menu.component";
TextInputAutocompleteMenuComponent,
} from './text-input-autocomplete-menu.component';
<ng-container *ngIf="choice?.type == 'user'; else hashtagBlock">
<a
href="javascript:;"
(click)="selectChoice.next(choice)"
>
<img
class="m-postAutocompleteItemRenderer__avatar mdl-shadow--2dp"
[src]="minds.cdn_url + 'icon/' + choice.guid + '/medium/' + choice.icontime">
{{ choice.username }}
</a>
<a href="javascript:;" (click)="selectChoice.next(choice)">
<img
class="m-postAutocompleteItemRenderer__avatar mdl-shadow--2dp"
[src]="
minds.cdn_url + 'icon/' + choice.guid + '/medium/' + choice.icontime
"
/>
{{ choice.username }}
</a>
</ng-container>
<ng-template #hashtagBlock>
<a
href="javascript:;"
(click)="selectChoice.next(choice)"
>
#{{ choice }}
</a>
<a href="javascript:;" (click)="selectChoice.next(choice)"> #{{ choice }} </a>
</ng-template>
import { Component, Input, OnInit } from "@angular/core";
import { Component, Input, OnInit } from '@angular/core';
@Component({
selector: "m-post-autocomplete-item-renderer",
templateUrl: "posts-autocomplete.component.html"
selector: 'm-post-autocomplete-item-renderer',
templateUrl: 'posts-autocomplete.component.html',
})
export class PostsAutocompleteItemRendererComponent {
@Input() choice;
......