diff --git a/sample-components/sampleComponent-2/package.json b/sample-components/sampleComponent-2/package.json index 15ae723f..92395a75 100644 --- a/sample-components/sampleComponent-2/package.json +++ b/sample-components/sampleComponent-2/package.json @@ -38,14 +38,16 @@ "@angular/platform-browser-dynamic": "2.0.0", "@angular/platform-server": "2.0.0", "@angular/router": "3.0.0", + "angular2-express-engine": "~2.0.11", "angular2-platform-node": "~2.0.11", "angular2-universal": "~2.0.11", "angular2-universal-polyfills": "~2.0.11", - "angular2-express-engine": "~2.0.11", "body-parser": "^1.15.2", "express": "^4.14.0", + "jquery": "^3.1.1", "methods": "~1.1.2", "rxjs": "5.0.0-beta.12", + "uikit": "^3.0.0-beta.18", "zone.js": "0.6.21" }, "devDependencies": { @@ -70,7 +72,7 @@ "ts-loader": "^0.8.2", "ts-node": "^1.3.0", "typescript": "2.0.0", - "webpack": "2.1.0-beta.22", + "webpack": "^2.1.0-beta.22", "webpack-dev-middleware": "^1.6.1", "webpack-dev-server": "^2.1.0-beta.0", "webpack-merge": "^0.13.0" diff --git a/sample-components/sampleComponent-2/src/app/app.ts b/sample-components/sampleComponent-2/src/app/app.ts index f3260e97..895a87ba 100644 --- a/sample-components/sampleComponent-2/src/app/app.ts +++ b/sample-components/sampleComponent-2/src/app/app.ts @@ -1,4 +1,7 @@ import { Component } from '@angular/core'; +// import UIkit from 'uikit'; +// import Icons from 'uikit/dist/js/uikit-icons'; + import 'rxjs/Rx'; @Component({ @@ -39,7 +42,14 @@ import 'rxjs/Rx'; export class App { constructor() { + // loads the Icon plugin + if(typeof document !== undefined) { + // UIkit.use(Icons); + // + // // components can be called from the imported UIkit reference + // UIkit.notification('Hello world.'); + } } } diff --git a/sample-components/sampleComponent-2/src/app/home/home.component.html b/sample-components/sampleComponent-2/src/app/home/home.component.html index fa7f4167..e738e5c2 100644 --- a/sample-components/sampleComponent-2/src/app/home/home.component.html +++ b/sample-components/sampleComponent-2/src/app/home/home.component.html @@ -13,3 +13,12 @@ + +
+ + +
+
+ {{citation}} diff --git a/sample-components/sampleComponent-2/src/app/home/home.component.ts b/sample-components/sampleComponent-2/src/app/home/home.component.ts index 03253360..89d7e5b8 100644 --- a/sample-components/sampleComponent-2/src/app/home/home.component.ts +++ b/sample-components/sampleComponent-2/src/app/home/home.component.ts @@ -2,14 +2,107 @@ import {Component} from '@angular/core'; import {Router} from '@angular/router'; import {Observable} from 'rxjs/Observable'; import {Location} from '@angular/common'; +declare var Cite:CiteType; +declare var fs:any; +declare var module:any; +declare var child_process:any; +declare var simpleSys:Function; +interface CiteType { + set:Function; + get:Function; + setOptions:Function; +} @Component({ selector: 'home', templateUrl: 'home.component.html', }) export class HomeComponent { - constructor ( private _router: Router, private location: Location) {} + styles:string[]=["bibtex","chicago","ieee","science","apa","cell","harvard","mla","nature","acm"]; + selectedStyle:string = "bibtex"; + + citation:string=""; + constructor ( private _router: Router, private location: Location) { + // var fs = require('fs'); +// if(typeof document !== undefined) { +// var citeproc = require("citeproc-js-node"); +// +// var sys = citeproc.simpleSys(); +// // Wherever your locale and style files are. None are included with the package. +// var enUS = ' This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2015-10-10T23:31:02+00:00 accessed and and others anonymous anon. at available at by circa c. cited edition editions ed. et al. forthcoming from ibid. in in press internet interview letter no date n.d. online presented at the reference references ref. refs. retrieved scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers line lines note notes opus opera page pages page pages paragraph paragraphs part parts section sections sub verbo sub verbis verse verses volume volumes bk. bks. chap. chaps. col. cols. fig. figs. fol. fols. no. nos. l. ll. n. nn. op. opp. p. pp. p. pp. para. paras. pt. pts. sec. secs. s.v. s.vv. v. vv. vol. vols. ¶¶ § §§ director directors editor editors editor editors illustrator illustrators translator translators editor & translator editors & translators dir. dirs. ed. eds. ed. eds. ill. ills. tran. trans. ed. & tran. eds. & trans. by directed by edited by edited by illustrated by interview by to by translated by edited & translated by dir. by ed. by ed. by illus. by trans. by ed. & trans. by January February March April May June July August September October November December Jan. Feb. Mar. Apr. May Jun. Jul. Aug. Sep. Oct. Nov. Dec. Spring Summer Autumn Winter ';//fs.readFileSync('../home/locales-en-US.xml', 'utf8'); +// sys.addLocale('en-US', enUS); +// var styleString = ' ';//fs.readFileSync('../home/bibtex.csl', 'utf8'); +// var engine = sys.newEngine(styleString, 'en-US', null); +// +// var items = {"14058/RN9M5BF3":{"accessed":{"month":"9","year":"2010","day":"10"},"id":"14058/RN9M5BF3","author":[{"given":"Adel","family":"Hendaoui"},{"given":"Moez","family":"Limayem"},{"given":"Craig W.","family":"Thompson"}],"title":"3D Social Virtual Worlds: Research Issues and Challenges","type":"article-journal","versionNumber":6816},"14058/NSBERGDK":{"accessed":{"month":"9","year":"2010","day":"10"},"issued":{"month":"6","year":"2009"},"event-place":"Istanbul","type":"paper-conference","DOI":"10.1109/DEST.2009.5276761","page-first":"151","id":"14058/NSBERGDK","title-short":"3D virtual worlds as collaborative communities enriching human endeavours","publisher-place":"Istanbul","author":[{"given":"C.","family":"Dreher"},{"given":"T.","family":"Reiners"},{"given":"N.","family":"Dreher"},{"given":"H.","family":"Dreher"}],"title":"3D virtual worlds as collaborative communities enriching human endeavours: Innovative applications in e-Learning","shortTitle":"3D virtual worlds as collaborative communities enriching human endeavours","page":"151-156","event":"2009 3rd IEEE International Conference on Digital Ecosystems and Technologies (DEST)","URL":"http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=5276761","versionNumber":1}}; +// +// sys.items = items; +// +// var clusters = [ +// { +// citationItems: ["14058/RN9M5BF3"], +// properties: { +// note:0 +// } +// }, +// { +// citationItems: ["14058/NSBERGDK"], +// properties: { +// note:0 +// } +// }, +// ]; +// +// engine.updateItems(Object.keys(items)); +// var bib = engine.makeBibliography(); +// console.log(bib[1]); +// this.citation =bib[1]; +// } + + + + var data= '[ { "id": "Q23571040", "type": "article-journal", "title": "Correlation of the Base Strengths of Amines 1", "DOI": "10.1021/ja01577a030", "author": [ { "given": "H. K.", "family": "Hall" } ], "issued": [ { "date-parts": [ "1957", "1", "1" ] } ], "container-title": "Journal of the American Chemical Society", "volume": "79", "issue": "20", "page": "5441-5444" } ]'; + var Cite = require('../home/citation-0.2.js'); + var opt = { + format: 'string', + type : 'string', + style : 'citation-apa', + lang : 'en-US' + }; + // var Cite = require('citation-js'); + var cite = new Cite(data, opt); + console.log("APA:"+cite.get()); + + opt = { + format: 'string', + type : 'string', + style : 'citation-harvard1', + lang : 'en-US' + }; + cite = new Cite(data, opt); + // cite.set(data); + console.log("harvard1: "+cite.get()); + + + + var opt_template = { + format: 'string', + type : 'string', + style : 'citation-ieee', + lang : 'en-US', + template : ' ' + }; + + // var opt = { format: 'string', type : 'string', style : 'citation-', lang : 'en-US', template : }; + var cite_template = new Cite(data, opt_template); + cite_template.set(data); + console.log("IEEE: "+cite_template.get()); + + + } + bibtex:string =` `; + ieee_csl:string =` `; } diff --git a/sample-components/sampleComponent-2/src/index.html b/sample-components/sampleComponent-2/src/index.html index 3c3c2067..070f971b 100644 --- a/sample-components/sampleComponent-2/src/index.html +++ b/sample-components/sampleComponent-2/src/index.html @@ -11,6 +11,7 @@ +