mirror of
https://gitlab.com/commento/commento.git
synced 2026-11-01 01:16:21 -05:00
frontend: use gulp, eslint, code refactor
Apologies in advance for the insanely huge commit. This commit is primarily based on Anton Linevych's amazing work found here [1]. While he had gone through the pains of making small, atomic changes to each file, I had put off reviewing the PR for a long time. By the time I finally got around to it, the project had changed so much that it didn't make sense to keep the commits the same way. So I've cherry-picked most of his commits, with some changes here and there, and I've squashed them into one commit. [1] https://gitlab.com/linevych/commento-ce/tree/feature/frontend_building_improvements
This commit is contained in:
1 parent
e4f71fe402
commit
9e3935b3b2
30 files changed
+5059
-395
No files matched your search
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true
|
||||
},
|
||||
"globals": {
|
||||
"$": true
|
||||
},
|
||||
"rules": {
|
||||
"no-bitwise": 2,
|
||||
"camelcase": 2,
|
||||
"brace-style": ["error", "1tbs"],
|
||||
"curly": ["error", "all"],
|
||||
"eqeqeq": ["error", "smart"],
|
||||
"indent": ["error", 2],
|
||||
"no-use-before-define": [
|
||||
2,
|
||||
{
|
||||
"functions": false
|
||||
}
|
||||
],
|
||||
"new-cap": 2,
|
||||
"no-caller": 2,
|
||||
"quotes": [
|
||||
2,
|
||||
"double"
|
||||
],
|
||||
"no-unused-vars": 2,
|
||||
"strict": [
|
||||
2,
|
||||
"function"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
.sass-cache
|
||||
node_modules/
|
||||
+7
-111
@@ -1,117 +1,13 @@
|
||||
SHELL = bash
|
||||
|
||||
# list of JS files to be built
|
||||
JS_BUILD = jquery.js vue.js highlight.js chartist.js login.js forgot.js reset.js signup.js dashboard.js logout.js commento.js
|
||||
|
||||
jquery.js = jquery.js
|
||||
vue.js = vue.js
|
||||
highlight.js = highlight.js
|
||||
chartist.js = chartist.js
|
||||
login.js = utils.js http.js auth-common.js login.js
|
||||
forgot.js = utils.js http.js forgot.js
|
||||
reset.js = utils.js http.js reset.js
|
||||
signup.js = utils.js http.js auth-common.js signup.js
|
||||
dashboard.js = utils.js http.js errors.js self.js dashboard.js dashboard-setting.js dashboard-domain.js dashboard-installation.js dashboard-general.js dashboard-moderation.js dashboard-statistics.js dashboard-import.js dashboard-danger.js
|
||||
logout.js = utils.js logout.js
|
||||
commento.js = commento.js
|
||||
|
||||
# for each file in $(JS_BUILD), list its composition
|
||||
|
||||
BUILD_DIR = build
|
||||
DEVEL_BUILD_DIR = $(BUILD_DIR)/devel
|
||||
PROD_BUILD_DIR = $(BUILD_DIR)/prod
|
||||
GULP = node_modules/.bin/gulp
|
||||
|
||||
HTML_SRC_DIR = .
|
||||
HTML_SRC_FILES = $(wildcard $(HTML_SRC_DIR)/*.html)
|
||||
HTML_DEVEL_BUILD_DIR = $(DEVEL_BUILD_DIR)
|
||||
HTML_DEVEL_BUILD_FILES = $(patsubst $(HTML_SRC_DIR)/%, $(HTML_DEVEL_BUILD_DIR)/%, $(HTML_SRC_FILES))
|
||||
HTML_PROD_BUILD_DIR = $(PROD_BUILD_DIR)
|
||||
HTML_PROD_BUILD_FILES = $(patsubst $(HTML_SRC_DIR)/%, $(HTML_PROD_BUILD_DIR)/%, $(HTML_SRC_FILES))
|
||||
devel:
|
||||
yarn install
|
||||
$(GULP) devel
|
||||
|
||||
HTML_MINIFIER = html-minifier
|
||||
HTML_MINIFIER_FLAGS = --collapse-whitespace --remove-comments
|
||||
|
||||
JS_SRC_DIR = js
|
||||
JS_SRC_FILES = $(wildcard $(JS_SRC_DIR)/*.js)
|
||||
JS_DEVEL_BUILD_DIR = $(DEVEL_BUILD_DIR)/js
|
||||
JS_DEVEL_BUILD_FILES = $(addprefix $(JS_DEVEL_BUILD_DIR)/, $(JS_BUILD))
|
||||
JS_PROD_BUILD_DIR = $(PROD_BUILD_DIR)/js
|
||||
JS_PROD_BUILD_FILES = $(addprefix $(JS_PROD_BUILD_DIR)/, $(JS_BUILD))
|
||||
|
||||
JS_MINIFIER = uglifyjs
|
||||
JS_MINIFIER_FLAGS = --compress --mangle
|
||||
|
||||
SASS_SRC_DIR = sass
|
||||
SASS_SRC_FILES = $(wildcard $(SASS_SRC_DIR)/*.scss)
|
||||
CSS_DEVEL_BUILD_DIR = $(DEVEL_BUILD_DIR)/css
|
||||
CSS_DEVEL_BUILD_FILES = $(patsubst $(SASS_SRC_DIR)/%.scss, $(CSS_DEVEL_BUILD_DIR)/%.css, $(SASS_SRC_FILES))
|
||||
CSS_PROD_BUILD_DIR = $(PROD_BUILD_DIR)/css
|
||||
CSS_PROD_BUILD_FILES = $(patsubst $(SASS_SRC_DIR)/%.scss, $(CSS_PROD_BUILD_DIR)/%.css, $(SASS_SRC_FILES))
|
||||
|
||||
CSS = sass
|
||||
CSS_DEVEL_FLAGS =
|
||||
CSS_PROD_FLAGS = $(CSS_DEVEL_FLAGS) --style compressed
|
||||
|
||||
IMGS_SRC_DIR = images
|
||||
IMGS_SRC_FILES = $(wildcard $(IMGS_SRC_DIR)/*)
|
||||
IMGS_DEVEL_BUILD_DIR = $(DEVEL_BUILD_DIR)/images
|
||||
IMGS_DEVEL_BUILD_FILES = $(patsubst $(IMGS_SRC_DIR)/%, $(IMGS_DEVEL_BUILD_DIR)/%, $(IMGS_SRC_FILES))
|
||||
IMGS_PROD_BUILD_DIR = $(PROD_BUILD_DIR)/images
|
||||
IMGS_PROD_BUILD_FILES = $(patsubst $(IMGS_SRC_DIR)/%, $(IMGS_PROD_BUILD_DIR)/%, $(IMGS_SRC_FILES))
|
||||
|
||||
devel: devel-html devel-js devel-css devel-imgs
|
||||
|
||||
prod: devel prod-html prod-js prod-css prod-imgs
|
||||
prod:
|
||||
yarn install
|
||||
$(GULP) prod
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILD_DIR);
|
||||
|
||||
devel-html: $(HTML_DEVEL_BUILD_FILES)
|
||||
|
||||
$(HTML_DEVEL_BUILD_FILES): $(HTML_DEVEL_BUILD_DIR)/%.html: $(HTML_SRC_DIR)/%.html
|
||||
cp $^ $@;
|
||||
|
||||
prod-html: $(HTML_PROD_BUILD_FILES)
|
||||
|
||||
$(HTML_PROD_BUILD_FILES): $(HTML_PROD_BUILD_DIR)/%.html: $(HTML_DEVEL_BUILD_DIR)/%.html
|
||||
$(HTML_MINIFIER) $(HTML_MINIFIER_FLAGS) -o $@ $^;
|
||||
|
||||
devel-js: $(JS_DEVEL_BUILD_FILES)
|
||||
|
||||
.SECONDEXPANSION:
|
||||
$(JS_DEVEL_BUILD_FILES): $(JS_DEVEL_BUILD_DIR)/%.js: $$(addprefix $$(JS_SRC_DIR)/, $$(%.js))
|
||||
>$@; \
|
||||
for f in $^; do \
|
||||
printf "// %s\n" "$$f" >>$@; \
|
||||
cat $$f >>$@; \
|
||||
printf "\n" >>$@; \
|
||||
done;
|
||||
|
||||
prod-js: $(JS_PROD_BUILD_FILES)
|
||||
|
||||
$(JS_PROD_BUILD_FILES): $(JS_PROD_BUILD_DIR)/%.js: $(JS_DEVEL_BUILD_DIR)/%.js
|
||||
$(JS_MINIFIER) $(JS_MINIFIER_FLAGS) -o $@ $^;
|
||||
|
||||
devel-css: $(CSS_DEVEL_BUILD_FILES)
|
||||
|
||||
$(CSS_DEVEL_BUILD_FILES): $(CSS_DEVEL_BUILD_DIR)/%.css: $(SASS_SRC_DIR)/%.scss $(SASS_SRC_FILES)
|
||||
$(CSS) $(CSS_DEVEL_FLAGS) $< $@;
|
||||
|
||||
prod-css: $(CSS_PROD_BUILD_FILES)
|
||||
|
||||
$(CSS_PROD_BUILD_FILES): $(CSS_PROD_BUILD_DIR)/%.css: $(SASS_SRC_DIR)/%.scss
|
||||
$(CSS) $(CSS_PROD_FLAGS) $^ $@;
|
||||
|
||||
$(shell mkdir -p $(HTML_DEVEL_BUILD_DIR) $(JS_DEVEL_BUILD_DIR) $(CSS_DEVEL_BUILD_DIR) $(HTML_PROD_BUILD_DIR) $(JS_PROD_BUILD_DIR) $(CSS_PROD_BUILD_DIR))
|
||||
|
||||
devel-imgs: $(IMGS_DEVEL_BUILD_FILES)
|
||||
|
||||
$(IMGS_DEVEL_BUILD_FILES): $(IMGS_DEVEL_BUILD_DIR)/%: $(IMGS_SRC_DIR)/%
|
||||
cp $^ $@;
|
||||
|
||||
prod-imgs: $(IMGS_PROD_BUILD_FILES)
|
||||
|
||||
$(IMGS_PROD_BUILD_FILES): $(IMGS_PROD_BUILD_DIR)/%: $(IMGS_SRC_DIR)/%
|
||||
cp $^ $@
|
||||
|
||||
$(shell mkdir -p $(HTML_DEVEL_BUILD_DIR) $(JS_DEVEL_BUILD_DIR) $(CSS_DEVEL_BUILD_DIR) $(IMGS_DEVEL_BUILD_DIR) $(HTML_PROD_BUILD_DIR) $(JS_PROD_BUILD_DIR) $(CSS_PROD_BUILD_DIR) $(IMGS_PROD_BUILD_DIR))
|
||||
@@ -0,0 +1,134 @@
|
||||
"use strict";
|
||||
|
||||
const gulp = require("gulp");
|
||||
const sass = require("gulp-sass");
|
||||
const sourcemaps = require("gulp-sourcemaps");
|
||||
const cleanCss = require("gulp-clean-css");
|
||||
const htmlMinifier = require("gulp-html-minifier");
|
||||
const uglify = require("gulp-uglify");
|
||||
const concat = require("gulp-concat");
|
||||
const rename = require("gulp-rename");
|
||||
const eslint = require("gulp-eslint");
|
||||
|
||||
const develPath = "build/devel/";
|
||||
const prodPath = "build/prod/";
|
||||
const scssSrc = "./sass/*.scss";
|
||||
const cssDir = "css/";
|
||||
const imagesDir = "images/";
|
||||
const imagesGlob = imagesDir + "**/*";
|
||||
const jsDir = "js/";
|
||||
const jsGlob = jsDir + "*.js";
|
||||
const htmlGlob = "./*.html";
|
||||
|
||||
const jsCompileMap = {
|
||||
"js/jquery.js": ["node_modules/jquery/dist/jquery.min.js"],
|
||||
"js/vue.js": ["node_modules/vue/dist/vue.min.js"],
|
||||
"js/highlight.js": ["node_modules/highlightjs/highlight.pack.min.js"],
|
||||
"js/chartist.js": ["node_modules/chartist/dist/chartist.min.js"],
|
||||
"js/login.js": [
|
||||
"js/utils.js",
|
||||
"js/http.js",
|
||||
"js/auth-common.js",
|
||||
"js/login.js"
|
||||
],
|
||||
"js/forgot.js": [
|
||||
"js/utils.js",
|
||||
"js/http.js",
|
||||
"js/forgot.js"
|
||||
],
|
||||
"js/reset.js": [
|
||||
"js/js/utils.js",
|
||||
"js/http.js",
|
||||
"js/reset.js"
|
||||
],
|
||||
"js/signup.js": [
|
||||
"js/utils.js",
|
||||
"js/http.js",
|
||||
"js/auth-common.js",
|
||||
"js/signup.js"
|
||||
],
|
||||
"js/dashboard.js": [
|
||||
"js/utils.js",
|
||||
"js/http.js",
|
||||
"js/errors.js",
|
||||
"js/self.js",
|
||||
"js/dashboard.js",
|
||||
"js/dashboard-setting.js",
|
||||
"js/dashboard-domain.js",
|
||||
"js/dashboard-installation.js",
|
||||
"js/dashboard-general.js",
|
||||
"js/dashboard-moderation.js",
|
||||
"js/dashboard-statistics.js",
|
||||
"js/dashboard-import.js",
|
||||
"js/dashboard-danger.js",
|
||||
],
|
||||
"js/logout.js": [
|
||||
"js/utils.js",
|
||||
"js/logout.js"
|
||||
],
|
||||
"js/commento.js": ["js/commento.js"],
|
||||
};
|
||||
|
||||
gulp.task("scss-devel", function () {
|
||||
return gulp.src(scssSrc)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(sass({outputStyle: "expanded"}).on("error", sass.logError))
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(develPath + cssDir));
|
||||
});
|
||||
|
||||
gulp.task("scss-prod", function () {
|
||||
return gulp.src(scssSrc)
|
||||
.pipe(sass({outputStyle: "compressed"}).on("error", sass.logError))
|
||||
.pipe(cleanCss({compatibility: "ie8", level: 2}))
|
||||
.pipe(gulp.dest(prodPath + cssDir));
|
||||
});
|
||||
|
||||
gulp.task("html-devel", function () {
|
||||
gulp.src([htmlGlob]).pipe(gulp.dest(develPath));
|
||||
});
|
||||
|
||||
gulp.task("html-prod", function () {
|
||||
gulp.src(htmlGlob)
|
||||
.pipe(htmlMinifier({collapseWhitespace: true, removeComments: true}))
|
||||
.pipe(gulp.dest(prodPath))
|
||||
});
|
||||
|
||||
gulp.task("images-devel", function () {
|
||||
gulp.src([imagesGlob]).pipe(gulp.dest(develPath + imagesDir));
|
||||
});
|
||||
|
||||
gulp.task("images-prod", function () {
|
||||
gulp.src([imagesGlob]).pipe(gulp.dest(prodPath + imagesDir));
|
||||
});
|
||||
|
||||
gulp.task("js-devel", function () {
|
||||
for (let outputFile in jsCompileMap) {
|
||||
gulp.src(jsCompileMap[outputFile])
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(concat(outputFile))
|
||||
.pipe(rename(outputFile))
|
||||
.pipe(uglify())
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(develPath))
|
||||
}
|
||||
});
|
||||
|
||||
gulp.task("js-prod", function () {
|
||||
for (let outputFile in jsCompileMap) {
|
||||
gulp.src(jsCompileMap[outputFile])
|
||||
.pipe(concat(outputFile))
|
||||
.pipe(rename(outputFile))
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest(prodPath))
|
||||
}
|
||||
});
|
||||
|
||||
gulp.task("lint", function () {
|
||||
return gulp.src(jsGlob)
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.failAfterError())
|
||||
});
|
||||
|
||||
gulp.task("devel", ["scss-devel", "html-devel", "images-devel", "lint", "js-devel"]);
|
||||
gulp.task("prod", ["scss-prod", "html-prod", "images-prod", "lint", "js-prod"]);
|
||||
@@ -1,17 +1,19 @@
|
||||
(function (global, document) {
|
||||
"use strict"
|
||||
|
||||
// Redirect the user to the dashboard if there's a cookie. If the cookie is
|
||||
// invalid, they would be redirected back to the login page *after* the
|
||||
// cookie is deleted.
|
||||
global.loggedInRedirect = function() {
|
||||
if (global.cookieGet("commentoOwnerToken") !== undefined)
|
||||
if (global.cookieGet("commentoOwnerToken") !== undefined) {
|
||||
document.location = global.origin + "/dashboard";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Prefills the email field from the URL parameter.
|
||||
global.prefillEmail = function() {
|
||||
if (paramGet("email") != undefined) {
|
||||
if (paramGet("email") !== undefined) {
|
||||
$("#email").val(paramGet("email"));
|
||||
$("#password").click();
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
/* Chartist.js 0.11.0
|
||||
* Copyright © 2017 Gion Kunz
|
||||
* Free to use under either the WTFPL license or the MIT license.
|
||||
* https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL
|
||||
* https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT
|
||||
*/
|
||||
|
||||
!function(a,b){"function"==typeof define&&define.amd?define("Chartist",[],function(){return a.Chartist=b()}):"object"==typeof module&&module.exports?module.exports=b():a.Chartist=b()}(this,function(){var a={version:"0.11.0"};return function(a,b,c){"use strict";c.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},c.noop=function(a){return a},c.alphaNumerate=function(a){return String.fromCharCode(97+a%26)},c.extend=function(a){var b,d,e;for(a=a||{},b=1;b<arguments.length;b++){d=arguments[b];for(var f in d)e=d[f],"object"!=typeof e||null===e||e instanceof Array?a[f]=e:a[f]=c.extend(a[f],e)}return a},c.replaceAll=function(a,b,c){return a.replace(new RegExp(b,"g"),c)},c.ensureUnit=function(a,b){return"number"==typeof a&&(a+=b),a},c.quantity=function(a){if("string"==typeof a){var b=/^(\d+)\s*(.*)$/g.exec(a);return{value:+b[1],unit:b[2]||void 0}}return{value:a}},c.querySelector=function(a){return a instanceof Node?a:b.querySelector(a)},c.times=function(a){return Array.apply(null,new Array(a))},c.sum=function(a,b){return a+(b?b:0)},c.mapMultiply=function(a){return function(b){return b*a}},c.mapAdd=function(a){return function(b){return b+a}},c.serialMap=function(a,b){var d=[],e=Math.max.apply(null,a.map(function(a){return a.length}));return c.times(e).forEach(function(c,e){var f=a.map(function(a){return a[e]});d[e]=b.apply(null,f)}),d},c.roundWithPrecision=function(a,b){var d=Math.pow(10,b||c.precision);return Math.round(a*d)/d},c.precision=8,c.escapingMap={"&":"&","<":"<",">":">",'"':""","'":"'"},c.serialize=function(a){return null===a||void 0===a?a:("number"==typeof a?a=""+a:"object"==typeof a&&(a=JSON.stringify({data:a})),Object.keys(c.escapingMap).reduce(function(a,b){return c.replaceAll(a,b,c.escapingMap[b])},a))},c.deserialize=function(a){if("string"!=typeof a)return a;a=Object.keys(c.escapingMap).reduce(function(a,b){return c.replaceAll(a,c.escapingMap[b],b)},a);try{a=JSON.parse(a),a=void 0!==a.data?a.data:a}catch(b){}return a},c.createSvg=function(a,b,d,e){var f;return b=b||"100%",d=d||"100%",Array.prototype.slice.call(a.querySelectorAll("svg")).filter(function(a){return a.getAttributeNS(c.namespaces.xmlns,"ct")}).forEach(function(b){a.removeChild(b)}),f=new c.Svg("svg").attr({width:b,height:d}).addClass(e),f._node.style.width=b,f._node.style.height=d,a.appendChild(f._node),f},c.normalizeData=function(a,b,d){var e,f={raw:a,normalized:{}};return f.normalized.series=c.getDataArray({series:a.series||[]},b,d),e=f.normalized.series.every(function(a){return a instanceof Array})?Math.max.apply(null,f.normalized.series.map(function(a){return a.length})):f.normalized.series.length,f.normalized.labels=(a.labels||[]).slice(),Array.prototype.push.apply(f.normalized.labels,c.times(Math.max(0,e-f.normalized.labels.length)).map(function(){return""})),b&&c.reverseData(f.normalized),f},c.safeHasProperty=function(a,b){return null!==a&&"object"==typeof a&&a.hasOwnProperty(b)},c.isDataHoleValue=function(a){return null===a||void 0===a||"number"==typeof a&&isNaN(a)},c.reverseData=function(a){a.labels.reverse(),a.series.reverse();for(var b=0;b<a.series.length;b++)"object"==typeof a.series[b]&&void 0!==a.series[b].data?a.series[b].data.reverse():a.series[b]instanceof Array&&a.series[b].reverse()},c.getDataArray=function(a,b,d){function e(a){if(c.safeHasProperty(a,"value"))return e(a.value);if(c.safeHasProperty(a,"data"))return e(a.data);if(a instanceof Array)return a.map(e);if(!c.isDataHoleValue(a)){if(d){var b={};return"string"==typeof d?b[d]=c.getNumberOrUndefined(a):b.y=c.getNumberOrUndefined(a),b.x=a.hasOwnProperty("x")?c.getNumberOrUndefined(a.x):b.x,b.y=a.hasOwnProperty("y")?c.getNumberOrUndefined(a.y):b.y,b}return c.getNumberOrUndefined(a)}}return a.series.map(e)},c.normalizePadding=function(a,b){return b=b||0,"number"==typeof a?{top:a,right:a,bottom:a,left:a}:{top:"number"==typeof a.top?a.top:b,right:"number"==typeof a.right?a.right:b,bottom:"number"==typeof a.bottom?a.bottom:b,left:"number"==typeof a.left?a.left:b}},c.getMetaData=function(a,b){var c=a.data?a.data[b]:a[b];return c?c.meta:void 0},c.orderOfMagnitude=function(a){return Math.floor(Math.log(Math.abs(a))/Math.LN10)},c.projectLength=function(a,b,c){return b/c.range*a},c.getAvailableHeight=function(a,b){return Math.max((c.quantity(b.height).value||a.height())-(b.chartPadding.top+b.chartPadding.bottom)-b.axisX.offset,0)},c.getHighLow=function(a,b,d){function e(a){if(void 0!==a)if(a instanceof Array)for(var b=0;b<a.length;b++)e(a[b]);else{var c=d?+a[d]:+a;g&&c>f.high&&(f.high=c),h&&c<f.low&&(f.low=c)}}b=c.extend({},b,d?b["axis"+d.toUpperCase()]:{});var f={high:void 0===b.high?-Number.MAX_VALUE:+b.high,low:void 0===b.low?Number.MAX_VALUE:+b.low},g=void 0===b.high,h=void 0===b.low;return(g||h)&&e(a),(b.referenceValue||0===b.referenceValue)&&(f.high=Math.max(b.referenceValue,f.high),f.low=Math.min(Line truncated
|
||||
return Array.prototype.slice.call(arguments).map(function(a){return a}).reduce(function(a,b){return{x:a.x+(b&&b.x)||0,y:a.y+(b&&b.y)||0}},{x:0,y:0})});d=c.getHighLow([i],a,a.horizontalBars?"x":"y")}else d=c.getHighLow(b.normalized.series,a,a.horizontalBars?"x":"y");d.high=+a.high||(0===a.high?0:d.high),d.low=+a.low||(0===a.low?0:d.low);var j,k,l,m,n,o=c.createChartRect(this.svg,a,f.padding);k=a.distributeSeries&&a.stackBars?b.normalized.labels.slice(0,1):b.normalized.labels,a.horizontalBars?(j=m=void 0===a.axisX.type?new c.AutoScaleAxis(c.Axis.units.x,b.normalized.series,o,c.extend({},a.axisX,{highLow:d,referenceValue:0})):a.axisX.type.call(c,c.Axis.units.x,b.normalized.series,o,c.extend({},a.axisX,{highLow:d,referenceValue:0})),l=n=void 0===a.axisY.type?new c.StepAxis(c.Axis.units.y,b.normalized.series,o,{ticks:k}):a.axisY.type.call(c,c.Axis.units.y,b.normalized.series,o,a.axisY)):(l=m=void 0===a.axisX.type?new c.StepAxis(c.Axis.units.x,b.normalized.series,o,{ticks:k}):a.axisX.type.call(c,c.Axis.units.x,b.normalized.series,o,a.axisX),j=n=void 0===a.axisY.type?new c.AutoScaleAxis(c.Axis.units.y,b.normalized.series,o,c.extend({},a.axisY,{highLow:d,referenceValue:0})):a.axisY.type.call(c,c.Axis.units.y,b.normalized.series,o,c.extend({},a.axisY,{highLow:d,referenceValue:0})));var p=a.horizontalBars?o.x1+j.projectValue(0):o.y1-j.projectValue(0),q=[];l.createGridAndLabels(e,h,this.supportsForeignObject,a,this.eventEmitter),j.createGridAndLabels(e,h,this.supportsForeignObject,a,this.eventEmitter),a.showGridBackground&&c.createGridBackground(e,o,a.classNames.gridBackground,this.eventEmitter),b.raw.series.forEach(function(d,e){var f,h,i=e-(b.raw.series.length-1)/2;f=a.distributeSeries&&!a.stackBars?l.axisLength/b.normalized.series.length/2:a.distributeSeries&&a.stackBars?l.axisLength/2:l.axisLength/b.normalized.series[e].length/2,h=g.elem("g"),h.attr({"ct:series-name":d.name,"ct:meta":c.serialize(d.meta)}),h.addClass([a.classNames.series,d.className||a.classNames.series+"-"+c.alphaNumerate(e)].join(" ")),b.normalized.series[e].forEach(function(g,k){var r,s,t,u;if(u=a.distributeSeries&&!a.stackBars?e:a.distributeSeries&&a.stackBars?0:k,r=a.horizontalBars?{x:o.x1+j.projectValue(g&&g.x?g.x:0,k,b.normalized.series[e]),y:o.y1-l.projectValue(g&&g.y?g.y:0,u,b.normalized.series[e])}:{x:o.x1+l.projectValue(g&&g.x?g.x:0,u,b.normalized.series[e]),y:o.y1-j.projectValue(g&&g.y?g.y:0,k,b.normalized.series[e])},l instanceof c.StepAxis&&(l.options.stretch||(r[l.units.pos]+=f*(a.horizontalBars?-1:1)),r[l.units.pos]+=a.stackBars||a.distributeSeries?0:i*a.seriesBarDistance*(a.horizontalBars?-1:1)),t=q[k]||p,q[k]=t-(p-r[l.counterUnits.pos]),void 0!==g){var v={};v[l.units.pos+"1"]=r[l.units.pos],v[l.units.pos+"2"]=r[l.units.pos],!a.stackBars||"accumulate"!==a.stackMode&&a.stackMode?(v[l.counterUnits.pos+"1"]=p,v[l.counterUnits.pos+"2"]=r[l.counterUnits.pos]):(v[l.counterUnits.pos+"1"]=t,v[l.counterUnits.pos+"2"]=q[k]),v.x1=Math.min(Math.max(v.x1,o.x1),o.x2),v.x2=Math.min(Math.max(v.x2,o.x1),o.x2),v.y1=Math.min(Math.max(v.y1,o.y2),o.y1),v.y2=Math.min(Math.max(v.y2,o.y2),o.y1);var w=c.getMetaData(d,k);s=h.elem("line",v,a.classNames.bar).attr({"ct:value":[g.x,g.y].filter(c.isNumeric).join(","),"ct:meta":c.serialize(w)}),this.eventEmitter.emit("draw",c.extend({type:"bar",value:g,index:k,meta:w,series:d,seriesIndex:e,axisX:m,axisY:n,chartRect:o,group:h,element:s},v))}}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:j.bounds,chartRect:o,axisX:m,axisY:n,svg:this.svg,options:a})}function e(a,b,d,e){c.Bar["super"].constructor.call(this,a,b,f,c.extend({},f,d),e)}var f={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackground:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};c.Bar=c.Base.extend({constructor:e,createChart:d})}(window,document,a),function(a,b,c){"use strict";function d(a,b,c){var d=b.x>a.x;return d&&"explode"===c||!d&&"implode"===c?"start":d&&"implode"===c||!d&&"explode"===c?"end":"middle"}function e(a){var b,e,f,h,i,j=c.normalizeData(this.data),k=[],l=a.startAngle;this.svg=c.createSvg(this.container,a.width,a.height,a.donut?a.classNames.chartDonut:a.classNames.chartPie),e=c.createChartRect(this.svg,a,g.padding),f=Math.min(e.width()/2,e.height()/2),i=a.total||j.normalized.series.reduce(function(a,b){return
Line truncated
|
||||
//# sourceMappingURL=chartist.min.js.map
|
||||
+208
-179
@@ -1,19 +1,20 @@
|
||||
(function(global, document) {
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
if (global.commento === undefined) {
|
||||
console.log("[commento] error: window.commento namespace not defined; maybe there's a mismatch in version between the backend and the frontend?");
|
||||
return;
|
||||
} else {
|
||||
global = global.commento;
|
||||
}
|
||||
|
||||
global = global.commento;
|
||||
|
||||
// Do not use other files like utils.js and http.js in the Makefile to build
|
||||
// Do not use other files like utils.js and http.js in the gulpfile to build
|
||||
// commento.js for the following reasons:
|
||||
// - We don't use jQuery in the actual JavaScript payload because we need
|
||||
// to be lightweight.
|
||||
// - They pollute the global/window namespace (with global.post, etc.).
|
||||
// That's NOT fine when we expect them source our JavaScript. For example,
|
||||
// That's NOT fine when we expect them to source our JavaScript. For example,
|
||||
// the user may have their own window.post defined. We don't want to
|
||||
// override that.
|
||||
|
||||
@@ -67,13 +68,12 @@
|
||||
var origin = global.origin;
|
||||
var cdn = global.cdn;
|
||||
var root = null;
|
||||
var cssOverride = undefined;
|
||||
var autoInit = undefined;
|
||||
var cssOverride;
|
||||
var autoInit;
|
||||
var isAuthenticated = false;
|
||||
var comments = [];
|
||||
var commenters = [];
|
||||
var requireIdentification = true;
|
||||
var requireModeration = true;
|
||||
var isModerator = false;
|
||||
var isFrozen = false;
|
||||
var shownSubmitButton = {"root": false};
|
||||
@@ -96,16 +96,6 @@
|
||||
}
|
||||
|
||||
|
||||
function dataGet(el, key) {
|
||||
return el.dataset[key];
|
||||
}
|
||||
|
||||
|
||||
function dataSet(el, key, data) {
|
||||
el.dataset[key] = data;
|
||||
}
|
||||
|
||||
|
||||
function append(root, el) {
|
||||
root.appendChild(el);
|
||||
}
|
||||
@@ -122,8 +112,9 @@
|
||||
|
||||
|
||||
function classRemove(el, cls) {
|
||||
if (el !== null)
|
||||
if (el !== null) {
|
||||
el.classList.remove("commento-" + cls);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,24 +124,26 @@
|
||||
|
||||
|
||||
function remove(el) {
|
||||
if (el !== null)
|
||||
if (el !== null) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function attrGet(node, a) {
|
||||
var attr = node.attributes[a];
|
||||
|
||||
if (attr === undefined)
|
||||
if (attr === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return attr.value;
|
||||
}
|
||||
|
||||
|
||||
function onclick(node, f, ...args) {
|
||||
function onclick(node, f, arg) {
|
||||
node.addEventListener("click", function() {
|
||||
f(...args);
|
||||
f(arg);
|
||||
}, false);
|
||||
}
|
||||
|
||||
@@ -176,7 +169,7 @@
|
||||
function get(url, callback) {
|
||||
var xmlDoc = new XMLHttpRequest();
|
||||
|
||||
xmlDoc.open('GET', url, true);
|
||||
xmlDoc.open("GET", url, true);
|
||||
xmlDoc.onload = function() {
|
||||
callback(JSON.parse(xmlDoc.response));
|
||||
};
|
||||
@@ -186,32 +179,25 @@
|
||||
|
||||
|
||||
function call(callback) {
|
||||
if (typeof(callback) == "function")
|
||||
if (typeof(callback) === "function") {
|
||||
callback();
|
||||
}
|
||||
|
||||
|
||||
function rootSpinnerShow() {
|
||||
var spinner = create("div");
|
||||
|
||||
classAdd(spinner, "loading");
|
||||
|
||||
append(root, spinner);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function cookieGet(name) {
|
||||
var c = "; " + document.cookie;
|
||||
var x = c.split("; " + name + "=");
|
||||
if (x.length == 2)
|
||||
if (x.length === 2) {
|
||||
return x.pop().split(";").shift();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function cookieSet(name, value) {
|
||||
var expires = "";
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (365*24*60*60*1000));
|
||||
date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000));
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
|
||||
document.cookie = name + "=" + value + expires + "; path=/";
|
||||
@@ -220,8 +206,9 @@
|
||||
|
||||
function commenterTokenGet() {
|
||||
var commenterToken = cookieGet("commentoCommenterToken");
|
||||
if (commenterToken === undefined)
|
||||
if (commenterToken === undefined) {
|
||||
return "anonymous";
|
||||
}
|
||||
|
||||
return commenterToken;
|
||||
}
|
||||
@@ -235,7 +222,7 @@
|
||||
|
||||
function selfGet(callback) {
|
||||
var commenterToken = commenterTokenGet();
|
||||
if (commenterToken == "anonymous") {
|
||||
if (commenterToken === "anonymous") {
|
||||
isAuthenticated = false;
|
||||
call(callback);
|
||||
return;
|
||||
@@ -273,14 +260,14 @@
|
||||
|
||||
attrSet(loggedContainer, "style", "display: none");
|
||||
attrSet(name, "href", resp.commenter.link);
|
||||
if (resp.commenter.photo == "undefined") {
|
||||
if (resp.commenter.photo === "undefined") {
|
||||
avatar = create("div");
|
||||
avatar.style["background"] = color;
|
||||
avatar.innerHTML = resp.commenter.name[0].toUpperCase();
|
||||
classAdd(avatar, "avatar");
|
||||
} else {
|
||||
avatar = create("img");
|
||||
if (resp.commenter.provider == "google") {
|
||||
if (resp.commenter.provider === "google") {
|
||||
attrSet(avatar, "src", resp.commenter.photo + "?sz=50");
|
||||
} else {
|
||||
attrSet(avatar, "src", resp.commenter.photo);
|
||||
@@ -303,7 +290,7 @@
|
||||
|
||||
function cssLoad(file, onload) {
|
||||
var link = create("link");
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
|
||||
link.type = "text/css";
|
||||
attrSet(link, "href", file);
|
||||
@@ -357,7 +344,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
requireModeration = resp.requireModeration;
|
||||
requireIdentification = resp.requireIdentification;
|
||||
isModerator = resp.isModerator;
|
||||
isFrozen = resp.isFrozen;
|
||||
@@ -448,12 +434,12 @@
|
||||
append(buttons, createButton);
|
||||
append(buttons, loginButton);
|
||||
append(buttonsContainer, buttons);
|
||||
if (!requireIdentification)
|
||||
if (!requireIdentification) {
|
||||
append(buttonsContainer, anonymousButton);
|
||||
}
|
||||
append(textareaContainer, question);
|
||||
append(textareaContainer, buttonsContainer);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
onclick(textarea, global.showSubmitButton, id);
|
||||
|
||||
attrSet(textarea, "placeholder", "Join the discussion!");
|
||||
@@ -478,14 +464,15 @@
|
||||
|
||||
commentsArea.innerHTML = "";
|
||||
|
||||
if (isLocked) {
|
||||
if (isAuthenticated)
|
||||
if (isLocked || isFrozen) {
|
||||
if (isAuthenticated) {
|
||||
append(mainArea, messageCreate("This thread is locked. You cannot add new comments."));
|
||||
else
|
||||
} else {
|
||||
append(mainArea, textareaCreate("root"));
|
||||
}
|
||||
else
|
||||
}
|
||||
} else {
|
||||
append(mainArea, textareaCreate("root"));
|
||||
}
|
||||
|
||||
append(mainArea, commentsArea);
|
||||
append(root, mainArea);
|
||||
@@ -510,11 +497,10 @@
|
||||
|
||||
var comment = textarea.value;
|
||||
|
||||
if (comment == "") {
|
||||
if (comment === "") {
|
||||
classAdd(textarea, "red-border");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
classRemove(textarea, "red-border");
|
||||
}
|
||||
|
||||
@@ -539,16 +525,18 @@
|
||||
commentsRender();
|
||||
|
||||
var message = "";
|
||||
if (resp.state == "unapproved")
|
||||
if (resp.state === "unapproved") {
|
||||
message = "Your comment is under moderation.";
|
||||
else if (resp.state == "flagged")
|
||||
} else if (resp.state === "flagged") {
|
||||
message = "Your comment was flagged as spam and is under moderation.";
|
||||
}
|
||||
|
||||
if (message != "") {
|
||||
if (id == "root")
|
||||
if (message !== "") {
|
||||
if (id === "root") {
|
||||
prepend($(ID_SUPER_CONTAINER + id), messageCreate(message));
|
||||
else
|
||||
} else {
|
||||
append($(ID_BODY + id), messageCreate(message));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -567,8 +555,9 @@
|
||||
];
|
||||
|
||||
var total = 0;
|
||||
for (var i = 0; i < name.length; i++)
|
||||
for (var i = 0; i < name.length; i++) {
|
||||
total += name.charCodeAt(i);
|
||||
}
|
||||
var color = colors[total % colors.length];
|
||||
|
||||
return color;
|
||||
@@ -586,34 +575,29 @@
|
||||
var elapsed = current - previous;
|
||||
|
||||
if (elapsed < msJustNow) {
|
||||
return 'just now';
|
||||
}
|
||||
else if (elapsed < msPerMinute) {
|
||||
return Math.round(elapsed/1000) + ' seconds ago';
|
||||
}
|
||||
else if (elapsed < msPerHour) {
|
||||
return Math.round(elapsed/msPerMinute) + ' minutes ago';
|
||||
}
|
||||
else if (elapsed < msPerDay ) {
|
||||
return Math.round(elapsed/msPerHour ) + ' hours ago';
|
||||
}
|
||||
else if (elapsed < msPerMonth) {
|
||||
return Math.round(elapsed/msPerDay) + ' days ago';
|
||||
}
|
||||
else if (elapsed < msPerYear) {
|
||||
return Math.round(elapsed/msPerMonth) + ' months ago';
|
||||
}
|
||||
else {
|
||||
return Math.round(elapsed/msPerYear ) + ' years ago';
|
||||
return "just now";
|
||||
} else if (elapsed < msPerMinute) {
|
||||
return Math.round(elapsed / 1000) + " seconds ago";
|
||||
} else if (elapsed < msPerHour) {
|
||||
return Math.round(elapsed / msPerMinute) + " minutes ago";
|
||||
} else if (elapsed < msPerDay ) {
|
||||
return Math.round(elapsed / msPerHour ) + " hours ago";
|
||||
} else if (elapsed < msPerMonth) {
|
||||
return Math.round(elapsed / msPerDay) + " days ago";
|
||||
} else if (elapsed < msPerYear) {
|
||||
return Math.round(elapsed / msPerMonth) + " months ago";
|
||||
} else {
|
||||
return Math.round(elapsed / msPerYear ) + " years ago";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function scorify(score) {
|
||||
if (score != 1)
|
||||
if (score !== 1) {
|
||||
return score + " points";
|
||||
else
|
||||
} else {
|
||||
return score + " point";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -624,10 +608,12 @@
|
||||
}
|
||||
|
||||
cur.sort(function(a, b) {
|
||||
if (a.commentHex == stickyCommentHex)
|
||||
if (a.commentHex === stickyCommentHex) {
|
||||
return -Infinity;
|
||||
if (b.commentHex == stickyCommentHex)
|
||||
}
|
||||
if (b.commentHex === stickyCommentHex) {
|
||||
return Infinity;
|
||||
}
|
||||
return b.score - a.score;
|
||||
});
|
||||
|
||||
@@ -655,10 +641,11 @@
|
||||
var contents = create("div");
|
||||
var color = colorGet(comment.commenterHex + "-" + commenter.name);
|
||||
var name;
|
||||
if (commenter.link != "undefined" && commenter.link != "https://undefined" && commenter.link != "")
|
||||
if (commenter.link !== "undefined" && commenter.link !== "https://undefined" && commenter.link !== "") {
|
||||
name = create("a");
|
||||
else
|
||||
} else {
|
||||
name = create("div");
|
||||
}
|
||||
|
||||
card.id = ID_CARD + comment.commentHex;
|
||||
body.id = ID_BODY + comment.commentHex;
|
||||
@@ -674,8 +661,9 @@
|
||||
approve.id = ID_APPROVE + comment.commentHex;
|
||||
remove.id = ID_REMOVE + comment.commentHex;
|
||||
sticky.id = ID_STICKY + comment.commentHex;
|
||||
if (children)
|
||||
if (children) {
|
||||
children.id = ID_CHILDREN + comment.commentHex;
|
||||
}
|
||||
contents.id = ID_CONTENTS + comment.commentHex;
|
||||
name.id = ID_NAME + comment.commentHex;
|
||||
|
||||
@@ -686,14 +674,15 @@
|
||||
reply.title = "Reply";
|
||||
approve.title = "Approve";
|
||||
remove.title = "Remove";
|
||||
if (stickyCommentHex == comment.commentHex) {
|
||||
if (isModerator)
|
||||
if (stickyCommentHex === comment.commentHex) {
|
||||
if (isModerator) {
|
||||
sticky.title = "Unsticky";
|
||||
else
|
||||
} else {
|
||||
sticky.title = "This comment has been stickied";
|
||||
}
|
||||
else
|
||||
}
|
||||
} else {
|
||||
sticky.title = "Sticky";
|
||||
}
|
||||
|
||||
card.style["borderLeft"] = "2px solid " + color;
|
||||
name.innerText = commenter.name;
|
||||
@@ -701,14 +690,14 @@
|
||||
timeago.innerHTML = timeDifference((new Date()).getTime(), Date.parse(comment.creationDate));
|
||||
score.innerText = scorify(comment.score);
|
||||
|
||||
if (commenter.photo == "undefined") {
|
||||
if (commenter.photo === "undefined") {
|
||||
avatar = create("div");
|
||||
avatar.style["background"] = color;
|
||||
avatar.innerHTML = commenter.name[0].toUpperCase();
|
||||
classAdd(avatar, "avatar");
|
||||
} else {
|
||||
avatar = create("img");
|
||||
if (commenter.provider == "google") {
|
||||
if (commenter.provider === "google") {
|
||||
attrSet(avatar, "src", commenter.photo + "?sz=50");
|
||||
} else {
|
||||
attrSet(avatar, "src", commenter.photo);
|
||||
@@ -717,10 +706,12 @@
|
||||
}
|
||||
|
||||
classAdd(card, "card");
|
||||
if (isModerator && comment.state != "approved")
|
||||
if (isModerator && comment.state !== "approved") {
|
||||
classAdd(card, "dark-card");
|
||||
if (comment.state == "flagged")
|
||||
}
|
||||
if (comment.state === "flagged") {
|
||||
classAdd(name, "flagged");
|
||||
}
|
||||
classAdd(header, "header");
|
||||
classAdd(name, "name");
|
||||
classAdd(subtitle, "subtitle");
|
||||
@@ -728,8 +719,9 @@
|
||||
classAdd(score, "score");
|
||||
classAdd(body, "body");
|
||||
classAdd(options, "options");
|
||||
if (mobileView)
|
||||
if (mobileView) {
|
||||
classAdd(options, "options-mobile");
|
||||
}
|
||||
classAdd(edit, "option-button");
|
||||
classAdd(edit, "option-edit");
|
||||
classAdd(reply, "option-button");
|
||||
@@ -745,16 +737,18 @@
|
||||
classAdd(remove, "option-button");
|
||||
classAdd(remove, "option-remove");
|
||||
classAdd(sticky, "option-button");
|
||||
if (stickyCommentHex == comment.commentHex)
|
||||
if (stickyCommentHex === comment.commentHex) {
|
||||
classAdd(sticky, "option-unsticky");
|
||||
else
|
||||
} else {
|
||||
classAdd(sticky, "option-sticky");
|
||||
}
|
||||
|
||||
if (isAuthenticated) {
|
||||
if (comment.direction > 0)
|
||||
if (comment.direction > 0) {
|
||||
classAdd(upvote, "upvoted");
|
||||
else if (comment.direction < 0)
|
||||
} else if (comment.direction < 0) {
|
||||
classAdd(downvote, "downvoted");
|
||||
}
|
||||
}
|
||||
|
||||
onclick(collapse, global.commentCollapse, comment.commentHex);
|
||||
@@ -762,20 +756,22 @@
|
||||
onclick(remove, global.commentDelete, comment.commentHex);
|
||||
onclick(sticky, global.commentSticky, comment.commentHex);
|
||||
|
||||
if (isAuthenticated)
|
||||
if (isAuthenticated) {
|
||||
upDownOnclickSet(upvote, downvote, comment.commentHex, comment.direction);
|
||||
else {
|
||||
} else {
|
||||
onclick(upvote, global.loginBoxShow);
|
||||
onclick(downvote, global.loginBoxShow);
|
||||
}
|
||||
|
||||
if (isAuthenticated || chosenAnonymous)
|
||||
if (isAuthenticated || chosenAnonymous) {
|
||||
onclick(reply, global.replyShow, comment.commentHex);
|
||||
else
|
||||
} else {
|
||||
onclick(reply, global.loginBoxShow);
|
||||
}
|
||||
|
||||
if (commenter.link != "undefined" && commenter.link != "https://undefined" && commenter.link != "")
|
||||
if (commenter.link !== "undefined" && commenter.link !== "https://undefined" && commenter.link !== "") {
|
||||
attrSet(name, "href", commenter.link);
|
||||
}
|
||||
|
||||
append(options, collapse);
|
||||
|
||||
@@ -786,26 +782,30 @@
|
||||
append(options, reply);
|
||||
|
||||
if (isModerator) {
|
||||
if (parentHex == "root")
|
||||
if (parentHex === "root") {
|
||||
append(options, sticky);
|
||||
}
|
||||
append(options, remove);
|
||||
if (comment.state != "approved")
|
||||
if (comment.state !== "approved") {
|
||||
append(options, approve);
|
||||
}
|
||||
else {
|
||||
if (stickyCommentHex == comment.commentHex)
|
||||
}
|
||||
} else {
|
||||
if (stickyCommentHex === comment.commentHex) {
|
||||
append(options, sticky);
|
||||
}
|
||||
}
|
||||
|
||||
attrSet(options, "style", "width: " + ((options.childNodes.length+1)*32) + "px;");
|
||||
for (var i = 0; i < options.childNodes.length; i++)
|
||||
for (var i = 0; i < options.childNodes.length; i++) {
|
||||
attrSet(options.childNodes[i], "style", "right: " + (i*32) + "px;");
|
||||
}
|
||||
|
||||
append(subtitle, score);
|
||||
append(subtitle, timeago);
|
||||
|
||||
if (!mobileView)
|
||||
if (!mobileView) {
|
||||
append(header, options);
|
||||
}
|
||||
append(header, avatar);
|
||||
append(header, name);
|
||||
append(header, subtitle);
|
||||
@@ -847,7 +847,6 @@
|
||||
|
||||
var card = $(ID_CARD + commentHex);
|
||||
var name = $(ID_NAME + commentHex);
|
||||
var options = $(ID_OPTIONS + commentHex);
|
||||
var tick = $(ID_APPROVE + commentHex);
|
||||
|
||||
classRemove(card, "dark-card");
|
||||
@@ -878,28 +877,29 @@
|
||||
function nameWidthFix() {
|
||||
var els = document.getElementsByClassName("commento-name");
|
||||
|
||||
for (var i = 0; i < els.length; i++)
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
attrSet(els[i], "style", "max-width: " + (els[i].getBoundingClientRect()["width"] + 20) + "px;")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function upDownOnclickSet(upvote, downvote, commentHex, direction) {
|
||||
if (direction > 0) {
|
||||
onclick(upvote, global.vote, commentHex, 1, 0);
|
||||
onclick(downvote, global.vote, commentHex, 1, -1);
|
||||
}
|
||||
else if (direction < 0) {
|
||||
onclick(upvote, global.vote, commentHex, -1, 1);
|
||||
onclick(downvote, global.vote, commentHex, -1, 0);
|
||||
}
|
||||
else {
|
||||
onclick(upvote, global.vote, commentHex, 0, 1);
|
||||
onclick(downvote, global.vote, commentHex, 0, -1);
|
||||
onclick(upvote, global.vote, commentHex, [1, 0]);
|
||||
onclick(downvote, global.vote, commentHex, [1, -1]);
|
||||
} else if (direction < 0) {
|
||||
onclick(upvote, global.vote, commentHex, [-1, 1]);
|
||||
onclick(downvote, global.vote, commentHex, [-1, 0]);
|
||||
} else {
|
||||
onclick(upvote, global.vote, commentHex, [0, 1]);
|
||||
onclick(downvote, global.vote, commentHex, [0, -1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
global.vote = function(commentHex, oldVote, direction) {
|
||||
global.vote = function(commentHex, dirs) {
|
||||
var oldVote = dirs[0];
|
||||
var direction = dirs[1];
|
||||
var upvote = $(ID_UPVOTE + commentHex);
|
||||
var downvote = $(ID_DOWNVOTE + commentHex);
|
||||
var score = $(ID_SCORE + commentHex);
|
||||
@@ -914,20 +914,27 @@
|
||||
|
||||
classRemove(upvote, "upvoted");
|
||||
classRemove(downvote, "downvoted");
|
||||
if (direction > 0)
|
||||
if (direction > 0) {
|
||||
classAdd(upvote, "upvoted");
|
||||
else if (direction < 0)
|
||||
} else if (direction < 0) {
|
||||
classAdd(downvote, "downvoted");
|
||||
}
|
||||
|
||||
score.innerText = scorify(parseInt(score.innerText.replace(/[^\d-.]/g, "")) + direction - oldVote);
|
||||
|
||||
post(origin + "/api/comment/vote", json, function(resp) {});
|
||||
post(origin + "/api/comment/vote", json, function(resp) {
|
||||
if (!resp.success) {
|
||||
errorShow(resp.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
global.replyShow = function(id) {
|
||||
if (id in shownReply && shownReply[id])
|
||||
if (id in shownReply && shownReply[id]) {
|
||||
return;
|
||||
}
|
||||
|
||||
var body = $(ID_BODY + id);
|
||||
append(body, textareaCreate(id));
|
||||
@@ -965,8 +972,9 @@
|
||||
var children = $(ID_CHILDREN + id);
|
||||
var button = $(ID_COLLAPSE + id);
|
||||
|
||||
if (children)
|
||||
if (children) {
|
||||
classAdd(children, "hidden");
|
||||
}
|
||||
|
||||
classRemove(button, "option-collapse");
|
||||
classAdd(button, "option-uncollapse");
|
||||
@@ -981,8 +989,9 @@
|
||||
var children = $(ID_CHILDREN + id);
|
||||
var button = $(ID_COLLAPSE + id);
|
||||
|
||||
if (children)
|
||||
if (children) {
|
||||
classRemove(children, "hidden");
|
||||
}
|
||||
|
||||
classRemove(button, "option-uncollapse");
|
||||
classAdd(button, "option-collapse");
|
||||
@@ -1015,8 +1024,9 @@
|
||||
|
||||
|
||||
global.showSubmitButton = function(id) {
|
||||
if (id in shownSubmitButton && shownSubmitButton[id])
|
||||
if (id in shownSubmitButton && shownSubmitButton[id]) {
|
||||
return;
|
||||
}
|
||||
|
||||
shownSubmitButton[id] = true;
|
||||
|
||||
@@ -1037,7 +1047,8 @@
|
||||
append(el, submit);
|
||||
}
|
||||
|
||||
global.anonymousChoose = function(provider) {
|
||||
|
||||
global.anonymousChoose = function() {
|
||||
cookieSet("commentoCommenterToken", "anonymous");
|
||||
chosenAnonymous = true;
|
||||
refreshAll();
|
||||
@@ -1178,12 +1189,13 @@
|
||||
append(loginBox, oauthPretext);
|
||||
append(oauthButtonsContainer, oauthButtons);
|
||||
append(loginBox, oauthButtonsContainer);
|
||||
if (!requireIdentification)
|
||||
if (!requireIdentification) {
|
||||
append(loginBox, anonymousButton);
|
||||
}
|
||||
oauthButtonsShown = true;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
oauthButtonsShown = false;
|
||||
}
|
||||
|
||||
append(loginBox, close);
|
||||
|
||||
@@ -1279,15 +1291,16 @@
|
||||
global.passwordAsk = function() {
|
||||
var loginBox = $(ID_LOGIN_BOX);
|
||||
var subtitle = $(ID_LOGIN_BOX_SUBTITLE);
|
||||
var emailInput = $(ID_LOGIN_BOX_EMAIL_INPUT);
|
||||
var emailButton = $(ID_LOGIN_BOX_EMAIL_BUTTON);
|
||||
var loginLinkContainer = $(ID_LOGIN_BOX_LOGIN_LINK_CONTAINER);
|
||||
var hr = $(ID_LOGIN_BOX_HR);
|
||||
var oauthButtonsContainer = $(ID_LOGIN_BOX_OAUTH_BUTTONS_CONTAINER);
|
||||
var oauthPretext = $(ID_LOGIN_BOX_OAUTH_PRETEXT);
|
||||
var anonymousButton = null;
|
||||
if (!requireIdentification);
|
||||
anonymousButton = $(ID_LOGIN_BOX_ANONYMOUS_BUTTON);
|
||||
if (!requireIdentification){
|
||||
;
|
||||
}
|
||||
anonymousButton = $(ID_LOGIN_BOX_ANONYMOUS_BUTTON);
|
||||
|
||||
remove(emailButton);
|
||||
remove(loginLinkContainer);
|
||||
@@ -1302,23 +1315,23 @@
|
||||
|
||||
var order, id, type, placeholder;
|
||||
|
||||
if (loginBoxType == "signup") {
|
||||
if (loginBoxType === "signup") {
|
||||
var order = ["name", "website", "password"];
|
||||
var id = [ID_LOGIN_BOX_NAME_INPUT, ID_LOGIN_BOX_WEBSITE_INPUT, ID_LOGIN_BOX_PASSWORD_INPUT];
|
||||
var type = ["text", "text", "password"];
|
||||
var placeholder = ["Real Name", "Website (Optional)", "Password"];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var order = ["password"];
|
||||
var id = [ID_LOGIN_BOX_PASSWORD_INPUT];
|
||||
var type = ["password"];
|
||||
var placeholder = ["Password"];
|
||||
}
|
||||
|
||||
if (loginBoxType == "signup")
|
||||
if (loginBoxType === "signup") {
|
||||
subtitle.innerText = "Finish the rest of your profile to complete."
|
||||
else
|
||||
} else {
|
||||
subtitle.innerText = "Enter your password to log in."
|
||||
}
|
||||
|
||||
for (var i = 0; i < order.length; i++) {
|
||||
var fieldContainer = create("div");
|
||||
@@ -1338,15 +1351,16 @@
|
||||
append(field, fieldInput);
|
||||
append(fieldContainer, field);
|
||||
|
||||
if (order[i] == "password") {
|
||||
if (order[i] === "password") {
|
||||
var fieldButton = create("button");
|
||||
classAdd(fieldButton, "email-button");
|
||||
fieldButton.innerText = loginBoxType;
|
||||
|
||||
if (loginBoxType == "signup")
|
||||
if (loginBoxType === "signup") {
|
||||
onclick(fieldButton, global.signup);
|
||||
else
|
||||
} else {
|
||||
onclick(fieldButton, global.login);
|
||||
}
|
||||
|
||||
append(field, fieldButton);
|
||||
}
|
||||
@@ -1354,10 +1368,11 @@
|
||||
append(loginBox, fieldContainer);
|
||||
}
|
||||
|
||||
if (loginBoxType == "signup")
|
||||
if (loginBoxType === "signup") {
|
||||
$(ID_LOGIN_BOX_NAME_INPUT).focus();
|
||||
else
|
||||
} else {
|
||||
$(ID_LOGIN_BOX_PASSWORD_INPUT).focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1392,36 +1407,41 @@
|
||||
|
||||
lock.disabled = true;
|
||||
pageUpdate(function(success) {
|
||||
lock.disabled = false;
|
||||
if (isLocked)
|
||||
lock.innerHTML = "Unlock Thread";
|
||||
else
|
||||
lock.innerHTML = "Lock Thread";
|
||||
if (success) {
|
||||
lock.disabled = false;
|
||||
if (isLocked) {
|
||||
lock.innerHTML = "Unlock Thread";
|
||||
} else {
|
||||
lock.innerHTML = "Lock Thread";
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
global.commentSticky = function(commentHex) {
|
||||
if (stickyCommentHex != "none") {
|
||||
if (stickyCommentHex !== "none") {
|
||||
var sticky = $(ID_STICKY + stickyCommentHex);
|
||||
classRemove(sticky, "option-unsticky");
|
||||
classAdd(sticky, "option-sticky");
|
||||
}
|
||||
|
||||
if (stickyCommentHex == commentHex)
|
||||
if (stickyCommentHex === commentHex) {
|
||||
stickyCommentHex = "none";
|
||||
else
|
||||
} else {
|
||||
stickyCommentHex = commentHex;
|
||||
}
|
||||
|
||||
pageUpdate(function(success) {
|
||||
var sticky = $(ID_STICKY + commentHex);
|
||||
if (stickyCommentHex == commentHex) {
|
||||
classRemove(sticky, "option-sticky");
|
||||
classAdd(sticky, "option-unsticky");
|
||||
}
|
||||
else {
|
||||
classRemove(sticky, "option-unsticky");
|
||||
classAdd(sticky, "option-sticky");
|
||||
if (success) {
|
||||
var sticky = $(ID_STICKY + commentHex);
|
||||
if (stickyCommentHex === commentHex) {
|
||||
classRemove(sticky, "option-sticky");
|
||||
classAdd(sticky, "option-unsticky");
|
||||
} else {
|
||||
classRemove(sticky, "option-unsticky");
|
||||
classAdd(sticky, "option-sticky");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1449,10 +1469,11 @@
|
||||
|
||||
classAdd(modTools, "mod-tools");
|
||||
|
||||
if (isLocked)
|
||||
if (isLocked) {
|
||||
lock.innerHTML = "Unlock Thread";
|
||||
else
|
||||
} else {
|
||||
lock.innerHTML = "Lock Thread";
|
||||
}
|
||||
|
||||
onclick(lock, global.threadLockToggle);
|
||||
|
||||
@@ -1464,10 +1485,11 @@
|
||||
|
||||
|
||||
global.loadCssOverride = function() {
|
||||
if (cssOverride === undefined)
|
||||
if (cssOverride === undefined) {
|
||||
global.allShow();
|
||||
else
|
||||
} else {
|
||||
cssLoad(cssOverride, "window.allShow()");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1479,11 +1501,13 @@
|
||||
|
||||
attrSet(mainArea, "style", "");
|
||||
|
||||
if (isModerator)
|
||||
if (isModerator) {
|
||||
attrSet(modTools, "style", "");
|
||||
}
|
||||
|
||||
if (loggedContainer)
|
||||
if (loggedContainer) {
|
||||
attrSet(loggedContainer, "style", "");
|
||||
}
|
||||
|
||||
attrSet(footer, "style", "");
|
||||
|
||||
@@ -1502,7 +1526,7 @@
|
||||
}
|
||||
|
||||
|
||||
global.loginBoxShow = function(signup) {
|
||||
global.loginBoxShow = function() {
|
||||
var mainArea = $(ID_MAIN_AREA);
|
||||
var loginBoxContainer = $(ID_LOGIN_BOX_CONTAINER);
|
||||
|
||||
@@ -1527,8 +1551,9 @@
|
||||
autoInit = attrGet(scripts[i], "data-auto-init");
|
||||
|
||||
ID_ROOT = attrGet(scripts[i], "data-id-root");
|
||||
if (ID_ROOT === undefined)
|
||||
if (ID_ROOT === undefined) {
|
||||
ID_ROOT = "commento";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1559,42 +1584,46 @@
|
||||
|
||||
|
||||
var initted = false;
|
||||
|
||||
|
||||
function init() {
|
||||
if (initted)
|
||||
if (initted) {
|
||||
return;
|
||||
}
|
||||
initted = true;
|
||||
|
||||
dataTagsLoad();
|
||||
|
||||
if (autoInit == "true" || autoInit === undefined)
|
||||
if (autoInit === "true" || autoInit === undefined) {
|
||||
global.main(undefined);
|
||||
else if (autoInit != "false")
|
||||
} else if (autoInit !== "false") {
|
||||
console.log("[commento] error: invalid value for data-auto-init; allowed values: true, false");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var readyLoad = function() {
|
||||
var readyState = document.readyState;
|
||||
|
||||
if (readyState == "loading") {
|
||||
if (readyState === "loading") {
|
||||
// The document is still loading. The div we need to fill might not have
|
||||
// been parsed yet, so let's wait and retry when the readyState changes.
|
||||
// If there is more than one state change, we aren't affected because we
|
||||
// have a double-call protection in init().
|
||||
document.addEventListener("readystatechange", readyLoad);
|
||||
}
|
||||
else if (readyState == "interactive") {
|
||||
} else if (readyState === "interactive") {
|
||||
// The document has been parsed and DOM objects are now accessible. While
|
||||
// JS, CSS, and images are still loading, we don't need to wait.
|
||||
init();
|
||||
}
|
||||
else if (readyState == "complete") {
|
||||
} else if (readyState === "complete") {
|
||||
// The page has fully loaded (including JS, CSS, and images). From our
|
||||
// point of view, this is practically no different from interactive.
|
||||
init();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
readyLoad();
|
||||
|
||||
|
||||
}(window, document));
|
||||
@@ -1,4 +1,5 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
// Opens the danger zone.
|
||||
global.dangerOpen = function() {
|
||||
@@ -12,8 +13,9 @@
|
||||
var data = global.dashboard.$data;
|
||||
|
||||
global.domainDelete(data.domains[data.cd].domain, function(success) {
|
||||
if (success)
|
||||
document.location = global.origin + '/dashboard';
|
||||
if (success) {
|
||||
document.location = global.origin + "/dashboard";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
// Selects a domain.
|
||||
global.domainSelect = function(domain) {
|
||||
@@ -6,14 +7,14 @@
|
||||
var domains = data.domains;
|
||||
|
||||
for (var i = 0; i < domains.length; i++) {
|
||||
if (domains[i].domain == domain) {
|
||||
global.vs("frozen", domains[i].state == "frozen");
|
||||
if (domains[i].domain === domain) {
|
||||
global.vs("frozen", domains[i].state === "frozen");
|
||||
domains[i].selected = true;
|
||||
data.cd = i;
|
||||
data.importedComments = domains[i].importedComments;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
domains[i].selected = false;
|
||||
}
|
||||
}
|
||||
|
||||
data.showSettings = true;
|
||||
@@ -28,8 +29,9 @@
|
||||
var data = global.dashboard.$data;
|
||||
var domains = data.domains;
|
||||
|
||||
for (var i = 0; i < domains.length; i++)
|
||||
for (var i = 0; i < domains.length; i++) {
|
||||
domains[i].selected = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,8 +78,8 @@
|
||||
}
|
||||
|
||||
resp.domains = resp.domains.sort(function(a, b) {
|
||||
var x = a.creationDate; var y = b.creationDate;
|
||||
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
var x = a.creationDate; var y = b.creationDate;
|
||||
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
});
|
||||
|
||||
for (var i = 0; i < resp.domains.length; i++) {
|
||||
@@ -98,8 +100,9 @@
|
||||
|
||||
global.vs("domains", resp.domains);
|
||||
|
||||
if (callback !== undefined)
|
||||
if (callback !== undefined) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -112,8 +115,9 @@
|
||||
};
|
||||
|
||||
global.post(global.origin + "/api/domain/update", json, function(resp) {
|
||||
if (callback !== undefined)
|
||||
if (callback !== undefined) {
|
||||
callback(resp.success);
|
||||
}
|
||||
|
||||
if (!resp.success) {
|
||||
global.globalErrorShow(resp.message);
|
||||
@@ -136,8 +140,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (callback !== undefined)
|
||||
if (callback !== undefined) {
|
||||
callback(resp.success);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Opens the general settings window.
|
||||
global.generalOpen = function() {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Opens the import window.
|
||||
global.importOpen = function() {
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Opens the installation view.
|
||||
global.installationOpen = function() {
|
||||
var data = global.dashboard.$data;
|
||||
|
||||
var html = '' +
|
||||
'<div id="commento"></div>\n' +
|
||||
'<script src="' + window.commentoCdn + '/js/commento.js"><\/script>\n' +
|
||||
'';
|
||||
var html = "" +
|
||||
"<div id=\"commento\"></div>\n" +
|
||||
"<script src=\"" + window.commentoCdn + "/js/commento.js\"><\/script>\n" +
|
||||
"";
|
||||
|
||||
$("#code-div").text(html);
|
||||
|
||||
$('pre code').each(function(i, block) {
|
||||
$("pre code").each(function(i, block) {
|
||||
hljs.highlightBlock(block);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Opens the moderatiosn settings window.
|
||||
global.moderationOpen = function() {
|
||||
@@ -20,13 +23,13 @@
|
||||
|
||||
var idx = -1;
|
||||
for (var i = 0; i < data.domains[data.cd].moderators.length; i++) {
|
||||
if (data.domains[data.cd].moderators[i].email == email) {
|
||||
if (data.domains[data.cd].moderators[i].email === email) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == -1) {
|
||||
if (idx === -1) {
|
||||
data.domains[data.cd].moderators.push({"email": email, "timeAgo": "just now"});
|
||||
global.buttonDisable("#new-mod-button");
|
||||
global.post(global.origin + "/api/domain/moderator/new", json, function(resp) {
|
||||
@@ -41,8 +44,7 @@
|
||||
$("#new-mod").val("");
|
||||
$("#new-mod").focus();
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
global.globalErrorShow("Already a moderator.");
|
||||
}
|
||||
}
|
||||
@@ -60,13 +62,13 @@
|
||||
|
||||
var idx = -1;
|
||||
for (var i = 0; i < data.domains[data.cd].moderators.length; i++) {
|
||||
if (data.domains[data.cd].moderators[i].email == email) {
|
||||
if (data.domains[data.cd].moderators[i].email === email) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (idx != -1) {
|
||||
if (idx !== -1) {
|
||||
data.domains[data.cd].moderators.splice(idx, 1);
|
||||
global.post(global.origin + "/api/domain/moderator/delete", json, function(resp) {
|
||||
if (!resp.success) {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Sets the vue.js toggle to select and deselect panes visually.
|
||||
function settingSelectCSS(id) {
|
||||
@@ -6,10 +9,9 @@
|
||||
var settings = data.settings;
|
||||
|
||||
for (var i = 0; i < settings.length; i++) {
|
||||
if (settings[i].id == id) {
|
||||
if (settings[i].id === id) {
|
||||
settings[i].selected = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
settings[i].selected = false;
|
||||
}
|
||||
}
|
||||
@@ -28,8 +30,9 @@
|
||||
$(".original").addClass("current");
|
||||
|
||||
for (var i = 0; i < settings.length; i++) {
|
||||
if (id == settings[i].id)
|
||||
if (id === settings[i].id) {
|
||||
settings[i].open();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -39,8 +42,9 @@
|
||||
var data = global.dashboard.$data;
|
||||
var settings = data.settings;
|
||||
|
||||
for (var i = 0; i < settings.length; i++)
|
||||
for (var i = 0; i < settings.length; i++) {
|
||||
settings[i].selected = false;
|
||||
}
|
||||
}
|
||||
|
||||
} (window.commento, document));
|
||||
@@ -1,35 +1,41 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
global.numberify = function(x) {
|
||||
if (x == 0)
|
||||
if (x === 0) {
|
||||
return {"zeros": "000", "num": "", "units": ""}
|
||||
}
|
||||
|
||||
if (x < 10)
|
||||
if (x < 10) {
|
||||
return {"zeros": "00", "num": x, "units": ""}
|
||||
}
|
||||
|
||||
if (x < 100)
|
||||
if (x < 100) {
|
||||
return {"zeros": "0", "num": x, "units": ""}
|
||||
}
|
||||
|
||||
if (x < 1000)
|
||||
if (x < 1000) {
|
||||
return {"zeros": "", "num": x, "units": ""}
|
||||
}
|
||||
|
||||
var res;
|
||||
|
||||
if (x < 1000000) {
|
||||
res = global.numberify((x/1000).toFixed(0))
|
||||
res.units = "K"
|
||||
}
|
||||
else if (x < 1000000000) {
|
||||
} else if (x < 1000000000) {
|
||||
res = global.numberify((x/1000000).toFixed(0))
|
||||
res.units = "M"
|
||||
}
|
||||
else if (x < 1000000000000) {
|
||||
} else if (x < 1000000000000) {
|
||||
res = global.numberify((x/1000000000).toFixed(0))
|
||||
res.units = "B"
|
||||
}
|
||||
|
||||
if (res.num*10 % 10 == 0)
|
||||
if (res.num*10 % 10 === 0) {
|
||||
res.num = Math.ceil(res.num);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -74,12 +80,12 @@
|
||||
|
||||
var labels = new Array();
|
||||
for (var i = 0; i < views.length; i++) {
|
||||
if ((views.length-i) % 7 == 0) {
|
||||
if ((views.length-i) % 7 === 0) {
|
||||
var x = (views.length-i)/7;
|
||||
labels.push(x + " week" + (x > 1 ? "s" : "") + " ago");
|
||||
}
|
||||
else
|
||||
} else {
|
||||
labels.push("");
|
||||
}
|
||||
}
|
||||
|
||||
new Chartist.Line("#views-graph", {
|
||||
@@ -92,8 +98,12 @@
|
||||
series: [comments],
|
||||
}, options);
|
||||
|
||||
data.domains[data.cd].viewsLast30Days = numberify(views.reduce(function(a, b) { return a + b; }, 0));
|
||||
data.domains[data.cd].commentsLast30Days = numberify(comments.reduce(function(a, b) { return a + b; }, 0));
|
||||
data.domains[data.cd].viewsLast30Days = numberify(views.reduce(function(a, b) {
|
||||
return a + b;
|
||||
}, 0));
|
||||
data.domains[data.cd].commentsLast30Days = numberify(comments.reduce(function(a, b) {
|
||||
return a + b;
|
||||
}, 0));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Sets a vue.js field. Short for "vue set".
|
||||
function vs(field, value) {
|
||||
@@ -82,8 +85,9 @@
|
||||
data: reactiveData,
|
||||
});
|
||||
|
||||
if (callback !== undefined)
|
||||
if (callback !== undefined) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
} (window.commento, document));
|
||||
@@ -1,9 +1,10 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Registers a given ID for a fade out after 5 seconds.
|
||||
global.registerHide = function(id) {
|
||||
var el = $(id);
|
||||
|
||||
setTimeout(function() {
|
||||
$(id).fadeOut("fast");
|
||||
}, 5000);
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Talks to the API and sends an reset email.
|
||||
global.sendResetHex = function() {
|
||||
var all_ok = global.unfilledMark(["#email"], function(el) {
|
||||
var allOk = global.unfilledMark(["#email"], function(el) {
|
||||
el.css("border-bottom", "1px solid red");
|
||||
});
|
||||
|
||||
if (!all_ok) {
|
||||
if (!allOk) {
|
||||
global.textSet("#err", "Please make sure all fields are filled.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
/*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */
|
||||
!function(e){var t="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):t&&(t.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return t.hljs}))}(function(e){function t(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function r(e){return e.nodeName.toLowerCase()}function a(e,t){var r=e&&e.exec(t);return r&&0===r.index}function n(e){return E.test(e)}function i(e){var t,r,a,i,s=e.className+" ";if(s+=e.parentNode?e.parentNode.className:"",r=M.exec(s))return w(r[1])?r[1]:"no-highlight";for(s=s.split(/\s+/),t=0,a=s.length;a>t;t++)if(i=s[t],n(i)||w(i))return i}function s(e){var t,r={},a=Array.prototype.slice.call(arguments,1);for(t in e)r[t]=e[t];return a.forEach(function(e){for(t in e)r[t]=e[t]}),r}function c(e){var t=[];return function a(e,n){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?n+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:n,node:i}),n=a(i,n),r(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:n,node:i}));return n}(e,0),t}function o(e,a,n){function i(){return e.length&&a.length?e[0].offset!==a[0].offset?e[0].offset<a[0].offset?e:a:"start"===a[0].event?e:a:e.length?e:a}function s(e){function a(e){return" "+e.nodeName+'="'+t(e.value).replace('"',""")+'"'}u+="<"+r(e)+N.map.call(e.attributes,a).join("")+">"}function c(e){u+="</"+r(e)+">"}function o(e){("start"===e.event?s:c)(e.node)}for(var l=0,u="",d=[];e.length||a.length;){var b=i();if(u+=t(n.substring(l,b[0].offset)),l=b[0].offset,b===e){d.reverse().forEach(c);do o(b.splice(0,1)[0]),b=i();while(b===e&&b.length&&b[0].offset===l);d.reverse().forEach(s)}else"start"===b[0].event?d.push(b[0].node):d.pop(),o(b.splice(0,1)[0])}return u+t(n.substr(l))}function l(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(t){return s(e,{v:null},t)})),e.cached_variants||e.eW&&[s(e)]||[e]}function u(e){function t(e){return e&&e.source||e}function r(r,a){return new RegExp(t(r),"m"+(e.cI?"i":"")+(a?"g":""))}function a(n,i){if(!n.compiled){if(n.compiled=!0,n.k=n.k||n.bK,n.k){var s={},c=function(t,r){e.cI&&(r=r.toLowerCase()),r.split(" ").forEach(function(e){var r=e.split("|");s[r[0]]=[t,r[1]?Number(r[1]):1]})};"string"==typeof n.k?c("keyword",n.k):k(n.k).forEach(function(e){c(e,n.k[e])}),n.k=s}n.lR=r(n.l||/\w+/,!0),i&&(n.bK&&(n.b="\\b("+n.bK.split(" ").join("|")+")\\b"),n.b||(n.b=/\B|\b/),n.bR=r(n.b),n.e||n.eW||(n.e=/\B|\b/),n.e&&(n.eR=r(n.e)),n.tE=t(n.e)||"",n.eW&&i.tE&&(n.tE+=(n.e?"|":"")+i.tE)),n.i&&(n.iR=r(n.i)),null==n.r&&(n.r=1),n.c||(n.c=[]),n.c=Array.prototype.concat.apply([],n.c.map(function(e){return l("self"===e?n:e)})),n.c.forEach(function(e){a(e,n)}),n.starts&&a(n.starts,i);var o=n.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([n.tE,n.i]).map(t).filter(Boolean);n.t=o.length?r(o.join("|"),!0):{exec:function(){return null}}}}a(e)}function d(e,r,n,i){function s(e,t){var r,n;for(r=0,n=t.c.length;n>r;r++)if(a(t.c[r].bR,e))return t.c[r]}function c(e,t){if(a(e.eR,t)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?c(e.parent,t):void 0}function o(e,t){return!n&&a(t.iR,e)}function l(e,t){var r=v.cI?t[0].toLowerCase():t[0];return e.k.hasOwnProperty(r)&&e.k[r]}function p(e,t,r,a){var n=a?"":L.classPrefix,i='<span class="'+n,s=r?"":R;return i+=e+'">',i+t+s}function m(){var e,r,a,n;if(!N.k)return t(E);for(n="",r=0,N.lR.lastIndex=0,a=N.lR.exec(E);a;)n+=t(E.substring(r,a.index)),e=l(N,a),e?(M+=e[1],n+=p(e[0],t(a[0]))):n+=t(a[0]),r=N.lR.lastIndex,a=N.lR.exec(E);return n+t(E.substr(r))}function f(){var e="string"==typeof N.sL;if(e&&!x[N.sL])return t(E);var r=e?d(N.sL,E,!0,k[N.sL]):b(E,N.sL.length?N.sL:void 0);return N.r>0&&(M+=r.r),e&&(k[N.sL]=r.top),p(r.language,r.value,!1,!0)}function g(){C+=null!=N.sL?f():m(),E=""}function _(e){C+=e.cN?p(e.cN,"",!0):"",N=Object.create(e,{parent:{value:N}})}function h(e,t){if(E+=e,null==t)return g(),0;var r=s(t,N);if(r)return r.skip?E+=t:(r.eB&&(E+=t),g(),r.rB||r.eB||(E=t)),_(r,t),r.rB?0:t.length;var a=c(N,t);if(a){var n=N;n.skip?E+=t:(n.rE||n.eE||(E+=t),g(),n.eE&&(E=t));do N.cN&&(C+=R),N.skip||(M+=N.r),N=N.parent;while(N!==a.parent);return a.starts&&_(a.starts,""),n.rE?0:t.length}if(o(t,N))throw new Error('Illegal lexeme "'+t+'" for mode "'+(N.cN||"<unnamed>")+'"');return E+=t,t.length||1}var v=w(e);if(!v)throw new Error('Unknown language: "'+e+'"');u(v);var y,N=i||v,k={},C="";for(y=N;y!==v;y=y.parent)y.cN&&(C=p(y.cN,"",!0)+C);var E="",M=0;try{for(var B,S,$=0;;){if(N.t.lastIndex=$,B=N.t.exec(r),!B)break;S=h(r.substring($,B.index),B[0]),$=B.index+S}for(h(r.substr($)),y=N;y.parent;y=y.parent)y.cN&&(C+=R);return{r:M,value:C,language:e,top:N}}catch(A){if(A.message&&-1!==A.message.indexOf("Illegal"))return{r:0,value:t(r)};throw A}}function b(e,r){r=r||L.languages||k(x);var a={r:0,value:t(e)},n=a;return r.filter(w).forEach(function(t){var r=d(t,e,!1);r.language=t,r.r>n.r&&(n=r),r.r>a.r&&(n=a,a=r)}),n.language&&(a.second_best=n),a}function p(e){return L.tabReplaLine truncated
|
||||
var t="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},a={cN:"doctag",b:"@[A-Za-z]+"},n={b:"#<",e:">"},i=[e.C("#","$",{c:[a]}),e.C("^\\=begin","^\\=end",{c:[a],r:10}),e.C("^__END__","\\n$")],s={cN:"subst",b:"#\\{",e:"}",k:r},c={cN:"string",c:[e.BE,s],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<(-?)\w+$/,e:/^\s*\w+$/}]},o={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},l=[c,n,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(i)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:t}),o].concat(i)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[c,{b:t}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:r},{b:"("+e.RSR+"|unless)\\s*",k:"unless",c:[n,{cN:"regexp",c:[e.BE,s],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(i),r:0}].concat(i);s.c=l,o.c=l;var u="[>?]>",d="[\\w#]+\\(\\w+\\):\\d+:\\d+>",b="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",p=[{b:/^\s*=>/,starts:{e:"$",c:l}},{cN:"meta",b:"^("+u+"|"+d+"|"+b+")",starts:{e:"$",c:l}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:i.concat(p).concat(l)}}),e.registerLanguage("shell",function(e){return{aliases:["console"],c:[{cN:"meta",b:"^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]",starts:{e:"$",sL:"bash"}}]}}),e.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>{}*#]/,c:[{bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment",e:/;/,eW:!0,l:/[\w\.]+/,k:{keyword:"abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred dLine truncated
|
||||
@@ -1,4 +1,7 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Performs a JSON POST request to the given url with the given data and
|
||||
// calls the callback function with the JSON response.
|
||||
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
|
||||
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={IDLine truncated
|
||||
a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e=Line truncated
|
||||
null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?bLine truncated
|
||||
@@ -1,13 +1,15 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
(document);
|
||||
|
||||
// Shows messages produced from email confirmation attempts.
|
||||
function displayConfirmedEmail() {
|
||||
var confirmed = global.paramGet("confirmed");
|
||||
|
||||
if (confirmed == "true") {
|
||||
if (confirmed === "true") {
|
||||
$("#msg").html("Successfully confirmed! Login to continue.")
|
||||
}
|
||||
else if (confirmed == "false") {
|
||||
} else if (confirmed === "false") {
|
||||
$("#err").html("That link has expired.")
|
||||
}
|
||||
}
|
||||
@@ -17,7 +19,7 @@
|
||||
function displayChangedPassword() {
|
||||
var changed = global.paramGet("changed");
|
||||
|
||||
if (changed == "true") {
|
||||
if (changed === "true") {
|
||||
$("#msg").html("Password changed successfully! Login to continue.")
|
||||
}
|
||||
}
|
||||
@@ -26,7 +28,7 @@
|
||||
function displaySignedUp() {
|
||||
var signedUp = global.paramGet("signedUp");
|
||||
|
||||
if (signedUp == "true") {
|
||||
if (signedUp === "true") {
|
||||
$("#msg").html("Registration successful! Login to continue.")
|
||||
}
|
||||
}
|
||||
@@ -42,11 +44,11 @@
|
||||
|
||||
// Logs the user in and redirects to the dashboard.
|
||||
global.login = function() {
|
||||
var all_ok = global.unfilledMark(["#email", "#password"], function(el) {
|
||||
var allOk = global.unfilledMark(["#email", "#password"], function(el) {
|
||||
el.css("border-bottom", "1px solid red");
|
||||
});
|
||||
|
||||
if (!all_ok) {
|
||||
if (!allOk) {
|
||||
global.textSet("#err", "Please make sure all fields are filled");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
global.logout = function() {
|
||||
global.cookieDelete("commentoOwnerToken");
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
global.resetPassword = function() {
|
||||
var all_ok = global.unfilledMark(["#password", "#password2"], function(el) {
|
||||
var allOk = global.unfilledMark(["#password", "#password2"], function(el) {
|
||||
el.css("border-bottom", "1px solid red");
|
||||
});
|
||||
|
||||
if (!all_ok) {
|
||||
if (!allOk) {
|
||||
global.textSet("#err", "Please make sure all fields are filled.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#password").val() != $("#password2").val()) {
|
||||
if ($("#password").val() !== $("#password2").val()) {
|
||||
global.textSet("#err", "The two passwords do not match.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
// Get self details.
|
||||
global.selfGet = function(callback) {
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
(function (global, document) {
|
||||
"use strict"
|
||||
|
||||
// Signs up the user and redirects to either the login page or the email
|
||||
// confirmation, depending on whether or not SMTP is configured in the
|
||||
// backend.
|
||||
global.signup = function() {
|
||||
if ($("#password").val() != $("#password2").val()) {
|
||||
if ($("#password").val() !== $("#password2").val()) {
|
||||
global.textSet("#err", "The two passwords don't match");
|
||||
return;
|
||||
}
|
||||
|
||||
var all_ok = global.unfilledMark(["#email", "#name", "#password", "#password2"], function(el) {
|
||||
var allOk = global.unfilledMark(["#email", "#name", "#password", "#password2"], function(el) {
|
||||
el.css("border-bottom", "1px solid red");
|
||||
});
|
||||
|
||||
if (!all_ok) {
|
||||
if (!allOk) {
|
||||
global.textSet("#err", "Please make sure all fields are filled");
|
||||
return;
|
||||
}
|
||||
@@ -33,10 +34,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (resp.confirmEmail)
|
||||
if (resp.confirmEmail) {
|
||||
document.locatidocumenton = global.origin + "/confirm-email";
|
||||
else
|
||||
} else {
|
||||
document.location = global.origin + "/login?signedUp=true";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
+26
-16
@@ -1,14 +1,16 @@
|
||||
(function (global, document) {
|
||||
"use strict";
|
||||
|
||||
// Gets a GET parameter in the current URL.
|
||||
global.paramGet = function(param) {
|
||||
var pageURL = decodeURIComponent(window.location.search.substring(1));
|
||||
var urlVariables = pageURL.split('&');
|
||||
var urlVariables = pageURL.split("&");
|
||||
|
||||
for (var i = 0; i < urlVariables.length; i++) {
|
||||
var paramURL = urlVariables[i].split('=');
|
||||
if (paramURL[0] === param)
|
||||
var paramURL = urlVariables[i].split("=");
|
||||
if (paramURL[0] === param) {
|
||||
return paramURL[1] === undefined ? true : paramURL[1];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -42,16 +44,16 @@
|
||||
// Given an array of input IDs, this function calls a callback function with
|
||||
// the first unfilled ID.
|
||||
global.unfilledMark = function(fields, callback) {
|
||||
var all_ok = true;
|
||||
var allOk = true;
|
||||
|
||||
for (var i = 0; i < fields.length; i++) {
|
||||
var el = $(fields[i]);
|
||||
if (el.val() == "") {
|
||||
if (el.val() === "") {
|
||||
callback(el);
|
||||
}
|
||||
}
|
||||
|
||||
return all_ok;
|
||||
return allOk;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,8 +61,9 @@
|
||||
global.cookieGet = function(name) {
|
||||
var c = "; " + document.cookie;
|
||||
var x = c.split("; " + name + "=");
|
||||
if (x.length == 2)
|
||||
if (x.length === 2) {
|
||||
return x.pop().split(";").shift();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -72,8 +75,9 @@
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
|
||||
var cookieString = name + "=" + value + expires + "; path=/";
|
||||
if (/^https:\/\//i.test(origin))
|
||||
if (/^https:\/\//i.test(origin)) {
|
||||
cookieString += "; secure";
|
||||
}
|
||||
|
||||
document.cookie = cookieString;
|
||||
}
|
||||
@@ -81,7 +85,7 @@
|
||||
|
||||
// Deletes a cookie.
|
||||
global.cookieDelete = function(name) {
|
||||
document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
||||
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:01 GMT;";
|
||||
}
|
||||
|
||||
|
||||
@@ -90,29 +94,35 @@
|
||||
var seconds = Math.floor((new Date() - date) / 1000);
|
||||
var interval = Math.floor(seconds / 31536000);
|
||||
|
||||
if (interval > 1)
|
||||
if (interval > 1) {
|
||||
return interval + " years ago";
|
||||
}
|
||||
|
||||
interval = Math.floor(seconds / 2592000);
|
||||
if (interval > 1)
|
||||
if (interval > 1) {
|
||||
return interval + " months ago";
|
||||
}
|
||||
|
||||
interval = Math.floor(seconds / 86400);
|
||||
if (interval > 1)
|
||||
if (interval > 1) {
|
||||
return interval + " days ago";
|
||||
}
|
||||
|
||||
interval = Math.floor(seconds / 3600);
|
||||
if (interval > 1)
|
||||
if (interval > 1) {
|
||||
return interval + " hours ago";
|
||||
}
|
||||
|
||||
interval = Math.floor(seconds / 60);
|
||||
if (interval > 1)
|
||||
if (interval > 1) {
|
||||
return interval + " minutes ago";
|
||||
}
|
||||
|
||||
if (seconds > 5)
|
||||
if (seconds > 5) {
|
||||
return Math.floor(seconds) + " seconds ago";
|
||||
else
|
||||
} else {
|
||||
return "just now";
|
||||
}
|
||||
}
|
||||
|
||||
} (window.commento, document));
|
||||
@@ -1,6 +0,0 @@
|
||||
/*!
|
||||
* Vue.js v2.5.16
|
||||
* (c) 2014-2018 Evan You
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var y=Object.freeze({});function M(e){return null==e}function D(e){return null!=e}function S(e){return!0===e}function T(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function P(e){return null!==e&&"object"==typeof e}var r=Object.prototype.toString;function l(e){return"[object Object]"===r.call(e)}function i(e){var t=parseFloat(String(e));return 0<=t&&Math.floor(t)===t&&isFinite(e)}function t(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function F(e){var t=parseFloat(e);return isNaN(t)?e:t}function s(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var c=s("slot,component",!0),u=s("key,ref,slot,slot-scope,is");function f(e,t){if(e.length){var n=e.indexOf(t);if(-1<n)return e.splice(n,1)}}var n=Object.prototype.hasOwnProperty;function p(e,t){return n.call(e,t)}function e(t){var n=Object.create(null);return function(e){return n[e]||(n[e]=t(e))}}var o=/-(\w)/g,g=e(function(e){return e.replace(o,function(e,t){return t?t.toUpperCase():""})}),d=e(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),a=/\B([A-Z])/g,_=e(function(e){return e.replace(a,"-$1").toLowerCase()});var v=Function.prototype.bind?function(e,t){return e.bind(t)}:function(n,r){function e(e){var t=arguments.length;return t?1<t?n.apply(r,arguments):n.call(r,e):n.call(r)}return e._length=n.length,e};function h(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function m(e,t){for(var n in t)e[n]=t[n];return e}function b(e){for(var t={},n=0;n<e.length;n++)e[n]&&m(t,e[n]);return t}function $(e,t,n){}var O=function(e,t,n){return!1},w=function(e){return e};function C(t,n){if(t===n)return!0;var e=P(t),r=P(n);if(!e||!r)return!e&&!r&&String(t)===String(n);try{var i=Array.isArray(t),o=Array.isArray(n);if(i&&o)return t.length===n.length&&t.every(function(e,t){return C(e,n[t])});if(i||o)return!1;var a=Object.keys(t),s=Object.keys(n);return a.length===s.length&&a.every(function(e){return C(t[e],n[e])})}catch(e){return!1}}function x(e,t){for(var n=0;n<e.length;n++)if(C(e[n],t))return n;return-1}function R(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var E="data-server-rendered",k=["component","directive","filter"],A=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],j={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:O,isReservedAttr:O,isUnknownElement:O,getTagNamespace:$,parsePlatformTagName:w,mustUseProp:O,_lifecycleHooks:A};function N(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var L=/[^\w.$]/;var I,H="__proto__"in{},B="undefined"!=typeof window,U="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,V=U&&WXEnvironment.platform.toLowerCase(),z=B&&window.navigator.userAgent.toLowerCase(),K=z&&/msie|trident/.test(z),J=z&&0<z.indexOf("msie 9.0"),q=z&&0<z.indexOf("edge/"),W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===I&&(I=!B&&!U&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),I},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=$,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){f(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},oe.target=null;var ae=[];function se(e){oe.target&&ae.push(oe.target),oe.target=e}function ce(){oe.target=ae.pop()}var le=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,tLine truncated
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "commento-ce",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"repository": "git@gitlab.com:commento/commento-ce.git",
|
||||
"author": "Adhityaa <c.adhityaa@gmail.com> Anton Linevych anton@linevich.net",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"chartist": "0.11.0",
|
||||
"fixmyjs": "2.0.0",
|
||||
"gulp": "3.9.1",
|
||||
"gulp-clean-css": "3.9.4",
|
||||
"gulp-concat": "2.6.1",
|
||||
"gulp-eslint": "5.0.0",
|
||||
"gulp-html-minifier": "0.1.8",
|
||||
"gulp-rename": "1.3.0",
|
||||
"gulp-sass": "4.0.1",
|
||||
"gulp-sourcemaps": "2.6.4",
|
||||
"gulp-uglify": "3.0.0",
|
||||
"highlightjs": "9.10.0",
|
||||
"html-minifier": "3.5.7",
|
||||
"jquery": "3.2.1",
|
||||
"natives": "^1.1.6",
|
||||
"normalize-scss": "7.0.1",
|
||||
"sass": "1.5.1",
|
||||
"uglify-js": "3.4.1",
|
||||
"vue": "2.5.16"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint": "^5.10.0"
|
||||
}
|
||||
}
|
||||
+4501
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user