Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng2-awesome-disqus

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-awesome-disqus - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

bundles/ng2-awesome-disqus.umd.js

17

disqus.component.d.ts

@@ -1,2 +0,2 @@

import { OnChanges, OnDestroy, SimpleChanges, Renderer, ElementRef, EventEmitter } from '@angular/core';
import { OnChanges, OnDestroy, SimpleChanges, Renderer2, ElementRef, EventEmitter } from '@angular/core';
import { DisqusService } from './disqus.service';

@@ -14,9 +14,5 @@ export declare class DisqusComponent implements OnChanges, OnDestroy {

title: string;
/** Add DISQUS count script */
count: boolean;
/** Remove DISQUS script on destroy */
removeOnDestroy: boolean;
/** Track Comments */
comment: EventEmitter<any>;
constructor(renderer: Renderer, el: ElementRef, dService: DisqusService);
constructor(renderer: Renderer2, el: ElementRef, dService: DisqusService);
ngOnChanges(changes: SimpleChanges): void;

@@ -26,11 +22,2 @@ addDisqusScript(): void;

reset(): void;
/** TODO: Get DISQUS Count */
/** ngAfterViewInit(){
this.dService.getCount().subscribe((res)=>{
console.log(res);
})
}
*/
/** Get the valid URL */
validatedUrl(): string;
/** Get disqus settings from inputs */

@@ -37,0 +24,0 @@ getConfig(): () => void;

@@ -1,4 +0,4 @@

import { Component, Input, Output, ChangeDetectionStrategy, Renderer, ElementRef, EventEmitter } from '@angular/core';
import { Component, Input, Output, ChangeDetectionStrategy, Renderer2, ElementRef, EventEmitter } from '@angular/core';
import { DisqusService } from './disqus.service';
export var DisqusComponent = (function () {
var DisqusComponent = (function () {
function DisqusComponent(renderer, el, dService) {

@@ -46,7 +46,8 @@ this.renderer = renderer;

/** Add DISQUS script */
var diqusScript = this.renderer.createElement(this.el.nativeElement, 'script');
diqusScript.src = "//" + this.shortname + ".disqus.com/embed.js";
diqusScript.async = true;
diqusScript.type = 'text/javascript';
this.renderer.setElementAttribute(diqusScript, 'data-timestamp', new Date().getTime().toString());
var disqusScript = this.renderer.createElement('script');
disqusScript.src = "//" + this.shortname + ".disqus.com/embed.js";
disqusScript.async = true;
disqusScript.type = 'text/javascript';
this.renderer.setAttribute(disqusScript, 'data-timestamp', new Date().getTime().toString());
this.renderer.appendChild(this.el.nativeElement, disqusScript);
};

@@ -60,24 +61,2 @@ /** Reset disqus with new inputs. */

};
/** TODO: Get DISQUS Count */
/** ngAfterViewInit(){
this.dService.getCount().subscribe((res)=>{
console.log(res);
})
}
*/
/** Get the valid URL */
DisqusComponent.prototype.validatedUrl = function () {
/** If URL is specified then validate it, otherwise use window URL */
if (this.url) {
var r = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
if (r.test(this.url)) {
return this.url;
}
else {
console.warn('[Disqus]: Invalid URL, fallback to Window URL');
}
}
/** fallback to "Window" URL, or to "Global" in universal */
return this.dService.url;
};
/** Get disqus settings from inputs */

@@ -88,3 +67,3 @@ DisqusComponent.prototype.getConfig = function () {

this.page.identifier = self.identifier;
this.page.url = self.url;
this.page.url = self.dService.validateUrl(self.url);
this.page.title = self.title;

@@ -103,3 +82,2 @@ this.category_id = self.categoryId;

this.dService.window.disqusConfig = undefined;
this.dService.window.DISQUSWIDGETS = undefined;
}

@@ -109,31 +87,29 @@ else {

global.disqusConfig = undefined;
global.DISQUSWIDGETS = undefined;
}
};
DisqusComponent.decorators = [
{ type: Component, args: [{
selector: 'disqus',
template: '<div id="disqus_thread"></div>',
changeDetection: ChangeDetectionStrategy.OnPush
},] },
];
/** @nocollapse */
DisqusComponent.ctorParameters = [
{ type: Renderer, },
{ type: ElementRef, },
{ type: DisqusService, },
];
DisqusComponent.propDecorators = {
'shortname': [{ type: Input },],
'identifier': [{ type: Input },],
'url': [{ type: Input },],
'categoryId': [{ type: Input },],
'language': [{ type: Input },],
'title': [{ type: Input },],
'count': [{ type: Input },],
'removeOnDestroy': [{ type: Input },],
'comment': [{ type: Output },],
};
return DisqusComponent;
}());
export { DisqusComponent };
DisqusComponent.decorators = [
{ type: Component, args: [{
selector: 'disqus',
template: '<div id="disqus_thread"></div>',
changeDetection: ChangeDetectionStrategy.OnPush
},] },
];
/** @nocollapse */
DisqusComponent.ctorParameters = function () { return [
{ type: Renderer2, },
{ type: ElementRef, },
{ type: DisqusService, },
]; };
DisqusComponent.propDecorators = {
'shortname': [{ type: Input },],
'identifier': [{ type: Input },],
'url': [{ type: Input },],
'categoryId': [{ type: Input },],
'language': [{ type: Input },],
'title': [{ type: Input },],
'comment': [{ type: Output },],
};
//# sourceMappingURL=disqus.component.js.map

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"DisqusComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"disqus","template":"<div id=\"disqus_thread\"></div>","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"}}]}],"members":{"shortname":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"identifier":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"url":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"categoryId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"language":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"count":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"removeOnDestroy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"comment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"./disqus.service","name":"DisqusService"}]}],"ngOnChanges":[{"__symbolic":"method"}],"addDisqusScript":[{"__symbolic":"method"}],"reset":[{"__symbolic":"method"}],"validatedUrl":[{"__symbolic":"method"}],"getConfig":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}
[{"__symbolic":"module","version":3,"metadata":{"DisqusComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"disqus","template":"<div id=\"disqus_thread\"></div>","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"}}]}],"members":{"shortname":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"identifier":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"url":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"categoryId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"language":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"comment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"./disqus.service","name":"DisqusService"}]}],"ngOnChanges":[{"__symbolic":"method"}],"addDisqusScript":[{"__symbolic":"method"}],"reset":[{"__symbolic":"method"}],"getConfig":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"DisqusComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"disqus","template":"<div id=\"disqus_thread\"></div>","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy"},"member":"OnPush"}}]}],"members":{"shortname":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"identifier":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"url":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"categoryId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"language":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"comment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"./disqus.service","name":"DisqusService"}]}],"ngOnChanges":[{"__symbolic":"method"}],"addDisqusScript":[{"__symbolic":"method"}],"reset":[{"__symbolic":"method"}],"getConfig":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}}}]
import { NgModule } from '@angular/core';
import { DisqusComponent } from './disqus.component';
import { DisqusService } from './disqus.service';
// import { JsonpModule } from '@angular/http';
export var DisqusModule = (function () {
var DisqusModule = (function () {
function DisqusModule() {
}
DisqusModule.decorators = [
{ type: NgModule, args: [{
declarations: [DisqusComponent],
providers: [DisqusService],
// imports: [JsonpModule],/
exports: [DisqusComponent]
},] },
];
/** @nocollapse */
DisqusModule.ctorParameters = [];
return DisqusModule;
}());
export { DisqusModule };
DisqusModule.decorators = [
{ type: NgModule, args: [{
declarations: [DisqusComponent],
providers: [DisqusService],
exports: [DisqusComponent]
},] },
];
/** @nocollapse */
DisqusModule.ctorParameters = function () { return []; };
//# sourceMappingURL=disqus.module.js.map

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"DisqusModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./disqus.component","name":"DisqusComponent"}],"providers":[{"__symbolic":"reference","module":"./disqus.service","name":"DisqusService"}],"exports":[{"__symbolic":"reference","module":"./disqus.component","name":"DisqusComponent"}]}]}]}}}
[{"__symbolic":"module","version":3,"metadata":{"DisqusModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./disqus.component","name":"DisqusComponent"}],"providers":[{"__symbolic":"reference","module":"./disqus.service","name":"DisqusService"}],"exports":[{"__symbolic":"reference","module":"./disqus.component","name":"DisqusComponent"}]}]}]}}},{"__symbolic":"module","version":1,"metadata":{"DisqusModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./disqus.component","name":"DisqusComponent"}],"providers":[{"__symbolic":"reference","module":"./disqus.service","name":"DisqusService"}],"exports":[{"__symbolic":"reference","module":"./disqus.component","name":"DisqusComponent"}]}]}]}}}]

@@ -1,7 +0,1 @@

export interface DisqusWidget {
proto: any;
forum: any;
displayCount: any;
getCount: any;
}
export declare class DisqusService {

@@ -13,3 +7,3 @@ window: any;

disqusConfig: any;
readonly disqusWidget: DisqusWidget;
validateUrl(url: string): string;
}
import { Injectable } from '@angular/core';
// import { Jsonp } from '@angular/http';
// import { Observable } from 'rxjs/Observable';
// import 'rxjs/add/operator/map';
// import 'rxjs/add/observable/empty';
// import 'rxjs/add/operator/catch';
var nativeWindow = function () {

@@ -11,5 +6,5 @@ // return the global native browser window object

};
export var DisqusService = (function () {
// constructor(private jsonp: Jsonp) {
var DisqusService = (function () {
function DisqusService() {
// constructor() {
this.window = nativeWindow();

@@ -46,35 +41,25 @@ }

});
Object.defineProperty(DisqusService.prototype, "disqusWidget", {
get: function () {
return (this.window) ? this.window.DISQUSWIDGETS : global.DISQUSWIDGETS;
},
enumerable: true,
configurable: true
});
// getCount() {
// //TODO: http://ng2.disqus.com/count-data.js?2=https://murhafsousli.github.io/ng2-disqus/
// let proto = 'https:';
// let forum = 'ng2';
// let url = 'https://murhafsousli.github.io/ng2-disqus/';
// let finalUrl = `${proto}//${forum}.disqus.com/count-data.js?callback=JSONP_CALLBACK&2=${url}`;
// console.log(finalUrl);
// return this.jsonp.request(finalUrl)
// .map((data: any) => {
// console.log(data);
// data = data.text();
// let result = JSON.parse(data.replace(/^displayCount\((.*)\)/, '$1'));
// return result.count || 0;
// })
// .catch((err) => {
// console.log(err);
// return Observable.empty()
// });
// }
DisqusService.decorators = [
{ type: Injectable },
];
/** @nocollapse */
DisqusService.ctorParameters = [];
DisqusService.prototype.validateUrl = function (url) {
/** If URL is specified then validate it, otherwise use window URL */
if (url) {
var r = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
if (r.test(url)) {
return url;
}
else {
console.warn('[Disqus]: Invalid URL, fallback to Window URL');
}
}
/** fallback to "Window" URL, or to "Global" in universal */
return this.url;
};
;
return DisqusService;
}());
export { DisqusService };
DisqusService.decorators = [
{ type: Injectable },
];
/** @nocollapse */
DisqusService.ctorParameters = function () { return []; };
//# sourceMappingURL=disqus.service.js.map

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"DisqusService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}}}}
[{"__symbolic":"module","version":3,"metadata":{"DisqusService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"validateUrl":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"DisqusService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"validateUrl":[{"__symbolic":"method"}]}}}}]

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./disqus.module"}]}
[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./disqus.module"}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./disqus.module"}]}]
{
"name": "ng2-awesome-disqus",
"version": "1.1.0",
"version": "1.1.1",
"description": "Angular Disqus Module",

@@ -21,10 +21,8 @@ "keywords": [

"homepage": "https://github.com/MurhafSousli/ng2-disqus#readme",
"main": "index.js",
"main": "bundles/ng2-awesome-disqus.umd.js",
"module": "index.js",
"typings": "index.d.ts",
"peerDependencies": {
"@angular/common": "^2.0.0",
"@angular/core": "^2.0.0",
"@angular/http": "^2.0.0"
"@angular/core": ">=2.0.0 <2.4.6 || >=2.4.8 <4.0.0-beta.6 || >=4.0.0-beta.8"
}
}

@@ -8,3 +8,3 @@ [![npm](https://img.shields.io/npm/v/ng2-awesome-disqus.svg?maxAge=2592000?style=plastic)](https://github.com/MurhafSousli/ng2-disqus) [![Build Status](https://travis-ci.org/MurhafSousli/ng2-disqus.svg?branch=master)](https://travis-ci.org/MurhafSousli/ng2-disqus) [![npm](https://img.shields.io/npm/dt/ng2-awesome-disqus.svg?maxAge=2592000?style=plastic)](https://www.npmjs.com/package/ng2-awesome-disqus)

Add disqus to your angular app instantly | [live demo](https://murhafsousli.github.io/ng2-disqus/)
Add disqus to your app instantly | [live demo](https://murhafsousli.github.io/ng2-disqus/)

@@ -19,3 +19,3 @@ ## Installation

Add `DisqusModule` to **NgModule** `imports` array.
Add `DisqusModule` in your root module

@@ -30,3 +30,3 @@ ```

```
In your template
Add disqus component

@@ -49,3 +49,3 @@ ```

Use the output `(comment)` to get user's comment response.
Use the output `(comment)` to get the responses for the new comments posted by users.

@@ -52,0 +52,0 @@ ## Issues

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc