├── license ├── .dockerignore ├── .babelrc ├── src ├── iframes │ ├── README.md │ ├── webGold │ │ └── js │ │ │ ├── .babelrc │ │ │ ├── components │ │ │ ├── Wallet │ │ │ │ ├── reducers │ │ │ │ │ └── walletReducer.js │ │ │ │ ├── actions │ │ │ │ │ └── storeActions.js │ │ │ │ ├── Disclaimer.js │ │ │ │ ├── ExtraEntropy.js │ │ │ │ └── PasswordEntry.js │ │ │ ├── PaymentForm │ │ │ │ ├── BraintreeForm.js │ │ │ │ ├── BitcoinForm.js │ │ │ │ ├── AddFunds │ │ │ │ │ ├── AddFundsButton.js │ │ │ │ │ ├── LoginButton.js │ │ │ │ │ └── index.js │ │ │ │ ├── Alert.js │ │ │ │ └── PaymentData.js │ │ │ ├── User │ │ │ │ ├── UserInfo.js │ │ │ │ └── User.spec.js │ │ │ ├── EthereumClient │ │ │ │ └── index.js │ │ │ ├── PresaleForm │ │ │ │ ├── BitcoinForm.js │ │ │ │ ├── Alert.js │ │ │ │ └── PaymentData.js │ │ │ ├── BalanceLine.js │ │ │ ├── Info.js │ │ │ ├── Disclaimer.js │ │ │ ├── ExtraEntropy.js │ │ │ └── PaymentHistory │ │ │ │ └── index.js │ │ │ ├── stores │ │ │ ├── PaymentActions.js │ │ │ ├── PaymentStore.js │ │ │ └── BalanceStore.js │ │ │ ├── actions │ │ │ └── transactions.js │ │ │ ├── libs │ │ │ ├── url.js │ │ │ ├── units.js │ │ │ └── apicalls.js │ │ │ ├── admin │ │ │ ├── requests.js │ │ │ ├── Prepayments.js │ │ │ ├── Emissions.js │ │ │ ├── Donations.js │ │ │ ├── Invoices.js │ │ │ ├── EtherFeeds.js │ │ │ └── Presales.js │ │ │ ├── crypto │ │ │ └── __mocks__ │ │ │ │ └── tweetnacl.js │ │ │ ├── resizeSender.js │ │ │ ├── presale.js │ │ │ └── txsigner.js │ ├── Pinger │ │ └── js │ │ │ ├── constants.js │ │ │ ├── index.js │ │ │ ├── actions │ │ │ └── formactions.js │ │ │ ├── auth.js │ │ │ ├── urlutils.js │ │ │ ├── utils.js │ │ │ ├── iframeresize.js │ │ │ ├── urlutils.spec.js │ │ │ └── components │ │ │ └── FileEntry.js │ └── constant.js ├── CoreEditor │ ├── components │ │ ├── utils │ │ │ ├── is_profile_url.js │ │ │ ├── change_urls_to_urls_for_edit.js │ │ │ └── is_profile_url.spec.js │ │ ├── Loading.js │ │ ├── Alert.js │ │ ├── StyleButton.js │ │ ├── CoverHeader.js │ │ ├── CommentEnabler.js │ │ ├── EditExternal.js │ │ ├── ListEditor.js │ │ └── Modal.js │ ├── epics │ │ ├── index.js │ │ └── imagePreview.js │ ├── utils │ │ ├── get_my_list.js │ │ ├── url.spec.js │ │ ├── get_my_list.spec.js │ │ ├── reducerTools.js │ │ ├── html2list.js │ │ ├── html2list.spec.js │ │ ├── helpers.js │ │ ├── entitytools.spec.js │ │ └── insertAtomicBlock.js │ ├── actions │ │ ├── externalsEditor.js │ │ ├── imagedialog.js │ │ ├── ticketdialog.js │ │ ├── coverActions.js │ │ ├── indexActions.spec.js │ │ ├── listEditorActions.js │ │ ├── linkdialog.js │ │ └── publishActions.spec.js │ ├── fixtures │ │ ├── fixture.js │ │ └── social.json │ ├── containers │ │ ├── CoverHeaderContainer.js │ │ ├── EditExternal.js │ │ ├── ArticleNavigationContainer.js │ │ ├── ListEditorContainer.js │ │ ├── LinkUrlDialog.js │ │ ├── ImageUrlDialog.js │ │ ├── TicketDialog.js │ │ ├── Postsettings.js │ │ └── CoverEditingDialogContainer.js │ ├── mixins │ │ └── mentions.js │ ├── mentions │ │ ├── scripts.js │ │ ├── mention.spec.js │ │ ├── mention.js │ │ └── mentions.js │ ├── DraftConverters │ │ └── article │ │ │ └── JSONToDraft.spec.js │ ├── reducers │ │ ├── externalsEditorReducer.js │ │ ├── imageDialog.js │ │ ├── linkDialog.js │ │ ├── ticketDialog.js │ │ ├── indexReducer.js │ │ ├── publish.spec.js │ │ ├── docUtils.js │ │ └── listEditorReducer.js │ ├── webrunesAPI.js │ ├── client.js │ ├── selectors │ │ └── publishSelectors.js │ ├── configureStore.js │ └── EditorEntities │ │ ├── LinkEntity.js │ │ ├── ImageEntitiy.js │ │ └── TicketEntity.js ├── base │ ├── actions │ │ ├── hashUpdateHook.js │ │ └── first_route.js │ ├── jsonld │ │ ├── entities │ │ │ ├── README.md │ │ │ ├── SocialMediaPosting.js │ │ │ ├── ItemList.js │ │ │ ├── LdJsonObject.spec.js │ │ │ ├── ImageObject.js │ │ │ └── Article.js │ │ ├── mentions │ │ │ ├── README.md │ │ │ ├── abstractMention.js │ │ │ ├── mention.spec.js │ │ │ └── image.js │ │ └── LdJsonDocument.spec.js │ ├── components │ │ ├── utils │ │ │ ├── linkBuilder │ │ │ │ └── linkCreator.js │ │ │ ├── change_url_to_url_for_edit.js │ │ │ └── string.js │ │ ├── misc │ │ │ ├── Loading.js │ │ │ ├── ListThumbnail.js │ │ │ ├── FixedCarousel.js │ │ │ └── CommentsDisabled.js │ │ ├── BackToTheProvidersPageButton.js │ │ ├── mapbox │ │ │ └── files │ │ │ │ ├── config.js │ │ │ │ └── data.js │ │ ├── Externals.js │ │ ├── ReadItLater.js │ │ ├── ArticleLists.js │ │ ├── widgets │ │ │ ├── Presale.js │ │ │ ├── Transactions.js │ │ │ └── Details.js │ │ ├── ItemList.js │ │ ├── Ticket.js │ │ ├── ArticleElement.js │ │ └── deprecated │ │ │ ├── CreateControlButtons.js │ │ │ └── CreateCover.js │ ├── Plus │ │ ├── utils │ │ │ ├── tools.spec.js │ │ │ ├── normURL.spec.js │ │ │ └── normURL.js │ │ ├── components │ │ │ ├── GenericListItem.js │ │ │ ├── Item.spec.js │ │ │ └── Item.js │ │ └── reducers │ │ │ └── plusReducer.spec.js │ ├── reducers │ │ ├── rootReducer.js │ │ ├── loginReducer.js │ │ ├── WrioDocument.spec.js │ │ └── documentReducer.spec.js │ ├── utils │ │ ├── set_url_with_hash.js │ │ ├── SafariStorage.js │ │ └── CrossStorageFactory.js │ ├── containers │ │ ├── CoverHeaderContainer.js │ │ └── ArticleNavigationContainer.js │ ├── servicelocator.js │ ├── global.js │ └── configureStore.js ├── config.js ├── devserver │ ├── core │ │ └── index.html │ └── pinger │ │ ├── index.html │ │ └── pingeriframe.html └── main.js ├── hub ├── googlec2c6e6a32837e668.html ├── googled54479b6cc666467.html ├── img │ ├── Soil.png │ ├── Desgin.png │ ├── cells.png │ ├── cover1.jpg │ ├── dht11.png │ ├── mission.jpg │ ├── Connections.png │ ├── Desgin-black.png │ ├── Soil-depth.png │ ├── architecture.jpg │ ├── cover_author.jpg │ ├── cover_user.jpg │ ├── ttgo-esp32.png │ ├── advanced_guide.jpg │ ├── cover1-200x200.jpg │ ├── mission-schema.jpg │ ├── beginners_guide.jpg │ ├── cover_developer.jpg │ ├── ttgo-esp32-front.png │ ├── cover_entrepreneur.jpg │ └── ttgo-esp32-cpmponents.png ├── offer │ └── img │ │ ├── bounty.jpg │ │ ├── development.jpg │ │ ├── promotion.jpg │ │ ├── bounty_200x200.jpg │ │ ├── promotion-200x200.jpg │ │ └── development-200x200.jpg ├── collection │ ├── img │ │ ├── stack-200x200.png │ │ ├── financing_strategy-200x200.png │ │ ├── investments_tokens-200x200.png │ │ └── financial_statement-200x200.png │ ├── investments_and_tokens │ │ └── img │ │ │ ├── series.png │ │ │ └── percentage_ratio.png │ └── financial_statement │ │ └── index.html └── ru │ ├── блог │ └── index.html │ ├── дао │ └── финансовая_отчётность │ │ └── index.html │ └── обложка │ └── index.html ├── compress.sh ├── .flowconfig ├── docker ├── README.md └── Dockerfile ├── test ├── fakeDom.js └── createInfoTicketTest.js ├── opsworks_nodejs ├── attributes │ └── customize.rb └── templates │ └── default │ └── node_web_app.monitrc.erb ├── .eslintrc ├── .gitignore ├── .travis.yml └── travis └── reset_cloudfront_cache.sh /license: -------------------------------------------------------------------------------- 1 | https://wrioos.com/license 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | ./git/* 2 | /node_modules/* 3 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react", "es2015", "stage-0"] 3 | } 4 | -------------------------------------------------------------------------------- /src/iframes/README.md: -------------------------------------------------------------------------------- 1 | This folder contains code that runs inside iframes 2 | -------------------------------------------------------------------------------- /hub/googlec2c6e6a32837e668.html: -------------------------------------------------------------------------------- 1 | google-site-verification: googlec2c6e6a32837e668.html -------------------------------------------------------------------------------- /hub/googled54479b6cc666467.html: -------------------------------------------------------------------------------- 1 | google-site-verification: googled54479b6cc666467.html -------------------------------------------------------------------------------- /hub/img/Soil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/Soil.png -------------------------------------------------------------------------------- /src/iframes/webGold/js/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react","es2015","stage-0"] 3 | } 4 | -------------------------------------------------------------------------------- /hub/img/Desgin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/Desgin.png -------------------------------------------------------------------------------- /hub/img/cells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/cells.png -------------------------------------------------------------------------------- /hub/img/cover1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/cover1.jpg -------------------------------------------------------------------------------- /hub/img/dht11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/dht11.png -------------------------------------------------------------------------------- /hub/img/mission.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/mission.jpg -------------------------------------------------------------------------------- /hub/img/Connections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/Connections.png -------------------------------------------------------------------------------- /hub/img/Desgin-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/Desgin-black.png -------------------------------------------------------------------------------- /hub/img/Soil-depth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/Soil-depth.png -------------------------------------------------------------------------------- /hub/img/architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/architecture.jpg -------------------------------------------------------------------------------- /hub/img/cover_author.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/cover_author.jpg -------------------------------------------------------------------------------- /hub/img/cover_user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/cover_user.jpg -------------------------------------------------------------------------------- /hub/img/ttgo-esp32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/ttgo-esp32.png -------------------------------------------------------------------------------- /hub/offer/img/bounty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/offer/img/bounty.jpg -------------------------------------------------------------------------------- /hub/img/advanced_guide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/advanced_guide.jpg -------------------------------------------------------------------------------- /hub/img/cover1-200x200.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/cover1-200x200.jpg -------------------------------------------------------------------------------- /hub/img/mission-schema.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/mission-schema.jpg -------------------------------------------------------------------------------- /hub/img/beginners_guide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/beginners_guide.jpg -------------------------------------------------------------------------------- /hub/img/cover_developer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/cover_developer.jpg -------------------------------------------------------------------------------- /hub/img/ttgo-esp32-front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/ttgo-esp32-front.png -------------------------------------------------------------------------------- /hub/offer/img/development.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/offer/img/development.jpg -------------------------------------------------------------------------------- /hub/offer/img/promotion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/offer/img/promotion.jpg -------------------------------------------------------------------------------- /hub/img/cover_entrepreneur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/cover_entrepreneur.jpg -------------------------------------------------------------------------------- /src/CoreEditor/components/utils/is_profile_url.js: -------------------------------------------------------------------------------- 1 | module.exports = url => 2 | url.split('/')[4] === 'index.html' 3 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/Wallet/reducers/walletReducer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 06.05.17. 3 | */ 4 | -------------------------------------------------------------------------------- /hub/img/ttgo-esp32-cpmponents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/img/ttgo-esp32-cpmponents.png -------------------------------------------------------------------------------- /hub/offer/img/bounty_200x200.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/offer/img/bounty_200x200.jpg -------------------------------------------------------------------------------- /hub/collection/img/stack-200x200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/collection/img/stack-200x200.png -------------------------------------------------------------------------------- /hub/offer/img/promotion-200x200.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/offer/img/promotion-200x200.jpg -------------------------------------------------------------------------------- /hub/offer/img/development-200x200.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/offer/img/development-200x200.jpg -------------------------------------------------------------------------------- /hub/collection/img/financing_strategy-200x200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/collection/img/financing_strategy-200x200.png -------------------------------------------------------------------------------- /hub/collection/img/investments_tokens-200x200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/collection/img/investments_tokens-200x200.png -------------------------------------------------------------------------------- /hub/collection/img/financial_statement-200x200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/collection/img/financial_statement-200x200.png -------------------------------------------------------------------------------- /hub/collection/investments_and_tokens/img/series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/collection/investments_and_tokens/img/series.png -------------------------------------------------------------------------------- /src/base/actions/hashUpdateHook.js: -------------------------------------------------------------------------------- 1 | import Rx from "rxjs"; 2 | 3 | const listener = new Rx.Subject(); 4 | 5 | export const postUpdateHook = () => listener.next(); 6 | -------------------------------------------------------------------------------- /src/iframes/Pinger/js/constants.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 26.05.17. 3 | */ 4 | 5 | export const COMMENT_LENGTH = 1024; 6 | export const TITLE_LENGTH = 72; 7 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/stores/PaymentActions.js: -------------------------------------------------------------------------------- 1 | import Reflux from "reflux"; 2 | 3 | var Actions = Reflux.createActions(["changeAmount"]); 4 | 5 | export default Actions; 6 | -------------------------------------------------------------------------------- /src/CoreEditor/epics/index.js: -------------------------------------------------------------------------------- 1 | import { combineEpics } from 'redux-observable'; 2 | import imagePreview from './imagePreview'; 3 | 4 | export default combineEpics(imagePreview); 5 | -------------------------------------------------------------------------------- /hub/collection/investments_and_tokens/img/percentage_ratio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webRunes/WRIO-InternetOS/HEAD/hub/collection/investments_and_tokens/img/percentage_ratio.png -------------------------------------------------------------------------------- /src/base/jsonld/entities/README.md: -------------------------------------------------------------------------------- 1 | # Short desc 2 | 3 | This directory contains JSON-LD abstraction classes, each type of 4 | the LD+JSON entity is abstracted using some class. 5 | 6 | -------------------------------------------------------------------------------- /src/base/components/utils/linkBuilder/linkCreator.js: -------------------------------------------------------------------------------- 1 | export default (data = {}, title, queryString) => { 2 | window.history.pushState(data,title,window.location.pathname + queryString) 3 | } -------------------------------------------------------------------------------- /src/iframes/webGold/js/actions/transactions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 06.12.15. 3 | */ 4 | 5 | import Reflux from "reflux"; 6 | 7 | module.exports = Reflux.createActions(["Balance", "Rate"]); 8 | -------------------------------------------------------------------------------- /src/base/components/utils/change_url_to_url_for_edit.js: -------------------------------------------------------------------------------- 1 | const 2 | getServiceUrl = require('../../servicelocator').getServiceUrl; 3 | 4 | module.exports = url => 5 | getServiceUrl('core') + '/edit?article=' + url 6 | -------------------------------------------------------------------------------- /src/base/jsonld/mentions/README.md: -------------------------------------------------------------------------------- 1 | # short desc 2 | 3 | This folder contains mention- and mention- alike objects, that are mapped 4 | directly into the text of the article 5 | 6 | All classes derived from abstract mention class -------------------------------------------------------------------------------- /src/config.js: -------------------------------------------------------------------------------- 1 | var config = {}; 2 | 3 | //config.gatewaysServiceUrl = "https://imec.herokuapp.com"; Testbed Gateways address 4 | config.gatewaysServiceUrl = "https://107.22.105.145"; // Lora Gateways AWS Server 5 | module.exports = config; -------------------------------------------------------------------------------- /src/base/jsonld/entities/SocialMediaPosting.js: -------------------------------------------------------------------------------- 1 | import LdJsonObject from "./LdJsonObject.js"; 2 | 3 | export default class SocialMediaPosting extends LdJsonObject { 4 | constructor(json, order, parent) { 5 | super(json, order, parent); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/devserver/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | This is development server's emulation of core service. Used for hosting it's iframes 9 | 10 | -------------------------------------------------------------------------------- /src/devserver/pinger/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | This is development server's emulation of pinger service. Used for hosting it's iframes 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/base/components/misc/Loading.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Loading = () => ( 4 | loading 9 | ); 10 | 11 | export default Loading; 12 | -------------------------------------------------------------------------------- /src/base/components/BackToTheProvidersPageButton.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | export default ({ providerLink }) => { 3 | return (
4 |
The device is a part of an IoT network. Back to the network provider's dashboard
5 |
) 6 | } 7 | -------------------------------------------------------------------------------- /src/CoreEditor/utils/get_my_list.js: -------------------------------------------------------------------------------- 1 | const 2 | request = require('superagent'), 3 | html2list = require('./html2list'); 4 | 5 | module.exports = (wrioID, cb) => 6 | request('GET', 'https://s3.amazonaws.com/wr.io/' + wrioID + '/list.html') 7 | .end((err, data) => 8 | cb(err, html2list(data.text)) 9 | ) 10 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/Wallet/actions/storeActions.js: -------------------------------------------------------------------------------- 1 | let nextTodoId = 0; 2 | 3 | const mkAction = name => param => { 4 | return { 5 | type: name, 6 | param: param 7 | }; 8 | }; 9 | export const entropyEntryFinished = mkAction("GOT_ENTROPY"); 10 | export const walletCreated = mkAction("WALLET_CREATED"); 11 | -------------------------------------------------------------------------------- /src/CoreEditor/utils/url.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 19.07.17. 3 | */ 4 | 5 | import { extractFileName } from "./url"; 6 | 7 | test("should extract filename correctly", () => { 8 | expect( 9 | extractFileName("https://wr.io/1234567890/sillyfolder/sillyfile.htm") 10 | ).toEqual("sillyfolder/sillyfile.htm"); 11 | }); 12 | -------------------------------------------------------------------------------- /src/iframes/constant.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 24.02.16. 3 | */ 4 | 5 | module.exports = { 6 | WRG_UNIT: 1000, // number of WRG in 1g of gold 7 | SATOSHI: 100000000, // satoshis in one BTC 8 | WEI: 1000000000000000000, // WEI in one ETH 9 | MIN_ETH_AMOUNT: 0.2, 10 | MAX_DEBT: -500 * 100, 11 | MAX_DONATE: 999999 12 | }; 13 | -------------------------------------------------------------------------------- /src/base/jsonld/entities/ItemList.js: -------------------------------------------------------------------------------- 1 | import LdJsonObject from "./LdJsonObject.js"; 2 | 3 | export default class ItemList extends LdJsonObject { 4 | constructor(json, order, root) { 5 | super(json, order, root); 6 | if (json.itemListElement) { 7 | json.itemListElement.forEach(part => this.addChild(part, order)); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /compress.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This scripts executed before deploy on Travis CI, it deletes node_modules, gzips all sources for quick download 4 | 5 | cd build 6 | 7 | echo "Gzipping scripts" 8 | 9 | gzip -9 *.js *.map 10 | for i in *.gz ; do mv "$i" "${i/.gz/}" ; done 11 | 12 | echo "Copying hub contents in dist folder" 13 | 14 | cp -fR ../hub/* . 15 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | .*/node_modules/** 3 | /bower_components/.* 4 | /coverage/.* 5 | /build/.* 6 | /hub/.* 7 | [include] 8 | ./node_modules/react 9 | ./node_modules/fbjs/lib 10 | ./node_modules/draft-js 11 | ./node_modules/immutable 12 | [libs] 13 | 14 | [options] 15 | module.system.node.resolve_dirname=src -------------------------------------------------------------------------------- /src/CoreEditor/components/utils/change_urls_to_urls_for_edit.js: -------------------------------------------------------------------------------- 1 | const 2 | getServiceUrl = require('../../../base/servicelocator').getServiceUrl; 3 | 4 | module.exports = myList => 5 | Boolean(myList && myList.length) && myList.map(o => 6 | Object({ 7 | url: getServiceUrl('core') + '/edit?article=' + o.url, 8 | name: o.name 9 | }) 10 | ) 11 | -------------------------------------------------------------------------------- /src/iframes/Pinger/js/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | require("./iframeresize"); // require iframe resizer middleware 4 | 5 | import Container from "./components/container.js"; 6 | 7 | ReactDOM.render(, document.getElementById("frame_container")); 8 | document.getElementById("loadingInd").style = "display:none;"; 9 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | This dockerfile contains base image for the WRIO Internet OS backend services 2 | All backend service images should be inherited from this image. 3 | 4 | This image have automatic build setup at https://hub.docker.com/r/webrunes/wriobase/builds/ 5 | 6 | To use this image, add first line to the Dockerfile 7 | ``` 8 | FROM webrunes/wriobase:latest 9 | ``` 10 | -------------------------------------------------------------------------------- /src/CoreEditor/actions/externalsEditor.js: -------------------------------------------------------------------------------- 1 | export const EXTERNAL_CHANGED = 'EXTERNAL_CHANGED'; 2 | export const EXTERNAL_ADD = 'EXTERNAL_ADD'; 3 | 4 | export function externalChanged(index, url) { 5 | return { 6 | type: EXTERNAL_CHANGED, 7 | url, 8 | index, 9 | }; 10 | } 11 | 12 | export function externalAdd() { 13 | return { 14 | type: EXTERNAL_ADD, 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /src/CoreEditor/components/utils/is_profile_url.spec.js: -------------------------------------------------------------------------------- 1 | const 2 | isProfileUrl = require('./is_profile_url'), 3 | assert = require('assert'); 4 | 5 | describe('Profile link text should be rendered as "Profile", not id', () => { 6 | it('is profile url', () => { 7 | assert( 8 | isProfileUrl( 9 | 'https://wr.io/995280022735/index.html' 10 | ) 11 | ) 12 | }) 13 | }) 14 | -------------------------------------------------------------------------------- /src/base/Plus/utils/tools.spec.js: -------------------------------------------------------------------------------- 1 | import assert from "assert"; 2 | import should from "should"; 3 | import { getNext } from "./tools.js"; 4 | 5 | describe("tools test", () => { 6 | it("Shoud return undefined", () => { 7 | const data = { 8 | test: { 9 | active: false 10 | } 11 | }; 12 | var ret = getNext(data, "test"); 13 | should.not.exist(ret); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /src/base/actions/first_route.js: -------------------------------------------------------------------------------- 1 | import {navigateArticleHash} from '../actions/actions'; 2 | 3 | let once = false; 4 | 5 | const 6 | routeOnce = () => { 7 | once = true; 8 | navigateArticleHash(location.hash); 9 | return once; 10 | }, 11 | isHash = () => location.hash[0] !== '#', 12 | firstRoute = () => 13 | once || routeOnce() && isHash(); 14 | 15 | module.exports = firstRoute; 16 | -------------------------------------------------------------------------------- /src/base/jsonld/mentions/abstractMention.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 27.06.16. 3 | */ 4 | 5 | class AbstractMention { 6 | constructor(opts) { 7 | this.original = opts; 8 | } 9 | 10 | attach(obj) { 11 | console.warn("Not implemented"); 12 | } 13 | 14 | render() { 15 | console.warn("Not implemented"); 16 | } 17 | 18 | applyMention(m) {} 19 | } 20 | export default AbstractMention; 21 | -------------------------------------------------------------------------------- /src/CoreEditor/utils/get_my_list.spec.js: -------------------------------------------------------------------------------- 1 | const 2 | getMyList = require('./get_my_list'), 3 | wrioID = '101144381240'; 4 | 5 | describe('Get list.html for user with wrioID', () => { 6 | it('user wrioID has list.html and it could be load by getMyList()', done => { 7 | getMyList(wrioID, (err, list) => { 8 | done(list.length >= 1 9 | ? undefined 10 | : err 11 | ) 12 | }) 13 | }) 14 | }) 15 | -------------------------------------------------------------------------------- /src/CoreEditor/utils/reducerTools.js: -------------------------------------------------------------------------------- 1 | export function findElementWithKey(elements, elementKey) { 2 | return elements.filter(e => e.key === elementKey)[0]; 3 | } 4 | 5 | export const replaceElementWithKey = (elements, element, key) => 6 | elements.map(el => (el.key === key ? element : el)); 7 | 8 | export const mergeElementDataWithKey = (elements, data, key) => 9 | elements.map(el => (el.key === key ? { ...el, ...data } : el)); 10 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/PaymentForm/BraintreeForm.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | class BraintreeForm extends React.Component { 4 | render() { 5 | return ( 6 |
7 |
8 |
9 |
10 | ); 11 | } 12 | } 13 | 14 | export default BraintreeForm; 15 | -------------------------------------------------------------------------------- /test/fakeDom.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 02.06.17. 3 | */ 4 | import {JSDOM} from 'jsdom'; 5 | 6 | 7 | var FAKE_DOM_HTML = ` 8 | 9 | 10 | 11 | 12 | `; 13 | 14 | 15 | function setupFakeDOM() { 16 | if (typeof document !== 'undefined') { 17 | return; 18 | } 19 | var jsd = new JSDOM(FAKE_DOM_HTML); 20 | global.window = jsd; 21 | global.document = jsd.window.document; 22 | } 23 | setupFakeDOM(); -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/User/UserInfo.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import PropTypes from "prop-types"; 3 | 4 | class UserInfo extends React.Component { 5 | render() { 6 | return ( 7 |
8 |

as {this.props.username}

9 | Logoff 10 |
11 | ); 12 | } 13 | } 14 | UserInfo.propTypes = { 15 | username: PropTypes.string.isRequired 16 | }; 17 | 18 | export default UserInfo; 19 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:15.04 2 | MAINTAINER Michael Bilenko 3 | RUN apt-get install -y curl 4 | RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - 5 | RUN apt-get update && apt-get install -y nodejs mc libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++ git libkrb5-dev 6 | RUN npm install -g http-server browserify gulp nodemon mocha 7 | RUN mkdir -p /srv/www 8 | RUN npm install -g babel@5.6.14 9 | RUN npm install -g npm@3 10 | 11 | -------------------------------------------------------------------------------- /src/base/components/mapbox/files/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | "token": "pk.eyJ1Ijoid2VicnVuZXMiLCJhIjoiY2p5NGY5Nm93MTVlNDNpbzg1N3czdmd5cCJ9.CptajnA9N30WwXNK1EygyA", 3 | "styles": { 4 | "londonCycle": "mapbox://styles/mapbox/light-v9", 5 | "light": "mapbox://styles/mapbox/light-v9", 6 | "dark": "mapbox://styles/mapbox/dark-v9", 7 | "basic": "mapbox://styles/mapbox/basic-v9", 8 | "outdoor": "mapbox://styles/mapbox/outdoors-v10" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/iframes/Pinger/js/actions/formactions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 25.05.17. 3 | */ 4 | import Reflux from "reflux"; 5 | 6 | export default Reflux.createActions([ 7 | "sendComment", 8 | "freeWRG", 9 | "commentChanged", 10 | "tagsChanged", 11 | "amountChanged", 12 | "openAuthPopup", 13 | "addFile", 14 | "requestFreeTHX", 15 | "cancelDonate", 16 | "resetFields", 17 | "resultMsg", 18 | "queryBalance", 19 | "deleteComment", 20 | "deletePhoto" 21 | ]); 22 | -------------------------------------------------------------------------------- /src/CoreEditor/components/Loading.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 18.07.17. 3 | */ 4 | import React, { Component } from 'react'; 5 | import LoadingComp from 'base/components/misc/Loading'; 6 | 7 | export class Loading extends Component { 8 | render() { 9 | return ; 10 | } 11 | } 12 | 13 | export class LoadingError extends Component { 14 | render() { 15 | return
Oops, something went wrong... Please try again
; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/base/reducers/rootReducer.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from "redux"; 2 | import headerReducer from "./headerReducer"; 3 | import loginReducer from "./loginReducer"; 4 | import documentReducer from "./documentReducer"; 5 | import plusReducer from "base/Plus/reducers/plusReducer"; 6 | 7 | const combinedReducer = combineReducers({ 8 | header: headerReducer, 9 | login: loginReducer, 10 | document: documentReducer, 11 | plusReducer: plusReducer 12 | }); 13 | 14 | export default combinedReducer; 15 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/stores/PaymentStore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 30.08.15. 3 | */ 4 | import Reflux from "reflux"; 5 | import Actions from "./PaymentActions"; 6 | 7 | var Store = Reflux.createStore({ 8 | init: function() { 9 | this.listenTo(Actions.changeAmount, this.changeAmount); 10 | }, 11 | changeAmount: function(amount) { 12 | console.log("Change amount triggered"); 13 | this.trigger({ 14 | amount: amount 15 | }); 16 | } 17 | }); 18 | 19 | export default Store; 20 | -------------------------------------------------------------------------------- /src/base/components/misc/ListThumbnail.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | export default class Thumbnail extends React.Component { 5 | render() { 6 | return ( 7 |
14 | ); 15 | } 16 | } 17 | 18 | Thumbnail.propTypes = { 19 | image: PropTypes.string.isRequired, 20 | }; 21 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/libs/url.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 30.03.17. 3 | */ 4 | 5 | export default function extractUrlParameter(val) { 6 | var result = "Not found", 7 | tmp = []; 8 | location.search 9 | //.replace ( "?", "" ) 10 | // this is better, there might be a question mark inside 11 | .substr(1) 12 | .split("&") 13 | .forEach(function(item) { 14 | tmp = item.split("="); 15 | if (tmp[0] === val) result = decodeURIComponent(tmp[1]); 16 | }); 17 | return result; 18 | } 19 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/EthereumClient/index.js: -------------------------------------------------------------------------------- 1 | import { Promise } from "es6-promise"; 2 | import React from "react"; 3 | import request from "superagent"; 4 | 5 | class EthereumClient extends React.Component { 6 | constructor(props) { 7 | super(props); 8 | } 9 | 10 | render() { 11 | return ( 12 |
13 |
Ethereum status
14 |

WRG balance:

15 |

Ethereum balance:

16 |
17 | ); 18 | } 19 | } 20 | 21 | export default EthereumClient; 22 | -------------------------------------------------------------------------------- /src/base/components/utils/string.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export function NormailizeJSON(s) { 4 | // preserve newlines, etc - use valid JSON 5 | s = s.replace(/\\n/g, "\\n") 6 | .replace(/\\'/g, "\\'") 7 | .replace(/\\"/g, '\\"') 8 | .replace(/\\&/g, "\\&") 9 | .replace(/\\r/g, "\\r") 10 | .replace(/\\t/g, "\\t") 11 | .replace(/\\b/g, "\\b") 12 | .replace(/\\f/g, "\\f"); 13 | // remove non-printable and other non-valid JSON chars 14 | s = s.replace(/[\u0000-\u0019]+/g,""); 15 | return s; 16 | } -------------------------------------------------------------------------------- /src/CoreEditor/fixtures/fixture.js: -------------------------------------------------------------------------------- 1 | import fs from "fs"; 2 | import path from "path"; 3 | 4 | const getFixture = (fixturename: string): Object => { 5 | var file = fs 6 | .readFileSync(path.join(__dirname, `../fixtures/${fixturename}.json`)) 7 | .toString(); 8 | return JSON.parse(file); 9 | }; 10 | 11 | export const getHtml = (fixturename: string): Object => { 12 | var file = fs 13 | .readFileSync(path.join(__dirname, `../fixtures/${fixturename}.html`)) 14 | .toString(); 15 | return file; 16 | }; 17 | 18 | export default getFixture; 19 | -------------------------------------------------------------------------------- /src/CoreEditor/containers/CoverHeaderContainer.js: -------------------------------------------------------------------------------- 1 | import { connect } from 'react-redux'; 2 | import CoverHeader from '../components/CoverHeader'; 3 | import * as coverDialogActions from 'CoreEditor/actions/coverDialog'; 4 | 5 | function mapStateToProps(state) { 6 | return { 7 | coverDialog: state.coverDialog 8 | }; 9 | } 10 | 11 | function mapDispatchToProps(dispatch) { 12 | return { 13 | onCoverPressed: () => dispatch(coverDialogActions.openCoverDialog()) 14 | }; 15 | } 16 | 17 | export default connect(mapStateToProps, mapDispatchToProps)(CoverHeader); 18 | -------------------------------------------------------------------------------- /src/base/reducers/loginReducer.js: -------------------------------------------------------------------------------- 1 | import * as actions from "base/actions/actions"; 2 | const defaultState = { 3 | wrioID: null, 4 | profile: null, 5 | myList: [] 6 | }; 7 | 8 | function loginReducer(state = defaultState, action) { 9 | switch (action.type) { 10 | case actions.LOGIN_MESSAGE: 11 | var profile = action.msg.profile; 12 | return { 13 | ...state, 14 | wrioID: profile.id, 15 | profile 16 | }; 17 | break; 18 | default: 19 | return state; 20 | } 21 | } 22 | 23 | export default loginReducer; 24 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/PaymentForm/BitcoinForm.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 03.09.15. 3 | */ 4 | import React from "react"; 5 | import Const from "../../../../constant.js"; 6 | 7 | let SATOSHI = Const.SATOSHI; 8 | 9 | class BitcoinForm extends React.Component { 10 | render() { 11 | return ( 12 |
13 |
14 | Payment request created, please pay {this.state.BTC} to adress{" "} 15 | {this.state.address / SATOSHIc} 16 |
17 |
18 | ); 19 | } 20 | } 21 | export default BitcoinForm; 22 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/PresaleForm/BitcoinForm.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 03.09.15. 3 | */ 4 | import React from "react"; 5 | import Const from "../../../../constant.js"; 6 | 7 | let SATOSHI = Const.SATOSHI; 8 | 9 | class BitcoinForm extends React.Component { 10 | render() { 11 | return ( 12 |
13 |
14 | Payment request created, please pay {this.state.BTC} to the address{" "} 15 | {this.state.address / SATOSHI} 16 |
17 |
18 | ); 19 | } 20 | } 21 | export default BitcoinForm; 22 | -------------------------------------------------------------------------------- /src/base/Plus/components/GenericListItem.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { CrossStorageFactory } from "../../utils/CrossStorageFactory.js"; 3 | import PropTypes from "prop-types"; 4 | 5 | var storage = CrossStorageFactory.getCrossStorage(); 6 | 7 | class GenericListItem extends React.Component { 8 | constructor(props) { 9 | super(props); 10 | } 11 | 12 | gotoUrl(e) { 13 | e.preventDefault(); 14 | this.props.onClick(this.props.data); 15 | } 16 | } 17 | 18 | GenericListItem.propTypes = { 19 | data: PropTypes.object.isRequired 20 | }; 21 | 22 | module.exports = GenericListItem; 23 | -------------------------------------------------------------------------------- /src/base/components/Externals.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | /** 3 | * Created by michbil on 30.06.17. 4 | */ 5 | 6 | import React from 'react'; 7 | import ItemListComponent from './ItemList.js'; 8 | import ItemList from '../jsonld/entities/ItemList.js'; 9 | import Loading from 'base/components/misc/Loading'; 10 | 11 | /* 12 | * Base class rendering document body 13 | * */ 14 | 15 | const Externals = ({ data }: { data: Array }) => { 16 | if (!data) { 17 | return ; 18 | } 19 | return data.map((list, key) => ); 20 | }; 21 | 22 | export default Externals; 23 | -------------------------------------------------------------------------------- /opsworks_nodejs/attributes/customize.rb: -------------------------------------------------------------------------------- 1 | ### 2 | # This is the place to override the opsworks_nodejs cookbook's default attributes. 3 | # 4 | # Do not edit THIS file directly. Instead, create 5 | # "opsworks_nodejs/attributes/customize.rb" in your cookbook repository and 6 | # put the overrides in YOUR customize.rb file. 7 | ### 8 | 9 | # The following shows how to override the Nodejs version: 10 | # 11 | #normal[:opsworks_nodejs][:version] = '0.10.21' 12 | 13 | #normal[:opsworks_nodejs][:version] = '0.12.0' 14 | #default['nodejs']['repo'] = 'https://deb.nodesource.com/node_0.12' 15 | 16 | normal[:opsworks_nodejs][:npm_install_options] = 'install' 17 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | // Use this file as a starting point for your project's .eslintrc. 3 | // Copy this file, and add rule overrides as needed. 4 | "extends": ["airbnb", "plugin:flowtype/recommended"], 5 | "globals": { 6 | "window": true, 7 | "document": true 8 | }, 9 | "parser": "babel-eslint", 10 | "plugins": ["flowtype"], 11 | "settings": { 12 | "import/resolver": { 13 | "babel-module": {} 14 | } 15 | }, 16 | "rules": { 17 | "class-methods-use-this": 0, 18 | "no-mixed-operators": [0, { "allowSamePrecedence": true }], 19 | "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/base/Plus/components/Item.spec.js: -------------------------------------------------------------------------------- 1 | import { expect } from "chai"; 2 | import Item from "./Item"; 3 | import React from "react"; 4 | import renderer from "react-test-renderer"; 5 | import { shallow } from "enzyme"; 6 | 7 | const TEST_DATA = { 8 | active: true, 9 | name: "test tab", 10 | url: "webrunes.com" 11 | }; 12 | 13 | describe("Item test", () => { 14 | it("should display item", () => { 15 | const data = TEST_DATA; 16 | const item = shallow( {}} />); 17 | const p = item.find("a").nodes[1].props; 18 | expect(p.href).to.equal(data.url); 19 | //expect(item.refs.tab._attributes.href._nodeValue).to.equal(data.url); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /src/CoreEditor/mixins/mentions.js: -------------------------------------------------------------------------------- 1 | export function applyMentions(mentions) { 2 | var i = mentions.length - 1, 3 | m = mentions[i], 4 | link = lnk => { 5 | if (lnk) { 6 | return "" + lnk.text + ""; 7 | } 8 | return ""; 9 | }, 10 | Link = link(m.link), 11 | After = m.after, 12 | before = (str, i) => { 13 | i--; 14 | m = mentions[i]; 15 | if (m) { 16 | var L = link(m.link), 17 | A = str.replace(m.before + (m.link ? m.link.text : ""), ""); 18 | return before(m.before, i) + L + A; 19 | } 20 | return str; 21 | }; 22 | return before(m.before, i) + Link + After; 23 | } 24 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/User/User.spec.js: -------------------------------------------------------------------------------- 1 | import User from "./index"; 2 | const React = require("react"); 3 | 4 | const renderer = require("react-test-renderer"); 5 | 6 | const TEST_DATA = { 7 | username: "test", 8 | btcExchangeRate: 1, 9 | exchangeRate: 1 10 | }; 11 | 12 | describe("User test", () => { 13 | it("should display user", () => { 14 | const data = TEST_DATA; 15 | const user = renderer.create( 16 | 21 | ); 22 | 23 | //expect(user.refs.usdBalance.textContent).to.equal('... USD'); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/libs/units.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 10.12.15. 3 | */ 4 | 5 | import Const from "../../../constant.js"; 6 | let SATOSHI = Const.SATOSHI; 7 | 8 | export default class UnitCoverter { 9 | constructor(rates) { 10 | this.rates = rates; 11 | } 12 | 13 | wrgToBtc(wrg) { 14 | return btc * this.rates.btcExchangeRate / (SATOSHI * Const.WRG_UNIT); 15 | } 16 | 17 | btcToWrg(btc) { 18 | return btc * SATOSHI * Const.WRG_UNIT / this.rates.btcExchangeRate; 19 | } 20 | 21 | wrgToUsd(wrg) { 22 | return wrg * this.rates.exchangeRate / Const.WRG_UNIT; 23 | } 24 | 25 | usdToWrg(usd) { 26 | return Const.WRG_UNIT * usd / this.rates.exchangeRate; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/base/utils/set_url_with_hash.js: -------------------------------------------------------------------------------- 1 | import * as global from '../global'; 2 | 3 | function setUrlWithHash(name: string, tabName: string) { 4 | window.history.pushState('page', 'params', window.location.pathname); 5 | console.log("name=====>" + name); 6 | console.log(global.tabKey); 7 | if (((global.tabKey == "deviceProfile") || (global.tabKey == "feed") || 8 | (global.tabKey == "dashboard")) && (name != "#dashboard") && (name != "#deviceProfile") && (name != "#feed")) { 9 | window.location.hash = name; 10 | location.reload(); 11 | } else { 12 | console.log("else===>") 13 | window.location.hash = name; 14 | console.log(window.location.hash); 15 | } 16 | } 17 | module.exports = setUrlWithHash; -------------------------------------------------------------------------------- /src/CoreEditor/mentions/scripts.js: -------------------------------------------------------------------------------- 1 | import { check } from "./mentions"; 2 | 3 | let scripts = scripts => { 4 | let i, 5 | json, 6 | data = []; 7 | for (i = 0; i < scripts.length; i += 1) { 8 | if (scripts[i].type === "application/ld+json") { 9 | json = undefined; 10 | try { 11 | json = JSON.parse(scripts[i].textContent); 12 | } catch (exception) { 13 | json = undefined; 14 | console.error("Invalid JSON-LD: " + exception); 15 | } 16 | if (typeof json === "object") { 17 | data.push(json); 18 | } 19 | } 20 | } 21 | /* data.forEach((jsn) => { 22 | check(jsn); 23 | }); 24 | */ return data; 25 | }; 26 | 27 | export { scripts }; 28 | -------------------------------------------------------------------------------- /src/base/containers/CoverHeaderContainer.js: -------------------------------------------------------------------------------- 1 | import { connect } from 'react-redux'; 2 | import CoverHeader from '../components/CoverHeader'; 3 | import * as actions from '../actions/actions'; 4 | 5 | function mapStateToProps(state) { 6 | return { 7 | covers: state.header.covers, 8 | images: state.header.images, 9 | currentCover: state.header.selected, 10 | }; 11 | } 12 | 13 | function mapDispatchToProps(dispatch) { 14 | return { 15 | onCoverChanged: (current) => { 16 | dispatch(actions.selectCover(current)); 17 | }, 18 | onCoverButtonPressed: cover => dispatch(actions.pressCoverButton(cover)), 19 | }; 20 | } 21 | 22 | export default connect(mapStateToProps, mapDispatchToProps)(CoverHeader); 23 | -------------------------------------------------------------------------------- /src/base/jsonld/LdJsonDocument.spec.js: -------------------------------------------------------------------------------- 1 | import LdJsonDocument from './LdJsonDocument'; 2 | import getFixture from 'CoreEditor/fixtures/fixture.js'; 3 | 4 | const json = getFixture('testjson'); 5 | 6 | test('should be able to create document from json, and getProperty from it', () => { 7 | const doc = new LdJsonDocument(json); 8 | console.log(doc); 9 | expect(doc.getProperty('author')).toEqual(''); 10 | }); 11 | 12 | test('getElementOfType and setElementOfType shold give consistent results', () => { 13 | const doc = new LdJsonDocument(json); 14 | doc.setElementOfType('Article', { 15 | '@type': 'Article', 16 | author: 'michael', 17 | }); 18 | expect(doc.getProperty('author')).toEqual('michael'); 19 | }); 20 | -------------------------------------------------------------------------------- /src/CoreEditor/components/Alert.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | class Alert extends React.Component { 5 | render() { 6 | return ( 7 |
8 | 11 | {this.props.message} 12 |
13 | ); 14 | } 15 | } 16 | 17 | Alert.defaultProps = { 18 | type: 'success', 19 | message: 'Default message', 20 | }; 21 | Alert.propTypes = { 22 | type: PropTypes.string, 23 | message: PropTypes.string, 24 | onClose: PropTypes.func, 25 | }; 26 | 27 | export default Alert; 28 | -------------------------------------------------------------------------------- /src/CoreEditor/utils/html2list.js: -------------------------------------------------------------------------------- 1 | const 2 | html2list = (list, html, position) => 3 | position + 18 === html.length 4 | ? list 5 | : function () { 6 | const 7 | url0 = html.indexOf('"', position), 8 | url1 = html.indexOf('"', url0 + 1), 9 | name0 = html.indexOf('>', url1 + 1), 10 | name1 = html.indexOf('<', name0 + 1); 11 | 12 | return html2list( 13 | list.concat({ 14 | url: html.substring(url0 + 1, url1), 15 | name: html.substring(name0 + 1, name1) 16 | }), 17 | html, 18 | name1 19 | ); 20 | }(); 21 | 22 | module.exports = html => 23 | html2list([], html, 0); 24 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/PaymentForm/AddFunds/AddFundsButton.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | /* 3 | class AddFundsButton extends React.Component { 4 | render() { 5 | return ( 6 | 7 | 10 | 11 | ); 12 | } 13 | }*/ 14 | class AddFundsButton extends React.Component { 15 | render() { 16 | return ( 17 | 20 | ); 21 | } 22 | } 23 | 24 | export default AddFundsButton; 25 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/PaymentForm/Alert.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import PropTypes from "prop-types"; 3 | class Alert extends React.Component { 4 | render() { 5 | return ( 6 |
7 | 10 | {this.props.message} 11 |
12 | ); 13 | } 14 | } 15 | 16 | Alert.defaultProps = { 17 | type: "success", 18 | message: "Default message" 19 | }; 20 | Alert.propTypes = { 21 | type: PropTypes.string, 22 | message: PropTypes.string, 23 | onClose: PropTypes.func 24 | }; 25 | 26 | export default Alert; 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | build/ 3 | bower_components/* 4 | node_modules/* 5 | Thumbs.db 6 | #Ignore files build by Visual Studio 7 | *.obj 8 | *.exe 9 | *.pdb 10 | *.user 11 | *.aps 12 | *.pch 13 | *.vspscc 14 | *_i.c 15 | *_p.c 16 | *.ncb 17 | *.suo 18 | *.tlb 19 | *.tlh 20 | *.bak 21 | *.cache 22 | *.ilk 23 | *.log 24 | [Dd]ebug*/ 25 | *.lib 26 | *.sbr 27 | obj/ 28 | [Rr]elease*/ 29 | _ReSharper*/ 30 | [Tt]est[Rr]esult* 31 | express 32 | /node_modules 33 | /node_modules/*/node-modules/ 34 | /node_modules/*/node 35 | /node_modules/*/node_modules 36 | node_modules/**/node_modules 37 | node_module/ 38 | config.json 39 | .module-cache 40 | npm-debug.log 41 | /start.js 42 | /start.js.map 43 | raw 44 | /main.js 45 | /main.js.map 46 | /deploy.js 47 | /deploy.sh 48 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/PresaleForm/Alert.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import PropTypes from "prop-types"; 3 | 4 | class Alert extends React.Component { 5 | render() { 6 | return ( 7 |
8 | 11 | {this.props.message} 12 |
13 | ); 14 | } 15 | } 16 | 17 | Alert.defaultProps = { 18 | type: "success", 19 | message: "Default message" 20 | }; 21 | Alert.propTypes = { 22 | type: PropTypes.string, 23 | message: PropTypes.string, 24 | onClose: PropTypes.func 25 | }; 26 | 27 | export default Alert; 28 | -------------------------------------------------------------------------------- /test/createInfoTicketTest.js: -------------------------------------------------------------------------------- 1 | import {expect} from 'chai'; 2 | import CreateInfoTicket from '../src/base/components/CreateInfoTicket'; 3 | 4 | require('./fakeDom.js'); 5 | 6 | 7 | import React from 'react'; 8 | import {renderIntoDocument, Simulate} from 'react-dom/test-utils'; 9 | 10 | const TEST_DATA = { 11 | name: 'test', 12 | about: 'test' 13 | }; 14 | 15 | describe('Item test', () => { 16 | it('should display item', () => { 17 | const data = TEST_DATA; 18 | const item = renderIntoDocument( 19 | 20 | ); 21 | 22 | expect(item.refs.name.textContent).to.equal(data.name); 23 | expect(item.refs.about.textContent).to.equal(data.about); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/CoreEditor/utils/html2list.spec.js: -------------------------------------------------------------------------------- 1 | const 2 | html2list = require('./html2list'), 3 | assert = require('assert'); 4 | 5 | describe('Parse HTML to list of links', () => { 6 | it('1 link', () => { 7 | const 8 | list = html2list('WRIOOS'); 9 | 10 | assert(list[0].name === 'WRIOOS'); 11 | assert(list[0].url === 'wrioos.com'); 12 | }) 13 | 14 | it('2 links', () => { 15 | const 16 | list = html2list('YandexGoogle'); 17 | 18 | assert(list[0].name === 'Yandex'); 19 | assert(list[0].url === 'ya.ru'); 20 | assert(list[1].name === 'Google'); 21 | assert(list[1].url === 'google.com'); 22 | }) 23 | 24 | }) 25 | -------------------------------------------------------------------------------- /src/base/containers/ArticleNavigationContainer.js: -------------------------------------------------------------------------------- 1 | import { connect } from "react-redux"; 2 | import { 3 | VerticalNav as VerticalNavComponent, 4 | LeftNav as LeftNavComponent 5 | } from "base/components/ArticleNavigation"; 6 | import * as actions from "base/actions/actions"; 7 | 8 | function mapStateToProps(state) { 9 | return { 10 | articleItems: state.document.toc.chapters 11 | }; 12 | } 13 | 14 | function mapDispatchToProps(dispatch) { 15 | return { 16 | onNavigateArticleHash: hash => dispatch(actions.navigateArticleHash(hash)) 17 | }; 18 | } 19 | 20 | export const VerticalNav = connect(mapStateToProps, mapDispatchToProps)( 21 | VerticalNavComponent 22 | ); 23 | export const LeftNav = connect(mapStateToProps, mapDispatchToProps)( 24 | LeftNavComponent 25 | ); 26 | -------------------------------------------------------------------------------- /src/CoreEditor/DraftConverters/article/JSONToDraft.spec.js: -------------------------------------------------------------------------------- 1 | import LdJsonDocument from 'base/jsonld/LdJsonDocument.js'; 2 | import JSONToDraft from './JSONToDraft'; 3 | import { ContentState } from 'draft-js'; 4 | import DraftToJSON from './DraftToJSON'; 5 | 6 | import getFixture from '../../fixtures/fixture.js'; 7 | 8 | test('Convert JSON contentblocks to Draft and back to JSON', () => { 9 | const json = getFixture('testjson'); 10 | const article = new LdJsonDocument(json); 11 | const { 12 | contentBlocks, images, mentions, socials, blockKeyToOrderMap, 13 | } = JSONToDraft(article); 14 | 15 | console.log(images, mentions, socials, blockKeyToOrderMap); 16 | 17 | const newJson = DraftToJSON(ContentState.createFromBlockArray(contentBlocks), article); 18 | console.log(newJson); 19 | }); 20 | -------------------------------------------------------------------------------- /src/CoreEditor/mentions/mention.spec.js: -------------------------------------------------------------------------------- 1 | import request from "supertest"; 2 | import assert from "assert"; 3 | import should from "should"; 4 | import { Mention, merge } from "./mention.js"; 5 | 6 | var stdout_write = process.stdout._write, 7 | stderr_write = process.stderr._write; 8 | 9 | process.stdout._write = stdout_write; 10 | process.stderr._write = stderr_write; 11 | 12 | describe("mention test", () => { 13 | it("Should determine correct mention start and order", () => { 14 | var mention = new Mention({ 15 | "@type": "Article", 16 | name: "First url title", 17 | about: "Text inside the ticket popup.", 18 | url: "https://webrunes.com/blog/?'dolor sit amet':3,104" 19 | }); 20 | mention.start.should.be.equal(104); 21 | mention.block.should.be.equal(3); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/CoreEditor/fixtures/social.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "@context": "https://schema.org", 3 | "@type": "Article", 4 | "inLanguage": "En", 5 | "keywords": "", 6 | "author": "https://wr.io/558153389649/?wr.io=558153389649", 7 | "editor": "", 8 | "name": "Untitledsd", 9 | "about": "tetetetetвыавыававава", 10 | "articleBody": [ 11 | " One more text!" 12 | ], 13 | "hasPart": [ 14 | { 15 | "@type": "SocialMediaPosting", 16 | "sharedContent": { 17 | "@type": "WebPage", 18 | "headline": "", 19 | "about": "Sample video", 20 | "url": "https://www.youtube.com/watch?v=ra5pNorC1io" 21 | } 22 | } 23 | ], 24 | "mentions": [ 25 | { 26 | "@type": "Article", 27 | "name": "text", 28 | "about": "", 29 | "url": "http://?google.com?'text':3,10" 30 | } 31 | ], 32 | "comment": "", 33 | "image": [] 34 | }] -------------------------------------------------------------------------------- /src/CoreEditor/containers/EditExternal.js: -------------------------------------------------------------------------------- 1 | import { connect } from 'react-redux'; 2 | import EditExternal from '../components/EditExternal'; 3 | import * as externalActions from 'CoreEditor/actions/externalsEditor'; 4 | import * as actions from 'base/actions/actions'; 5 | 6 | function mapStateToProps(state) { 7 | return { 8 | externals: state.externalsEditor, 9 | }; 10 | } 11 | 12 | function mapDispatchToProps(dispatch) { 13 | return { 14 | onChange: (index, e) => { 15 | const url = e.target.value; 16 | dispatch(externalActions.externalChanged(index, url)); 17 | dispatch(actions.loadExternal(index, url)); 18 | }, 19 | onAddElement: () => { 20 | dispatch({ type: 'EXTERNAL_ADD' }); 21 | }, 22 | }; 23 | } 24 | 25 | export default connect(mapStateToProps, mapDispatchToProps)(EditExternal); 26 | -------------------------------------------------------------------------------- /opsworks_nodejs/templates/default/node_web_app.monitrc.erb: -------------------------------------------------------------------------------- 1 | check host node_web_app_<%= @application_name %> with address 127.0.0.1 2 | start program = "/bin/bash -c 'cd <%= @deploy[:deploy_to] %>/current ; source <%= @deploy[:deploy_to] %>/shared/app.env ; /usr/bin/env PORT=<%= @deploy[:nodejs][:port] %> NODE_PATH=<%= @deploy[:deploy_to] %>/current/node_modules:<%= @deploy[:deploy_to] %>/current /usr/local/bin/node <%= @monitored_script %> &>> <%= @deploy[:deploy_to] %>/nodejs_app.log'" 3 | stop program = "/usr/bin/pkill -f 'node <%= @monitored_script %>'" 4 | <% if @deploy[:ssl_support] -%> 5 | if failed port <%= @deploy[:nodejs][:port] %> type TCPSSL protocol HTTP 6 | <% else -%> 7 | if failed port <%= @deploy[:nodejs][:port] %> protocol HTTP 8 | <% end -%> 9 | request / 10 | with timeout 10 seconds 11 | then restart 12 | -------------------------------------------------------------------------------- /src/iframes/Pinger/js/auth.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 05.03.17. 3 | */ 4 | /* 5 | import { getCookie } from "./utils.js"; 6 | import { getServiceUrl } from "base/servicelocator"; 7 | 8 | export function openAuthPopup() { 9 | var loginUrl = getServiceUrl("login"); 10 | var callbackurl = "//" + window.location.host + "/callback"; 11 | window.open( 12 | loginUrl + "/authapi?callback=" + encodeURIComponent(callbackurl), 13 | "Login", 14 | "height=500,width=700" 15 | ); 16 | } 17 | 18 | export function logoff() { 19 | $.ajax("/logoff").success(function(res) { 20 | location.reload(); 21 | }); 22 | } 23 | 24 | export function checkLoggedIn() { 25 | console.log(document.cookie); 26 | if (!getCookie("sid")) { 27 | openAuthPopup(); 28 | } else { 29 | console.log("Cookie exists, aborting"); 30 | } 31 | } 32 | */ 33 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/admin/requests.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 13.06.17. 3 | */ 4 | import request from "superagent"; 5 | 6 | export async function requestStats(): string { 7 | const balance = await request.get("/api/webgold/coinadmin/master"); 8 | return JSON.parse(balance.text); 9 | } 10 | 11 | export async function requestGap(): string { 12 | const res = await request 13 | .get("/api/blockchain/get_gap") 14 | .set("X-Requested-With", "XMLHttpRequest"); 15 | return JSON.parse(res.text); 16 | } 17 | 18 | export async function getLatestBlockEtherscan(): string { 19 | let url = 20 | "https://ropsten.etherscan.io/api?module=proxy&action=eth_blockNumber&apikey=3854N5NEEKKCP4E4EB26W5SRG5D8ZSBGSK"; 21 | const res = await request.get(url); 22 | const text = JSON.parse(res.text); 23 | return parseInt(text.result, 16); 24 | } 25 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/crypto/__mocks__/tweetnacl.js: -------------------------------------------------------------------------------- 1 | // becuase prng is not defined in nodejs env, lets override it 2 | "use strict"; 3 | 4 | const path = require("path"); 5 | const nacl = require.requireActual("tweetnacl"); 6 | 7 | // monkeypatch (see: bitpay/bitcore-lib#34) 8 | import crypto from "crypto"; 9 | const sourceCreateHash = crypto.createHash; 10 | crypto.createHash = function createHash(alg) { 11 | if (alg === "ripemd160") { 12 | alg = "rmd160"; 13 | } 14 | return sourceCreateHash(alg); 15 | }; 16 | 17 | const rndfun = (x, n) => { 18 | console.log(`rnd called with parameters 0: ${n}, ${x}`); 19 | x = crypto.randomBytes(n); 20 | var i, 21 | v = crypto.randomBytes(n); 22 | //for (i = 0; i < n; i++) x[i] = v[i]; 23 | return x; 24 | }; 25 | nacl.setPRNG(rndfun); // use crypto PRNG fro testing 26 | 27 | module.exports = nacl; 28 | -------------------------------------------------------------------------------- /src/CoreEditor/containers/ArticleNavigationContainer.js: -------------------------------------------------------------------------------- 1 | import { connect } from 'react-redux'; 2 | import { 3 | VerticalNav as VerticalNavComponent, 4 | LeftNav as LeftNavComponent, 5 | } from 'base/components/ArticleNavigation'; 6 | import * as actions from 'base/actions/actions'; 7 | 8 | function mapStateToProps(state) { 9 | const { toc } = state.editorDocument; 10 | if (toc) { 11 | return { 12 | articleItems: toc.chapters, 13 | }; 14 | } return { 15 | articleItems: [], 16 | }; 17 | } 18 | 19 | function mapDispatchToProps(dispatch) { 20 | return { 21 | onNavigateArticleHash: hash => dispatch(actions.navigateArticleHash(hash)), 22 | }; 23 | } 24 | 25 | export const VerticalNav = connect(mapStateToProps, mapDispatchToProps)(VerticalNavComponent); 26 | export const LeftNav = connect(mapStateToProps, mapDispatchToProps)(LeftNavComponent); 27 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/BalanceLine.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 18.04.16. 3 | */ 4 | import React from "react"; 5 | import PropTypes from "prop-types"; 6 | 7 | export default class BalanceLine extends React.Component { 8 | constructor(props) { 9 | super(props); 10 | } 11 | 12 | render() { 13 | return ( 14 |
  • 15 | {this.props.label} 16 | 17 | {this.props.wrg} 18 | WRG 19 | 20 | {this.props.usd} 21 | USD 22 | 23 | 24 |
  • 25 | ); 26 | } 27 | } 28 | 29 | BalanceLine.propTypes = { 30 | label: PropTypes.string, 31 | wrg: PropTypes.any, 32 | usd: PropTypes.any 33 | }; 34 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/PaymentForm/PaymentData.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import QRCode from "../../3rdparty/qrcode"; 3 | import PropTypes from "prop-types"; 4 | 5 | class PaymentData extends React.Component { 6 | constructor(props) { 7 | super(props); 8 | } 9 | 10 | componentDidMount() { 11 | console.log("PaymentData Mounted"); 12 | new QRCode(document.getElementById("qrcode"), this.props.adress); 13 | } 14 | 15 | render() { 16 | return ( 17 |
    18 |

    19 | Please send {this.props.amount}BTC to the bitcoin adress{" "} 20 | {this.props.adress} 21 |

    22 |
    23 |
    24 | ); 25 | } 26 | } 27 | PaymentData.propTypes = { 28 | adress: PropTypes.string, 29 | amount: PropTypes.string 30 | }; 31 | 32 | export default PaymentData; 33 | -------------------------------------------------------------------------------- /src/CoreEditor/containers/ListEditorContainer.js: -------------------------------------------------------------------------------- 1 | import { connect } from 'react-redux'; 2 | import ListEditor from '../components/ListEditor'; 3 | import * as listActions from '../actions/listEditorActions'; 4 | 5 | function mapStateToProps(state) { 6 | return { 7 | items: state.listEditor, 8 | }; 9 | } 10 | 11 | function mapDispatchToProps(dispatch) { 12 | return { 13 | onAddElement: () => { 14 | dispatch(listActions.addElement({ url: '' })); 15 | }, 16 | onListChange: key => (elname, data) => { 17 | console.log(key, data); 18 | dispatch(listActions.changeElement({ [elname]: data }, key)); 19 | if (elname === 'url') { 20 | // TODO make smart preview 21 | // dispatch(listActions.fetchPreview(data, key)); 22 | } 23 | }, 24 | }; 25 | } 26 | 27 | export default connect(mapStateToProps, mapDispatchToProps)(ListEditor); 28 | -------------------------------------------------------------------------------- /src/base/Plus/utils/normURL.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 15.01.16. 3 | */ 4 | 5 | import assert from "assert"; 6 | import should from "should"; 7 | import normURL, { getPlusUrl, isPlusUrl } from "./normURL.js"; 8 | 9 | describe("URL normalizer test", () => { 10 | it("Should normalize URLs correctly", () => { 11 | var url = "https://wrioos.com/index.htm"; 12 | var normalized = normURL(url); 13 | should(normalized).equal("//wrioos.com"); 14 | should(normURL("//wr.io/474365383130/Untitled")).equal( 15 | "//wr.io/474365383130/Untitled" 16 | ); 17 | }); 18 | 19 | it("Should recognize plus url correctly", () => { 20 | var testurl = "https://wr.io/558153389649/Plus-WRIO-App/#"; 21 | should(isPlusUrl(testurl, "558153389649")).equal(true); 22 | should(isPlusUrl("https://login.wrrios.com/#", "558153389649")).equal( 23 | false 24 | ); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /src/CoreEditor/components/StyleButton.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 07.08.16. 3 | */ 4 | import React from 'react'; 5 | import PropTypes from 'prop-types'; 6 | 7 | export default class StyleButton extends React.Component { 8 | constructor() { 9 | super(); 10 | this.onToggle = this.onToggle.bind(this); 11 | } 12 | onToggle(e) { 13 | e.preventDefault(); 14 | this.props.onToggle(this.props.style); 15 | } 16 | render() { 17 | let className = 'RichEditor-styleButton'; 18 | if (this.props.active) { 19 | className += ' RichEditor-activeButton'; 20 | } 21 | return ( 22 | 23 | {this.props.label} 24 | 25 | ); 26 | } 27 | } 28 | 29 | StyleButton.propTypes = { 30 | onToggle: PropTypes.func, 31 | style: PropTypes.string, 32 | active: PropTypes.bool, 33 | label: PropTypes.string, 34 | }; 35 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/PaymentForm/AddFunds/LoginButton.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { getServiceUrl } from "base/servicelocator"; 3 | 4 | class LoginButton extends React.Component { 5 | openAuthPopup() { 6 | var loginUrl = getServiceUrl("login"); 7 | var callbackurl = 8 | window.location.protocol + "//" + window.location.host + "/callback"; 9 | window.open( 10 | loginUrl + "authapi?callback=" + encodeURIComponent(callbackurl), 11 | "Login", 12 | "height=500,width=700" 13 | ); 14 | } 15 | 16 | render() { 17 | return ( 18 | 25 | ); 26 | } 27 | } 28 | LoginButton.propTypes = {}; 29 | 30 | export default LoginButton; 31 | -------------------------------------------------------------------------------- /src/CoreEditor/utils/helpers.js: -------------------------------------------------------------------------------- 1 | export const getMention = (name, about, link) => ({ 2 | '@type': 'Article', 3 | name, 4 | about, 5 | url: link, 6 | }); 7 | 8 | export const getImageObject = (url: string, name: string, description: string) => ({ 9 | '@type': 'ImageObject', 10 | contentUrl: url, 11 | description, 12 | name, 13 | }); 14 | 15 | export const getSocialMediaPosting = (src: string, description: string, title: string) => ({ 16 | '@type': 'SocialMediaPosting', 17 | sharedContent: { 18 | '@type': 'WebPage', 19 | headline: title, 20 | about: description, 21 | url: src, 22 | }, 23 | }); 24 | 25 | export const getTicket = (url: string, image: string, about: string, name: string) => ({ 26 | '@type': 'Article', 27 | name, 28 | about, 29 | image, 30 | url, 31 | }); 32 | 33 | export const getPart = (name: string) => ({ 34 | '@type': 'Article', 35 | name, 36 | articleBody: [], 37 | }); 38 | -------------------------------------------------------------------------------- /src/base/components/misc/FixedCarousel.js: -------------------------------------------------------------------------------- 1 | // see https://github.com/react-bootstrap/react-bootstrap/issues/1914 2 | import React from "react"; 3 | import { Carousel as BootstrapCarousel } from "react-bootstrap"; 4 | export default class Carousel extends BootstrapCarousel { 5 | direction(prevIndex, index) { 6 | if (prevIndex === index) { 7 | return null; 8 | } 9 | 10 | if (prevIndex === this.props.children.length - 1 && index === 0) { 11 | return "next"; 12 | } 13 | 14 | return prevIndex > index ? "prev" : "next"; 15 | } 16 | 17 | componentWillReceiveProps(nextProps) { 18 | const activeIndex = this.getActiveIndex(); 19 | if ( 20 | nextProps.activeIndex == null && 21 | this.state.activeIndex >= nextProps.children.length 22 | ) { 23 | this.setState({ 24 | activeIndex: 0, 25 | previousActiveIndex: null, 26 | direction: null 27 | }); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/base/components/ReadItLater.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import UrlMixin from '../mixins/UrlMixin'; 3 | import { getResourcePath } from '../global'; 4 | import Thumbnail from './misc/ListThumbnail'; 5 | import Ticket from './Ticket'; 6 | import Loading from 'base/components/misc/Loading'; 7 | 8 | const ItemListElement = ({ 9 | name, about, image, url, 10 | }) => { 11 | const itemImage = image || getResourcePath('/img/no-photo-200x200.png'); 12 | return ; 13 | }; 14 | 15 | const ReadItLater = ({ RIL }) => { 16 | if (!RIL) { 17 | return ; 18 | } 19 | const tabs = RIL; 20 | // TODO: only basic information (name) is available, to implement description and photo additional extraction needed 21 | return ( 22 |
    {tabs.map((t, i) => )}
    23 | ); 24 | }; 25 | 26 | export default ReadItLater; 27 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/Info.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | class Info extends React.Component { 4 | render() { 5 | return ( 6 | 26 | ); 27 | } 28 | } 29 | 30 | export default Info; 31 | -------------------------------------------------------------------------------- /src/CoreEditor/components/CoverHeader.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ItemList from 'base/jsonld/entities/ItemList'; 3 | import ImageObject from 'base/jsonld/entities/ImageObject'; 4 | 5 | const defaultBg = 'https://default.wrioos.com/img/default-cover-bg.png'; 6 | 7 | const CoverHeader = ({ 8 | coverDialog, 9 | onCoverPressed 10 | }) => { 11 | const coverBgStyle = {textAlign: 'center'}; 12 | const headerStyle = { height: 'auto', minHeight: '110px', backgroundSize: 'auto' }; 13 | 14 | return ( 15 |
    16 |
    21 | {coverDialog && coverDialog.submit 22 | ? coverDialog.tabs.length === 1 23 | ? '1 cover' 24 | : coverDialog.tabs.length + ' covers' 25 | : '' 26 | } 27 |
    28 |
    29 | ) 30 | } 31 | 32 | export default CoverHeader; 33 | -------------------------------------------------------------------------------- /src/CoreEditor/utils/entitytools.spec.js: -------------------------------------------------------------------------------- 1 | import { mkDoc } from '../reducers/docUtils'; 2 | import * as EntityTools from './entitytools'; 3 | import getFixture from '../fixtures/fixture.js'; 4 | import JSONDocument from 'base/jsonld/LdJsonDocument'; 5 | 6 | const json = getFixture('social'); 7 | 8 | /** 9 | * The goal of this test is to make import of documents without extra spaces or newlines 10 | */ 11 | test('Should IMPORT document with social media entity without extra newlines', () => { 12 | const doc = new JSONDocument(json); 13 | const { editorState } = mkDoc({}, doc); 14 | const blockMap = editorState.getCurrentContent().getBlockMap(); 15 | blockMap.forEach((block, key) => { 16 | console.log(`blockk ${key} type: ${block.type} text: <<<${block.text}>>>`); 17 | }); 18 | }); 19 | 20 | test('Should extract table of contents correctly', () => { 21 | const doc = new JSONDocument(json); 22 | const { editorState } = mkDoc({}, doc); 23 | const toc = EntityTools.extractTableOfContents(editorState); 24 | expect(toc).toEqual(['Untitledsd']); 25 | }); 26 | -------------------------------------------------------------------------------- /src/base/jsonld/mentions/mention.spec.js: -------------------------------------------------------------------------------- 1 | import request from "supertest"; 2 | import assert from "assert"; 3 | import should from "should"; 4 | import Mention from "./mention.js"; 5 | import ImageObject from "./image.js"; 6 | 7 | describe("mention test", () => { 8 | it("Shoud determine correct mention start and order", () => { 9 | var mention = new Mention({ 10 | "@type": "Article", 11 | name: "First url title", 12 | about: "Text inside the ticket popup.", 13 | url: "https://webrunes.com/blog.htm?'dolor sit amet':3,104" 14 | }); 15 | mention.start.should.be.equal(104); 16 | mention.order.should.be.equal(3); 17 | }); 18 | 19 | it("Shoud determine correct mention start and order for ImageObject", () => { 20 | var mention = new ImageObject({ 21 | "@type": "ImageObject", 22 | name: "Object", 23 | about: "Object about", 24 | contentUrl: "https://pbs.twimg.com/media/CTfm_JRWsAEPBfq.jpg?3,0" 25 | }); 26 | mention.start.should.be.equal(0); 27 | mention.order.should.be.equal(3); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/Disclaimer.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default class Disclaimer extends React.Component { 4 | render() { 5 | return ( 6 |
    7 |
    Keep it safe!
    8 |

    9 | These 12 words are your wallet seed. It will unlock complete access to 10 | your funds even if you can't access your computer anymore. Please 11 | write them down on a piece of paper before continuing. 12 |

    13 |

    14 | Important: We care about the security and anonymity of our 15 | users, thus we do not save passwords, access keys or personal data on 16 | the servers. It is impossible to steal something that doesn't exist. 17 | This protects your data and money against interventions of hackers and 18 | other third parties. But remember: we will not be able to recover 19 | access to the wallet if you lose the code phrase provided below. 20 |

    21 |
    22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/iframes/webGold/js/components/Wallet/Disclaimer.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default class Disclaimer extends React.Component { 4 | render() { 5 | return ( 6 |
    7 |
    Keep it safe!
    8 |

    9 | These 12 words are your wallet seed. It will unlock complete access to 10 | your funds even if you can't access your computer anymore. Please 11 | write them down on a piece of paper before continuing. 12 |

    13 |

    14 | Important: We care about the security and anonymity of our 15 | users, thus we do not save passwords, access keys or personal data on 16 | the servers. It is impossible to steal something that doesn't exist. 17 | This protects your data and money against interventions of hackers and 18 | other third parties. But remember: we will not be able to recover 19 | access to the wallet if you lose the code phrase provided below. 20 |

    21 |
    22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/base/jsonld/entities/LdJsonObject.spec.js: -------------------------------------------------------------------------------- 1 | import request from "supertest"; 2 | import assert from "assert"; 3 | import should from "should"; 4 | import LdJsonObject from "./LdJsonObject"; 5 | 6 | const fixture = { 7 | "@context": "https://schema.org", 8 | "@type": "Article", 9 | inLanguage: "En", 10 | keywords: "", 11 | author: "https://wr.io/848825910709/?wr.io=848825910709", 12 | editor: "", 13 | name: "Untitled", 14 | about: "", 15 | articleBody: [" ", ""], 16 | hasPart: [ 17 | { 18 | "@type": "SocialMediaPosting", 19 | sharedContent: { 20 | "@type": "WebPage", 21 | headline: "", 22 | about: "", 23 | url: "https://www.youtube.com/watch?v=9GTB4oGLSz4" 24 | } 25 | } 26 | ], 27 | mentions: [], 28 | comment: "", 29 | image: [] 30 | }; 31 | 32 | describe("mention test", () => { 33 | it("Shoud correctly evaluate type of JSON-LD object", () => { 34 | const obj = new LdJsonObject(fixture, 0, 0); 35 | obj.hasElementOfType("Article").should.be.true(); 36 | obj.hasElementOfType("Social").should.be.false(); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /src/CoreEditor/components/CommentEnabler.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 29.04.16. 3 | */ 4 | import React from 'react'; 5 | import PropTypes from 'prop-types'; 6 | 7 | const domain = process.env.DOMAIN; 8 | 9 | const CommentEnabler = ({ isChecked, onCheck }) => { 10 | function handleInputChange(event) { 11 | const target = event.target; 12 | const value = target.type === 'checkbox' ? target.checked : target.value; 13 | onCheck(value); 14 | } 15 | 16 | return ( 17 |
    18 |
    19 | 32 |
    33 |
    34 | ); 35 | }; 36 | 37 | export default CommentEnabler; 38 | -------------------------------------------------------------------------------- /src/base/jsonld/entities/ImageObject.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by michbil on 13.09.16. 3 | */ 4 | 5 | import React from 'react'; 6 | import LdJsonObject from "./LdJsonObject.js"; 7 | import Image from "../mentions/image"; 8 | import mention from "../mentions/mention.js"; 9 | 10 | export default class ImageObject extends LdJsonObject { 11 | constructor(json, order, root) { 12 | super(json, order, root); 13 | } 14 | 15 | getCoverItems() { 16 | return this.data.text.map((item, i) => { 17 | let appliedMention = {}; 18 | if (this.mappedMent.text && this.mappedMent.text[i]) { 19 | appliedMention.text = this.mappedMent.text[i].render(i); 20 | appliedMention.bullet = this.mappedMent.text[i].bullet; 21 | } else { 22 | if (mention.isBulletItem(this.data.text[i])) { 23 | appliedMention.bullet = true; 24 | appliedMention.text = mention.skipAsterisk(item); 25 | } else { 26 | appliedMention.text = item === '' 27 | ? (
    ) 28 | : item 29 | } 30 | } 31 | return appliedMention; 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/base/components/misc/CommentsDisabled.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { getServiceUrl, getDomain } from '../../servicelocator.js'; 3 | import PropTypes from 'prop-types'; 4 | 5 | export default class CommentsDisabled extends React.Component { 6 | render() { 7 | const iStyle = { 8 | width: '100%', 9 | height: '230px', 10 | border: 'none', 11 | }; 12 | 13 | const frameUrl = 14 | `${getServiceUrl('core')}/edit?comment_article=${encodeURIComponent(window.location.href)}`; 15 | if (this.props.isAuthor) { 16 | return