├── .gitignore
├── sample_ui.png
├── backend
├── batchpriceupdater
│ ├── .settings
│ │ ├── org.eclipse.wst.jsdt.ui.superType.name
│ │ ├── org.eclipse.wst.jsdt.ui.superType.container
│ │ ├── org.eclipse.wst.common.project.facet.core.xml
│ │ ├── org.eclipse.wst.common.component
│ │ ├── .jsdtscope
│ │ └── org.eclipse.jdt.core.prefs
│ ├── scripts
│ │ └── start-backend.sh
│ ├── WebContent
│ │ └── META-INF
│ │ │ └── MANIFEST.MF
│ ├── lib
│ │ ├── httpcore-4.4.9.jar
│ │ ├── httpclient-4.5.5.jar
│ │ ├── json-simple-1.1.1.jar
│ │ ├── postgresql-42.2.2.jar
│ │ ├── commons-codec-1.10.jar
│ │ └── commons-logging-1.2.jar
│ ├── src
│ │ └── com
│ │ │ └── eosrp
│ │ │ ├── db
│ │ │ ├── DbContract.java
│ │ │ └── PostgresHelper.java
│ │ │ ├── network
│ │ │ ├── HttpGetHelper.java
│ │ │ └── HttpPostHelper.java
│ │ │ ├── ErpResUpdateBatch.java
│ │ │ └── resources
│ │ │ └── EosResources.java
│ ├── .project
│ ├── .classpath
│ └── LICENSE
├── api
│ ├── db
│ │ ├── build_alldata__day_candles.sql
│ │ ├── build_alldata_week_candles.sql
│ │ ├── build_day_candles.sql
│ │ ├── build_hour_candles.sql
│ │ ├── build_week_candles.sql
│ │ └── build_minute_candles.sql
│ ├── conf
│ │ └── config.js
│ ├── package.json
│ ├── LICENSE
│ ├── server.js
│ └── controllers
│ │ └── apiCtrl.js
└── README.md
├── process_flow.png
├── frontend
├── favicon.ico
├── favicon-128.png
├── images
│ ├── plus.png
│ ├── arrow.png
│ ├── arrow2.png
│ ├── arrow3.png
│ ├── arrow4.png
│ ├── blank.gif
│ ├── minus.png
│ ├── about-1.jpg
│ ├── about-2.jpg
│ ├── about-3.jpg
│ ├── bg-next.png
│ ├── bg-prev.png
│ ├── eos-logo.png
│ ├── bg-close@2x.png
│ ├── bg-next@2x.png
│ ├── bg-prev@2x.png
│ ├── eosny-logo.png
│ ├── background-1.png
│ ├── arrow-down-white.png
│ ├── EOS-NY_Horizontal.png
│ ├── arrow-right-white.png
│ └── icons
│ │ ├── futuro_icons_143.png
│ │ ├── futuro_icons_186.png
│ │ ├── futuro_icons_253.png
│ │ ├── futuro_icons_285.png
│ │ └── futuro_icons_346.png
├── favicon-16x16.png
├── favicon-32x32.png
├── favicon-96x96.png
├── mstile-70x70.png
├── favicon-196x196.png
├── mstile-144x144.png
├── mstile-150x150.png
├── mstile-310x150.png
├── mstile-310x310.png
├── fonts
│ ├── FontAwesome.otf
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ ├── fontawesome-webfont.woff2
│ └── bootstrap
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
├── apple-touch-icon-57x57.png
├── apple-touch-icon-60x60.png
├── apple-touch-icon-72x72.png
├── apple-touch-icon-76x76.png
├── apple-touch-icon-114x114.png
├── apple-touch-icon-120x120.png
├── apple-touch-icon-144x144.png
├── apple-touch-icon-152x152.png
├── js
│ ├── preloader.js
│ ├── input.fields.js
│ ├── jquery.form.js
│ ├── piechart.js
│ ├── main.js
│ ├── jquery.ba-bbq.min.js
│ ├── jquery-easing-1.3.js
│ ├── modernizr.js
│ ├── jquery.touchSwipe.min.js
│ ├── packery-mode.pkgd.min.js
│ ├── jquery.flexslider-min.js
│ ├── jquery.isotope.load.js
│ └── jquery.fancybox.pack.js
├── widgets
│ ├── cpu.html
│ ├── ram.html
│ ├── net.html
│ ├── test-widgets.html
│ ├── widget-net.js
│ ├── widget-cpu.js
│ ├── widgets.css
│ └── widget-ram.js
└── css
│ ├── reset.css
│ ├── convert.css
│ ├── flexslider.css
│ ├── responsive.css
│ └── jquery.fancybox.css
├── LICENSE.txt
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | build/
3 | node_modules/
4 |
--------------------------------------------------------------------------------
/sample_ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/sample_ui.png
--------------------------------------------------------------------------------
/backend/batchpriceupdater/.settings/org.eclipse.wst.jsdt.ui.superType.name:
--------------------------------------------------------------------------------
1 | Window
--------------------------------------------------------------------------------
/process_flow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/process_flow.png
--------------------------------------------------------------------------------
/backend/batchpriceupdater/scripts/start-backend.sh:
--------------------------------------------------------------------------------
1 | nohup java -jar keypaireosrp.jar &
--------------------------------------------------------------------------------
/frontend/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/favicon.ico
--------------------------------------------------------------------------------
/frontend/favicon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/favicon-128.png
--------------------------------------------------------------------------------
/frontend/images/plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/plus.png
--------------------------------------------------------------------------------
/frontend/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/favicon-16x16.png
--------------------------------------------------------------------------------
/frontend/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/favicon-32x32.png
--------------------------------------------------------------------------------
/frontend/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/favicon-96x96.png
--------------------------------------------------------------------------------
/frontend/images/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/arrow.png
--------------------------------------------------------------------------------
/frontend/images/arrow2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/arrow2.png
--------------------------------------------------------------------------------
/frontend/images/arrow3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/arrow3.png
--------------------------------------------------------------------------------
/frontend/images/arrow4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/arrow4.png
--------------------------------------------------------------------------------
/frontend/images/blank.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/blank.gif
--------------------------------------------------------------------------------
/frontend/images/minus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/minus.png
--------------------------------------------------------------------------------
/frontend/mstile-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/mstile-70x70.png
--------------------------------------------------------------------------------
/backend/batchpriceupdater/WebContent/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/frontend/favicon-196x196.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/favicon-196x196.png
--------------------------------------------------------------------------------
/frontend/images/about-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/about-1.jpg
--------------------------------------------------------------------------------
/frontend/images/about-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/about-2.jpg
--------------------------------------------------------------------------------
/frontend/images/about-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/about-3.jpg
--------------------------------------------------------------------------------
/frontend/images/bg-next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/bg-next.png
--------------------------------------------------------------------------------
/frontend/images/bg-prev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/bg-prev.png
--------------------------------------------------------------------------------
/frontend/images/eos-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/eos-logo.png
--------------------------------------------------------------------------------
/frontend/mstile-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/mstile-144x144.png
--------------------------------------------------------------------------------
/frontend/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/mstile-150x150.png
--------------------------------------------------------------------------------
/frontend/mstile-310x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/mstile-310x150.png
--------------------------------------------------------------------------------
/frontend/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/mstile-310x310.png
--------------------------------------------------------------------------------
/frontend/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/frontend/images/bg-close@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/bg-close@2x.png
--------------------------------------------------------------------------------
/frontend/images/bg-next@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/bg-next@2x.png
--------------------------------------------------------------------------------
/frontend/images/bg-prev@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/bg-prev@2x.png
--------------------------------------------------------------------------------
/frontend/images/eosny-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/eosny-logo.png
--------------------------------------------------------------------------------
/frontend/images/background-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/background-1.png
--------------------------------------------------------------------------------
/frontend/apple-touch-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/apple-touch-icon-57x57.png
--------------------------------------------------------------------------------
/frontend/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/frontend/apple-touch-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/apple-touch-icon-72x72.png
--------------------------------------------------------------------------------
/frontend/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/frontend/images/arrow-down-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/arrow-down-white.png
--------------------------------------------------------------------------------
/backend/batchpriceupdater/.settings/org.eclipse.wst.jsdt.ui.superType.container:
--------------------------------------------------------------------------------
1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary
--------------------------------------------------------------------------------
/frontend/apple-touch-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/apple-touch-icon-114x114.png
--------------------------------------------------------------------------------
/frontend/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/frontend/apple-touch-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/apple-touch-icon-144x144.png
--------------------------------------------------------------------------------
/frontend/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/frontend/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/frontend/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/frontend/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/frontend/images/EOS-NY_Horizontal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/EOS-NY_Horizontal.png
--------------------------------------------------------------------------------
/frontend/images/arrow-right-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/arrow-right-white.png
--------------------------------------------------------------------------------
/frontend/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/frontend/images/icons/futuro_icons_143.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/icons/futuro_icons_143.png
--------------------------------------------------------------------------------
/frontend/images/icons/futuro_icons_186.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/icons/futuro_icons_186.png
--------------------------------------------------------------------------------
/frontend/images/icons/futuro_icons_253.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/icons/futuro_icons_253.png
--------------------------------------------------------------------------------
/frontend/images/icons/futuro_icons_285.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/icons/futuro_icons_285.png
--------------------------------------------------------------------------------
/frontend/images/icons/futuro_icons_346.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/images/icons/futuro_icons_346.png
--------------------------------------------------------------------------------
/backend/batchpriceupdater/lib/httpcore-4.4.9.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/backend/batchpriceupdater/lib/httpcore-4.4.9.jar
--------------------------------------------------------------------------------
/backend/batchpriceupdater/lib/httpclient-4.5.5.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/backend/batchpriceupdater/lib/httpclient-4.5.5.jar
--------------------------------------------------------------------------------
/backend/batchpriceupdater/lib/json-simple-1.1.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/backend/batchpriceupdater/lib/json-simple-1.1.1.jar
--------------------------------------------------------------------------------
/backend/batchpriceupdater/lib/postgresql-42.2.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/backend/batchpriceupdater/lib/postgresql-42.2.2.jar
--------------------------------------------------------------------------------
/backend/batchpriceupdater/lib/commons-codec-1.10.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/backend/batchpriceupdater/lib/commons-codec-1.10.jar
--------------------------------------------------------------------------------
/backend/batchpriceupdater/lib/commons-logging-1.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/backend/batchpriceupdater/lib/commons-logging-1.2.jar
--------------------------------------------------------------------------------
/frontend/fonts/bootstrap/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/fonts/bootstrap/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/frontend/fonts/bootstrap/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/fonts/bootstrap/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/frontend/fonts/bootstrap/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/fonts/bootstrap/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/frontend/fonts/bootstrap/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosnewyork/erp/HEAD/frontend/fonts/bootstrap/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/frontend/js/preloader.js:
--------------------------------------------------------------------------------
1 | jQuery(window).load(function() {
2 | "use strict";
3 | jQuery("#status").fadeOut(350);
4 | jQuery("#preloader").delay(350).fadeOut(350);
5 |
6 | });
7 |
--------------------------------------------------------------------------------
/backend/api/db/build_alldata__day_candles.sql:
--------------------------------------------------------------------------------
1 | SELECT
2 | date_trunc('day', dt) dt,
3 | (array_agg(peos ORDER BY dt ASC))[1] o,
4 | MAX(peos) h,
5 | MIN(peos) l,
6 | (array_agg(peos ORDER BY dt DESC))[1] c
7 | FROM "eosram"
8 | GROUP BY date_trunc('day', dt)
9 | ORDER BY dt;
10 |
--------------------------------------------------------------------------------
/backend/api/db/build_alldata_week_candles.sql:
--------------------------------------------------------------------------------
1 | SELECT
2 | date_trunc('week', dt) dt,
3 | (array_agg(peos ORDER BY dt ASC))[1] o,
4 | MAX(peos) h,
5 | MIN(peos) l,
6 | (array_agg(peos ORDER BY dt DESC))[1] c
7 | FROM "eosram"
8 | GROUP BY date_trunc('week', dt)
9 | ORDER BY dt;
10 |
--------------------------------------------------------------------------------
/backend/api/db/build_day_candles.sql:
--------------------------------------------------------------------------------
1 | SELECT
2 | date_trunc('day', dt) dt,
3 | (array_agg(peos ORDER BY dt ASC))[1] o,
4 | MAX(peos) h,
5 | MIN(peos) l,
6 | (array_agg(peos ORDER BY dt DESC))[1] c
7 | FROM "eosram"
8 | WHERE dt BETWEEN $1::timestamp AND now()::timestamp
9 | GROUP BY date_trunc('day', dt)
10 | ORDER BY dt;
11 |
--------------------------------------------------------------------------------
/backend/api/db/build_hour_candles.sql:
--------------------------------------------------------------------------------
1 | SELECT
2 | date_trunc('hour', dt) dt,
3 | (array_agg(peos ORDER BY dt ASC))[1] o,
4 | MAX(peos) h,
5 | MIN(peos) l,
6 | (array_agg(peos ORDER BY dt DESC))[1] c
7 | FROM "eosram"
8 | WHERE dt BETWEEN $1::timestamp AND now()::timestamp
9 | GROUP BY date_trunc('hour', dt)
10 | ORDER BY dt;
11 |
--------------------------------------------------------------------------------
/backend/api/db/build_week_candles.sql:
--------------------------------------------------------------------------------
1 | SELECT
2 | date_trunc('week', dt) dt,
3 | (array_agg(peos ORDER BY dt ASC))[1] o,
4 | MAX(peos) h,
5 | MIN(peos) l,
6 | (array_agg(peos ORDER BY dt DESC))[1] c
7 | FROM "eosram"
8 | WHERE dt BETWEEN $1::timestamp AND now()::timestamp
9 | GROUP BY date_trunc('week', dt)
10 | ORDER BY dt;
11 |
--------------------------------------------------------------------------------
/backend/api/conf/config.js:
--------------------------------------------------------------------------------
1 | var config = {
2 | //~ DB connection settings
3 | database: {
4 | host: '127.0.0.1',
5 | port: '5432',
6 | dbname: 'dbname',
7 | user: '',
8 | pass: '',
9 | },
10 | //~ Server details
11 | server: {
12 | host: '127.0.0.1',
13 | port: '8000'
14 | }
15 | };
16 | module.exports = config;
17 |
--------------------------------------------------------------------------------
/backend/api/db/build_minute_candles.sql:
--------------------------------------------------------------------------------
1 | SELECT
2 | date_trunc('minute', dt) dt,
3 | (array_agg(peos ORDER BY dt ASC))[1] o,
4 | MAX(peos) h,
5 | MIN(peos) l,
6 | (array_agg(peos ORDER BY dt DESC))[1] c
7 | FROM "eosram"
8 | WHERE dt BETWEEN $1::timestamp AND now()::timestamp
9 | GROUP BY date_trunc('minute', dt)
10 | ORDER BY dt;
11 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/src/com/eosrp/db/DbContract.java:
--------------------------------------------------------------------------------
1 | package com.eosrp.db;
2 |
3 | public interface DbContract {
4 | public static final String HOST = "jdbc:postgresql://erpdb.cf4d9ymguhtu.us-west-2.rds.amazonaws.com/";
5 | public static final String DB_NAME = "eosrpdbprices";
6 | public static final String USERNAME = "";
7 | public static final String PASSWORD = "";
8 | }
9 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/.settings/org.eclipse.wst.common.project.facet.core.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/.settings/org.eclipse.wst.common.component:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/frontend/js/input.fields.js:
--------------------------------------------------------------------------------
1 | jQuery.fn.inputHints = function() {
2 | "use strict";
3 | jQuery(this).each(function(i) {
4 | jQuery(this).val(jQuery(this).attr('title'));
5 | });
6 | jQuery(this).focus(function() {
7 | if (jQuery(this).val() == jQuery(this).attr('title'))
8 | jQuery(this).val('');
9 | }).blur(function() {
10 | if (jQuery(this).val() == '')
11 | jQuery(this).val(jQuery(this).attr('title'));
12 | });
13 | };
14 |
15 |
16 | jQuery(document).ready(function() {
17 | "use strict";
18 | jQuery('input[title], textarea[title]').inputHints();
19 | });
--------------------------------------------------------------------------------
/backend/batchpriceupdater/.settings/.jsdtscope:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.compliance=1.8
7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.source=1.8
13 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | erp-backend
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.wst.common.project.facet.core.builder
15 |
16 |
17 |
18 |
19 | org.eclipse.wst.validation.validationbuilder
20 |
21 |
22 |
23 |
24 |
25 | org.eclipse.jem.workbench.JavaEMFNature
26 | org.eclipse.wst.common.modulecore.ModuleCoreNature
27 | org.eclipse.wst.common.project.facet.core.nature
28 | org.eclipse.jdt.core.javanature
29 | org.eclipse.wst.jsdt.core.jsNature
30 |
31 |
32 |
--------------------------------------------------------------------------------
/frontend/js/jquery.form.js:
--------------------------------------------------------------------------------
1 | jQuery(document).ready(function() {
2 | "use strict";
3 | $('#submit').on('click', function() {
4 |
5 | var action = $('#contactform').attr('action');
6 |
7 | $("#message").fadeOut(200, function() {
8 | $('#message').hide();
9 |
10 | $('#submit')
11 | .attr('disabled', 'disabled');
12 |
13 | $.post(action, {
14 | name: $('#name').val(),
15 | email: $('#email').val(),
16 | phone: $('#phone').val(),
17 | comments: $('#comments').val()
18 | },
19 | function(data) {
20 | document.getElementById('message').innerHTML = data;
21 | $('#message').fadeIn(200);
22 | $('.hide').hide(0);
23 | $('#submit').removeAttr('disabled');
24 |
25 | }
26 | );
27 |
28 | });
29 |
30 | return false;
31 |
32 | });
33 |
34 | });
--------------------------------------------------------------------------------
/backend/api/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "eosrp-backend-api",
3 | "version": "0.1.0",
4 | "description": "A backend API for the EOS Resource Planner that is used to query and display charting data to the frontend",
5 | "main": "server.js",
6 | "scripts": {
7 | "start:dev": "nodemon server.js",
8 | "start:prod": "NODE_ENV=production nodemon server.js"
9 | },
10 | "repository": {
11 | "type": "git",
12 | "url": "git+https://github.com/acoutts/erp.git"
13 | },
14 | "keywords": [
15 | "eosio",
16 | "eos",
17 | "backend",
18 | "eosrp"
19 | ],
20 | "author": "Andrew Coutts",
21 | "license": "MIT",
22 | "bugs": {
23 | "url": "https://github.com/acoutts/erp/issues"
24 | },
25 | "homepage": "https://github.com/acoutts/erp/backend#readme",
26 | "devDependencies": {
27 | "nodemon": "^1.17.5"
28 | },
29 | "dependencies": {
30 | "body-parser": "^1.18.3",
31 | "express": "^4.16.3",
32 | "lodash": "^4.17.13",
33 | "massive": "^5.0.0",
34 | "moment": "^2.22.2",
35 | "morgan": "^1.9.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/frontend/widgets/cpu.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
Bandwidth: CPU (Ms)
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/frontend/widgets/ram.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
Storage: RAM (Kb)
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/frontend/widgets/net.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
Bandwidth: Network (Kb)
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/backend/api/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 acoutts
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Andrew Coutts
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 acoutts
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/frontend/widgets/test-widgets.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/frontend/css/reset.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 |
3 | html,
4 | body,
5 | div,
6 | span,
7 | applet,
8 | object,
9 | iframe,
10 | h1,
11 | h2,
12 | h3,
13 | h4,
14 | h5,
15 | h6,
16 | p,
17 | blockquote,
18 | pre,
19 | a,
20 | abbr,
21 | acronym,
22 | address,
23 | big,
24 | cite,
25 | code,
26 | del,
27 | dfn,
28 | em,
29 | font,
30 | img,
31 | ins,
32 | kbd,
33 | q,
34 | s,
35 | samp,
36 | small,
37 | strike,
38 | strong,
39 | sub,
40 | sup,
41 | tt,
42 | var,
43 | dl,
44 | dt,
45 | dd,
46 | ol,
47 | ul,
48 | li,
49 | fieldset,
50 | form,
51 | label,
52 | legend,
53 | table,
54 | caption,
55 | tbody,
56 | tfoot,
57 | thead,
58 | tr,
59 | th,
60 | td {
61 | margin: 0;
62 | padding: 0;
63 | border: 0;
64 | outline: 0;
65 | font-weight: inherit;
66 | font-style: inherit;
67 | font-size: 100%;
68 | font-family: inherit;
69 | vertical-align: baseline;
70 | }
71 |
72 | :focus {
73 | outline: 0;
74 | }
75 |
76 | body {
77 | line-height: 1;
78 | color: black;
79 | /*background: white;*/
80 | }
81 |
82 | ol,
83 | ul {
84 | list-style: none;
85 | }
86 |
87 | table {
88 | border-collapse: separate;
89 | border-spacing: 0;
90 | }
91 |
92 | caption,
93 | th,
94 | td {
95 | text-align: left;
96 | font-weight: normal;
97 | }
--------------------------------------------------------------------------------
/backend/batchpriceupdater/src/com/eosrp/network/HttpGetHelper.java:
--------------------------------------------------------------------------------
1 | package com.eosrp.network;
2 |
3 | import java.io.IOException;
4 | import org.apache.http.HttpEntity;
5 | import org.apache.http.client.methods.CloseableHttpResponse;
6 | import org.apache.http.client.methods.HttpGet;
7 | import org.apache.http.impl.client.CloseableHttpClient;
8 | import org.apache.http.impl.client.HttpClients;
9 | import org.apache.http.util.EntityUtils;
10 | import org.json.simple.JSONObject;
11 | import org.json.simple.JSONValue;
12 |
13 | public class HttpGetHelper {
14 |
15 | private String strUrl;
16 |
17 | //~ Constructor
18 | public HttpGetHelper(String _url) {
19 | strUrl = _url;
20 | }
21 |
22 | //~ Sends an HTTP GET request to the URL passed into the constructor
23 | //~
24 | //~ Returns a JSON object of the response JSON
25 | public JSONObject sendRequest() throws IOException {
26 | String strRespString;
27 |
28 | CloseableHttpClient httpclient = HttpClients.createDefault();
29 | HttpGet httpGet = new HttpGet(strUrl);
30 | CloseableHttpResponse response = httpclient.execute(httpGet);
31 |
32 | try {
33 | //~ DEBUG
34 | System.out.println("GET | Url: " + strUrl + " | " + response.getStatusLine());
35 | HttpEntity respEntity = response.getEntity();
36 | strRespString = EntityUtils.toString(respEntity);
37 | EntityUtils.consume(respEntity);
38 | } finally {
39 | response.close();
40 | }
41 |
42 | return (JSONObject) JSONValue.parse(strRespString);
43 | }
44 |
45 |
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/frontend/js/piechart.js:
--------------------------------------------------------------------------------
1 | /*jQuery(window).load(function() {
2 | "use strict";
3 |
4 | google.charts.load('current', {
5 | 'packages': ['corechart']
6 | });
7 | google.charts.setOnLoadCallback(drawChart);
8 |
9 | function drawChart() {
10 |
11 | var data = google.visualization.arrayToDataTable([
12 | ['Task', 'Percentage'],
13 | ['Token Sale', 65],
14 | ['Development', 20],
15 | ['Team', 7],
16 | ['Marketing', 5],
17 | ['Legal Fund', 3]
18 | ]);
19 |
20 | var options = {
21 | enableInteractivity: 'true',
22 | pieSliceText: 'none',
23 | fontSize: '14',
24 | pieStartAngle: 36,
25 | 'legend': {
26 | position: 'labeled'
27 | },
28 | fontName: 'IBM Plex Sans',
29 | colors: ['#0096a0', '#00a7b2', '#2bc0ca', '#40d4de', '#67e1e9'],
30 | 'tooltip': {
31 | trigger: 'none'
32 | }
33 |
34 | };
35 |
36 | if (jQuery(window).width() < 668) {
37 |
38 | var options = {
39 | enableInteractivity: 'true',
40 | pieSliceText: 'percentage',
41 | fontSize: '10',
42 | pieStartAngle: 36,
43 | 'legend': {
44 | position: 'left'
45 | },
46 | fontName: 'IBM Plex Sans',
47 | colors: ['#0096a0', '#00a7b2', '#2bc0ca', '#40d4de', '#67e1e9'],
48 | 'tooltip': {
49 | trigger: 'none'
50 | }
51 | };
52 |
53 | }
54 |
55 |
56 |
57 | var chart = new google.visualization.PieChart(document.getElementById('piechart'));
58 |
59 | chart.draw(data, options);
60 | }
61 |
62 |
63 | });*/
64 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/src/com/eosrp/network/HttpPostHelper.java:
--------------------------------------------------------------------------------
1 | package com.eosrp.network;
2 |
3 | import java.io.IOException;
4 | import org.apache.http.HttpEntity;
5 | import org.apache.http.client.methods.CloseableHttpResponse;
6 | import org.apache.http.client.methods.HttpPost;
7 | import org.apache.http.entity.StringEntity;
8 | import org.apache.http.impl.client.CloseableHttpClient;
9 | import org.apache.http.impl.client.HttpClients;
10 | import org.apache.http.util.EntityUtils;
11 | import org.json.simple.JSONObject;
12 | import org.json.simple.JSONValue;
13 |
14 | public class HttpPostHelper {
15 |
16 | private String strUrl;
17 | private String strReqJson;
18 |
19 | //~ Constructor
20 | public HttpPostHelper(String _strUrl, String _strReqJson) {
21 | strUrl = _strUrl;
22 | strReqJson = _strReqJson;
23 | }
24 |
25 | //~ Sends an HTTP POST request to the URL passed into the constructor
26 | //~ and uses the JSON parameters in a string passed into the constructor
27 | //~
28 | //~ Example parameter string (for RAM market):
29 | //~ {"json":"true","code":"eosio","scope":"eosio","table":"rammarket","limit":"10"}
30 | //~
31 | //~ Returns a JSON object of the response JSON
32 | public JSONObject sendRequest() throws IOException {
33 | String _strRespString;
34 |
35 | CloseableHttpClient httpclient = HttpClients.createDefault();
36 | HttpPost httpPost = new HttpPost(strUrl);
37 | StringEntity strentReqString = new StringEntity(strReqJson);
38 | httpPost.setEntity(strentReqString);
39 | httpPost.setHeader("Content-type", "application/json");
40 | CloseableHttpResponse response = httpclient.execute(httpPost);
41 |
42 | try {
43 | //~ DEBUG
44 | System.out.println("POST | Url: " + strUrl + " | " + response.getStatusLine());
45 | HttpEntity respEntity = response.getEntity();
46 | _strRespString = EntityUtils.toString(respEntity);
47 | EntityUtils.consume(respEntity);
48 | } finally {
49 | response.close();
50 | }
51 |
52 | return (JSONObject) JSONValue.parse(_strRespString);
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/frontend/css/convert.css:
--------------------------------------------------------------------------------
1 | .convert{
2 | width: auto;
3 | padding: 30px;
4 | background: #FFFFFF;
5 | margin: auto;
6 | /*box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.22);
7 | -moz-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.22);
8 | -webkit-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.22);
9 | */
10 | }
11 | .convert h2{
12 | background: #4D4D4D;
13 | text-transform: uppercase;
14 | color: #797979;
15 | font-size: 18px;
16 | font-weight: 100;
17 | padding: 20px;
18 | margin: -30px -30px 30px -30px;
19 | }
20 | .convert input[type="text"],
21 | .convert input[type="date"],
22 | .convert input[type="datetime"],
23 | .convert input[type="email"],
24 | .convert input[type="number"],
25 | .convert input[type="search"],
26 | .convert input[type="time"],
27 | .convert input[type="url"],
28 | .convert input[type="password"],
29 | .convert textarea,
30 | .convert select
31 | {
32 | box-sizing: border-box;
33 | -webkit-box-sizing: border-box;
34 | -moz-box-sizing: border-box;
35 | outline: none;
36 | display: block;
37 | width: 100%;
38 | padding: 7px;
39 | border: none;
40 | border-bottom: 1px solid #ddd;
41 | background: transparent;
42 | margin-bottom: 5px;
43 | font: 16px Arial, Helvetica, sans-serif;
44 | height: 45px;
45 | }
46 | .convert textarea{
47 | resize:none;
48 | overflow: hidden;
49 | }
50 | .convert input[type="button"],
51 | .convert input[type="submit"]{
52 | -moz-box-shadow: inset 0px 1px 0px 0px #45D6D6;
53 | -webkit-box-shadow: inset 0px 1px 0px 0px #45D6D6;
54 | box-shadow: inset 0px 1px 0px 0px #45D6D6;
55 | background-color: #2CBBBB;
56 | border: 1px solid #27A0A0;
57 | display: inline-block;
58 | cursor: pointer;
59 | color: #FFFFFF;
60 | font-family: 'Open Sans Condensed', sans-serif;
61 | font-size: 14px;
62 | padding: 8px 18px;
63 | text-decoration: none;
64 | text-transform: uppercase;
65 | }
66 | .convert input[type="button"]:hover,
67 | .convert input[type="submit"]:hover {
68 | background:linear-gradient(to bottom, #34CACA 5%, #30C9C9 100%);
69 | background-color:#34CACA;
70 | }
71 |
--------------------------------------------------------------------------------
/backend/api/server.js:
--------------------------------------------------------------------------------
1 | //~ Import configurations
2 | var config = require('./conf/config');
3 |
4 | //~ Setup server
5 | const express = require('express');
6 | const app = module.exports = express();
7 | const logger = require('morgan');
8 | const bodyParser = require('body-parser');
9 | const http = require('http');
10 | const massive = require('massive');
11 |
12 |
13 | //~ Connect to the DB
14 | massive({
15 | host: config.database.host,
16 | port: config.database.port,
17 | database: config.database.dbname,
18 | user: config.database.user,
19 | password: config.database.password
20 | }).then(db => {
21 | //~ Print if successful
22 | console.log("Initialized DB successfully");
23 | app.set('db', db);
24 |
25 | //~ Initialize controller
26 | var apiCtrl = require('./controllers/apiCtrl');
27 |
28 | //~ Middleware
29 | //~ Log requests to the console
30 | app.use(logger('dev'));
31 |
32 | //~ Parse incoming requests data
33 | app.use(bodyParser.json());
34 | app.use(bodyParser.urlencoded({ extended: false}));
35 |
36 | //~ For debug only
37 | app.use(function(req, res, next) {
38 | res.header("Access-Control-Allow-Origin", "*");
39 | res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
40 | next();
41 | });
42 |
43 | //~ Routing endpoints
44 | app.get('/v1/ram/1', apiCtrl.getRam1d); //~ last day of data
45 | app.get('/v1/ram/3', apiCtrl.getRam3d); //~ last 3 days of data
46 | app.get('/v1/ram/7', apiCtrl.getRam7d); //~ last week of data
47 | app.get('/v1/ram/14', apiCtrl.getRam14d); //~ last 2 weeks of data
48 | app.get('/v1/ram/30', apiCtrl.getRam30d); //~ last month of data
49 | app.get('/v1/ram/90', apiCtrl.getRam90d); //~ last 3 mo of data
50 | app.get('/v1/ram/180', apiCtrl.getRam180d); //~ last 6 mo of data
51 | app.get('/v1/ram/365', apiCtrl.getRam365d); //~ Last 1 year of data
52 | app.get('/v1/ram/all', apiCtrl.getRamAll); //~ Return daily resolution for all datapoints
53 |
54 | //~ Generic 404 error for invalid URIs
55 | app.get('*', function(req, res) {
56 | res.status(404).send({url: req.originalUrl + ' not found'})
57 | });
58 |
59 | //~ Launch the server
60 | app.listen(config.server.port);
61 | console.log('todo list RESTful API server started on: ' + config.server.port);
62 | });
63 |
--------------------------------------------------------------------------------
/frontend/js/main.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | "use strict";
3 |
4 | $('#menu-button, #menu-close-button').on('click touchend', function(e) {
5 | e.preventDefault();
6 | $('body').toggleClass('pushed-left');
7 | $('#menu-button').toggleClass('open');
8 | });
9 |
10 | $('.with-tile-below .absolute-bottom').on('click', function(e) {
11 | e.preventDefault();
12 | $(this).parent('.image-overlay').stop().addClass('pushed-right');
13 | });
14 |
15 | $('.with-tile-below').on('mouseleave', function(e) {
16 | e.preventDefault();
17 | $(this).children('.image-overlay').stop().removeClass('pushed-right');
18 | });
19 |
20 | $('.panel-heading a').on('click', function() {
21 | $('.panel-heading').removeClass('active');
22 | if (!$(this).closest('.panel').find('.panel-collapse').hasClass('in')) {
23 | $(this).parents('.panel-heading').addClass('active');
24 | }
25 | });
26 |
27 | $('body').not('body.touch').on('click touchend', function(e) {
28 | var $body = $(this);
29 | var $target = $(e.target);
30 | if (($body.hasClass('pushed-left-alt') || $body.hasClass('pushed-left')) && $target.closest('#main-nav').length === 0 && $target.closest('#menu-button').length === 0) {
31 | e.preventDefault();
32 | $body.removeClass('pushed-left-alt').removeClass('pushed-left');
33 | }
34 | });
35 |
36 | $('#main-nav a').not('.sub-nav a, a.sub-nav-toggle').on('click', function() {
37 | $('body').removeClass('pushed-left-alt').removeClass('pushed-left');
38 | $('.sub-nav').stop().slideUp(420, function() {
39 | $(this).addClass('hidden');
40 | });
41 | });
42 |
43 | $('.sub-nav-toggle').on('click touchend', function(e) {
44 | e.preventDefault();
45 | var $subNav = $(this).next('.sub-nav');
46 | if ($subNav.hasClass('hidden')) {
47 | $subNav.hide().removeClass('hidden').stop().slideDown(420);
48 | } else {
49 | $subNav.stop().slideUp(420, function() {
50 | $(this).addClass('hidden');
51 | });
52 | }
53 | });
54 |
55 | $('#main-nav li').on('mouseleave', function(e) {
56 | e.preventDefault();
57 | var $subNav2 = $(this).children('.sub-nav');
58 | $subNav2.stop().slideUp(420, function() {
59 | $(this).addClass('hidden');
60 | });
61 | });
62 |
63 | if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
64 | $('body').addClass('touch');
65 | }
66 | });
67 |
--------------------------------------------------------------------------------
/frontend/widgets/widget-net.js:
--------------------------------------------------------------------------------
1 | jQuery(window).load(function($) {
2 | "use strict";
3 |
4 | /* --- Begin EOS data update routines --- */
5 | function getXmlHttpRequestObject() {
6 | if (window.XMLHttpRequest) {
7 | return new XMLHttpRequest();
8 | } else if (window.ActiveXObject) {
9 | return new ActiveXObject("Microsoft.XMLHTTP");
10 | } else {
11 | alert(
12 | "Your Browser does not support AJAX!\nIt's about time to upgrade don't you think?"
13 | );
14 | }
15 | }
16 |
17 | var reqEos = getXmlHttpRequestObject();
18 | var reqBan = getXmlHttpRequestObject();
19 | var eosPriceUsd;
20 |
21 | function updateEosData() {
22 | if (reqEos.readyState == 4 || reqEos.readyState == 0) {
23 | reqEos.open("GET", "https://api.coinmarketcap.com/v2/ticker/1765/"); //~ EOS/USD price
24 | reqEos.onreadystatechange = handleResponseEos;
25 | }
26 |
27 | if (reqBan.readyState == 4 || reqBan.readyState == 0) {
28 | reqBan.open("POST", "https://api.eossweden.org/v1/chain/get_account");
29 | reqBan.onreadystatechange = handleResponseBan;
30 | }
31 | reqEos.send();
32 | reqBan.send(JSON.stringify({ account_name: "eosnewyorkio" }));
33 | }
34 |
35 | function handleResponseEos() {
36 | if (reqEos.readyState == 4) {
37 | parseStateEos(JSON.parse(reqEos.responseText));
38 | }
39 | }
40 |
41 | function handleResponseBan() {
42 | if (reqBan.readyState == 4) {
43 | parseStateBan(JSON.parse(reqBan.responseText));
44 | }
45 | }
46 |
47 | function parseStateEos(xDoc) {
48 | if (xDoc == null) return;
49 |
50 | eosPriceUsd = xDoc.data.quotes.USD.price;
51 | }
52 |
53 | function parseStateBan(xDoc) {
54 | if (xDoc == null) return;
55 |
56 | var target = document.getElementById("net-price-eos");
57 | var netStaked = xDoc.total_resources.net_weight.substr(
58 | 0,
59 | xDoc.total_resources.net_weight.indexOf(" ")
60 | );
61 | var netAvailable = xDoc.net_limit.max / 1024; // convert bytes to kilobytes
62 | var netPrice = netStaked / netAvailable;
63 | target.innerHTML = netPrice.toFixed(8) + " EOS per Kb";
64 | target = document.getElementById("net-price-usd");
65 | target.innerHTML =
66 | "~ $" + (netPrice.toFixed(8) * eosPriceUsd).toFixed(3) + " USD per Kb";
67 | }
68 | /* --- End of EOS data routines --- */
69 |
70 | updateEosData(); //~ Update EOS data on page load
71 | });
72 |
--------------------------------------------------------------------------------
/frontend/widgets/widget-cpu.js:
--------------------------------------------------------------------------------
1 | jQuery(window).load(function($) {
2 | "use strict";
3 |
4 | /* --- Begin EOS data update routines --- */
5 | function getXmlHttpRequestObject() {
6 | if (window.XMLHttpRequest) {
7 | return new XMLHttpRequest();
8 | } else if (window.ActiveXObject) {
9 | return new ActiveXObject("Microsoft.XMLHTTP");
10 | } else {
11 | alert(
12 | "Your Browser does not support AJAX!\nIt's about time to upgrade don't you think?"
13 | );
14 | }
15 | }
16 |
17 | var reqEos = getXmlHttpRequestObject();
18 | var reqBan = getXmlHttpRequestObject();
19 | var eosPriceUsd;
20 |
21 | function updateEosData() {
22 | if (reqEos.readyState == 4 || reqEos.readyState == 0) {
23 | reqEos.open("GET", "https://api.coinmarketcap.com/v2/ticker/1765/"); //~ EOS/USD price
24 | reqEos.onreadystatechange = handleResponseEos;
25 | }
26 |
27 | if (reqBan.readyState == 4 || reqBan.readyState == 0) {
28 | reqBan.open("POST", "https://api.eossweden.org/v1/chain/get_account");
29 | reqBan.onreadystatechange = handleResponseBan;
30 | }
31 | reqEos.send();
32 | reqBan.send(JSON.stringify({ account_name: "eosnewyorkio" }));
33 | }
34 |
35 | function handleResponseEos() {
36 | if (reqEos.readyState == 4) {
37 | parseStateEos(JSON.parse(reqEos.responseText));
38 | }
39 | }
40 |
41 | function handleResponseBan() {
42 | if (reqBan.readyState == 4) {
43 | parseStateBan(JSON.parse(reqBan.responseText));
44 | }
45 | }
46 |
47 | function parseStateEos(xDoc) {
48 | if (xDoc == null) return;
49 |
50 | eosPriceUsd = xDoc.data.quotes.USD.price;
51 | }
52 |
53 | function parseStateBan(xDoc) {
54 | if (xDoc == null) return;
55 |
56 | var target = document.getElementById("cpu-price-eos");
57 | var cpuStaked = xDoc.total_resources.cpu_weight.substr(
58 | 0,
59 | xDoc.total_resources.cpu_weight.indexOf(" ")
60 | );
61 | var cpuAvailable = xDoc.cpu_limit.max / 1000; // convert microseconds to milliseconds
62 | var cpuPrice = cpuStaked / cpuAvailable;
63 | target.innerHTML = cpuPrice.toFixed(8) + " EOS per Ms";
64 | target = document.getElementById("cpu-price-usd");
65 | target.innerHTML =
66 | "~ $" + (cpuPrice.toFixed(8) * eosPriceUsd).toFixed(3) + " USD per Ms";
67 | }
68 | /* --- End of EOS data routines --- */
69 |
70 | updateEosData(); //~ Update EOS data on page load
71 | });
72 |
--------------------------------------------------------------------------------
/backend/api/controllers/apiCtrl.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var app = require('../server');
4 | var db = app.get('db');
5 | var moment = require('moment');
6 |
7 | //~ Setup date variables
8 | const oneDayAgo = moment().utc().subtract(24, 'hour').format("YYYY-MM-DD HH:mm:SS");
9 | const threeDaysAgo = moment().utc().subtract(3, 'day').format('YYYY-MM-DD');
10 | const sevenDaysAgo = moment().utc().subtract(7, 'day').format('YYYY-MM-DD HH:mm:SS');
11 | const fourteenDaysAgo = moment().utc().subtract(14, 'day').format('YYYY-MM-DD');
12 | const thirtyDaysAgo = moment().utc().subtract(30, 'day').format('YYYY-MM-DD');
13 | const ninetyDaysAgo = moment().utc().subtract(90, 'day').format('YYYY-MM-DD');
14 | const oneEightyDaysAgo = moment().utc().subtract(180, 'day').format('YYYY-MM-DD');
15 | const oneYearAgo = moment().utc().subtract(365, 'day').format('YYYY-MM-DD');
16 |
17 | module.exports = {
18 |
19 | //~ 1 day resolution
20 | getRam1d: function(req, res) {
21 | db.build_minute_candles(oneDayAgo).then(results => {
22 | res.status(200).send(results);
23 | })
24 | },
25 |
26 | //~ 3 day resolution
27 | getRam3d: function(req, res) {
28 | db.build_minute_candles(threeDaysAgo).then(results => {
29 | res.status(200).send(results);
30 | })
31 | },
32 |
33 | //~ 7 day resolution
34 | getRam7d: function(req, res) {
35 | db.build_hour_candles(sevenDaysAgo).then(results => {
36 | res.status(200).send(results);
37 | })
38 | },
39 |
40 | //~ 14 day resolution
41 | getRam14d: function(req, res) {
42 | db.build_hour_candles(fourteenDaysAgo).then(results => {
43 | res.status(200).send(results);
44 | })
45 | },
46 |
47 | //~ 30 day resolution
48 | getRam30d: function(req, res) {
49 | db.build_hour_candles(thirtyDaysAgo).then(results => {
50 | res.status(200).send(results);
51 | })
52 | },
53 |
54 | //~ 90 day resolution
55 | getRam90d: function(req, res) {
56 | db.build_day_candles(ninetyDaysAgo).then(results => {
57 | res.status(200).send(results);
58 | })
59 | },
60 |
61 | //~ 180 day resolution
62 | getRam180d: function(req, res) {
63 | db.build_day_candles(oneEightyDaysAgo).then(results => {
64 | res.status(200).send(results);
65 | })
66 | },
67 |
68 | //~ 365 day resolution
69 | getRam365d: function(req, res) {
70 | db.build_week_candles(oneYearAgo).then(results => {
71 | res.status(200).send(results);
72 | })
73 | },
74 |
75 | //~ All data
76 | getRamAll: function(req, res) {
77 | db.build_alldata_week_candles().then(results => {
78 | res.status(200).send(results);
79 | })
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/frontend/widgets/widgets.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 |
3 | html,
4 | body,
5 | div,
6 | h4,
7 | p {
8 | margin: 0;
9 | padding: 0;
10 | border: 0;
11 | outline: 0;
12 | font-weight: inherit;
13 | font-style: inherit;
14 | font-size: 100%;
15 | font-family: inherit;
16 | vertical-align: baseline;
17 | }
18 | :focus {
19 | outline: 0;
20 | }
21 | body {
22 | line-height: 1;
23 | color: black;
24 | /*background: white;*/
25 | }
26 | .tile-1 {
27 | width: 100%;
28 | height: 100%;
29 | padding: 30px 35px 20px 35px;
30 | }
31 | html {
32 | overflow: -moz-scrollbars-vertical;
33 | overflow-y: scroll;
34 | overflow-x: hidden;
35 | }
36 | .element {
37 | float: left;
38 | background: none;
39 | border: 1px solid #dedede;
40 | }
41 | *, *:before, *:after {
42 | -webkit-font-smoothing: antialiased;
43 | }
44 | body {
45 | font-size: 16px;
46 | font-family: "Open Sans", "IBM Plex Sans", "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
47 | color: #666;
48 | -moz-osx-font-smoothing: grayscale;
49 | -webkit-font-smoothing: antialiased;
50 | }
51 | *, *:after, *:before {
52 | -webkit-box-sizing: border-box;
53 | -moz-box-sizing: border-box;
54 | box-sizing: border-box;
55 | padding: 0;
56 | margin: 0;
57 | text-rendering: optimizeLegibility;
58 | outline: 0;
59 | }
60 | p {
61 | padding: 0;
62 | margin: 0 0 10px;
63 | -webkit-transition: all 0.2s ease 0s;
64 | transition: all 0.2s ease 0s;
65 | position: relative;
66 | line-height: 1.5;
67 | }
68 | p.small {
69 | font-size: 75%;
70 | font-weight: 400;
71 | font-family: "Open Sans", Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
72 | text-transform: uppercase;
73 | opacity: 0.5;
74 | letter-spacing: 1px;
75 | }
76 | h4 {
77 | line-height: 1.35;
78 | color: #2b2b2b;
79 | display: block;
80 | position: relative;
81 | font-weight: 400;
82 | }
83 | h4 {
84 | font-size: 22px;
85 | }
86 | .header {
87 | margin-top: 0px;
88 | }
89 | #content {
90 | width: 100%;
91 | position: relative;
92 | z-index: 55;
93 | height: auto;
94 | }
95 | .element.bg-change {
96 | background: #fff;
97 | transition: box-shadow 0.3s ease-in-out;
98 | }
99 | .element {
100 | overflow: hidden;
101 | -webkit-transition: none;
102 | transition: none;
103 | }
104 | .futuro_icons_143-widget {
105 | background: url(../images/icons/futuro_icons_143.png) center no-repeat;
106 | background-size: 42px 42px;
107 | }
108 | .futuro_icons_186-widget {
109 | background: url(../images/icons/futuro_icons_186.png) center no-repeat;
110 | background-size: 42px 42px;
111 | }
112 | .futuro_icons_253-widget {
113 | background: url(../images/icons/futuro_icons_253.png) center no-repeat;
114 | background-size: 42px 42px;
115 | }
116 | .icons {
117 | position: relative;
118 | height: 42px;
119 | width: 42px;
120 | margin-top: 25px;
121 | margin-bottom: 15px;
122 | display: inline-block;
123 | }
124 | .absolute-top-right {
125 | position: absolute;
126 | right: 35px;
127 | top: 33px;
128 | margin: 0;
129 | }
130 | .icon-to-the-right {
131 | max-width: calc(100% - 55px);
132 | }
133 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/src/com/eosrp/db/PostgresHelper.java:
--------------------------------------------------------------------------------
1 | package com.eosrp.db;
2 |
3 | import java.io.IOException;
4 | import java.sql.Connection;
5 | import java.sql.DriverManager;
6 | import java.sql.PreparedStatement;
7 | import java.sql.ResultSet;
8 | import java.sql.SQLException;
9 | import java.sql.Timestamp;
10 |
11 | public class PostgresHelper {
12 |
13 | private Connection conn;
14 | private String strHost;
15 | private String strDbName;
16 | private String strUser;
17 | private String strPass;
18 | private String strStatementRam;
19 | private String strStatementCpu;
20 | private String strStatementNet;
21 | private String strStatement;
22 | private PreparedStatement prepStatement;
23 |
24 | public PostgresHelper(String host, String dbName, String user, String pass) {
25 | strHost = host;
26 | strDbName = dbName;
27 | strUser = user;
28 | strPass = pass;
29 |
30 | strStatementRam = "INSERT INTO eosram (dt, peos, pusd) VALUES (?, ?, ?)";
31 | strStatementCpu = "INSERT INTO eoscpu (dt, peos, pusd) VALUES (?, ?, ?)";
32 | strStatementNet = "INSERT INTO eosnet (dt, peos, pusd) VALUES (?, ?, ?)";
33 | }
34 |
35 | //~ Generic method to insert into any table
36 | public boolean sendQuery(String _table, Double _eosPriceUsd, PostgresHelper _client, Double _resourcePriceEos) throws SQLException, IOException {
37 | //~ Get timestamp
38 | java.util.Date date = new java.util.Date(System.currentTimeMillis());
39 | java.sql.Timestamp dt = new java.sql.Timestamp(date.getTime());
40 |
41 |
42 | //~ Attempt to insert record
43 | //~ DEBUG
44 | //~ System.out.printf("Table: %s, dt: %s, _eosPriceUsd: %s, _resourcePriceEos: %s\n", _table, dt, _eosPriceUsd, _resourcePriceEos);
45 | if (_client.insert(_table, dt, _eosPriceUsd, _resourcePriceEos) == 1) {
46 | //~ DEBUG
47 | System.out.println("DB record added successfully");
48 | return true;
49 | }
50 | return false;
51 | }
52 |
53 | public boolean connect() throws SQLException, ClassNotFoundException {
54 | if (strHost.isEmpty() || strDbName.isEmpty() || strUser.isEmpty() || strPass.isEmpty()) {
55 | throw new SQLException("Database credentials missing");
56 | }
57 |
58 | Class.forName("org.postgresql.Driver");
59 | this.conn = DriverManager.getConnection(
60 | this.strHost + this.strDbName,
61 | this.strUser, this.strPass);
62 | return true;
63 | }
64 |
65 | public ResultSet execQuery(String query) throws SQLException {
66 | return this.conn.createStatement().executeQuery(query);
67 | }
68 |
69 | public int insert(String table, Timestamp _dt, double _eosPriceUsd, double _resourcePriceEos) throws SQLException {
70 |
71 | switch (table) {
72 | case "eosram":
73 | strStatement = strStatementRam;
74 | break;
75 |
76 | case "eoscpu":
77 | strStatement = strStatementCpu;
78 | break;
79 |
80 | case "eosnet":
81 | strStatement = strStatementNet;
82 | break;
83 |
84 | }
85 | prepStatement = conn.prepareStatement(strStatement);
86 | prepStatement.setTimestamp(1, _dt);
87 | prepStatement.setDouble(2, _resourcePriceEos);
88 | prepStatement.setDouble(3, (_resourcePriceEos * _eosPriceUsd));
89 |
90 | //~ DEBUG
91 | System.out.println("Statement to execute: " + prepStatement.toString());
92 | return prepStatement.executeUpdate();
93 | }
94 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ERP
2 |
3 |
4 | ## Simple is Powerful
5 |
6 | EOS has the limitless potential to empower us to tackle some of the most important issues we face as a global society. But before we secure life, liberty, and property, the community must develop the tools to help answer the basic questions. No matter what their goal, every developer will start with a single question when building on the EOS.IO platform, “How many EOS tokens do I need to power my idea?”.
7 |
8 | Per our roadmap item, [Community dApp Project](https://steemit.com/eos/@eosnewyork/eos-new-york-initial-roadmap-and-milestones), EOS New York is developing a tool that will answer this question.
9 |
10 | ## The EOS Resource Planner or ERP
11 |
12 | We are developing both a standalone and modular service that will be queryable by anyone in order to understand, at that point in time, the amount of staked tokens needed to secure desired resources. Yes, it will be centrally available at [www.eosrp.io](http://eosrp.io) (under construction) but for convenience only. The code will be open source and can be used anywhere by anyone
13 |
14 | At this time, accurate resource estimates will not be available until the network is launched. Per the EOS.IO whitepaper, “Block producers publish their available capacity for bandwidth, computation, and state.” [source](https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md#token-model-and-resource-usage). We anticipate all Block Producers to comply and make accessible their network statistics to help power this tool.
15 |
16 | ## Phased Approach
17 |
18 | Below is the “features-in-phases” approach for deploying the EOS Resource Planner.
19 |
20 | * Phase 1 (Available near launch): Point-in-time estimate of EOS tokens required for X resources <> Point-in-time estimate of resources afforded from Y EOS tokens.
21 | * Phase 2 (Q4 2018): Average look-back window of additional resources afforded based on fractional reserve system.
22 | * Phase 3 (Pending Chintai Development): Average lease price of Y EOS tokens available.
23 | * Phase 4 (Pending EOS Ecosystem): Multi-chain resource estimation.
24 |
25 | The tool is of straightforward design and we do not foresee challenges hitting the deployment date close to EOS launch. Phase 2 must occur toward the end of the year so that we can accrue enough data to provide a statistically significant average of fractional reserve resources allocated over different lengths of time.
26 |
27 | ## Process Flows and Interfaces (illustrative)
28 |
29 | Below are a flowchart and sample user interface design which visualizes the intended direction of the EOS Resource Planner:
30 |
31 | ### Process Flow
32 | *For illustrative purposes only*
33 | 
34 |
35 | ### Sample User Interface
36 | *For illustrative purposes only*
37 | 
38 |
39 | Once the tool is finished, we hope it's deployed across voting portals, block explorers, and many other community-developed tools. Our goal is that the ERP is flexible enough to plug-in anywhere needed.
40 |
41 | Note: The current design and architecture is based on our understanding of resource staking and the underlying software. All that is stated herein is subject to change based on software updates and/or fundamental token resource adjustments. Please feel free to help contribute to this open source project by making a PR on this repo.
42 |
--------------------------------------------------------------------------------
/frontend/widgets/widget-ram.js:
--------------------------------------------------------------------------------
1 | jQuery(window).load(function($) {
2 | "use strict";
3 |
4 | /* --- Begin EOS data update routines --- */
5 | function getXmlHttpRequestObject() {
6 | if (window.XMLHttpRequest) {
7 | return new XMLHttpRequest();
8 | } else if (window.ActiveXObject) {
9 | return new ActiveXObject("Microsoft.XMLHTTP");
10 | } else {
11 | alert(
12 | "Your Browser does not support AJAX!\nIt's about time to upgrade don't you think?"
13 | );
14 | }
15 | }
16 |
17 | var reqEos = getXmlHttpRequestObject();
18 | var reqRam = getXmlHttpRequestObject();
19 | var reqGlobal = getXmlHttpRequestObject();
20 | var eosPriceUsd;
21 | var maxRam;
22 |
23 | function updateEosData() {
24 | if (reqGlobal.readyState == 4 || reqGlobal.readyState == 0) {
25 | reqGlobal.open(
26 | "POST",
27 | "https://api.eossweden.org/v1/chain/get_table_rows"
28 | );
29 | reqGlobal.onreadystatechange = handleResponseGlobal;
30 | }
31 |
32 | if (reqEos.readyState == 4 || reqEos.readyState == 0) {
33 | reqEos.open("GET", "https://api.coinmarketcap.com/v2/ticker/1765/"); //~ EOS/USD price
34 | reqEos.onreadystatechange = handleResponseEos;
35 | }
36 |
37 | if (reqRam.readyState == 4 || reqRam.readyState == 0) {
38 | reqRam.open("POST", "https://api.eossweden.org/v1/chain/get_table_rows");
39 | reqRam.onreadystatechange = handleResponseRam;
40 | }
41 | reqEos.send();
42 | reqRam.send(
43 | JSON.stringify({
44 | json: "true",
45 | code: "eosio",
46 | scope: "eosio",
47 | table: "rammarket",
48 | limit: "10"
49 | })
50 | );
51 | }
52 |
53 | function handleResponseEos() {
54 | if (reqEos.readyState == 4) {
55 | parseStateEos(JSON.parse(reqEos.responseText));
56 | }
57 | }
58 |
59 | function handleResponseRam() {
60 | if (reqRam.readyState == 4) {
61 | parseStateRam(JSON.parse(reqRam.responseText));
62 | }
63 | }
64 |
65 | function handleResponseGlobal() {
66 | if (reqGlobal.readyState == 4) {
67 | parseStateGlobal(JSON.parse(reqGlobal.responseText));
68 | }
69 | }
70 |
71 | function parseStateGlobal(xDoc) {
72 | if (xDoc == null) return;
73 |
74 | maxRam = xDoc.rows[0].max_ram_size;
75 | }
76 |
77 | function parseStateEos(xDoc) {
78 | if (xDoc == null) return;
79 |
80 | eosPriceUsd = xDoc.data.quotes.USD.price;
81 | }
82 |
83 | function parseStateRam(xDoc) {
84 | if (xDoc == null) return;
85 |
86 | var ramBaseBalance = xDoc.rows[0].base.balance; // Amount of RAM bytes in use
87 | ramBaseBalance = ramBaseBalance.substr(0, ramBaseBalance.indexOf(" "));
88 | var ramQuoteBalance = xDoc.rows[0].quote.balance; // Amount of EOS in the RAM collector
89 | ramQuoteBalance = ramQuoteBalance.substr(0, ramQuoteBalance.indexOf(" "));
90 | var ramUsed = 1 - (ramBaseBalance - maxRam);
91 | var ramPriceEos = (ramQuoteBalance / ramBaseBalance).toFixed(8) * 1024; // Price in kb
92 |
93 | var target = document.getElementById("ram-price-eos");
94 | target.innerHTML = ramPriceEos + " EOS per Kb";
95 | target = document.getElementById("ram-price-usd");
96 | target.innerHTML =
97 | "~ $" + (ramPriceEos * eosPriceUsd).toFixed(3) + " USD per Kb";
98 | }
99 | /* --- End of EOS data routines --- */
100 |
101 | updateEosData(); //~ Update EOS data on page load
102 | });
103 |
--------------------------------------------------------------------------------
/frontend/css/flexslider.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery FlexSlider v2.0
3 | * http://www.woothemes.com/flexslider/
4 | *
5 | * Copyright 2012 WooThemes
6 | * Free to use under the GPLv2 license.
7 | * http://www.gnu.org/licenses/gpl-2.0-rainbow.html
8 | *
9 | * Contributing author: Tyler Smith (@mbmufffin)
10 | */
11 |
12 |
13 | /* Browser Resets */
14 | .flex-container a:active,
15 | .flexslider a:active,
16 | .flex-container a:focus,
17 | .flexslider a:focus {outline: none;}
18 | .slides,
19 | .flex-control-nav,
20 | .flex-direction-nav {margin: 0; padding: 0; list-style: none;}
21 |
22 | /* FlexSlider Necessary Styles
23 | *********************************/
24 | .flexslider {margin: 0; padding: 0; }
25 | .flexslider .slides > li {display: none; -webkit-backface-visibility: hidden;} /* Hide the slides before the JS is loaded. Avoids image jumping */
26 | .flexslider .slides img {width: 100%; display: block;}
27 | .flex-pauseplay span {text-transform: capitalize;}
28 |
29 | /* Clearfix for the .slides element */
30 | .slides:after {content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
31 | html[xmlns] .slides {display: block;}
32 | * html .slides {height: 1%;}
33 |
34 | /* No JavaScript Fallback */
35 | /* If you are not using another script, such as Modernizr, make sure you
36 | * include js that eliminates this class on page load */
37 | .no-js .slides > li:first-child {display: block;}
38 |
39 |
40 | /* FlexSlider Default Theme
41 | *********************************/
42 | .flexslider { position:relative; }
43 | .flex-viewport {max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; transition: all 1s ease;}
44 | .loading .flex-viewport {max-height: 300px;}
45 | .flexslider .slides {zoom: 1;}
46 |
47 | .carousel li {margin-right: 5px}
48 |
49 |
50 | /* Direction Nav */
51 | .flex-direction-nav {*height: 0; z-index:20;}
52 | .flex-direction-nav a { margin: 0px 0 0; z-index:20; display: block; position: absolute; top: 50%; margin-top:-37px; cursor: pointer; text-indent: -9999px; opacity: 0; -webkit-transition: all 0.2s ease-in-out 0s; -moz-transition: all 0.2s ease-in-out 0s; -o-transition: all 0.2s ease-in-out 0s; transition: all 0.2s ease-in-out 0s; display:inline-block; width:54px; height:74px;}
53 |
54 | .flex-direction-nav .flex-next {background:url(../images/bg-next.png) center no-repeat #fff; background-size:24px 24px; right: 35px; border: 0; }
55 | .flex-direction-nav .flex-prev {background:url(../images/bg-prev.png) center no-repeat #fff; background-size:24px 24px; left: 35px; border: 0; }
56 |
57 | .flexslider .flex-next {opacity: 1; }
58 | .flexslider .flex-prev {opacity: 1; }
59 |
60 | /* Control Nav */
61 | .flex-control-nav {width: 100%; position: absolute; bottom: -40px; text-align: center; display:none !important;}
62 | .flex-control-nav li {margin: 0 6px; display: inline-block; zoom: 1; *display: inline;}
63 | .flex-control-paging li a {width: 11px; height: 11px; display: block; background: #666; background: rgba(0,0,0,0.5); cursor: pointer; text-indent: -9999px; -webkit-border-radius: 20px; -moz-border-radius: 20px; -o-border-radius: 20px; border-radius: 20px; box-shadow: inset 0 0 3px rgba(0,0,0,0.3);}
64 | .flex-control-paging li a:hover { background: #333; background: rgba(0,0,0,0.7); }
65 | .flex-control-paging li a.flex-active { background: #000; background: rgba(0,0,0,0.9); cursor: default; }
66 |
67 | .flex-control-thumbs {margin: 5px 0 0; position: static; overflow: hidden;}
68 | .flex-control-thumbs li {width: 25%; float: left; margin: 0;}
69 | .flex-control-thumbs img {width: 100%; display: block; opacity: .7; cursor: pointer;}
70 | .flex-control-thumbs img:hover {opacity: 1;}
71 | .flex-control-thumbs .flex-active {opacity: 1; cursor: default;}
72 |
73 |
74 |
75 |
76 |
77 | .flexslider.testimonials .flex-direction-nav .flex-next, .flexslider.testimonials .flex-direction-nav .flex-prev { display:none; }
78 |
--------------------------------------------------------------------------------
/frontend/css/responsive.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 |
3 | /*Larger devices (small laptops):*/
4 | @media only screen and (max-width: 1200px) {
5 | .container {
6 | width: 900px;
7 | }
8 | }
9 |
10 | /*Medium devices (landscape tablets):*/
11 | @media only screen and (max-width: 992px) {
12 | .client {
13 | width: 33.3333333%;
14 | }
15 | nav .social-list {
16 | padding-bottom: 0;
17 | }
18 | .container {
19 | width: 600px;
20 | }
21 | #menu-button {
22 | display: table;
23 | }
24 | nav {
25 | position: absolute;
26 | width: 100%;
27 | display: block;
28 | z-index: 900;
29 | background: #fff;
30 | border-bottom: 1px solid #dedede;
31 | -webkit-box-shadow: 0px 1px 10px 0px rgba(0,0,0,0.05);
32 | box-shadow: 0px 1px 10px 0px rgba(0,0,0,0.05);
33 | top: -500px;
34 | -webkit-transition: top 0.3s ease-in-out;
35 | -moz-transition: top 0.3s ease-in-out;
36 | -o-transition: top 0.3s ease-in-out;
37 | transition: top 0.3s ease-in-out;
38 | }
39 | .pushed-left nav {
40 | top: -5px;
41 | -webkit-transition: top 0.3s ease-in-out;
42 | -moz-transition: top 0.3s ease-in-out;
43 | -o-transition: top 0.3s ease-in-out;
44 | transition: top 0.3s ease-in-out;
45 | }
46 | #main-nav ul {
47 | float: none;
48 | padding: 32px 0 20px;
49 | }
50 | #main-nav ul li {
51 | float: none;
52 | text-align: center;
53 | }
54 | #main-nav ul li a {
55 | padding: 4px 0 5px 0px;
56 | }
57 | #main-nav ul li ul {
58 | padding: 4px 0 5px;
59 | }
60 | }
61 |
62 | /* Move banner down on small devices */
63 | @media only screen and (max-width: 692px) {
64 | h4#headertitle-inner {
65 | display: block;
66 | top: 24px
67 | }
68 |
69 | h4#headertitle {
70 | display: none;
71 | }
72 |
73 | #headeralert {
74 | margin-bottom: -15px;
75 | }
76 | }
77 |
78 | /*Small devices (portrait tablets):*/
79 | @media only screen and (max-width: 668px) {
80 | /* re-arrange footer on smaller screens */
81 | #eosnylogo {
82 | bottom: 35px
83 | }
84 | #sourcecode {
85 | position: relative;
86 | }
87 | .social-list {
88 | padding-bottom: 16px;
89 | bottom: 51px
90 | }
91 | .container {
92 | width: 320px;
93 | }
94 | .client {
95 | width: 50%;
96 | }
97 | .tile-1 {
98 | height: 214px;
99 | }
100 | .tile-2 {
101 | width: 280px;
102 | height: auto;
103 | padding: 30px 35px 20px 35px;
104 | }
105 | .tile-4 {
106 | width: 280px;
107 | height: auto;
108 | }
109 | .tile-5 {
110 | height: 1190px;
111 | }
112 | .element, .image-overlay {
113 | width: 300px !important;
114 | }
115 | h1, h2 {
116 | font-size: 28px;
117 | letter-spacing: -0.5px;
118 | margin-bottom: 20px;
119 | }
120 | #piechart {
121 | width: 360px;
122 | height: 280px;
123 | cursor: default;
124 | margin-left: -30px;
125 | }
126 | .piechart-tile {
127 | height: 340px;
128 | }
129 | }
130 |
131 | /*Extra small devices (phones):*/
132 | @media only screen and (max-width: 480px) {
133 | footer p {
134 | text-align: center !important;
135 | float: none !important;
136 | }
137 | header .social-list {
138 | right: 19px;
139 | }
140 | header .social-list li {
141 | padding: 0 4px;
142 | }
143 | p.small {
144 | padding-bottom: 0;
145 | }
146 | h3.panel-title {
147 | padding: 25px 0px !important;
148 | }
149 | .panel-heading::after, .panel-heading::before {
150 | right: 0;
151 | }
152 | .panel-body {
153 | padding: 5px 0px 20px !important
154 | }
155 | .more-margin {
156 | margin-top: 10px;
157 | }
158 | .header {
159 | padding-bottom: 0px;
160 | }
161 | h1#logo {
162 | margin-left: 10px;
163 | background-size: 164px 63px;
164 | top: -6px;
165 | }
166 | header #eos-price-usd {
167 | right: 30px;
168 | }
169 | .social-list {
170 | position: relative;
171 | bottom: -5px;
172 | right: 0px;
173 | }
174 | #eosnylogo {
175 | bottom: 22px;
176 | }
177 | #sourcecode {
178 | left: 0px;
179 | }
180 | h3 {
181 | font-size: 23px;
182 | }
183 | h4 {
184 | font-size: 16px;
185 | }
186 | .tile-5 {
187 | height: 1150px;
188 | }
189 | }
190 |
191 | /*Legacy extra-small devices (old phones):*/
192 | @media only screen and (max-width: 365px) {
193 | header #eos-price-usd {
194 | top: 72px;
195 | }
196 | }
197 |
--------------------------------------------------------------------------------
/frontend/js/jquery.ba-bbq.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
3 | * http://benalman.com/projects/jquery-bbq-plugin/
4 | *
5 | * Copyright (c) 2010 "Cowboy" Ben Alman
6 | * Dual licensed under the MIT and GPL licenses.
7 | * http://benalman.com/about/license/
8 | */
9 | (function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M ').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
--------------------------------------------------------------------------------
/backend/batchpriceupdater/src/com/eosrp/ErpResUpdateBatch.java:
--------------------------------------------------------------------------------
1 | package com.eosrp;
2 |
3 | import java.io.IOException;
4 | import java.sql.SQLException;
5 | import com.eosrp.db.DbContract;
6 | import com.eosrp.db.PostgresHelper;
7 | import com.eosrp.resources.EosResources;
8 | import java.util.concurrent.Executors;
9 | import java.util.concurrent.ScheduledExecutorService;
10 | import java.util.concurrent.TimeUnit;
11 |
12 | public class ErpResUpdateBatch {
13 |
14 | private static PostgresHelper initDatabase() {
15 | //~ Initialize DB connection
16 | PostgresHelper client = new PostgresHelper(
17 | DbContract.HOST,
18 | DbContract.DB_NAME,
19 | DbContract.USERNAME,
20 | DbContract.PASSWORD);
21 |
22 | try {
23 | if (client.connect()) {
24 | //~ DEBUG
25 | //~ System.out.println("DB connected");
26 | }
27 |
28 | } catch (ClassNotFoundException | SQLException e) {
29 | e.printStackTrace();
30 | }
31 | return client;
32 | }
33 |
34 | public static void storePrice(String _table, EosResources _eosRes, PostgresHelper _client) throws SQLException, IOException {
35 | Boolean result;
36 |
37 | //~ DEBUG
38 | //~ System.out.println(_table);
39 |
40 | switch (_table) {
41 | case "eosram":
42 | if (_client != null) {
43 | result = _client.sendQuery("eosram", _eosRes.getEosPriceUsd(), _client, _eosRes.getRamBytesPrice());
44 | if (result == true) {
45 | //~ DEBUG
46 | //~ System.out.println("Successful query");
47 | }
48 | else
49 | {
50 | //~ DEBUG
51 | //~ System.out.println("Unsuccessful query");
52 | }
53 | }
54 | break;
55 |
56 | case "eoscpu":
57 | if (_client != null) {
58 | result = _client.sendQuery("eoscpu", _eosRes.getEosPriceUsd(), _client, _eosRes.getCpuMicSecPrice());
59 | if (result == true) {
60 | //~ DEBUG
61 | //~ System.out.println("Successful query");
62 | }
63 | else
64 | {
65 | //~ DEBUG
66 | //~ System.out.println("Unsuccessful query");
67 | }
68 | }
69 | break;
70 |
71 | case "eosnet":
72 | if (_client != null) {
73 | result = _client.sendQuery("eosnet", _eosRes.getEosPriceUsd(), _client, _eosRes.getNetBandBytesPrice());
74 | if (result == true) {
75 | //~ DEBUG
76 | //~ System.out.println("Successful query");
77 | }
78 | else
79 | {
80 | //~ DEBUG
81 | //~ System.out.println("Unsuccessful query");
82 | }
83 | }
84 | break;
85 | }
86 |
87 |
88 |
89 | //~ Print the DB records
90 | /*ResultSet rs = _client.execQuery("SELECT * FROM eosram");
91 | while(rs.next()) {
92 | System.out.printf("%s\t%s\t%s\n",
93 | rs.getString(1),
94 | rs.getString(2),
95 | rs.getString(3));
96 | }*/
97 | }
98 |
99 | public static void main(String[] args){
100 | //~ Backup node: node1.eosphere.io:8888
101 | String strUrlEosPriceUsd = "https://api.coinmarketcap.com/v2/ticker/1765";
102 | String strUrlGetTableRows = "https://api.eossweden.org/v1/chain/get_table_rows";
103 | String strUrlGetAccount = "https://api.eossweden.org/v1/chain/get_account";
104 |
105 | //~ Instantiate objects
106 | PostgresHelper client = initDatabase();
107 | EosResources eosRes = new EosResources(strUrlEosPriceUsd, strUrlGetTableRows, strUrlGetAccount);
108 |
109 | System.out.println("Initialized objects, spawning task..");
110 |
111 | //~ Spawn a thread to run the storage/update procedures
112 | Runnable runnable = new Runnable() {
113 | public void run() {
114 | System.out.println("Running task");
115 | try {
116 | storePrice("eosram", eosRes, client);
117 | storePrice("eoscpu", eosRes, client);
118 | storePrice("eosnet", eosRes, client);
119 | } catch (SQLException e) {
120 | e.printStackTrace();
121 | } catch (IOException e) {
122 | e.printStackTrace();
123 | }
124 | }
125 | };
126 | ScheduledExecutorService service = Executors
127 | .newSingleThreadScheduledExecutor();
128 | service.scheduleAtFixedRate(runnable, 0, 60, TimeUnit.SECONDS);
129 | }
130 | /* try {
131 | storePrice("eosram", eosRes, client);
132 | storePrice("eoscpu", eosRes, client);
133 | storePrice("eosnet", eosRes, client);
134 | } catch (SQLException e) {
135 | e.printStackTrace();
136 | } catch (IOException e) {
137 | e.printStackTrace();
138 | }*/
139 | }
--------------------------------------------------------------------------------
/backend/README.md:
--------------------------------------------------------------------------------
1 | # EOS Resource Planner Backend API
2 |
3 | The backend for EOSRP currently has two components:
4 | * Java component that inserts the latest price information into a postgres database
5 | * Node.JS component exposing a REST API that queries the database to return records and will later be used to render candlestick charting on the client-side
6 |
7 | In the future this architecture will be simplified and redesigned with one tier accessing the DB. For now the goal was to begin collecting historical metrics on the resource prices as soon as possible.
8 |
9 | The Java component runs as a batch job every minute scraping the latest resource prices and saving them into a postgres database.
10 |
11 | The NodeJS component runs as an Express.js server and uses Massive.js to query the postgres database. At this time it only works with the ram table but will support the cpu and network tables in the future.
12 |
13 |
14 | You will need a postgres database with the following table schema:
15 |
16 | ```
17 | TABLE NAME: eosram
18 | Column | Type |
19 | --------+-----------------------------+
20 | dt | timestamp without time zone | Time stamp of data point
21 | peos | numeric | The price in EOS at time of data point
22 | pusd | numeric | The equivalent price in USD at time of data point
23 | id | integer | Auto-incremented counter
24 | ```
25 |
26 | ## API Setup Requirements
27 |
28 | * Node 8
29 | * Git
30 |
31 | ## API Instructions
32 | Clone the repository and install the dependencies.
33 |
34 | ```bash
35 | npm install
36 | ```
37 |
38 | Open `restapi/conf/config.js` and modify the database/server settings to match your environment
39 |
40 | ```
41 | database: {
42 | host: '127.0.0.1',
43 | port: '5432',
44 | dbname: 'dbname',
45 | user: 'username',
46 | pass: 'pw',
47 | },
48 | //~ Server details
49 | server: {
50 | host: '127.0.0.1',
51 | port: '8000'
52 | }
53 | ```
54 |
55 | ## Starting the API
56 |
57 | ```bash
58 | npm run start:dev
59 | ```
60 |
61 | ## Using the API
62 |
63 | After launching the server you should see a message saying the server was started on port 8000:
64 | ```bash
65 | $ npm run start:dev
66 |
67 | > eosrp-backend-api@0.1.0 start:dev
68 | > nodemon server.js
69 |
70 | [nodemon] 1.17.5
71 | [nodemon] to restart at any time, enter `rs`
72 | [nodemon] watching: *.*
73 | [nodemon] starting `node server.js`
74 | Initialized DB successfully
75 | todo list RESTful API server started on: 8000
76 |
77 | ```
78 |
79 | Now use a utility like Postman to get some data. The URL options are:
80 | ```
81 | http://localhost:8000/v1/ram/1 // Last 1 day of data in minute resolution
82 | http://localhost:8000/v1/ram/3 // Last 3 days of data in minute resolution
83 | http://localhost:8000/v1/ram/7 // Last 7 days of data in hour resolution
84 | http://localhost:8000/v1/ram/14 // Last 14 days of data in hour resolution
85 | http://localhost:8000/v1/ram/30 // Last 30 days of data in hour resolution
86 | http://localhost:8000/v1/ram/90 // Last 90 days of data in day resolution
87 | http://localhost:8000/v1/ram/180 // Last 180 days of data in day resolution
88 | http://localhost:8000/v1/ram/365 // Last 1 year of data in week resolution
89 | http://localhost:8000/v1/ram/all // All available data in week resolution
90 | ```
91 | A successful request will return JSON data containing the price information grouped into candles with open, high, low, and close computed:
92 | ```
93 | GET http://localhost:8000/v1/ram/90
94 |
95 |
96 | RESPONSE (200):
97 | [
98 | {
99 | "dt": "2018-06-17T04:00:00.000Z",
100 | "o": "0.0000152925255706774",
101 | "h": "0.0000160796653563408",
102 | "l": "0.0000152925255706774",
103 | "c": "0.000016079005452629"
104 | },
105 | {
106 | "dt": "2018-06-18T04:00:00.000Z",
107 | "o": "0.0000160790254122507",
108 | "h": "0.0000165781105264275",
109 | "l": "0.0000160790254122507",
110 | "c": "0.0000165781048168569"
111 | },
112 | {
113 | "dt": "2018-06-19T04:00:00.000Z",
114 | "o": "0.0000165781256259231",
115 | "h": "0.0000173864480561336",
116 | "l": "0.0000165781256259231",
117 | "c": "0.0000173864480561336"
118 | },
119 | {
120 | "dt": "2018-06-20T04:00:00.000Z",
121 | "o": "0.0000173864682236967",
122 | "h": "0.0000176286892090938",
123 | "l": "0.0000173864682236967",
124 | "c": "0.0000176286892090938"
125 | },
126 | {
127 | "dt": "2018-06-21T04:00:00.000Z",
128 | "o": "0.0000176287097679978",
129 | "h": "0.0000207348716915592",
130 | "l": "0.0000176287097679978",
131 | "c": "0.0000207348716915592"
132 | }
133 | ]
134 |
--------------------------------------------------------------------------------
/frontend/css/jquery.fancybox.css:
--------------------------------------------------------------------------------
1 | /*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */
2 | .fancybox-wrap,
3 | .fancybox-skin,
4 | .fancybox-outer,
5 | .fancybox-inner,
6 | .fancybox-image,
7 | .fancybox-wrap iframe,
8 | .fancybox-wrap object,
9 | .fancybox-nav,
10 | .fancybox-nav span,
11 | .fancybox-tmp
12 | {
13 | padding: 0;
14 | margin: 0;
15 | border: 0;
16 | outline: none;
17 | vertical-align: top;
18 | }
19 |
20 | .fancybox-wrap {
21 | position: absolute;
22 | top: 0;
23 | left: 0;
24 | z-index: 8020;
25 | }
26 |
27 | .fancybox-skin {
28 | position: relative;
29 | background: none;
30 | color: #444;
31 | text-shadow: none;
32 | }
33 |
34 | .fancybox-opened {
35 | z-index: 8030;
36 | }
37 |
38 | .fancybox-outer, .fancybox-inner {
39 | position: relative;
40 | }
41 |
42 | .fancybox-inner {
43 | overflow: hidden;
44 | background:none;
45 | }
46 |
47 | .fancybox-type-iframe .fancybox-inner {
48 | -webkit-overflow-scrolling: touch;
49 | }
50 |
51 | .fancybox-error {
52 | color: #444;
53 | font: 14px/21px;
54 | margin: 0;
55 | font-size:14px; font-weight:400;
56 | padding: 15px;
57 | white-space: nowrap;
58 | }
59 |
60 | .fancybox-image, .fancybox-iframe {
61 | display: block;
62 | width: 100%;
63 | height: 100%;
64 | }
65 |
66 | .fancybox-image {
67 | max-width: 100%;
68 | max-height: 100%;
69 | }
70 |
71 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
72 | background-image: url('fancybox_sprite.png');
73 | }
74 |
75 | #fancybox-loading {
76 | position: fixed;
77 | top: 50%;
78 | left: 50%;
79 | margin-top: -22px;
80 | margin-left: -22px;
81 | background-position: 0 -108px;
82 | opacity: 0.8;
83 | cursor: pointer;
84 | z-index: 8060;
85 | }
86 |
87 | #fancybox-loading div {
88 | width: 44px;
89 | height: 44px;
90 | background: url(../images/ajax-loader2.gif) center center no-repeat;
91 | }
92 |
93 | .fancybox-close {
94 | position: absolute;
95 | top: -60px;
96 | left: -24px;
97 | margin-left:50%;
98 | width: 48px;
99 | height: 48px;
100 | background: url(../images/bg-close@2x.png) center no-repeat;
101 | background-size:36px 36px;
102 | cursor: pointer;
103 | z-index: 8040;
104 | }
105 |
106 |
107 | .fancybox-nav {
108 | position: absolute;
109 | top: 0;
110 | width: 40%;
111 | height: 100%;
112 | cursor: pointer;
113 | text-decoration: none;
114 | background: transparent url('blank.gif'); /* helps IE */
115 | -webkit-tap-highlight-color: rgba(0,0,0,0);
116 | z-index: 8040;
117 | }
118 |
119 | .fancybox-prev {
120 | left: 0;
121 | }
122 |
123 | .fancybox-next {
124 | right: 0;
125 | }
126 |
127 | .fancybox-nav span {
128 | position: absolute;
129 | top: 50%;
130 | width: 50px;
131 | height: 70px;
132 | margin-top: -35px;
133 | cursor: pointer;
134 | z-index: 8040;
135 | visibility: visible !important;
136 | }
137 |
138 | .fancybox-prev span {
139 | left: 0px;
140 | width: 50px;
141 | height: 70px;
142 | background: url(../images/bg-prev.png) center no-repeat #fff;
143 | background-size:24px 24px;
144 | cursor: pointer;
145 | z-index: 8040;
146 | }
147 |
148 | .fancybox-next span {
149 | right: 0px;
150 | width: 50px;
151 | height: 70px;
152 | background: url(../images/bg-next.png) center no-repeat #fff;
153 | background-size:24px 24px;
154 | cursor: pointer;
155 | z-index: 8040;
156 | }
157 |
158 | .fancybox-nav:hover span {
159 | visibility: visible;
160 | }
161 |
162 | .fancybox-tmp {
163 | position: absolute;
164 | top: -99999px;
165 | left: -99999px;
166 | visibility: hidden;
167 | max-width: 99999px;
168 | max-height: 99999px;
169 | overflow: visible !important;
170 | }
171 |
172 | /* Overlay helper */
173 |
174 | .fancybox-lock {
175 | overflow: hidden;
176 | }
177 |
178 | .fancybox-overlay {
179 | position: absolute;
180 | top: 0;
181 | left: 0;
182 | overflow: hidden;
183 | display: none;
184 | z-index: 8010;
185 | background:rgba(0, 0, 0, 0.92);
186 | }
187 |
188 | .fancybox-overlay-fixed {
189 | position: fixed;
190 | bottom: 0;
191 | right: 0;
192 | }
193 |
194 | .fancybox-lock .fancybox-overlay {
195 | overflow: auto;
196 | overflow-y: scroll;
197 | }
198 |
199 | /* Title helper */
200 |
201 | .fancybox-title {
202 | visibility: hidden;
203 | font: 16px;
204 | margin: 0; font-weight:400;
205 | font-style:normal;
206 | position: relative;
207 | text-shadow: none;
208 | z-index: 8050;
209 | margin-top:5px;
210 | }
211 |
212 | .fancybox-opened .fancybox-title {
213 | visibility: visible;
214 | }
215 |
216 | .fancybox-title-float-wrap {
217 | position: absolute;
218 | bottom: 0;
219 | right: 50%;
220 | margin-bottom: -45px;
221 | z-index: 8050;
222 | text-align: center;
223 | }
224 |
225 | .fancybox-title-float-wrap .child {
226 | display: inline-block;
227 | margin-right: -100%;
228 | padding: 2px 20px;
229 | background: transparent; /* Fallback for web browsers that doesn't support RGBa */
230 | color: #FFF;
231 | line-height: 24px;
232 | white-space: nowrap;
233 | }
234 |
235 | .fancybox-title-outside-wrap {
236 | position: relative;
237 | margin-top: 10px;
238 | color: #fff;
239 | }
240 |
241 | .fancybox-title-inside-wrap {
242 | padding-top: 10px;
243 | }
244 |
245 | .fancybox-title-over-wrap {
246 | position: absolute;
247 | bottom: 0;
248 | left: 0;
249 | color: #fff;
250 | padding: 10px;
251 | background: #000;
252 | background: rgba(0, 0, 0, .8);
253 | }
254 |
--------------------------------------------------------------------------------
/backend/batchpriceupdater/src/com/eosrp/resources/EosResources.java:
--------------------------------------------------------------------------------
1 | package com.eosrp.resources;
2 |
3 | import java.io.IOException;
4 |
5 | import org.json.simple.JSONArray;
6 | import org.json.simple.JSONObject;
7 |
8 | import com.eosrp.network.HttpGetHelper;
9 | import com.eosrp.network.HttpPostHelper;
10 |
11 | public class EosResources {
12 |
13 | private String strUrlEosPriceUsd;
14 | private String strUrlGetTable;
15 | private String strUrlGetAccount;
16 |
17 | public EosResources(String _strUrlEosPriceUsd, String _strUrlGetTable, String _strUrlGetAccount) {
18 | strUrlEosPriceUsd = _strUrlEosPriceUsd;
19 | strUrlGetTable = _strUrlGetTable;
20 | strUrlGetAccount = _strUrlGetAccount;
21 | }
22 |
23 | //~ Get the current price of CPU bandwidth in EOS/microseconds
24 | public double getCpuMicSecPrice() throws IOException {
25 | Double cpuPriceEos;
26 |
27 | String strAccountInfoJson = "{\"account_name\":\"eosnewyorkio\"}";
28 |
29 | //~ Instantiate the POST request object
30 | //~ and fetch latest price for CPU
31 | HttpPostHelper postReq = new HttpPostHelper(strUrlGetAccount, strAccountInfoJson);
32 | JSONObject jsonResp = postReq.sendRequest();
33 |
34 | //~ We need to access 'total_resources' and 'cpu_limit' to get the balance values
35 | JSONObject strTotalResources = (JSONObject) jsonResp.get("total_resources");
36 | JSONObject strCpuLimit = (JSONObject) jsonResp.get("cpu_limit");
37 | String strCpuWeight = (String) strTotalResources.get("cpu_weight");
38 | Long lngCpuLimitMax = (Long) strCpuLimit.get("max");
39 |
40 | //~ The value is a string with a unit on the end, select only the numerical part
41 | String strTrimmedCpuLimit = strCpuWeight.substring(0, strCpuWeight.indexOf(' '));
42 |
43 | //~ Now cast it into a double so we can do math on it
44 | Double dblNetCpuStaked = Double.parseDouble(strTrimmedCpuLimit);
45 | cpuPriceEos = dblNetCpuStaked / lngCpuLimitMax;
46 |
47 | //~ DEBUG
48 | //~ System.out.println(strCpuWeight);
49 | //~ System.out.println(dblNetCpuStaked);
50 | System.out.println("cpuPriceEos: " + cpuPriceEos);
51 |
52 | return cpuPriceEos;
53 | }
54 |
55 | //~ Get the current price of Network bandwidth in EOS/bytes
56 | public double getNetBandBytesPrice() throws IOException {
57 | Double netPriceEos;
58 |
59 | String strAccountInfoJson = "{\"account_name\":\"eosnewyorkio\"}";
60 |
61 | //~ Instantiate the POST request object
62 | //~ and fetch latest price for CPU
63 | HttpPostHelper postReq = new HttpPostHelper(strUrlGetAccount, strAccountInfoJson);
64 | JSONObject jsonResp = postReq.sendRequest();
65 |
66 | //~ We need to access 'total_resources' and 'net_limit' to get the balance values
67 | JSONObject strTotalResources = (JSONObject) jsonResp.get("total_resources");
68 | JSONObject strNetLimit = (JSONObject) jsonResp.get("net_limit");
69 | String strNetWeight = (String) strTotalResources.get("net_weight");
70 | Long lngNetLimitMax = (Long) strNetLimit.get("max");
71 |
72 | //~ The value is a string with a unit on the end, select only the numerical part
73 | String strTrimmedNetLimit = strNetWeight.substring(0, strNetWeight.indexOf(' '));
74 |
75 | //~ Now cast it into a double so we can do math on it
76 | Double dblNetStaked = Double.parseDouble(strTrimmedNetLimit);
77 | netPriceEos = dblNetStaked / lngNetLimitMax;
78 |
79 | //~ DEBUG
80 | //~ System.out.println(strNetWeight);
81 | //~ System.out.println(dblNetStaked);
82 | System.out.println("netPriceEos: " + netPriceEos);
83 |
84 | return netPriceEos;
85 | }
86 |
87 | //~ Get current price per byte (RAM/EOS) for next byte of RAM
88 | //~ Note this does not include the price slippage or 0.5% fee
89 | //~ Todo: use Bancor algorithm to calculate exact price of X bytes
90 | public double getRamBytesPrice() throws IOException {
91 | Double ramPriceEos;
92 |
93 | //~ This is from running the following command in cleos to get the JSON payload:
94 | //~ cleos --print-response --print-request get table eosio eosio rammarket
95 | String strRamMarketJson = "{\"json\":\"true\",\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rammarket\",\"limit\":\"10\"}";
96 |
97 | //~ DEBUG
98 | //~ System.out.println("reqJson: " + ramMarketJson);
99 |
100 | //~ Instantiate the POST request object
101 | //~ and fetch latest price for ram
102 | HttpPostHelper postReq = new HttpPostHelper(strUrlGetTable, strRamMarketJson);
103 | JSONObject jsonResp = postReq.sendRequest();
104 |
105 | //~ The JSON response looks like this:
106 | //~ {"rows":[{"supply":"10000000000.0000 RAMCORE","base":{"balance":"67172012846 RAM","weight":"0.50000000000000000"},"quote":{"balance":"1023040.5170 EOS","weight":"0.50000000000000000"}}],"more":false}
107 | //~ First use a JSONArray to read the first (only) row in the data
108 | JSONArray rowsArray = (JSONArray) jsonResp.get("rows");
109 | JSONObject strRow = (JSONObject) rowsArray.get(0);
110 |
111 | //~ We need to access 'quote' and 'base' to get the balance values
112 | JSONObject strQuote = (JSONObject) strRow.get("quote");
113 | JSONObject strBase = (JSONObject) strRow.get("base");
114 | String strQuoteBalance = (String) strQuote.get("balance").toString();
115 | String strBaseBalance = (String) strBase.get("balance").toString();
116 |
117 | //~ The balance value is a string with a unit on the end, select only the numerical part
118 | String strTrimmedQuoteBalance = strQuoteBalance.substring(0, strQuoteBalance.indexOf(' '));
119 | String strTrimmedBaseBalance = strBaseBalance.substring(0, strBaseBalance.indexOf(' '));
120 |
121 | //~ Now cast it into a double so we can do math on it
122 | Double dblQuoteBalance = Double.parseDouble(strTrimmedQuoteBalance);
123 | Double dblBaseBalance = Double.parseDouble(strTrimmedBaseBalance);
124 |
125 | //~ Finally calculate the RAM/EOS price before returning it
126 | ramPriceEos = dblQuoteBalance / dblBaseBalance;
127 |
128 | //~ DEBUG
129 | //~ System.out.printf("Quote Balance: %f\n", dblQuoteBalance);
130 | //~ System.out.printf("Base Balance: %f\n", dblBaseBalance);
131 | System.out.println("ramPriceEos: " + ramPriceEos);
132 |
133 | return ramPriceEos;
134 | }
135 |
136 | //~ Get the current EOS/USD price from coinmarketcap's API
137 | public double getEosPriceUsd() throws IOException {
138 | Double eosPriceUsd;
139 |
140 | //~ Instantiate the GET request object
141 | //~ and fetch latest price for EOS/USD
142 | HttpGetHelper getReq = new HttpGetHelper(strUrlEosPriceUsd);
143 |
144 | //~ Capture request response JSON in a JSON object
145 | JSONObject jsonResp = getReq.sendRequest();
146 |
147 | //~ Get USD price of EOS from the JSON response
148 | JSONObject data = (JSONObject) jsonResp.get("data");
149 | JSONObject quotes = (JSONObject) data.get("quotes");
150 | JSONObject usd = (JSONObject) quotes.get("USD");
151 | eosPriceUsd = (Double) usd.get("price");
152 |
153 | //~ DEBUG
154 | System.out.println("eosPriceUsd: " + eosPriceUsd);
155 |
156 | return eosPriceUsd;
157 | }
158 |
159 | }
160 |
--------------------------------------------------------------------------------
/frontend/js/jquery-easing-1.3.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3 | *
4 | * Uses the built in easing capabilities added In jQuery 1.1
5 | * to offer multiple easing options
6 | *
7 | * TERMS OF USE - jQuery Easing
8 | *
9 | * Open source under the BSD License.
10 | *
11 | * Copyright © 2008 George McGinley Smith
12 | * All rights reserved.
13 | *
14 | * Redistribution and use in source and binary forms, with or without modification,
15 | * are permitted provided that the following conditions are met:
16 | *
17 | * Redistributions of source code must retain the above copyright notice, this list of
18 | * conditions and the following disclaimer.
19 | * Redistributions in binary form must reproduce the above copyright notice, this list
20 | * of conditions and the following disclaimer in the documentation and/or other materials
21 | * provided with the distribution.
22 | *
23 | * Neither the name of the author nor the names of contributors may be used to endorse
24 | * or promote products derived from this software without specific prior written permission.
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34 | * OF THE POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | // t: current time, b: begInnIng value, c: change In value, d: duration
39 | jQuery.easing['jswing'] = jQuery.easing['swing'];
40 |
41 | jQuery.extend( jQuery.easing,
42 | {
43 | def: 'easeOutQuad',
44 | swing: function (x, t, b, c, d) {
45 | //alert(jQuery.easing.default);
46 | return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
47 | },
48 | easeInQuad: function (x, t, b, c, d) {
49 | return c*(t/=d)*t + b;
50 | },
51 | easeOutQuad: function (x, t, b, c, d) {
52 | return -c *(t/=d)*(t-2) + b;
53 | },
54 | easeInOutQuad: function (x, t, b, c, d) {
55 | if ((t/=d/2) < 1) return c/2*t*t + b;
56 | return -c/2 * ((--t)*(t-2) - 1) + b;
57 | },
58 | easeInCubic: function (x, t, b, c, d) {
59 | return c*(t/=d)*t*t + b;
60 | },
61 | easeOutCubic: function (x, t, b, c, d) {
62 | return c*((t=t/d-1)*t*t + 1) + b;
63 | },
64 | easeInOutCubic: function (x, t, b, c, d) {
65 | if ((t/=d/2) < 1) return c/2*t*t*t + b;
66 | return c/2*((t-=2)*t*t + 2) + b;
67 | },
68 | easeInQuart: function (x, t, b, c, d) {
69 | return c*(t/=d)*t*t*t + b;
70 | },
71 | easeOutQuart: function (x, t, b, c, d) {
72 | return -c * ((t=t/d-1)*t*t*t - 1) + b;
73 | },
74 | easeInOutQuart: function (x, t, b, c, d) {
75 | if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
76 | return -c/2 * ((t-=2)*t*t*t - 2) + b;
77 | },
78 | easeInQuint: function (x, t, b, c, d) {
79 | return c*(t/=d)*t*t*t*t + b;
80 | },
81 | easeOutQuint: function (x, t, b, c, d) {
82 | return c*((t=t/d-1)*t*t*t*t + 1) + b;
83 | },
84 | easeInOutQuint: function (x, t, b, c, d) {
85 | if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
86 | return c/2*((t-=2)*t*t*t*t + 2) + b;
87 | },
88 | easeInSine: function (x, t, b, c, d) {
89 | return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
90 | },
91 | easeOutSine: function (x, t, b, c, d) {
92 | return c * Math.sin(t/d * (Math.PI/2)) + b;
93 | },
94 | easeInOutSine: function (x, t, b, c, d) {
95 | return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
96 | },
97 | easeInExpo: function (x, t, b, c, d) {
98 | return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
99 | },
100 | easeOutExpo: function (x, t, b, c, d) {
101 | return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
102 | },
103 | easeInOutExpo: function (x, t, b, c, d) {
104 | if (t==0) return b;
105 | if (t==d) return b+c;
106 | if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
107 | return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
108 | },
109 | easeInCirc: function (x, t, b, c, d) {
110 | return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
111 | },
112 | easeOutCirc: function (x, t, b, c, d) {
113 | return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
114 | },
115 | easeInOutCirc: function (x, t, b, c, d) {
116 | if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
117 | return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
118 | },
119 | easeInElastic: function (x, t, b, c, d) {
120 | var s=1.70158;var p=0;var a=c;
121 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
122 | if (a < Math.abs(c)) { a=c; var s=p/4; }
123 | else var s = p/(2*Math.PI) * Math.asin (c/a);
124 | return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
125 | },
126 | easeOutElastic: function (x, t, b, c, d) {
127 | var s=1.70158;var p=0;var a=c;
128 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
129 | if (a < Math.abs(c)) { a=c; var s=p/4; }
130 | else var s = p/(2*Math.PI) * Math.asin (c/a);
131 | return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
132 | },
133 | easeInOutElastic: function (x, t, b, c, d) {
134 | var s=1.70158;var p=0;var a=c;
135 | if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
136 | if (a < Math.abs(c)) { a=c; var s=p/4; }
137 | else var s = p/(2*Math.PI) * Math.asin (c/a);
138 | if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
139 | return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
140 | },
141 | easeInBack: function (x, t, b, c, d, s) {
142 | if (s == undefined) s = 1.70158;
143 | return c*(t/=d)*t*((s+1)*t - s) + b;
144 | },
145 | easeOutBack: function (x, t, b, c, d, s) {
146 | if (s == undefined) s = 1.70158;
147 | return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
148 | },
149 | easeInOutBack: function (x, t, b, c, d, s) {
150 | if (s == undefined) s = 1.70158;
151 | if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
152 | return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
153 | },
154 | easeInBounce: function (x, t, b, c, d) {
155 | return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
156 | },
157 | easeOutBounce: function (x, t, b, c, d) {
158 | if ((t/=d) < (1/2.75)) {
159 | return c*(7.5625*t*t) + b;
160 | } else if (t < (2/2.75)) {
161 | return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
162 | } else if (t < (2.5/2.75)) {
163 | return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
164 | } else {
165 | return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
166 | }
167 | },
168 | easeInOutBounce: function (x, t, b, c, d) {
169 | if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
170 | return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
171 | }
172 | });
173 |
174 | /*
175 | *
176 | * TERMS OF USE - EASING EQUATIONS
177 | *
178 | * Open source under the BSD License.
179 | *
180 | * Copyright © 2001 Robert Penner
181 | * All rights reserved.
182 | *
183 | * Redistribution and use in source and binary forms, with or without modification,
184 | * are permitted provided that the following conditions are met:
185 | *
186 | * Redistributions of source code must retain the above copyright notice, this list of
187 | * conditions and the following disclaimer.
188 | * Redistributions in binary form must reproduce the above copyright notice, this list
189 | * of conditions and the following disclaimer in the documentation and/or other materials
190 | * provided with the distribution.
191 | *
192 | * Neither the name of the author nor the names of contributors may be used to endorse
193 | * or promote products derived from this software without specific prior written permission.
194 | *
195 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
196 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
197 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
198 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
199 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
200 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
201 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
202 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
203 | * OF THE POSSIBILITY OF SUCH DAMAGE.
204 | *
205 | */
--------------------------------------------------------------------------------
/frontend/js/modernizr.js:
--------------------------------------------------------------------------------
1 | /* Modernizr 2.8.3 (Custom Build) | MIT & BSD
2 | * Build: http://modernizr.com/download/#-backgroundsize-borderradius-boxshadow-flexbox-flexboxlegacy-multiplebgs-opacity-rgba-textshadow-generatedcontent-cssgradients-csstransforms-csstransforms3d-csstransitions-inputtypes-inlinesvg-svg-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load
3 | */
4 | ;window.Modernizr=function(a,b,c){function B(a){j.cssText=a}function C(a,b){return B(n.join(a+";")+(b||""))}function D(a,b){return typeof a===b}function E(a,b){return!!~(""+a).indexOf(b)}function F(a,b){for(var d in a){var e=a[d];if(!E(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function G(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:D(f,"function")?f.bind(d||b):f}return!1}function H(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return D(b,"string")||D(b,"undefined")?F(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),G(e,b,c))}function I(){e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z={}.hasOwnProperty,A;!D(z,"undefined")&&!D(z.call,"undefined")?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return H("flexWrap")},s.flexboxlegacy=function(){return H("boxDirection")},s.rgba=function(){return B("background-color:rgba(150,255,150,.5)"),E(j.backgroundColor,"rgba")},s.multiplebgs=function(){return B("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return H("backgroundSize")},s.borderradius=function(){return H("borderRadius")},s.boxshadow=function(){return H("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return C("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return B((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),E(j.backgroundImage,"gradient")},s.csstransforms=function(){return!!H("transform")},s.csstransforms3d=function(){var a=!!H("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return H("transition")},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML=" ",(a.firstChild&&a.firstChild.namespaceURI)==r.svg};for(var J in s)A(s,J)&&(x=J.toLowerCase(),e[x]=s[J](),v.push((e[x]?"":"no-")+x));return e.input||I(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)A(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},B(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.testProp=function(a){return F([a])},e.testAllProps=H,e.testStyles=y,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f0){return}var be=bd.originalEvent?bd.originalEvent:bd;var bc,bb=a?be.touches[0]:be;Z=g;if(a){W=be.touches.length}else{bd.preventDefault()}ag=0;aP=null;aJ=null;ab=0;a1=0;aZ=0;G=1;aq=0;aQ=aj();M=aa();R();if(!a||(W===av.fingers||av.fingers===i)||aX()){ai(0,bb);T=at();if(W==2){ai(1,be.touches[1]);a1=aZ=au(aQ[0].start,aQ[1].start)}if(av.swipeStatus||av.pinchStatus){bc=O(be,Z)}}else{bc=false}if(bc===false){Z=q;O(be,Z);return bc}else{if(av.hold){af=setTimeout(f.proxy(function(){aR.trigger("hold",[be.target]);if(av.hold){bc=av.hold.call(aR,be,be.target)}},this),av.longTapThreshold)}ao(true)}return null}function a3(be){var bh=be.originalEvent?be.originalEvent:be;if(Z===h||Z===q||am()){return}var bd,bc=a?bh.touches[0]:bh;var bf=aH(bc);a2=at();if(a){W=bh.touches.length}if(av.hold){clearTimeout(af)}Z=k;if(W==2){if(a1==0){ai(1,bh.touches[1]);a1=aZ=au(aQ[0].start,aQ[1].start)}else{aH(bh.touches[1]);aZ=au(aQ[0].end,aQ[1].end);aJ=ar(aQ[0].end,aQ[1].end)}G=a7(a1,aZ);aq=Math.abs(a1-aZ)}if((W===av.fingers||av.fingers===i)||!a||aX()){aP=aL(bf.start,bf.end);al(be,aP);ag=aS(bf.start,bf.end);ab=aM();aI(aP,ag);if(av.swipeStatus||av.pinchStatus){bd=O(bh,Z)}if(!av.triggerOnTouchEnd||av.triggerOnTouchLeave){var bb=true;if(av.triggerOnTouchLeave){var bg=aY(this);bb=E(bf.end,bg)}if(!av.triggerOnTouchEnd&&bb){Z=aC(k)}else{if(av.triggerOnTouchLeave&&!bb){Z=aC(h)}}if(Z==q||Z==h){O(bh,Z)}}}else{Z=q;O(bh,Z)}if(bd===false){Z=q;O(bh,Z)}}function L(bb){var bc=bb.originalEvent;if(a){if(bc.touches.length>0){F();return true}}if(am()){W=ad}a2=at();ab=aM();if(ba()||!an()){Z=q;O(bc,Z)}else{if(av.triggerOnTouchEnd||(av.triggerOnTouchEnd==false&&Z===k)){bb.preventDefault();Z=h;O(bc,Z)}else{if(!av.triggerOnTouchEnd&&a6()){Z=h;aF(bc,Z,A)}else{if(Z===k){Z=q;O(bc,Z)}}}}ao(false);return null}function a9(){W=0;a2=0;T=0;a1=0;aZ=0;G=1;R();ao(false)}function K(bb){var bc=bb.originalEvent;if(av.triggerOnTouchLeave){Z=aC(h);O(bc,Z)}}function aK(){aR.unbind(J,aN);aR.unbind(aD,a9);aR.unbind(ay,a3);aR.unbind(U,L);if(S){aR.unbind(S,K)}ao(false)}function aC(bf){var be=bf;var bd=aA();var bc=an();var bb=ba();if(!bd||bb){be=q}else{if(bc&&bf==k&&(!av.triggerOnTouchEnd||av.triggerOnTouchLeave)){be=h}else{if(!bc&&bf==h&&av.triggerOnTouchLeave){be=q}}}return be}function O(bd,bb){var bc=undefined;if(I()||V()){bc=aF(bd,bb,l)}else{if((P()||aX())&&bc!==false){bc=aF(bd,bb,t)}}if(aG()&&bc!==false){bc=aF(bd,bb,j)}else{if(ap()&&bc!==false){bc=aF(bd,bb,b)}else{if(ah()&&bc!==false){bc=aF(bd,bb,A)}}}if(bb===q){a9(bd)}if(bb===h){if(a){if(bd.touches.length==0){a9(bd)}}else{a9(bd)}}return bc}function aF(be,bb,bd){var bc=undefined;if(bd==l){aR.trigger("swipeStatus",[bb,aP||null,ag||0,ab||0,W,aQ]);if(av.swipeStatus){bc=av.swipeStatus.call(aR,be,bb,aP||null,ag||0,ab||0,W,aQ);if(bc===false){return false}}if(bb==h&&aV()){aR.trigger("swipe",[aP,ag,ab,W,aQ]);if(av.swipe){bc=av.swipe.call(aR,be,aP,ag,ab,W,aQ);if(bc===false){return false}}switch(aP){case p:aR.trigger("swipeLeft",[aP,ag,ab,W,aQ]);if(av.swipeLeft){bc=av.swipeLeft.call(aR,be,aP,ag,ab,W,aQ)}break;case o:aR.trigger("swipeRight",[aP,ag,ab,W,aQ]);if(av.swipeRight){bc=av.swipeRight.call(aR,be,aP,ag,ab,W,aQ)}break;case e:aR.trigger("swipeUp",[aP,ag,ab,W,aQ]);if(av.swipeUp){bc=av.swipeUp.call(aR,be,aP,ag,ab,W,aQ)}break;case x:aR.trigger("swipeDown",[aP,ag,ab,W,aQ]);if(av.swipeDown){bc=av.swipeDown.call(aR,be,aP,ag,ab,W,aQ)}break}}}if(bd==t){aR.trigger("pinchStatus",[bb,aJ||null,aq||0,ab||0,W,G,aQ]);if(av.pinchStatus){bc=av.pinchStatus.call(aR,be,bb,aJ||null,aq||0,ab||0,W,G,aQ);if(bc===false){return false}}if(bb==h&&a8()){switch(aJ){case c:aR.trigger("pinchIn",[aJ||null,aq||0,ab||0,W,G,aQ]);if(av.pinchIn){bc=av.pinchIn.call(aR,be,aJ||null,aq||0,ab||0,W,G,aQ)}break;case z:aR.trigger("pinchOut",[aJ||null,aq||0,ab||0,W,G,aQ]);if(av.pinchOut){bc=av.pinchOut.call(aR,be,aJ||null,aq||0,ab||0,W,G,aQ)}break}}}if(bd==A){if(bb===q||bb===h){clearTimeout(aW);clearTimeout(af);if(Y()&&!H()){N=at();aW=setTimeout(f.proxy(function(){N=null;aR.trigger("tap",[be.target]);if(av.tap){bc=av.tap.call(aR,be,be.target)}},this),av.doubleTapThreshold)}else{N=null;aR.trigger("tap",[be.target]);if(av.tap){bc=av.tap.call(aR,be,be.target)}}}}else{if(bd==j){if(bb===q||bb===h){clearTimeout(aW);N=null;aR.trigger("doubletap",[be.target]);if(av.doubleTap){bc=av.doubleTap.call(aR,be,be.target)}}}else{if(bd==b){if(bb===q||bb===h){clearTimeout(aW);N=null;aR.trigger("longtap",[be.target]);if(av.longTap){bc=av.longTap.call(aR,be,be.target)}}}}}return bc}function an(){var bb=true;if(av.threshold!==null){bb=ag>=av.threshold}return bb}function ba(){var bb=false;if(av.cancelThreshold!==null&&aP!==null){bb=(aT(aP)-ag)>=av.cancelThreshold}return bb}function ae(){if(av.pinchThreshold!==null){return aq>=av.pinchThreshold}return true}function aA(){var bb;if(av.maxTimeThreshold){if(ab>=av.maxTimeThreshold){bb=false}else{bb=true}}else{bb=true}return bb}function al(bb,bc){if(av.allowPageScroll===m||aX()){bb.preventDefault()}else{var bd=av.allowPageScroll===s;switch(bc){case p:if((av.swipeLeft&&bd)||(!bd&&av.allowPageScroll!=D)){bb.preventDefault()}break;case o:if((av.swipeRight&&bd)||(!bd&&av.allowPageScroll!=D)){bb.preventDefault()}break;case e:if((av.swipeUp&&bd)||(!bd&&av.allowPageScroll!=u)){bb.preventDefault()}break;case x:if((av.swipeDown&&bd)||(!bd&&av.allowPageScroll!=u)){bb.preventDefault()}break}}}function a8(){var bc=aO();var bb=X();var bd=ae();return bc&&bb&&bd}function aX(){return !!(av.pinchStatus||av.pinchIn||av.pinchOut)}function P(){return !!(a8()&&aX())}function aV(){var be=aA();var bg=an();var bd=aO();var bb=X();var bc=ba();var bf=!bc&&bb&&bd&&bg&&be;return bf}function V(){return !!(av.swipe||av.swipeStatus||av.swipeLeft||av.swipeRight||av.swipeUp||av.swipeDown)}function I(){return !!(aV()&&V())}function aO(){return((W===av.fingers||av.fingers===i)||!a)}function X(){return aQ[0].end.x!==0}function a6(){return !!(av.tap)}function Y(){return !!(av.doubleTap)}function aU(){return !!(av.longTap)}function Q(){if(N==null){return false}var bb=at();return(Y()&&((bb-N)<=av.doubleTapThreshold))}function H(){return Q()}function ax(){return((W===1||!a)&&(isNaN(ag)||agav.longTapThreshold)&&(ag=0)){return p}else{if((bd<=360)&&(bd>=315)){return p}else{if((bd>=135)&&(bd<=225)){return o}else{if((bd>45)&&(bd<135)){return x}else{return e}}}}}function at(){var bb=new Date();return bb.getTime()}function aY(bb){bb=f(bb);var bd=bb.offset();var bc={left:bd.left,right:bd.left+bb.outerWidth(),top:bd.top,bottom:bd.top+bb.outerHeight()};return bc}function E(bb,bc){return(bb.x>bc.left&&bb.xbc.top&&bb.y=a.x+b&&this.y+this.height>=a.y+c},a.prototype.overlaps=function(a){var b=this.x+this.width,c=this.y+this.height,d=a.x+a.width,e=a.y+a.height;return this.xa.x&&this.ya.y},a.prototype.getMaximalFreeRects=function(b){if(!this.overlaps(b))return!1;var c,d=[],e=this.x+this.width,f=this.y+this.height,g=b.x+b.width,h=b.y+b.height;return this.yg&&(c=new a({x:g,y:this.y,width:e-g,height:this.height}),d.push(c)),f>h&&(c=new a({x:this.x,y:h,width:this.width,height:f-h}),d.push(c)),this.x=a.width&&this.height>=a.height},a}),function(a,b){if("function"==typeof define&&define.amd)define("packery/js/packer",["./rect"],b);else if("object"==typeof exports)module.exports=b(require("./rect"));else{var c=a.Packery=a.Packery||{};c.Packer=b(c.Rect)}}(window,function(a){function b(a,b,c){this.width=a||0,this.height=b||0,this.sortDirection=c||"downwardLeftToRight",this.reset()}b.prototype.reset=function(){this.spaces=[],this.newSpaces=[];var b=new a({x:0,y:0,width:this.width,height:this.height});this.spaces.push(b),this.sorter=c[this.sortDirection]||c.downwardLeftToRight},b.prototype.pack=function(a){for(var b=0,c=this.spaces.length;c>b;b++){var d=this.spaces[b];if(d.canFit(a)){this.placeInSpace(a,d);break}}},b.prototype.placeInSpace=function(a,b){a.x=b.x,a.y=b.y,this.placed(a)},b.prototype.placed=function(a){for(var b=[],c=0,d=this.spaces.length;d>c;c++){var e=this.spaces[c],f=e.getMaximalFreeRects(a);f?b.push.apply(b,f):b.push(e)}this.spaces=b,this.mergeSortSpaces()},b.prototype.mergeSortSpaces=function(){b.mergeRects(this.spaces),this.spaces.sort(this.sorter)},b.prototype.addSpace=function(a){this.spaces.push(a),this.mergeSortSpaces()},b.mergeRects=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];if(d){var e=a.slice(0);e.splice(b,1);for(var f=0,g=0,h=e.length;h>g;g++){var i=e[g],j=b>g?0:1;d.contains(i)&&(a.splice(g+j-f,1),f++)}}}return a};var c={downwardLeftToRight:function(a,b){return a.y-b.y||a.x-b.x},rightwardTopToBottom:function(a,b){return a.x-b.x||a.y-b.y}};return b}),function(a,b){"function"==typeof define&&define.amd?define("packery/js/item",["get-style-property/get-style-property","outlayer/outlayer","./rect"],b):"object"==typeof exports?module.exports=b(require("desandro-get-style-property"),require("outlayer"),require("./rect")):a.Packery.Item=b(a.getStyleProperty,a.Outlayer,a.Packery.Rect)}(window,function(a,b,c){var d=a("transform"),e=function(){b.Item.apply(this,arguments)};e.prototype=new b.Item;var f=e.prototype._create;return e.prototype._create=function(){f.call(this),this.rect=new c,this.placeRect=new c},e.prototype.dragStart=function(){this.getPosition(),this.removeTransitionStyles(),this.isTransitioning&&d&&(this.element.style[d]="none"),this.getSize(),this.isPlacing=!0,this.needsPositioning=!1,this.positionPlaceRect(this.position.x,this.position.y),this.isTransitioning=!1,this.didDrag=!1},e.prototype.dragMove=function(a,b){this.didDrag=!0;var c=this.layout.size;a-=c.paddingLeft,b-=c.paddingTop,this.positionPlaceRect(a,b)},e.prototype.dragStop=function(){this.getPosition();var a=this.position.x!=this.placeRect.x,b=this.position.y!=this.placeRect.y;this.needsPositioning=a||b,this.didDrag=!1},e.prototype.positionPlaceRect=function(a,b,c){this.placeRect.x=this.getPlaceRectCoord(a,!0),this.placeRect.y=this.getPlaceRectCoord(b,!1,c)},e.prototype.getPlaceRectCoord=function(a,b,c){var d=b?"Width":"Height",e=this.size["outer"+d],f=this.layout[b?"columnWidth":"rowHeight"],g=this.layout.size["inner"+d];b||(g=Math.max(g,this.layout.maxY),this.layout.rowHeight||(g-=this.layout.gutter));var h;if(f){f+=this.layout.gutter,g+=b?this.layout.gutter:0,a=Math.round(a/f);var i;i=this.layout.options.isHorizontal?b?"ceil":"floor":b?"floor":"ceil";var j=Math[i](g/f);j-=Math.ceil(e/f),h=j}else h=g-e;return a=c?a:Math.min(a,h),a*=f||1,Math.max(0,a)},e.prototype.copyPlaceRectPosition=function(){this.rect.x=this.placeRect.x,this.rect.y=this.placeRect.y},e.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},e}),function(a,b){"function"==typeof define&&define.amd?define("packery/js/packery",["classie/classie","get-size/get-size","outlayer/outlayer","./rect","./packer","./item"],b):"object"==typeof exports?module.exports=b(require("desandro-classie"),require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):a.Packery=b(a.classie,a.getSize,a.Outlayer,a.Packery.Rect,a.Packery.Packer,a.Packery.Item)}(window,function(a,b,c,d,e,f){function g(a,b){return a.position.y-b.position.y||a.position.x-b.position.x}function h(a,b){return a.position.x-b.position.x||a.position.y-b.position.y}d.prototype.canFit=function(a){return this.width>=a.width-1&&this.height>=a.height-1};var i=c.create("packery");return i.Item=f,i.prototype._create=function(){c.prototype._create.call(this),this.packer=new e,this.stamp(this.options.stamped);var a=this;this.handleDraggabilly={dragStart:function(){a.itemDragStart(this.element)},dragMove:function(){a.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){a.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(b){a.itemDragStart(b.currentTarget)},drag:function(b,c){a.itemDragMove(b.currentTarget,c.position.left,c.position.top)},stop:function(b){a.itemDragEnd(b.currentTarget)}}},i.prototype._resetLayout=function(){this.getSize(),this._getMeasurements();var a=this.packer;this.options.isHorizontal?(a.width=Number.POSITIVE_INFINITY,a.height=this.size.innerHeight+this.gutter,a.sortDirection="rightwardTopToBottom"):(a.width=this.size.innerWidth+this.gutter,a.height=Number.POSITIVE_INFINITY,a.sortDirection="downwardLeftToRight"),a.reset(),this.maxY=0,this.maxX=0},i.prototype._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},i.prototype._getItemLayoutPosition=function(a){return this._packItem(a),a.rect},i.prototype._packItem=function(a){this._setRectSize(a.element,a.rect),this.packer.pack(a.rect),this._setMaxXY(a.rect)},i.prototype._setMaxXY=function(a){this.maxX=Math.max(a.x+a.width,this.maxX),this.maxY=Math.max(a.y+a.height,this.maxY)},i.prototype._setRectSize=function(a,c){var d=b(a),e=d.outerWidth,f=d.outerHeight;(e||f)&&(e=this._applyGridGutter(e,this.columnWidth),f=this._applyGridGutter(f,this.rowHeight)),c.width=Math.min(e,this.packer.width),c.height=Math.min(f,this.packer.height)},i.prototype._applyGridGutter=function(a,b){if(!b)return a+this.gutter;b+=this.gutter;var c=a%b,d=c&&1>c?"round":"ceil";return a=Math[d](a/b)*b},i.prototype._getContainerSize=function(){return this.options.isHorizontal?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},i.prototype._manageStamp=function(a){var b,c=this.getItem(a);if(c&&c.isPlacing)b=c.placeRect;else{var e=this._getElementOffset(a);b=new d({x:this.options.isOriginLeft?e.left:e.right,y:this.options.isOriginTop?e.top:e.bottom})}this._setRectSize(a,b),this.packer.placed(b),this._setMaxXY(b)},i.prototype.sortItemsByPosition=function(){var a=this.options.isHorizontal?h:g;this.items.sort(a)},i.prototype.fit=function(a,b,c){var d=this.getItem(a);d&&(this._getMeasurements(),this.stamp(d.element),d.getSize(),d.isPlacing=!0,b=void 0===b?d.rect.x:b,c=void 0===c?d.rect.y:c,d.positionPlaceRect(b,c,!0),this._bindFitEvents(d),d.moveTo(d.placeRect.x,d.placeRect.y),this.layout(),this.unstamp(d.element),this.sortItemsByPosition(),d.isPlacing=!1,d.copyPlaceRectPosition())},i.prototype._bindFitEvents=function(a){function b(){d++,2==d&&c.emitEvent("fitComplete",[a])}var c=this,d=0;a.on("layout",function(){return b(),!0}),this.on("layoutComplete",function(){return b(),!0})},i.prototype.resize=function(){var a=b(this.element),c=this.size&&a,d=this.options.isHorizontal?"innerHeight":"innerWidth";c&&a[d]==this.size[d]||this.layout()},i.prototype.itemDragStart=function(a){this.stamp(a);var b=this.getItem(a);b&&b.dragStart()},i.prototype.itemDragMove=function(a,b,c){function d(){f.layout(),delete f.dragTimeout}var e=this.getItem(a);e&&e.dragMove(b,c);var f=this;this.clearDragTimeout(),this.dragTimeout=setTimeout(d,40)},i.prototype.clearDragTimeout=function(){this.dragTimeout&&clearTimeout(this.dragTimeout)},i.prototype.itemDragEnd=function(b){var c,d=this.getItem(b);if(d&&(c=d.didDrag,d.dragStop()),!d||!c&&!d.needsPositioning)return void this.unstamp(b);a.add(d.element,"is-positioning-post-drag");var e=this._getDragEndLayoutComplete(b,d);d.needsPositioning?(d.on("layout",e),d.moveTo(d.placeRect.x,d.placeRect.y)):d&&d.copyPlaceRectPosition(),this.clearDragTimeout(),this.on("layoutComplete",e),this.layout()},i.prototype._getDragEndLayoutComplete=function(b,c){var d=c&&c.needsPositioning,e=0,f=d?2:1,g=this;return function(){return e++,e!=f?!0:(c&&(a.remove(c.element,"is-positioning-post-drag"),c.isPlacing=!1,c.copyPlaceRectPosition()),g.unstamp(b),g.sortItemsByPosition(),d&&g.emitEvent("dragItemPositioned",[c]),!0)}},i.prototype.bindDraggabillyEvents=function(a){a.on("dragStart",this.handleDraggabilly.dragStart),a.on("dragMove",this.handleDraggabilly.dragMove),a.on("dragEnd",this.handleDraggabilly.dragEnd)},i.prototype.bindUIDraggableEvents=function(a){a.on("dragstart",this.handleUIDraggable.start).on("drag",this.handleUIDraggable.drag).on("dragstop",this.handleUIDraggable.stop)},i.Rect=d,i.Packer=e,i}),function(a,b){"function"==typeof define&&define.amd?define(["isotope/js/layout-mode","packery/js/packery","get-size/get-size"],b):"object"==typeof exports?module.exports=b(require("isotope-layout/js/layout-mode"),require("packery"),require("get-size")):b(a.Isotope.LayoutMode,a.Packery,a.getSize)}(window,function(a,b,c){function d(a,b){for(var c in b)a[c]=b[c];return a}var e=a.create("packery"),f=e.prototype._getElementOffset,g=e.prototype._getMeasurement;d(e.prototype,b.prototype),e.prototype._getElementOffset=f,e.prototype._getMeasurement=g;var h=e.prototype._resetLayout;e.prototype._resetLayout=function(){this.packer=this.packer||new b.Packer,h.apply(this,arguments)};var i=e.prototype._getItemLayoutPosition;e.prototype._getItemLayoutPosition=function(a){return a.rect=a.rect||new b.Rect,i.call(this,a)};var j=e.prototype._manageStamp;return e.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,j.apply(this,arguments)},e.prototype.needsResizeLayout=function(){var a=c(this.element),b=this.size&&a,d=this.options.isHorizontal?"innerHeight":"innerWidth";return b&&a[d]!=this.size[d]},e});
--------------------------------------------------------------------------------
/frontend/js/jquery.flexslider-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery FlexSlider v2.6.1
3 | * Copyright 2012 WooThemes
4 | * Contributing Author: Tyler Smith
5 | */!function($){"use strict";var e=!0;$.flexslider=function(t,a){var n=$(t);n.vars=$.extend({},$.flexslider.defaults,a);var i=n.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,r=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&n.vars.touch,o="click touchend MSPointerUp keyup",l="",c,d="vertical"===n.vars.direction,u=n.vars.reverse,v=n.vars.itemWidth>0,p="fade"===n.vars.animation,m=""!==n.vars.asNavFor,f={};$.data(t,"flexslider",n),f={init:function(){n.animating=!1,n.currentSlide=parseInt(n.vars.startAt?n.vars.startAt:0,10),isNaN(n.currentSlide)&&(n.currentSlide=0),n.animatingTo=n.currentSlide,n.atEnd=0===n.currentSlide||n.currentSlide===n.last,n.containerSelector=n.vars.selector.substr(0,n.vars.selector.search(" ")),n.slides=$(n.vars.selector,n),n.container=$(n.containerSelector,n),n.count=n.slides.length,n.syncExists=$(n.vars.sync).length>0,"slide"===n.vars.animation&&(n.vars.animation="swing"),n.prop=d?"top":"marginLeft",n.args={},n.manualPause=!1,n.stopped=!1,n.started=!1,n.startTimeout=null,n.transitions=!n.vars.video&&!p&&n.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var a in t)if(void 0!==e.style[t[a]])return n.pfx=t[a].replace("Perspective","").toLowerCase(),n.prop="-"+n.pfx+"-transform",!0;return!1}(),n.ensureAnimationEnd="",""!==n.vars.controlsContainer&&(n.controlsContainer=$(n.vars.controlsContainer).length>0&&$(n.vars.controlsContainer)),""!==n.vars.manualControls&&(n.manualControls=$(n.vars.manualControls).length>0&&$(n.vars.manualControls)),""!==n.vars.customDirectionNav&&(n.customDirectionNav=2===$(n.vars.customDirectionNav).length&&$(n.vars.customDirectionNav)),n.vars.randomize&&(n.slides.sort(function(){return Math.round(Math.random())-.5}),n.container.empty().append(n.slides)),n.doMath(),n.setup("init"),n.vars.controlNav&&f.controlNav.setup(),n.vars.directionNav&&f.directionNav.setup(),n.vars.keyboard&&(1===$(n.containerSelector).length||n.vars.multipleKeyboard)&&$(document).bind("keyup",function(e){var t=e.keyCode;if(!n.animating&&(39===t||37===t)){var a=39===t?n.getTarget("next"):37===t?n.getTarget("prev"):!1;n.flexAnimate(a,n.vars.pauseOnAction)}}),n.vars.mousewheel&&n.bind("mousewheel",function(e,t,a,i){e.preventDefault();var s=0>t?n.getTarget("next"):n.getTarget("prev");n.flexAnimate(s,n.vars.pauseOnAction)}),n.vars.pausePlay&&f.pausePlay.setup(),n.vars.slideshow&&n.vars.pauseInvisible&&f.pauseInvisible.init(),n.vars.slideshow&&(n.vars.pauseOnHover&&n.hover(function(){n.manualPlay||n.manualPause||n.pause()},function(){n.manualPause||n.manualPlay||n.stopped||n.play()}),n.vars.pauseInvisible&&f.pauseInvisible.isHidden()||(n.vars.initDelay>0?n.startTimeout=setTimeout(n.play,n.vars.initDelay):n.play())),m&&f.asNav.setup(),r&&n.vars.touch&&f.touch(),(!p||p&&n.vars.smoothHeight)&&$(window).bind("resize orientationchange focus",f.resize),n.find("img").attr("draggable","false"),setTimeout(function(){n.vars.start(n)},200)},asNav:{setup:function(){n.asNav=!0,n.animatingTo=Math.floor(n.currentSlide/n.move),n.currentItem=n.currentSlide,n.slides.removeClass(i+"active-slide").eq(n.currentItem).addClass(i+"active-slide"),s?(t._slider=n,n.slides.each(function(){var e=this;e._gesture=new MSGesture,e._gesture.target=e,e.addEventListener("MSPointerDown",function(e){e.preventDefault(),e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1),e.addEventListener("MSGestureTap",function(e){e.preventDefault();var t=$(this),a=t.index();$(n.vars.asNavFor).data("flexslider").animating||t.hasClass("active")||(n.direction=n.currentItem=s&&t.hasClass(i+"active-slide")?n.flexAnimate(n.getTarget("prev"),!0):$(n.vars.asNavFor).data("flexslider").animating||t.hasClass(i+"active-slide")||(n.direction=n.currentItem '),n.pagingCount>1)for(var r=0;r ":' '+t+" ","thumbnails"===n.vars.controlNav&&!0===n.vars.thumbCaptions){var d=s.attr("data-thumbcaption");""!==d&&void 0!==d&&(a+=''+d+" ")}n.controlNavScaffold.append(""+a+" "),t++}n.controlsContainer?$(n.controlsContainer).append(n.controlNavScaffold):n.append(n.controlNavScaffold),f.controlNav.set(),f.controlNav.active(),n.controlNavScaffold.delegate("a, img",o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(n.direction=a>n.currentSlide?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},setupManual:function(){n.controlNav=n.manualControls,f.controlNav.active(),n.controlNav.bind(o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(a>n.currentSlide?n.direction="next":n.direction="prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},set:function(){var e="thumbnails"===n.vars.controlNav?"img":"a";n.controlNav=$("."+i+"control-nav li "+e,n.controlsContainer?n.controlsContainer:n)},active:function(){n.controlNav.removeClass(i+"active").eq(n.animatingTo).addClass(i+"active")},update:function(e,t){n.pagingCount>1&&"add"===e?n.controlNavScaffold.append($(''+n.count+" ")):1===n.pagingCount?n.controlNavScaffold.find("li").remove():n.controlNav.eq(t).closest("li").remove(),f.controlNav.set(),n.pagingCount>1&&n.pagingCount!==n.controlNav.length?n.update(t,e):f.controlNav.active()}},directionNav:{setup:function(){var e=$('");n.customDirectionNav?n.directionNav=n.customDirectionNav:n.controlsContainer?($(n.controlsContainer).append(e),n.directionNav=$("."+i+"direction-nav li a",n.controlsContainer)):(n.append(e),n.directionNav=$("."+i+"direction-nav li a",n)),f.directionNav.update(),n.directionNav.bind(o,function(e){e.preventDefault();var t;(""===l||l===e.type)&&(t=$(this).hasClass(i+"next")?n.getTarget("next"):n.getTarget("prev"),n.flexAnimate(t,n.vars.pauseOnAction)),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";1===n.pagingCount?n.directionNav.addClass(e).attr("tabindex","-1"):n.vars.animationLoop?n.directionNav.removeClass(e).removeAttr("tabindex"):0===n.animatingTo?n.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):n.animatingTo===n.last?n.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):n.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var e=$('');n.controlsContainer?(n.controlsContainer.append(e),n.pausePlay=$("."+i+"pauseplay a",n.controlsContainer)):(n.append(e),n.pausePlay=$("."+i+"pauseplay a",n)),f.pausePlay.update(n.vars.slideshow?i+"pause":i+"play"),n.pausePlay.bind(o,function(e){e.preventDefault(),(""===l||l===e.type)&&($(this).hasClass(i+"pause")?(n.manualPause=!0,n.manualPlay=!1,n.pause()):(n.manualPause=!1,n.manualPlay=!0,n.play())),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(e){"play"===e?n.pausePlay.removeClass(i+"pause").addClass(i+"play").html(n.vars.playText):n.pausePlay.removeClass(i+"play").addClass(i+"pause").html(n.vars.pauseText)}},touch:function(){function e(e){e.stopPropagation(),n.animating?e.preventDefault():(n.pause(),t._gesture.addPointer(e.pointerId),T=0,c=d?n.h:n.w,f=Number(new Date),l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c)}function a(e){e.stopPropagation();var a=e.target._slider;if(a){var n=-e.translationX,i=-e.translationY;return T+=d?i:n,m=T,y=d?Math.abs(T)500)&&(e.preventDefault(),!p&&a.transitions&&(a.vars.animationLoop||(m=T/(0===a.currentSlide&&0>T||a.currentSlide===a.last&&T>0?Math.abs(T)/c+2:1)),a.setProps(l+m,"setTouch"))))}}function i(e){e.stopPropagation();var t=e.target._slider;if(t){if(t.animatingTo===t.currentSlide&&!y&&null!==m){var a=u?-m:m,n=a>0?t.getTarget("next"):t.getTarget("prev");t.canAdvance(n)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?t.flexAnimate(n,t.vars.pauseOnAction):p||t.flexAnimate(t.currentSlide,t.vars.pauseOnAction,!0)}r=null,o=null,m=null,l=null,T=0}}var r,o,l,c,m,f,g,h,S,y=!1,x=0,b=0,T=0;s?(t.style.msTouchAction="none",t._gesture=new MSGesture,t._gesture.target=t,t.addEventListener("MSPointerDown",e,!1),t._slider=n,t.addEventListener("MSGestureChange",a,!1),t.addEventListener("MSGestureEnd",i,!1)):(g=function(e){n.animating?e.preventDefault():(window.navigator.msPointerEnabled||1===e.touches.length)&&(n.pause(),c=d?n.h:n.w,f=Number(new Date),x=e.touches[0].pageX,b=e.touches[0].pageY,l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c,r=d?b:x,o=d?x:b,t.addEventListener("touchmove",h,!1),t.addEventListener("touchend",S,!1))},h=function(e){x=e.touches[0].pageX,b=e.touches[0].pageY,m=d?r-b:r-x,y=d?Math.abs(m)t)&&(e.preventDefault(),!p&&n.transitions&&(n.vars.animationLoop||(m/=0===n.currentSlide&&0>m||n.currentSlide===n.last&&m>0?Math.abs(m)/c+2:1),n.setProps(l+m,"setTouch")))},S=function(e){if(t.removeEventListener("touchmove",h,!1),n.animatingTo===n.currentSlide&&!y&&null!==m){var a=u?-m:m,i=a>0?n.getTarget("next"):n.getTarget("prev");n.canAdvance(i)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?n.flexAnimate(i,n.vars.pauseOnAction):p||n.flexAnimate(n.currentSlide,n.vars.pauseOnAction,!0)}t.removeEventListener("touchend",S,!1),r=null,o=null,m=null,l=null},t.addEventListener("touchstart",g,!1))},resize:function(){!n.animating&&n.is(":visible")&&(v||n.doMath(),p?f.smoothHeight():v?(n.slides.width(n.computedW),n.update(n.pagingCount),n.setProps()):d?(n.viewport.height(n.h),n.setProps(n.h,"setTotal")):(n.vars.smoothHeight&&f.smoothHeight(),n.newSlides.width(n.computedW),n.setProps(n.computedW,"setTotal")))},smoothHeight:function(e){if(!d||p){var t=p?n:n.viewport;e?t.animate({height:n.slides.eq(n.animatingTo).innerHeight()},e):t.innerHeight(n.slides.eq(n.animatingTo).innerHeight())}},sync:function(e){var t=$(n.vars.sync).data("flexslider"),a=n.animatingTo;switch(e){case"animate":t.flexAnimate(a,n.vars.pauseOnAction,!1,!0);break;case"play":t.playing||t.asNav||t.play();break;case"pause":t.pause()}},uniqueID:function(e){return e.filter("[id]").add(e.find("[id]")).each(function(){var e=$(this);e.attr("id",e.attr("id")+"_clone")}),e},pauseInvisible:{visProp:null,init:function(){var e=f.pauseInvisible.getHiddenProp();if(e){var t=e.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(t,function(){f.pauseInvisible.isHidden()?n.startTimeout?clearTimeout(n.startTimeout):n.pause():n.started?n.play():n.vars.initDelay>0?setTimeout(n.play,n.vars.initDelay):n.play()})}},isHidden:function(){var e=f.pauseInvisible.getHiddenProp();return e?document[e]:!1},getHiddenProp:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;tn.currentSlide?"next":"prev"),m&&1===n.pagingCount&&(n.direction=n.currentItemn.limit&&1!==n.visible?n.limit:S):h=0===n.currentSlide&&e===n.count-1&&n.vars.animationLoop&&"next"!==n.direction?u?(n.count+n.cloneOffset)*c:0:n.currentSlide===n.last&&0===e&&n.vars.animationLoop&&"prev"!==n.direction?u?0:(n.count+1)*c:u?(n.count-1-e+n.cloneOffset)*c:(e+n.cloneOffset)*c,n.setProps(h,"",n.vars.animationSpeed),n.transitions?(n.vars.animationLoop&&n.atEnd||(n.animating=!1,n.currentSlide=n.animatingTo),n.container.unbind("webkitTransitionEnd transitionend"),n.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(n.ensureAnimationEnd),n.wrapup(c)}),clearTimeout(n.ensureAnimationEnd),n.ensureAnimationEnd=setTimeout(function(){n.wrapup(c)},n.vars.animationSpeed+100)):n.container.animate(n.args,n.vars.animationSpeed,n.vars.easing,function(){n.wrapup(c)})}n.vars.smoothHeight&&f.smoothHeight(n.vars.animationSpeed)}},n.wrapup=function(e){p||v||(0===n.currentSlide&&n.animatingTo===n.last&&n.vars.animationLoop?n.setProps(e,"jumpEnd"):n.currentSlide===n.last&&0===n.animatingTo&&n.vars.animationLoop&&n.setProps(e,"jumpStart")),n.animating=!1,n.currentSlide=n.animatingTo,n.vars.after(n)},n.animateSlides=function(){!n.animating&&e&&n.flexAnimate(n.getTarget("next"))},n.pause=function(){clearInterval(n.animatedSlides),n.animatedSlides=null,n.playing=!1,n.vars.pausePlay&&f.pausePlay.update("play"),n.syncExists&&f.sync("pause")},n.play=function(){n.playing&&clearInterval(n.animatedSlides),n.animatedSlides=n.animatedSlides||setInterval(n.animateSlides,n.vars.slideshowSpeed),n.started=n.playing=!0,n.vars.pausePlay&&f.pausePlay.update("pause"),n.syncExists&&f.sync("play")},n.stop=function(){n.pause(),n.stopped=!0},n.canAdvance=function(e,t){var a=m?n.pagingCount-1:n.last;return t?!0:m&&n.currentItem===n.count-1&&0===e&&"prev"===n.direction?!0:m&&0===n.currentItem&&e===n.pagingCount-1&&"next"!==n.direction?!1:e!==n.currentSlide||m?n.vars.animationLoop?!0:n.atEnd&&0===n.currentSlide&&e===a&&"next"!==n.direction?!1:n.atEnd&&n.currentSlide===a&&0===e&&"next"===n.direction?!1:!0:!1},n.getTarget=function(e){return n.direction=e,"next"===e?n.currentSlide===n.last?0:n.currentSlide+1:0===n.currentSlide?n.last:n.currentSlide-1},n.setProps=function(e,t,a){var i=function(){var a=e?e:(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo,i=function(){if(v)return"setTouch"===t?e:u&&n.animatingTo===n.last?0:u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:n.animatingTo===n.last?n.limit:a;switch(t){case"setTotal":return u?(n.count-1-n.currentSlide+n.cloneOffset)*e:(n.currentSlide+n.cloneOffset)*e;case"setTouch":return u?e:e;case"jumpEnd":return u?e:n.count*e;case"jumpStart":return u?n.count*e:e;default:return e}}();return-1*i+"px"}();n.transitions&&(i=d?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)",a=void 0!==a?a/1e3+"s":"0s",n.container.css("-"+n.pfx+"-transition-duration",a),n.container.css("transition-duration",a)),n.args[n.prop]=i,(n.transitions||void 0===a)&&n.container.css(n.args),n.container.css("transform",i)},n.setup=function(e){if(p)n.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===e&&(r?n.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+n.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(n.currentSlide).css({opacity:1,zIndex:2}):0==n.vars.fadeFirstSlide?n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).css({opacity:1}):n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing)),n.vars.smoothHeight&&f.smoothHeight();else{var t,a;"init"===e&&(n.viewport=$('
').css({overflow:"hidden",position:"relative"}).appendTo(n).append(n.container),n.cloneCount=0,n.cloneOffset=0,u&&(a=$.makeArray(n.slides).reverse(),n.slides=$(a),n.container.empty().append(n.slides))),n.vars.animationLoop&&!v&&(n.cloneCount=2,n.cloneOffset=1,"init"!==e&&n.container.find(".clone").remove(),n.container.append(f.uniqueID(n.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(f.uniqueID(n.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),n.newSlides=$(n.vars.selector,n),t=u?n.count-1-n.currentSlide+n.cloneOffset:n.currentSlide+n.cloneOffset,d&&!v?(n.container.height(200*(n.count+n.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){n.newSlides.css({display:"block"}),n.doMath(),n.viewport.height(n.h),n.setProps(t*n.h,"init")},"init"===e?100:0)):(n.container.width(200*(n.count+n.cloneCount)+"%"),n.setProps(t*n.computedW,"init"),setTimeout(function(){n.doMath(),n.newSlides.css({width:n.computedW,marginRight:n.computedM,"float":"left",display:"block"}),n.vars.smoothHeight&&f.smoothHeight()},"init"===e?100:0))}v||n.slides.removeClass(i+"active-slide").eq(n.currentSlide).addClass(i+"active-slide"),n.vars.init(n)},n.doMath=function(){var e=n.slides.first(),t=n.vars.itemMargin,a=n.vars.minItems,i=n.vars.maxItems;n.w=void 0===n.viewport?n.width():n.viewport.width(),n.h=e.height(),n.boxPadding=e.outerWidth()-e.width(),v?(n.itemT=n.vars.itemWidth+t,n.itemM=t,n.minW=a?a*n.itemT:n.w,n.maxW=i?i*n.itemT-t:n.w,n.itemW=n.minW>n.w?(n.w-t*(a-1))/a:n.maxWn.w?n.w:n.vars.itemWidth,n.visible=Math.floor(n.w/n.itemW),n.move=n.vars.move>0&&n.vars.moven.w?n.itemW*(n.count-1)+t*(n.count-1):(n.itemW+t)*n.count-n.w-t):(n.itemW=n.w,n.itemM=t,n.pagingCount=n.count,n.last=n.count-1),n.computedW=n.itemW-n.boxPadding,n.computedM=n.itemM},n.update=function(e,t){n.doMath(),v||(en.controlNav.length?f.controlNav.update("add"):("remove"===t&&!v||n.pagingCountn.last&&(n.currentSlide-=1,n.animatingTo-=1),f.controlNav.update("remove",n.last))),n.vars.directionNav&&f.directionNav.update()},n.addSlide=function(e,t){var a=$(e);n.count+=1,n.last=n.count-1,d&&u?void 0!==t?n.slides.eq(n.count-t).after(a):n.container.prepend(a):void 0!==t?n.slides.eq(t).before(a):n.container.append(a),n.update(t,"add"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.added(n)},n.removeSlide=function(e){var t=isNaN(e)?n.slides.index($(e)):e;n.count-=1,n.last=n.count-1,isNaN(e)?$(e,n.slides).remove():d&&u?n.slides.eq(n.last).remove():n.slides.eq(e).remove(),n.doMath(),n.update(t,"remove"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.removed(n)},f.init()},$(window).blur(function(t){e=!1}).focus(function(t){e=!0}),$.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,fadeFirstSlide:!0,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",customDirectionNav:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){}},$.fn.flexslider=function(e){if(void 0===e&&(e={}),"object"==typeof e)return this.each(function(){var t=$(this),a=e.selector?e.selector:".slides > li",n=t.find(a);1===n.length&&e.allowOneSlide===!1||0===n.length?(n.fadeIn(400),e.start&&e.start(t)):void 0===t.data("flexslider")&&new $.flexslider(this,e)});var t=$(this).data("flexslider");switch(e){case"play":t.play();break;case"pause":t.pause();break;case"stop":t.stop();break;case"next":t.flexAnimate(t.getTarget("next"),!0);break;case"prev":case"previous":t.flexAnimate(t.getTarget("prev"),!0);break;default:"number"==typeof e&&t.flexAnimate(e,!0)}}}(jQuery);
6 |
7 | jQuery('.flexslider').not('.flexslider.testimonials').flexslider({
8 | animation: "slide",
9 | slideshow: false
10 | });
11 |
12 | jQuery('.flexslider.testimonials').flexslider({
13 | animation: "fade",
14 | slideshow: true
15 | });
--------------------------------------------------------------------------------
/frontend/js/jquery.isotope.load.js:
--------------------------------------------------------------------------------
1 | var eosPriceUsd;
2 | var ramPriceEos;
3 | var ramPriceUsd;
4 | var netPriceEos;
5 | var netPriceUsd;
6 | var cpuPriceEos;
7 | var cpuPriceUsd;
8 | var maxRam;
9 | var usedRam;
10 |
11 | var chainEndpoint = "https://eos.greymass.com";
12 |
13 | jQuery(window).load(function($) {
14 | "use strict";
15 |
16 | /* --- Begin EOS data update routines --- */
17 | function getXmlHttpRequestObject() {
18 | if (window.XMLHttpRequest) {
19 | return new XMLHttpRequest();
20 | } else if (window.ActiveXObject) {
21 | return new ActiveXObject("Microsoft.XMLHTTP");
22 | } else {
23 | alert(
24 | "Your Browser does not support AJAX!\nIt's about time to upgrade don't you think?"
25 | );
26 | }
27 | }
28 |
29 | var reqEos = getXmlHttpRequestObject();
30 | var reqRam = getXmlHttpRequestObject();
31 | var reqBan = getXmlHttpRequestObject();
32 | var reqGlobal = getXmlHttpRequestObject();
33 |
34 | function updateEosData() {
35 | if (reqGlobal.readyState == 4 || reqGlobal.readyState == 0) {
36 | reqGlobal.open("POST", chainEndpoint + "/v1/chain/get_table_rows");
37 | reqGlobal.onreadystatechange = handleResponseGlobal;
38 | }
39 |
40 | if (reqEos.readyState == 4 || reqEos.readyState == 0) {
41 | // reqEos.open("GET", "https://api.coinmarketcap.com/v2/ticker/1765/"); //~ EOS/USD price
42 | reqEos.open(
43 | "GET",
44 | "https://api.coinbase.com/v2/prices/EOS-USD/spot",
45 | true
46 | );
47 | reqEos.onreadystatechange = handleResponseEos;
48 | }
49 |
50 | if (reqRam.readyState == 4 || reqRam.readyState == 0) {
51 | reqRam.open("POST", chainEndpoint + "/v1/chain/get_table_rows");
52 | reqRam.onreadystatechange = handleResponseRam;
53 | }
54 |
55 | if (reqBan.readyState == 4 || reqBan.readyState == 0) {
56 | reqBan.open("POST", chainEndpoint + "/v1/chain/get_account");
57 | reqBan.onreadystatechange = handleResponseBan;
58 | }
59 | reqGlobal.send(
60 | JSON.stringify({
61 | json: "true",
62 | code: "eosio",
63 | scope: "eosio",
64 | table: "global"
65 | })
66 | );
67 | }
68 |
69 | function handleResponseGlobal() {
70 | if (reqGlobal.readyState == 4) {
71 | parseStateGlobal(JSON.parse(reqGlobal.responseText));
72 | reqEos.send();
73 | }
74 | }
75 |
76 | function handleResponseEos() {
77 | if (reqEos.readyState == 4) {
78 | parseStateEos(JSON.parse(reqEos.responseText));
79 | reqRam.send(
80 | JSON.stringify({
81 | json: "true",
82 | code: "eosio",
83 | scope: "eosio",
84 | table: "rammarket",
85 | limit: "10"
86 | })
87 | );
88 | reqBan.send(JSON.stringify({ account_name: "eosnewyorkio" }));
89 | }
90 | }
91 |
92 | function handleResponseRam() {
93 | if (reqRam.readyState == 4) {
94 | parseStateRam(JSON.parse(reqRam.responseText));
95 | }
96 | }
97 |
98 | function handleResponseBan() {
99 | if (reqBan.readyState == 4) {
100 | parseStateBan(JSON.parse(reqBan.responseText));
101 | }
102 | }
103 |
104 | function parseStateGlobal(xDoc) {
105 | if (xDoc == null) return;
106 |
107 | maxRam = xDoc.rows[0].max_ram_size;
108 | usedRam = xDoc.rows[0].total_ram_bytes_reserved;
109 | }
110 |
111 | function parseStateEos(xDoc) {
112 | if (xDoc == null) return;
113 |
114 | var target = document.getElementById("eos-price-usd");
115 | // eosPriceUsd = xDoc.data.quotes.USD.price;
116 | eosPriceUsd = parseFloat(xDoc.data.amount);
117 | target.innerHTML = "1 EOS = $" + eosPriceUsd.toFixed(2) + " USD";
118 | }
119 |
120 | function parseStateRam(xDoc) {
121 | if (xDoc == null) return;
122 |
123 | var ramBaseBalance = xDoc.rows[0].base.balance; // Amount of RAM bytes in use
124 | ramBaseBalance = ramBaseBalance.substr(0, ramBaseBalance.indexOf(" "));
125 | var ramQuoteBalance = xDoc.rows[0].quote.balance; // Amount of EOS in the RAM collector
126 | ramQuoteBalance = ramQuoteBalance.substr(0, ramQuoteBalance.indexOf(" "));
127 | ramPriceEos = ((ramQuoteBalance / ramBaseBalance) * 1024).toFixed(8); // Price in KiB
128 | ramPriceUsd = ramPriceEos * eosPriceUsd;
129 | var ramUtilization = (usedRam / maxRam) * 100;
130 |
131 | var target = document.getElementById("maxRam");
132 | target.innerHTML = (maxRam / 1024 / 1024 / 1024).toFixed(2) + " GiB";
133 | target = document.getElementById("allocatedRam");
134 | target.innerHTML = (usedRam / 1024 / 1024 / 1024).toFixed(2) + " GiB";
135 | target = document.getElementById("utilizedRam");
136 | target.innerHTML = ramUtilization.toFixed(2) + " %";
137 | target = document.getElementById("ramUtilVal");
138 | target.innerHTML = ramUtilization.toFixed(2) + "%";
139 | target = document.getElementById("ramUtilBar");
140 | target.style.width = ramUtilization.toFixed(2) + "%";
141 | target = document.getElementById("ram-price-eos");
142 | target.innerHTML = ramPriceEos + " EOS per KiB";
143 | target = document.getElementById("ram-price-usd");
144 | target.innerHTML =
145 | "~ $" + (ramPriceEos * eosPriceUsd).toFixed(3) + " USD per KiB";
146 | }
147 |
148 | function parseStateBan(xDoc) {
149 | if (xDoc == null) return;
150 |
151 | var target = document.getElementById("net-price-eos");
152 | var netStaked = xDoc.total_resources.net_weight.substr(
153 | 0,
154 | xDoc.total_resources.net_weight.indexOf(" ")
155 | );
156 | var netAvailable = xDoc.net_limit.max / 1024; //~ convert bytes to kilobytes
157 | netPriceEos = (netStaked / netAvailable / 3).toFixed(8); //~ divide by 3 to get average per day from 3 day avg
158 | netPriceUsd = netPriceEos * eosPriceUsd;
159 | target.innerHTML = netPriceEos + " EOS/KiB/Day";
160 | target = document.getElementById("net-price-usd");
161 | target.innerHTML =
162 | "~ $" + (netPriceEos * eosPriceUsd).toFixed(3) + " USD/KiB/Day";
163 |
164 | target = document.getElementById("cpu-price-eos");
165 | var cpuStaked = xDoc.total_resources.cpu_weight.substr(
166 | 0,
167 | xDoc.total_resources.cpu_weight.indexOf(" ")
168 | );
169 | var cpuAvailable = xDoc.cpu_limit.max / 1000; // convert microseconds to milliseconds
170 | cpuPriceEos = (cpuStaked / cpuAvailable / 3).toFixed(8); //~ divide by 3 to get average per day from 3 day avg
171 | cpuPriceUsd = cpuPriceEos * eosPriceUsd;
172 | target.innerHTML = cpuPriceEos + " EOS/ms/Day";
173 | target = document.getElementById("cpu-price-usd");
174 | target.innerHTML =
175 | "~ $" + (cpuPriceEos * eosPriceUsd).toFixed(3) + " USD/ms/Day";
176 | }
177 | /* --- End of EOS data routines --- */
178 |
179 | function eborLoadIsotope() {
180 | var $container = jQuery("#container"),
181 | $optionContainer = jQuery("#options"),
182 | $options = $optionContainer.find('a[href^="#"]').not('a[href="#"]'),
183 | isOptionLinkClicked = false;
184 |
185 | $container.isotope({
186 | itemSelector: ".element",
187 | resizable: false,
188 | filter: "*",
189 | transitionDuration: "0.5s",
190 | layoutMode: "packery"
191 | });
192 |
193 | if (jQuery("body").hasClass("video-detail"))
194 | $container.isotope({
195 | transformsEnabled: false
196 | });
197 |
198 | jQuery(window).smartresize(function() {
199 | $container.isotope("layout");
200 | });
201 |
202 | $options.on("click", function() {
203 | var $this = jQuery(this),
204 | href = $this.attr("href");
205 |
206 | if ($this.hasClass("selected")) {
207 | return;
208 | } else {
209 | $options.removeClass("selected");
210 | $this.addClass("selected");
211 | }
212 |
213 | jQuery.bbq.pushState("#" + href);
214 | isOptionLinkClicked = true;
215 | updateEosData(); //~ Update all prices
216 | return false;
217 | });
218 |
219 | jQuery(window)
220 | .on("hashchange", function() {
221 | var theFilter = window.location.hash.replace(/^#/, "");
222 |
223 | if (theFilter == false) theFilter = "home";
224 |
225 | $container.isotope({
226 | filter: "." + theFilter
227 | });
228 |
229 | if (isOptionLinkClicked == false) {
230 | $options.removeClass("selected");
231 | $optionContainer
232 | .find('a[href="#' + theFilter + '"]')
233 | .addClass("selected");
234 | }
235 |
236 | isOptionLinkClicked = false;
237 | })
238 | .trigger("hashchange");
239 | }
240 | eborLoadIsotope();
241 | updateEosData(); //~ Update EOS data on page load
242 | jQuery(window)
243 | .trigger("resize")
244 | .trigger("smartresize");
245 | });
246 |
247 | $(".splink").on("click", function() {
248 | "use strict";
249 | $("html, body").animate({ scrollTop: 0 }, 1000);
250 | });
251 |
252 | $(function() {
253 | $(".calc-change").on("change keydown paste input", function(e) {
254 | var elem = $(this);
255 | var target;
256 | var unitTarget;
257 | var unitTargetValue;
258 | var value;
259 | var currencyTarget;
260 | var currencyValue;
261 | var priceValue;
262 | var roundingUnits;
263 |
264 | //~ Main switch to handle changes to the forms
265 | switch (elem.attr("id")) {
266 | case "eos-afford-ram":
267 | case "ram-afford-unit":
268 | case "ram-have-unit":
269 | unitTarget = document.getElementById("ram-afford-unit");
270 | unitTargetValue = unitTarget.options[unitTarget.selectedIndex].text;
271 | currencyTarget = document.getElementById("ram-have-unit");
272 | currencyValue =
273 | currencyTarget.options[currencyTarget.selectedIndex].text;
274 |
275 | if (currencyValue == "USD") {
276 | priceValue = ramPriceUsd;
277 | }
278 | if (currencyValue == "EOS") {
279 | priceValue = ramPriceEos;
280 | }
281 | value = document.getElementById("eos-afford-ram").value;
282 | switch (unitTargetValue) {
283 | case "bytes":
284 | if (currencyValue == "USD") {
285 | value = (value / ramPriceUsd) * 1024;
286 | break;
287 | }
288 | if (currencyValue == "EOS") {
289 | value = (value / ramPriceEos) * 1024;
290 | break;
291 | }
292 | case "KiB":
293 | if (currencyValue == "USD") {
294 | value = value / ramPriceUsd;
295 | break;
296 | }
297 | if (currencyValue == "EOS") {
298 | value = value / ramPriceEos;
299 | break;
300 | }
301 | break;
302 | case "MiB":
303 | if (currencyValue == "USD") {
304 | value = value / ramPriceUsd / 1024;
305 | break;
306 | }
307 | if (currencyValue == "EOS") {
308 | value = value / ramPriceEos / 1024;
309 | break;
310 | }
311 | break;
312 | case "GiB":
313 | if (currencyValue == "USD") {
314 | value = value / ramPriceUsd / 1024 / 1024;
315 | break;
316 | }
317 | if (currencyValue == "EOS") {
318 | value = value / ramPriceEos / 1024 / 1024;
319 | break;
320 | }
321 | break;
322 | }
323 | target = document.getElementById("result-afford-ram");
324 | target.innerHTML = value.toFixed(4);
325 | break;
326 |
327 | case "eos-afford-net":
328 | case "net-afford-unit":
329 | case "net-have-unit":
330 | unitTarget = document.getElementById("net-afford-unit");
331 | unitTargetValue = unitTarget.options[unitTarget.selectedIndex].text;
332 | currencyTarget = document.getElementById("net-have-unit");
333 | currencyValue =
334 | currencyTarget.options[currencyTarget.selectedIndex].text;
335 |
336 | if (currencyValue == "USD") {
337 | priceValue = netPriceUsd;
338 | }
339 | if (currencyValue == "EOS") {
340 | priceValue = netPriceEos;
341 | }
342 | value = document.getElementById("eos-afford-net").value;
343 | switch (unitTargetValue) {
344 | case "bytes / day":
345 | if (currencyValue == "USD") {
346 | value = (value / netPriceUsd) * 1024;
347 | break;
348 | }
349 | if (currencyValue == "EOS") {
350 | value = (value / netPriceEos) * 1024;
351 | break;
352 | }
353 | case "KiB / day":
354 | if (currencyValue == "USD") {
355 | value = value / netPriceUsd;
356 | break;
357 | }
358 | if (currencyValue == "EOS") {
359 | value = value / netPriceEos;
360 | break;
361 | }
362 | break;
363 | case "MiB / day":
364 | if (currencyValue == "USD") {
365 | value = value / netPriceUsd / 1024;
366 | break;
367 | }
368 | if (currencyValue == "EOS") {
369 | value = value / netPriceEos / 1024;
370 | break;
371 | }
372 | break;
373 | case "GiB / day":
374 | if (currencyValue == "USD") {
375 | value = value / netPriceUsd / 1024 / 1024;
376 | break;
377 | }
378 | if (currencyValue == "EOS") {
379 | value = value / netPriceEos / 1024 / 1024;
380 | break;
381 | }
382 | break;
383 | }
384 | target = document.getElementById("result-afford-net");
385 | target.innerHTML = value.toFixed(4);
386 | break;
387 |
388 | case "eos-afford-cpu":
389 | case "cpu-afford-unit":
390 | case "cpu-have-unit":
391 | unitTarget = document.getElementById("cpu-afford-unit");
392 | unitTargetValue = unitTarget.options[unitTarget.selectedIndex].text;
393 | currencyTarget = document.getElementById("cpu-have-unit");
394 | currencyValue =
395 | currencyTarget.options[currencyTarget.selectedIndex].text;
396 |
397 | if (currencyValue == "USD") {
398 | priceValue = cpuPriceUsd;
399 | }
400 | if (currencyValue == "EOS") {
401 | priceValue = cpuPriceEos;
402 | }
403 | value = document.getElementById("eos-afford-cpu").value;
404 | switch (unitTargetValue) {
405 | case "µs / day":
406 | if (currencyValue == "USD") {
407 | value = (value / cpuPriceUsd) * 1000;
408 | break;
409 | }
410 | if (currencyValue == "EOS") {
411 | value = (value / cpuPriceEos) * 1000;
412 | break;
413 | }
414 | case "ms / day":
415 | if (currencyValue == "USD") {
416 | value = value / cpuPriceUsd;
417 | break;
418 | }
419 | if (currencyValue == "EOS") {
420 | value = value / cpuPriceEos;
421 | break;
422 | }
423 | break;
424 | case "s / day":
425 | if (currencyValue == "USD") {
426 | value = value / cpuPriceUsd / 1000;
427 | break;
428 | }
429 | if (currencyValue == "EOS") {
430 | value = value / cpuPriceEos / 1000;
431 | break;
432 | }
433 | break;
434 | }
435 | target = document.getElementById("result-afford-cpu");
436 | target.innerHTML = value.toFixed(4);
437 | break;
438 |
439 | case "eos-cost-ram":
440 | case "ram-need-unit":
441 | case "ram-cost-unit":
442 | unitTarget = document.getElementById("ram-need-unit");
443 | unitTargetValue = unitTarget.options[unitTarget.selectedIndex].text;
444 | currencyTarget = document.getElementById("ram-cost-unit");
445 | currencyValue =
446 | currencyTarget.options[currencyTarget.selectedIndex].text;
447 | if (currencyValue == "USD") {
448 | priceValue = ramPriceUsd;
449 | roundingUnits = 3;
450 | }
451 | if (currencyValue == "EOS") {
452 | priceValue = ramPriceEos;
453 | roundingUnits = 8;
454 | }
455 | value = document.getElementById("eos-cost-ram").value;
456 | switch (unitTargetValue) {
457 | case "bytes":
458 | if (currencyValue == "USD") {
459 | value = (value * ramPriceUsd) / 1024;
460 | break;
461 | }
462 | if (currencyValue == "EOS") {
463 | value = (value * ramPriceEos) / 1024;
464 | break;
465 | }
466 | case "KiB":
467 | if (currencyValue == "USD") {
468 | value = value * ramPriceUsd;
469 | break;
470 | }
471 | if (currencyValue == "EOS") {
472 | value = value * ramPriceEos;
473 | break;
474 | }
475 | break;
476 | case "MiB":
477 | if (currencyValue == "USD") {
478 | value = value * ramPriceUsd * 1024;
479 | break;
480 | }
481 | if (currencyValue == "EOS") {
482 | value = value * ramPriceEos * 1024;
483 | break;
484 | }
485 | break;
486 | case "GiB":
487 | if (currencyValue == "USD") {
488 | value = value * ramPriceUsd * 1024 * 1024;
489 | break;
490 | }
491 | if (currencyValue == "EOS") {
492 | value = value * ramPriceEos * 1024 * 1024;
493 | break;
494 | }
495 | break;
496 | }
497 |
498 | target = document.getElementById("result-cost-ram");
499 | target.innerHTML = value.toFixed(roundingUnits);
500 | break;
501 |
502 | case "eos-cost-net":
503 | case "net-need-unit":
504 | case "net-cost-unit":
505 | unitTarget = document.getElementById("net-need-unit");
506 | unitTargetValue = unitTarget.options[unitTarget.selectedIndex].text;
507 | currencyTarget = document.getElementById("net-cost-unit");
508 | currencyValue =
509 | currencyTarget.options[currencyTarget.selectedIndex].text;
510 | if (currencyValue == "USD") {
511 | priceValue = netPriceUsd;
512 | roundingUnits = 3;
513 | }
514 | if (currencyValue == "EOS") {
515 | priceValue = netPriceEos;
516 | roundingUnits = 8;
517 | }
518 | value = document.getElementById("eos-cost-net").value;
519 | switch (unitTargetValue) {
520 | case "bytes / day":
521 | if (currencyValue == "USD") {
522 | value = (value * netPriceUsd) / 1024;
523 | break;
524 | }
525 | if (currencyValue == "EOS") {
526 | value = (value * netPriceEos) / 1024;
527 | break;
528 | }
529 | case "KiB / day":
530 | if (currencyValue == "USD") {
531 | value = value * netPriceUsd;
532 | break;
533 | }
534 | if (currencyValue == "EOS") {
535 | value = value * netPriceEos;
536 | break;
537 | }
538 | break;
539 | case "MiB / day":
540 | if (currencyValue == "USD") {
541 | value = value * netPriceUsd * 1024;
542 | break;
543 | }
544 | if (currencyValue == "EOS") {
545 | value = value * netPriceEos * 1024;
546 | break;
547 | }
548 | break;
549 | case "GiB / day":
550 | if (currencyValue == "USD") {
551 | value = value * netPriceUsd * 1024 * 1024;
552 | break;
553 | }
554 | if (currencyValue == "EOS") {
555 | value = value * netPriceEos * 1024 * 1024;
556 | break;
557 | }
558 | break;
559 | }
560 |
561 | target = document.getElementById("result-cost-net");
562 | target.innerHTML = value.toFixed(roundingUnits);
563 | break;
564 |
565 | case "eos-cost-cpu":
566 | case "cpu-need-unit":
567 | case "cpu-cost-unit":
568 | unitTarget = document.getElementById("cpu-need-unit");
569 | unitTargetValue = unitTarget.options[unitTarget.selectedIndex].text;
570 | currencyTarget = document.getElementById("cpu-cost-unit");
571 | currencyValue =
572 | currencyTarget.options[currencyTarget.selectedIndex].text;
573 | if (currencyValue == "USD") {
574 | priceValue = cpuPriceUsd;
575 | roundingUnits = 3;
576 | }
577 | if (currencyValue == "EOS") {
578 | priceValue = cpuPriceEos;
579 | roundingUnits = 8;
580 | }
581 | value = document.getElementById("eos-cost-cpu").value;
582 | switch (unitTargetValue) {
583 | case "µs / day":
584 | if (currencyValue == "USD") {
585 | value = (value * cpuPriceUsd) / 1000;
586 | break;
587 | }
588 | if (currencyValue == "EOS") {
589 | value = (value * cpuPriceEos) / 1000;
590 | break;
591 | }
592 | case "ms / day":
593 | if (currencyValue == "USD") {
594 | value = value * cpuPriceUsd;
595 | break;
596 | }
597 | if (currencyValue == "EOS") {
598 | value = value * cpuPriceEos;
599 | break;
600 | }
601 | break;
602 | case "s / day":
603 | if (currencyValue == "USD") {
604 | value = value * cpuPriceUsd * 1000;
605 | break;
606 | }
607 | if (currencyValue == "EOS") {
608 | value = value * cpuPriceEos * 1000;
609 | break;
610 | }
611 | break;
612 | }
613 |
614 | target = document.getElementById("result-cost-cpu");
615 | target.innerHTML = value.toFixed(roundingUnits);
616 | break;
617 | }
618 | });
619 | });
620 |
--------------------------------------------------------------------------------
/frontend/js/jquery.fancybox.pack.js:
--------------------------------------------------------------------------------
1 | (function(C,z,f,r){var q=f(C),n=f(z),b=f.fancybox=function(){b.open.apply(this,arguments)},H=navigator.userAgent.match(/msie/i),w=null,s=z.createTouch!==r,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},p=function(a){return a&&"string"===f.type(a)},F=function(a){return p(a)&&0',image:' ',iframe:'",error:'The requested content cannot be loaded. Please try again later.
',closeBtn:' ',next:' ',prev:' '},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
5 | openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
6 | isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("data-title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
7 | c.metadata())):k=c);g=d.href||k.href||(p(c)?c:null);h=d.title!==r?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));p(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":p(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(p(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
8 | k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==r&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
9 | b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
10 | setTimeout(b.next,b.current.playSpeed))},c=function(){d();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==r&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},
12 | e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(w),w=null);b.isOpen&&!w&&(w=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),w=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),
13 | b.trigger("onUpdate")),b.update())},hideLoading:function(){n.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('').click(b.cancel).appendTo("body");n.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||
14 | !1,d={x:q.scrollLeft(),y:q.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&C.innerWidth?C.innerWidth:q.width(),d.h=s&&C.innerHeight?C.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&n.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=
15 | e.target||e.srcElement;if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,
17 | e){e&&(b.helpers[d]&&f.isFunction(b.helpers[d][a]))&&(e=f.extend(!0,{},b.helpers[d].defaults,e),b.helpers[d][a](e,c))});f.event.trigger(a+".fb")}},isImage:function(a){return p(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(a){return p(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&
18 | (d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=
19 | !0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady");
20 | if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=
21 | this.width;b.coming.height=this.height;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,
22 | (new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=
23 | b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();
24 | e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",
25 | !1)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='
',h="",f.each(a.swf,function(a,b){e+=' ';h+=" "+a+'="'+b+'"'}),e+='"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");
26 | a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,
27 | v=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,p=l(y[1]+y[3]),r=l(y[0]+y[2]),z,A,t,D,B,G,C,E,w;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=l(k.outerWidth(!0)-k.width());z=l(k.outerHeight(!0)-k.height());A=p+y;t=r+z;D=F(c)?(a.w-A)*l(c)/100:c;B=F(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(w=h.content,h.autoHeight&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(g.width(D).height(9999),G=w.contents().find("body"),q&&G.css("overflow-x",
28 | "hidden"),B=G.height())}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=l(D);j=l(B);E=D/B;m=l(F(m)?l(m,"w")-A:m);n=l(F(n)?l(n,"w")-A:n);u=l(F(u)?l(u,"h")-t:u);v=l(F(v)?l(v,"h")-t:v);G=n;C=v;h.fitToView&&(n=Math.min(a.w-A,n),v=Math.min(a.h-t,v));A=a.w-p;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/E)),j>v&&(j=v,c=l(j*E)),c
A||p>r)&&(c>m&&j>u)&&!(19n&&(c=n,j=l(c/E)),g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height();else c=Math.max(m,Math.min(c,c-(a-A))),j=Math.max(u,Math.min(j,j-(p-r)));q&&("auto"===s&&jA||p>r)&&c>m&&j>u;c=h.aspectRatio?cu&&j ').appendTo("body");
38 | this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){f(a.target).hasClass("fancybox-overlay")&&(b.isActive?b.close():d.close())});this.overlay.css(a.css).show()},
39 | close:function(){f(".fancybox-overlay").remove();q.unbind("resize.overlay");this.overlay=null;!1!==this.margin&&(f("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var a="100%",b;this.overlay.width(a).height("100%");H?(b=Math.max(z.documentElement.offsetWidth,z.body.offsetWidth),n.width()>b&&(a=n.width())):n.width()>q.width()&&(a=n.width());this.overlay.width(a).height(n.height())},onReady:function(a,b){f(".fancybox-overlay").stop(!0,
40 | !0);this.overlay||(this.margin=n.height()>q.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,this.el=z.all&&!z.querySelector?f("html"):f("body"),this.create(a));a.locked&&this.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",l(this.margin)+b.scrollbarWidth));this.open(a)},onUpdate:function(){this.fixed||
41 | this.update()},afterClose:function(a){this.overlay&&!b.isActive&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(p(e)&&""!==f.trim(e)){d=f(''+e+"
");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),
42 | H&&d.width(d.width()),d.wrapInner(' '),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+
43 | '"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):n.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};n.ready(function(){f.scrollbarWidth===r&&(f.scrollbarWidth=function(){var a=f('').appendTo("body"),b=a.children(),
44 | b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===r){var a=f.support,d=f('
').appendTo("body"),e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery);
45 |
46 |
47 | jQuery(document).ready(function() {
48 |
49 | "use strict";
50 |
51 | // initiate fancybox for images
52 | jQuery("a.popup, a[rel=group]").fancybox({
53 | closeClick : true,
54 | helpers : {
55 | overlay : {
56 | locked : false
57 | }
58 | },
59 | afterShow: function() {
60 | $('.fancybox-wrap').swipe({
61 | swipe : function(event, direction) {
62 | if (direction === 'left' || direction === 'up') {
63 | $.fancybox.prev( direction );
64 | } else {
65 | $.fancybox.next( direction );
66 | }
67 | }
68 | });
69 | }
70 | });
71 |
72 |
73 | // initiate fancybox for videos
74 | jQuery(".video-popup").fancybox({
75 | 'width' : '80%',
76 | 'height' : '75%',
77 | 'autoScale' : true,
78 | 'type' : 'iframe',
79 | closeClick : true,
80 | helpers : {
81 | overlay : {
82 | locked : false
83 | }
84 | }
85 | });
86 |
87 | });
--------------------------------------------------------------------------------