dropped usage of gulp,

by using the external tool
[jsmin](https://github.com/douglascrockford/JSMin.git)
This commit is contained in:
Paul Schneider 2019-05-29 21:37:54 +01:00
commit f0e47e7ec6
22 changed files with 3684 additions and 4439 deletions

309
src/Yavsc/.eslintrc.json Normal file
View file

@ -0,0 +1,309 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"accessor-pairs": "error",
"array-bracket-newline": "error",
"array-bracket-spacing": [
"error",
"never"
],
"array-callback-return": "error",
"array-element-newline": "off",
"arrow-body-style": "error",
"arrow-parens": "error",
"arrow-spacing": "error",
"block-scoped-var": "error",
"block-spacing": [
"error",
"always"
],
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
"callback-return": "off",
"camelcase": "error",
"capitalized-comments": "off",
"class-methods-use-this": "error",
"comma-dangle": "error",
"comma-spacing": [
"error",
{
"after": true,
"before": false
}
],
"comma-style": [
"error",
"last"
],
"complexity": "off",
"computed-property-spacing": [
"error",
"never"
],
"consistent-return": "off",
"consistent-this": "off",
"curly": "off",
"default-case": "error",
"dot-location": [
"error",
"property"
],
"dot-notation": "error",
"eol-last": "error",
"eqeqeq": "off",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": "off",
"func-style": "off",
"function-paren-newline": "error",
"generator-star-spacing": "error",
"global-require": "error",
"guard-for-in": "error",
"handle-callback-err": "error",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"implicit-arrow-linebreak": "error",
"indent": "off",
"indent-legacy": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "off",
"keyword-spacing": [
"error",
{
"after": true,
"before": true
}
],
"line-comment-position": "off",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "error",
"lines-around-directive": "off",
"lines-between-class-members": "error",
"max-classes-per-file": "error",
"max-depth": "error",
"max-len": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-comment-style": "off",
"multiline-ternary": "off",
"new-parens": "error",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"no-alert": "error",
"no-array-constructor": "error",
"no-async-promise-executor": "error",
"no-await-in-loop": "error",
"no-bitwise": "off",
"no-buffer-constructor": "error",
"no-caller": "error",
"no-catch-shadow": "error",
"no-confusing-arrow": "error",
"no-continue": "error",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "error",
"no-empty-function": "error",
"no-eq-null": "off",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-inner-declarations": [
"error",
"functions"
],
"no-invalid-this": "off",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loop-func": "error",
"no-magic-numbers": "off",
"no-misleading-character-class": "error",
"no-mixed-operators": "off",
"no-mixed-requires": "error",
"no-multi-assign": "off",
"no-multi-spaces": "off",
"no-multi-str": "error",
"no-multiple-empty-lines": "error",
"no-native-reassign": "error",
"no-negated-condition": "error",
"no-negated-in-lhs": "error",
"no-nested-ternary": "off",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "error",
"no-plusplus": "off",
"no-process-env": "error",
"no-process-exit": "error",
"no-proto": "error",
"no-prototype-builtins": "error",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": [
"error",
"except-parens"
],
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "off",
"no-shadow-restricted-names": "error",
"no-spaced-func": "error",
"no-sync": "error",
"no-tabs": "error",
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-undefined": "off",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unused-expressions": "off",
"no-use-before-define": "off",
"no-useless-call": "error",
"no-useless-catch": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "off",
"no-void": "error",
"no-warning-comments": "error",
"no-whitespace-before-property": "error",
"no-with": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "error",
"object-curly-spacing": [
"error",
"always"
],
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "error",
"operator-assignment": [
"error",
"always"
],
"operator-linebreak": "off",
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "off",
"prefer-const": "error",
"prefer-destructuring": "off",
"prefer-named-capture-group": "off",
"prefer-numeric-literals": "error",
"prefer-object-spread": "error",
"prefer-promise-reject-errors": "error",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "error",
"prefer-template": "off",
"quote-props": "off",
"quotes": [
"error",
"single"
],
"radix": [
"error",
"always"
],
"require-atomic-updates": "error",
"require-await": "error",
"require-jsdoc": "off",
"require-unicode-regexp": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": [
"error",
{
"after": true,
"before": false
}
],
"semi-style": [
"error",
"last"
],
"sort-imports": "error",
"sort-keys": "off",
"sort-vars": "error",
"space-before-blocks": "error",
"space-before-function-paren": "off",
"space-in-parens": [
"error",
"never"
],
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "off",
"strict": "off",
"switch-colon-spacing": [
"error",
{
"after": true,
"before": false
}
],
"symbol-description": "error",
"template-curly-spacing": "error",
"template-tag-spacing": "error",
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "error",
"vars-on-top": "off",
"wrap-iife": "off",
"wrap-regex": "off",
"yield-star-spacing": "error",
"yoda": [
"error",
"never"
]
}
}

View file

@ -1,11 +0,0 @@
FROM microsoft/aspnet:1.0.0-rc1-update1
RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list
RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/*
COPY . /app
WORKDIR /app
RUN ["dnu", "restore"]
EXPOSE 5001/tcp
ENTRYPOINT ["dnx", "-p", "project.json", "web"]

View file

@ -5,9 +5,14 @@ HOSTADMIN=root
ASPNET_LOG_LEVEL=debug
SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make
include $(MAKEFILE_DIR)/versioning.mk
include $(MAKEFILE_DIR)/dnx.mk
MINJS=wwwroot/js/bootstrap.min.js wwwroot/js/input-lib.min.js wwwroot/js/jquery.signalR-2.2.1.min.js wwwroot/js/quill.min.js wwwroot/js/chat.min.js wwwroot/js/jquery-2.2.4.min.js wwwroot/js/jquery-ui.min.js wwwroot/js/showdown.min.js wwwroot/js/comment.min.js wwwroot/js/jquery-3.2.1.min.js wwwroot/js/md-helpers.min.js wwwroot/js/site.min.js wwwroot/js/dropzone.min.js wwwroot/js/jquery-migrate-3.0.0.min.js wwwroot/js/parallax.min.js wwwroot/js/str.min.js wwwroot/js/google-geoloc.min.js wwwroot/js/jquery.min.js wwwroot/js/paypalbutton.min.js wwwroot/js/to-markdown.min.js
MINCSS=wwwroot/css/coiffure.min.css wwwroot/css/dev.min.css wwwroot/css/freespeech.min.css wwwroot/css/yavsc.min.css wwwroot/css/default.min.css wwwroot/css/font-awesome.min.css wwwroot/css/lua.min.css wwwroot/css/yavscpre.min.css wwwroot/css/clear/site.min.css wwwroot/css/main/bootstrap.min.css wwwroot/css/main/jquery-ui.min.css wwwroot/css/main/site.min.css wwwroot/css/dark/site.min.css wwwroot/css/main/dropzone.min.css wwwroot/css/main/quill.snow.min.css
web: project.lock.json
ASPNET_LOG_LEVEL=$(ASPNET_LOG_LEVEL) ASPNET_ENV=$(ASPNET_ENV) dnx web --configuration=$(CONFIGURATION)
@ -45,3 +50,15 @@ else
git status
endif
%.min.js: %.js
jsmin < $^ > $@
%.min.css: %.css
jsmin < $^ > $@
minJs: $(MINJS)
minCss: $(MINCSS)
minify: minCss minJs

View file

@ -46,7 +46,7 @@
<script>
$(document).ready(function() {
if (typeof allowCircleToBlog !== "undefined") {
if (typeof(allowCircleToBlog) !== 'undefined') {
$('input.Blogcirle[type=checkbox]').on('change', allowCircleToBlog);
}
});

View file

@ -1,12 +0,0 @@
{
"name": "Yavsc",
"private": true,
"dependencies": {
"bootstrap": "3.3.5",
"jquery": "2.1.4",
"jquery-validation": "1.14.0",
"jquery-validation-unobtrusive": "3.2.4",
"enyo/dropzone": "*",
"eonasdan-bootstrap-datetimepicker": "^4.17.37"
}
}

View file

@ -1,55 +0,0 @@
/// <binding Clean='clean' />
"use strict";
var gulp = require("gulp"),
rimraf = require("rimraf"),
cssmin = require("gulp-cssmin"),
uglify = require("gulp-uglify"),
shell = require("gulp-shell"),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
dnx = require("gulp-dnx-tasks");
var webroot = "./wwwroot/";
var paths = {
bower: "./bower_components/",
js: webroot + "js/**/*.js",
minJs: webroot + "js/**/*.min.js",
css: webroot + "css/**/*.css",
minCss: webroot + "css/**/*.min.css",
concatJsDest: webroot + "js/site.min.js",
concatCssDest: webroot + "css/site.min.css"
};
gulp.task("clean:js", function(cb) {
rimraf(paths.concatJsDest, cb);
});
gulp.task("clean:css", function(cb) {
rimraf(paths.concatCssDest, cb);
});
gulp.task("clean", ["clean:js", "clean:css"]);
gulp.task("min:css", function() {
gulp.src([paths.css, "!" + paths.minCss, '!site.css'])
.pipe(cssmin())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('wwwroot/css'));
});
gulp.task("min:js", function() {
return gulp.src([paths.js, "!" + paths.minJs, '!site.js'])
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('wwwroot/js'));
});
gulp.task("min", ["min:js", "min:css"]);
gulp.task('build', shell.task(['dnu build --configuration=Debug']));
gulp.task('run', shell.task(['ASPNET_ENV=Development dnx web --configuration=Debug']));
gulp.task('buildrelease', shell.task(['dnu build --configuration=Release']));
gulp.task("default", ["min"]);

File diff suppressed because it is too large Load diff

View file

@ -7,20 +7,9 @@
"url": "https://github.com/pazof/yavsc"
},
"license": "GPL-3.0",
"devDependencies": {
"grunt": "^1.0.2",
"gulp": "^3.9.1",
"gulp-clean": "^0.4.0",
"gulp-concat": "2.6.1",
"gulp-cssmin": "^0.2.0",
"gulp-dnx-tasks": "^1.0.0-beta7",
"gulp-shell": "^0.6.5",
"gulp-uglify": "^3.0.0",
"rimraf": "^2.6.2"
},
"devDependencies": {},
"dependencies": {
"ansi-to-html": "^0.6.4",
"braintree-web": "^3.31.0",
"paypal-permissions-sdk": "^1.0.10"
}
}

View file

@ -171,7 +171,7 @@
]
},
"scripts": {
"prepublish": "gulp min"
"prepublish": "make minify"
},
"embed": "Views/**/*.cshtml"
}

View file

@ -1 +1,26 @@
.discussion,.notif,.pv{font-family:monospace}#targets,.userinfo{display:block}.blog a:active,.blog a:hover,a:active,a:hover{outline:0}.blogphoto,.row img,main img{max-width:100%}.navbar-brand,.navbar-link,.navbar-nav .dropdown>a{background-color:rgba(0,0,0,.2);border-radius:2em}.navbar-brand:focus,.navbar-brand:hover,.navbar-link:focus,.navbar-link:hover{background-color:rgba(0,0,0,.4)}.ql-editor{border:1em outset #ee903e;padding:1em}.badge{margin:1em}.badge img{height:2em}.row img{max-height:6em}main img{max-height:100%}.userinfo{padding:.8em .8em .8em 2em;margin:.6em;background-repeat:no-repeat;background-attachment:local;background-size:contain;background-image:url(/images/lis.svg);overflow:auto}.performer{border-radius:1.5em;background-color:#f1e4f1;padding:1em}.performer ul{margin-left:2.5em}.smalltofhol{align-self:left;padding:.1em;border-radius:50%}.commentmeta{margin:.5em;padding:.5em;border-right:#444 dashed 1px;border-top:#444 solid 1px}.price,.total{font-weight:700;padding:.2em;margin:.2em}.price{font-size:large}.total{font-size:xx-large;background-color:#f8f;border:3px solid #000;border-radius:1em}.blog,.panel{padding:1em}.blog a{font-weight:900}.discussion{color:#000}.notif{color:#006}.pv{color:#251;font-style:bold}tr.visiblepost,tr.visiblepost img{max-height:3em}tr.hiddenpost{max-height:2em;background-color:#888;font-size:smaller}tr.hiddenpost img{max-height:3em}a.bloglink{font-weight:700;text-shadow:0 0 8px #000}a{font-weight:900}.panel{display:inline-block;margin:1em;color:#0d5175;background-color:inherit;border:1px solid #306cc6}#discussion{float:left}button,input,select,textarea{background-color:#bbb;color:#000}.jumbotron{padding:.5em}.carousel .item .carousel-caption-s{-webkit-transition:-webkit-transform 2s background-color 2s color 2s;-moz-transition:transform 2s background-color 2s color 2s;transition:transform 2s;transform:scale3d(0,0,0);-webkit-transform:scale3d(0,0,0)}.carousel .item.active .carousel-caption-s{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}.disabled{color:#999;background-color:#555}.smallphoto{max-height:4em}.carousel-caption-s p{-webkit-text-shadow:3px 3px 7px #000;animation:mymove 4s infinite;font-family:Arial;font-weight:800;font-size:x-large;text-shadow:3px 3px 7px #00003c;color:#fff;background-color:rgba(94,24,194,.15);border-radius:.5em}.carousel-caption-s{right:3em;top:1em;left:3em;z-index:10;padding-top:20px;padding-bottom:20px;text-align:center;min-height:16em;overflow:auto}.carousel-inner .item{padding-left:15%;padding-right:15%}.carousel-indicators{position:absolute;z-index:15;padding:0;text-align:center;list-style:none;top:.1em;height:1em}main.container{padding-right:1em;padding-left:1em;margin-left:1em;margin-right:1em}@media (max-width:767px){main.container{padding-right:.3em;padding-left:.3em;margin-left:.3em;margin-right:.3em}.carousel-caption-s p{margin:.2em;padding:.2em}}@-webkit-keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}@keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}ul.actiongroup li{display:inline}ul.actiongroup li a:hover{background-color:rgba(200,200,200,.6);color:#400}footer{vertical-align:bottom;padding:1.5em}.display-field{font-kerning:none;display:inline-flex;color:#008}.display-label{font-family:'Lucida Sans','Lucida Sans Regular','Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;font-stretch:condensed;display:inline-flex;color:#ff8;padding:.1em;border-radius:.5em;background-color:#210912}.blogtitle,div.roomlist{display:inline-block}footer{color:grey;font-weight:bolder;font-size:x-small}.meta{color:#444;font-style:italic;font-size:smaller}.activity{font-family:fantasy}.blogtitle{font-size:x-large}.blogphoto{margin:1em;max-height:100%;image-orientation:from-image}body{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif}p{font-size:20px}p.small{font-size:16px}.smalltext{font-size:10px}h1,h2,h3,h4,h5,h6{font-family:Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:700}div.chatbar{border-bottom:#1818a7 solid 2px}div.chatctl{float:right}
.navbar-link,.navbar-brand,.navbar-nav.dropdown>a{background-color:rgba(0,0,0,.2);border-radius:2em;}.navbar-link:hover,.navbar-brand:hover,.navbar-link:focus,.navbar-brand:focus{background-color:rgba(0,0,0,.4);}.ql-editor{border:outset 1em rgb(238,144,62);padding:1em;}.badge{margin:1em;}.badge img{height:2em;}.row img{max-width:100%;max-height:6em;}
main img{max-width:100%;max-height:100%;}.userinfo{display:block;padding:.8em;margin:.6em;background-repeat:no-repeat;background-attachment:local;background-size:contain;background-image:url('/images/lis.svg');overflow:auto;padding-left:2em;}.performer{border-radius:1.5em;background-color:#f1e4f1;padding:1em;}.performer ul{margin-left:2.5em;}.smalltofhol{align-self:left;padding:.1em;border-radius:50%;}.commentmeta{margin:.5em;padding:.5em;border-right:#444 dashed 1px;border-top:#444 solid 1px;}.price{font-weight:bold;font-size:large;padding:.2em;margin:.2em;}.total{font-weight:bold;font-size:xx-large;background-color:#f8f;border:solid black 3px;border-radius:1em;padding:.2em;margin:.2em;}.blog{padding:1em;}.blog a{font-weight:900;}.blog a:active,.blog a:hover{outline:0;}.discussion{color:black;}.notif{color:#555;}.pv{color:#540;font-style:bold;}.discussion{font-family:monospace;}.notif{color:#006;font-family:monospace;}.pv{color:#251;font-family:monospace;font-style:bold;}#targets{display:block;}
tr.visiblepost{max-height:3em;}
tr.visiblepost img{max-height:3em;}
tr.hiddenpost{max-height:2em;background-color:#888;font-size:smaller;}
tr.hiddenpost img{max-height:3em;}
a.bloglink{font-weight:bold;text-shadow:0px 0px 8px black;}
a{font-weight:900;}
a:active,a:hover{outline:0;}.panel{display:inline-block;padding:1em;margin:1em;color:#0d5175;background-color:inherit;border:solid#306cc6 1px;}#discussion{float:left;}
input,select,button,textarea{background-color:#bbb;color:#000;}.jumbotron{padding:.5em;}.carousel.item.carousel-caption-s{-webkit-transition:-webkit-transform 2s background-color 2s color 2s;-moz-transition:transform 2s background-color 2s color 2s;transition:transform 2s;transform:scale3d(0,0,0);-webkit-transform:scale3d(0,0,0);}.carousel.item.active.carousel-caption-s{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);}.disabled{color:#999;background-color:#555;}.smallphoto{max-height:4em;}.carousel-caption-s p{-webkit-text-shadow:3px 3px 7px rgb(0,0,0);animation:mymove 4s infinite;font-family:"Arial";font-weight:800;font-size:x-large;text-shadow:3px 3px 7px rgb(0,0,60);color:#fff;background-color:rgba(94,24,194,.15);border-radius:.5em;}.carousel-caption-s{right:3em;top:1em;left:3em;z-index:10;padding-top:20px;padding-bottom:20px;text-align:center;min-height:16em;overflow:auto;}.carousel-inner.item{padding-left:15%;padding-right:15%;}.carousel-indicators{position:absolute;z-index:15;padding:0;text-align:center;list-style:none;top:.1em;height:1em;}
main.container{padding-right:1em;padding-left:1em;margin-left:1em;margin-right:1em;}@media(max-width:767px){main.container{padding-right:.3em;padding-left:.3em;margin-left:.3em;margin-right:.3em;}.carousel-caption-s p{margin:0.2em;padding:.2em;}}@-webkit-keyframes mymove{from{text-decoration-color:red;}
50%{text-decoration-color:blue;}
to{text-decoration-color:red;}}@keyframes mymove{from{text-decoration-color:red;}
50%{text-decoration-color:blue;}
to{text-decoration-color:red;}}
ul.actiongroup li{display:inline;}
ul.actiongroup li a:hover{background-color:rgba(200,200,200,.6);color:#400;}
footer{vertical-align:bottom;padding:1.5em;}.display-field{font-kerning:none;display:inline-flex;color:#008;}.display-label{font-family:'Lucida Sans','Lucida Sans Regular','Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;font-stretch:condensed;display:inline-flex;color:#ff8;padding:.1em;border-radius:.5em;background-color:#210912;}
footer{color:rgb(128,128,128);font-weight:bolder;font-size:x-small;}.meta{color:#444;font-style:italic;font-size:smaller;}.activity{font-family:fantasy}.blogtitle{display:inline-block;font-size:x-large;}.blogphoto{margin:1em;max-width:100%;max-height:100%;image-orientation:from-image;}
body{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;}
p{font-size:20px;}
p.small{font-size:16px;}.smalltext{font-size:10px;}
h1,h2,h3,h4,h5,h6{font-family:"Montserrat","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:700;}
div.chatbar{border-bottom:rgb(24,24,167)solid 2px;}
div.roomlist{display:inline-block;}
div.chatctl{float:right;}

View file

@ -658,8 +658,7 @@ if (typeof jQuery === 'undefined') {
if (!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
this.$element[dimension](0)
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)
}

File diff suppressed because one or more lines are too long

View file

@ -1,8 +1,9 @@
+(function ($) {
/*
# chat control ids
window.ChatHubHandler = (function ($) {
## inputs
/*
# chat control ids
## inputs
* msg_<rname> : input providing a room message
* pv_<uname> : input providing a private message
@ -17,7 +18,7 @@
* server : container for server messages
## temporary containers
* room_<rname> : room message list
* pv_<uname> : private discussion display
@ -28,134 +29,132 @@
*/
$.fn.filterByData = function (prop, val) {
return this.filter(
function () { return $(this).data(prop) == val; }
)
}
return this.filter(function () { return $(this).data(prop) == val; });
};
var ChatView = function ($view, full) {
var ChatView = function ($view, full)
{
if (!full) throw "not implemented";
if (!full) throw new Error('not implemented');
// build a channel list
var chans = Array();
var users = Array();
var chans = [];
var frontRoomName;
var ulist = $("<ul></ul>").addClass('userlist');
var notifications = $("<ul></ul>").addClass('notifs');
var ulist = $('<ul></ul>').addClass('userlist');
var notifications = $('<ul></ul>').addClass('notifs');
ulist.appendTo($view);
notifications.appendTo($view);
var chat = $.connection.chatHub
var chat = $.connection.chatHub;
// Create a function that the hub can call back to display messages.
chat.client.addMessage = function (name, room, message) {
// Add the message to the page.
$('#room_'+room).append('<li class="discussion"><strong>' + htmlEncode(name)
+ '</strong>: ' + htmlEncode(message) + '</li>')
}
$('#room_' + room).append('<li class="discussion"><strong>' + htmlEncode(name) + '</strong>: ' + htmlEncode(message) + '</li>');
};
chat.client.addPV = function (name, message) {
if (!$('#mute').prop('checked')) {
audio.play()
audio.play();
}
// Add the pv to the page.
$('#pv_'+name).append('<li class="pv"><strong>' + htmlEncode(name)
+ '</strong>: ' + htmlEncode(message) + '</li>')
}
chat.client.notify = function (tag, message) {
$('#pv_' + name).append('<li class="pv"><strong>' + htmlEncode(name) + '</strong>: ' + htmlEncode(message) + '</li>');
};
chat.client.notifyRoom = function (tag, targetid, message) {
// Add the notification to the page.
if (tag === 'connected' || tag === "reconnected") {
onUserConnected(message);
}
else if (tag === 'disconnected') {
onUserDisconnected(message)
} // reconnected userpart userjoin deniedpv
$("<li></li>").append(tag+": ").append(message).addClass(tag).
appendTo(notifications);
}
if (tag === 'connected' || tag === 'reconnected') onUserConnected(targetid, message);
else if (tag === 'disconnected') onUserDisconnected(targetid, message);
// eslint-disable-next-line no-warning-comments
// TODO reconnected userpart userjoin deniedpv
$('<li></li>').addClass(tag).append(tag + ': ' + targetid + ' ').append(message).addClass(tag).appendTo($('#room_' + targetid));
};
chat.client.notifyUser = function (tag, targetid, message) {
// Add the notification to the page.
if (tag === 'connected' || tag === 'reconnected') onUserConnected(targetid, message);
else if (tag === 'disconnected') onUserDisconnected(targetid, message);
// eslint-disable-next-line no-warning-comments
// TODO reconnected userpart userjoin deniedpv
$('<li></li>').append(tag + ': ' + targetid).append(message).addClass(tag).appendTo(notifications);
};
var setActiveRoom = function(room) {
var frontRoom;
if (frontRoomName!=='') {
frontRoom=$("#vroom_"+frontRoomName);
if (frontRoomName !== '') {
frontRoom = $('#vroom_' + frontRoomName);
// eslint-disable-next-line no-warning-comments
// TODO animate
frontRoom.addClass("hidden");
$("#sel_"+frontRoomName).addClass("btn-primary");
frontRoom.addClass('hidden');
$('#sel_' + frontRoomName).addClass('btn-primary');
}
frontRoomName = room;
frontRoom=$("#vroom_"+room);
$("#sel_"+room).removeClass("btn-primary");
frontRoom.removeClass("hidden");
}
frontRoom = $('#vroom_' + room);
$('#sel_' + room).removeClass('btn-primary');
frontRoom.removeClass('hidden');
};
var chatbar = $('<div class="chatbar"></div>');
var roomjoin = $('<div class="chatctl" class=\"form-control\"></div>');
var roomjoin = $('<div class="chatctl" class="form-control"></div>');
var roomlist = $('<div class="roomlist"></div>');
roomlist.appendTo(chatbar);
$("<label for=\"channame\">Join&nbsp;:</label>")
$('<label for="channame">Join&nbsp;:</label>')
.appendTo(roomjoin);
var chanName = $("<input id=\"channame\" title=\"channel name\" hint=\"yavsc\" >");
var chanName = $('<input id="channame" title="channel name" hint="yavsc" >');
chanName.appendTo(roomjoin);
roomjoin.appendTo(chatbar);
chatbar.appendTo($view);
var chatlist = $('<div class="chatlist" ></div>');
chatlist.appendTo($view);
var buildRoom = function (room)
{
var roomTag = $("<a>"+room+"</a>").addClass("btn");
roomTag.prop("id","sel_"+room)
.click(function(){
var buildRoom = function (room) {
var roomTag = $('<a>' + room + '</a>').addClass('btn');
roomTag.prop('id', 'sel_' + room).click(function() {
setActiveRoom(room);
$(this).removeClass("btn-primary");
$(this).removeClass('btn-primary');
});
roomTag.appendTo(roomlist);
var roomview = $("<div></div>").addClass("container");
var roomview = $('<div></div>').addClass('container');
roomview.appendTo(chatlist);
roomview.prop('id',"vroom_"+room);
var msglist = $("<ul></ul>").addClass("mesglist");
msglist.prop('id',"room_"+room);
roomview.prop('id', 'vroom_' + room);
var msglist = $('<ul></ul>').addClass('mesglist');
msglist.prop('id', 'room_' + room);
msglist.appendTo(roomview);
$("<input type=\"text\">")
.prop('id','inp_'+room)
.prop('enable',false)
.prop('hint','hello')
.prop('title','send to '+room)
$('<input type="text">')
.prop('id', 'inp_' + room)
.prop('enable', false)
.prop('hint', 'hello')
.prop('title', 'send to ' + room)
.addClass('form-control')
.keydown(function(ev) {
if (ev.which == 13) {
if (this.value.length==0) return;
if (this.value.length == 0) return;
chat.server.send(room, this.value);
this.value="";
}}).appendTo(roomview);
this.value = '';
}
}).appendTo(roomview);
chans.push(room);
setActiveRoom(room);
}
};
$view.data("chans").split(",").forEach(function(chan) {
buildRoom(chan)
$view.data('chans').split(',').forEach(function(chan) {
buildRoom(chan);
});
function onCx () {
setTimeout(function () {
getUsers()
}, 120),
getUsers();
}, 120);
$('#chatview').removeClass('disabled');
chans.forEach(function(room) {
chat.server.join(room).done(function(chatInfo)
{
chat.server.join(room).done(function(chatInfo) {
setActiveRoom(chatInfo.Name);
});
})
});
}
function onDisCx () {
@ -164,125 +163,120 @@
// Start the connection.
$.connection.hub.start().done(function () {
onCx()
})
onCx();
});
$.connection.hub.disconnected(function () {
onDisCx()
onDisCx();
setTimeout(function () {
$.connection.hub.start().done(function () {
// $('#mySignalRConnectionIdHidden').val($.connection.hub.id)
onCx()
onCx();
}, 30000); // Re-start connection after 30 seconds
})
})
chanName.keydown(
function (event) {
if (event.which == 13) {
if (this.value.length==0) return;
buildRoom(this.value);
chat.server.join(this.value).done(function(chatInfo)
{
setActiveRoom(chatInfo.Name);
});
this.value=""
} else {
// TODO showRoomInfo(this.value);
}
});
});
var pvuis
chanName.keydown(function (event) {
if (event.which == 13) {
if (this.value.length == 0) return;
buildRoom(this.value);
chat.server.join(this.value).done(function(chatInfo) {
setActiveRoom(chatInfo.Name);
});
this.value = '';
}
// else TODO showRoomInfo(this.value);
});
var pvuis;
// eslint-disable-next-line no-warning-comments
// TODO get this data from the chatview element
var audio = new Audio('/sounds/bell.mp3')
var audio = new Audio('/sounds/bell.mp3');
var sendPV = function () {
var msg = $('#pv').val()
var msg = $('#pv').val();
// Call the Send method on the hub.
$.each(pvuis.CXs, function () {
chat.server.sendPV(this, msg)
})
$('#discussion').append('<li class="pv">' + htmlEncode(pvuis.UserName)
+ '<< ' + htmlEncode(msg) + '</li>')
chat.server.sendPV(this, msg);
});
$('#discussion').append('<li class="pv">' + htmlEncode(pvuis.UserName) + '<< ' + htmlEncode(msg) + '</li>');
// Clear text box and reset focus for next comment.
$('#pv').val('')
}
$('#pv').val('');
};
$('#pv').keydown(function (event) {
if (event.which == 13) {
sendPV()
sendPV();
}
})
});
$('#command').keydown(function (event) {
if (event.which == 13) {
sendCommand()
// eslint-disable-next-line no-warning-comments
// TODO server command: sendCommand()
}
})
});
var addChatUser = function (uname) {
$("#u_"+uname).remove();
$('#u_' + uname).remove();
// ulist.remove("li.user[data='"+uname+"']");
$('<li class="user"><img src="/Avatars/' + uname + '.xs.png"> ' + uname + '</li>')
.prop('id', 'u_'+uname)
.prop('id', 'u_' + uname)
.css('cursor', 'pointer')
.click(function () { setPrivateTarget(this); })
.appendTo(ulist)
}
.appendTo(ulist);
};
var getUsers = function () {
$.get('/api/chat/users').done(
function (users) {
$.get('/api/chat/users').done(function (users) {
$.each(users, function () {
var user = this
addChatUser(user.UserName)
})
}
)
}
var user = this;
addChatUser(user.UserName);
});
});
};
// This optional function html-encodes messages for display in the page.
function htmlEncode (value) {
var encodedValue = $('<div />').text(value).html()
return encodedValue
var encodedValue = $('<div />').text(value).html();
return encodedValue;
}
var setPrivateTarget = function (li) {
$('#rooms').addClass('hidden')
$('#sendpvbox').removeClass('hidden')
pvuis = { CXs: $(li).data('cxids'), UserName: $(li).data('name') }
$('#sendpvdest').html(pvuis.UserName)
$('#pvs').focus()
}
$('#rooms').addClass('hidden');
$('#sendpvbox').removeClass('hidden');
pvuis = { CXs: $(li).data('cxids'), UserName: $(li).data('name') };
$('#sendpvdest').html(pvuis.UserName);
$('#pvs').focus();
};
var setPublic = function () {
$('#rooms').removeClass('hidden')
$('#sendpvbox').addClass('hidden')
$('#message').focus()
}
$('#pubChan').css('cursor', 'pointer')
$('#pubChan').click(setPublic)
setPublic()
$('#rooms').removeClass('hidden');
$('#sendpvbox').addClass('hidden');
$('#message').focus();
};
$('#pubChan').css('cursor', 'pointer');
$('#pubChan').click(setPublic);
setPublic();
var onUserDisconnected = function (uname) {
$("#u_"+uname).remove();
}
$('#u_' + uname).remove();
};
var onUserConnected = function (username) {
addChatUser(username)
}
$(window).unload(function () { chat.server.abort(); })
addChatUser(username);
};
}
$(window).unload(function () { chat.server.abort(); });
$(document).ready(function($){
ChatView($('#chatview'),true);
};
$(document).ready(function($) {
ChatView($('#chatview'), true);
});
})(jQuery);
})(window.jQuery);

View file

@ -1 +1,7 @@
!function(k){k.fn.filterByData=function(n,e){return this.filter(function(){return k(this).data(n)==e})};var e=function(n,e){if(!e)throw"not implemented";var a,i=Array(),o=(Array(),k("<ul></ul>").addClass("userlist")),s=k("<ul></ul>").addClass("notifs");o.appendTo(n),s.appendTo(n);var t=k.connection.chatHub;t.client.addMessage=function(n,e,a){k("#room_"+e).append('<li class="discussion"><strong>'+y(n)+"</strong>: "+y(a)+"</li>")},t.client.addPV=function(n,e){k("#mute").prop("checked")||m.play(),k("#pv_"+n).append('<li class="pv"><strong>'+y(n)+"</strong>: "+y(e)+"</li>")},t.client.notify=function(n,e){"connected"===n||"reconnected"===n?g(e):"disconnected"===n&&_(e),k("<li></li>").append(n+": ").append(e).addClass(n).appendTo(s)};var d=function(n){var e;""!==a&&((e=k("#vroom_"+a)).addClass("hidden"),k("#sel_"+a).addClass("btn-primary")),e=k("#vroom_"+(a=n)),k("#sel_"+n).removeClass("btn-primary"),e.removeClass("hidden")},c=k('<div class="chatbar"></div>'),r=k('<div class="chatctl" class="form-control"></div>'),l=k('<div class="roomlist"></div>');l.appendTo(c),k('<label for="channame">Join&nbsp;:</label>').appendTo(r);var p=k('<input id="channame" title="channel name" hint="yavsc" >');p.appendTo(r),r.appendTo(c),c.appendTo(n);var u=k('<div class="chatlist" ></div>');u.appendTo(n);var v,h=function(e){var n=k("<a>"+e+"</a>").addClass("btn");n.prop("id","sel_"+e).click(function(){d(e),k(this).removeClass("btn-primary")}),n.appendTo(l);var a=k("<div></div>").addClass("container");a.appendTo(u),a.prop("id","vroom_"+e);var o=k("<ul></ul>").addClass("mesglist");o.prop("id","room_"+e),o.appendTo(a),k('<input type="text">').prop("id","inp_"+e).prop("enable",!1).prop("hint","hello").prop("title","send to "+e).addClass("form-control").keydown(function(n){if(13==n.which){if(0==this.value.length)return;t.server.send(e,this.value),this.value=""}}).appendTo(a),i.push(e),d(e)};function f(){setTimeout(function(){b()},120),k("#chatview").removeClass("disabled"),i.forEach(function(n){t.server.join(n).done(function(n){d(n.Name)})})}n.data("chans").split(",").forEach(function(n){h(n)}),k.connection.hub.start().done(function(){f()}),k.connection.hub.disconnected(function(){k("#chatview").addClass("disabled"),setTimeout(function(){k.connection.hub.start().done(function(){f()},3e4)})}),p.keydown(function(n){if(13==n.which){if(0==this.value.length)return;h(this.value),t.server.join(this.value).done(function(n){d(n.Name)}),this.value=""}});var m=new Audio("/sounds/bell.mp3");k("#pv").keydown(function(n){var e;13==n.which&&(e=k("#pv").val(),k.each(v.CXs,function(){t.server.sendPV(this,e)}),k("#discussion").append('<li class="pv">'+y(v.UserName)+"<< "+y(e)+"</li>"),k("#pv").val(""))}),k("#command").keydown(function(n){13==n.which&&sendCommand()});var C=function(n){k("#u_"+n).remove(),k('<li class="user"><img src="/Avatars/'+n+'.xs.png"> '+n+"</li>").prop("id","u_"+n).css("cursor","pointer").click(function(){T(this)}).appendTo(o)},b=function(){k.get("/api/chat/users").done(function(n){k.each(n,function(){C(this.UserName)})})};function y(n){return k("<div />").text(n).html()}var T=function(n){k("#rooms").addClass("hidden"),k("#sendpvbox").removeClass("hidden"),v={CXs:k(n).data("cxids"),UserName:k(n).data("name")},k("#sendpvdest").html(v.UserName),k("#pvs").focus()},w=function(){k("#rooms").removeClass("hidden"),k("#sendpvbox").addClass("hidden"),k("#message").focus()};k("#pubChan").css("cursor","pointer"),k("#pubChan").click(w),w();var _=function(n){k("#u_"+n).remove()},g=function(n){C(n)};k(window).unload(function(){t.server.abort()})};k(document).ready(function(n){e(n("#chatview"),!0)})}(jQuery);
window.ChatHubHandler=(function($){$.fn.filterByData=function(prop,val){return this.filter(function(){return $(this).data(prop)==val;});};var ChatView=function($view,full){if(!full)throw new Error('not implemented');var chans=[];var frontRoomName;var ulist=$('<ul></ul>').addClass('userlist');var notifications=$('<ul></ul>').addClass('notifs');ulist.appendTo($view);notifications.appendTo($view);var chat=$.connection.chatHub;chat.client.addMessage=function(name,room,message){$('#room_'+room).append('<li class="discussion"><strong>'+htmlEncode(name)+'</strong>: '+htmlEncode(message)+'</li>');};chat.client.addPV=function(name,message){if(!$('#mute').prop('checked')){audio.play();}
$('#pv_'+name).append('<li class="pv"><strong>'+htmlEncode(name)+'</strong>: '+htmlEncode(message)+'</li>');};chat.client.notifyRoom=function(tag,targetid,message){if(tag==='connected'||tag==='reconnected')onUserConnected(targetid,message);else if(tag==='disconnected')onUserDisconnected(targetid,message);$('<li></li>').addClass(tag).append(tag+': '+targetid+' ').append(message).addClass(tag).appendTo($('#room_'+targetid));};chat.client.notifyUser=function(tag,targetid,message){if(tag==='connected'||tag==='reconnected')onUserConnected(targetid,message);else if(tag==='disconnected')onUserDisconnected(targetid,message);$('<li></li>').append(tag+': '+targetid).append(message).addClass(tag).appendTo(notifications);};var setActiveRoom=function(room){var frontRoom;if(frontRoomName!==''){frontRoom=$('#vroom_'+frontRoomName);frontRoom.addClass('hidden');$('#sel_'+frontRoomName).addClass('btn-primary');}
frontRoomName=room;frontRoom=$('#vroom_'+room);$('#sel_'+room).removeClass('btn-primary');frontRoom.removeClass('hidden');};var chatbar=$('<div class="chatbar"></div>');var roomjoin=$('<div class="chatctl" class="form-control"></div>');var roomlist=$('<div class="roomlist"></div>');roomlist.appendTo(chatbar);$('<label for="channame">Join&nbsp;:</label>').appendTo(roomjoin);var chanName=$('<input id="channame" title="channel name" hint="yavsc" >');chanName.appendTo(roomjoin);roomjoin.appendTo(chatbar);chatbar.appendTo($view);var chatlist=$('<div class="chatlist" ></div>');chatlist.appendTo($view);var buildRoom=function(room){var roomTag=$('<a>'+room+'</a>').addClass('btn');roomTag.prop('id','sel_'+room).click(function(){setActiveRoom(room);$(this).removeClass('btn-primary');});roomTag.appendTo(roomlist);var roomview=$('<div></div>').addClass('container');roomview.appendTo(chatlist);roomview.prop('id','vroom_'+room);var msglist=$('<ul></ul>').addClass('mesglist');msglist.prop('id','room_'+room);msglist.appendTo(roomview);$('<input type="text">').prop('id','inp_'+room).prop('enable',false).prop('hint','hello').prop('title','send to '+room).addClass('form-control').keydown(function(ev){if(ev.which==13){if(this.value.length==0)return;chat.server.send(room,this.value);this.value='';}}).appendTo(roomview);chans.push(room);setActiveRoom(room);};$view.data('chans').split(',').forEach(function(chan){buildRoom(chan);});function onCx(){setTimeout(function(){getUsers();},120);$('#chatview').removeClass('disabled');chans.forEach(function(room){chat.server.join(room).done(function(chatInfo){setActiveRoom(chatInfo.Name);});});}
function onDisCx(){$('#chatview').addClass('disabled');}
$.connection.hub.start().done(function(){onCx();});$.connection.hub.disconnected(function(){onDisCx();setTimeout(function(){$.connection.hub.start().done(function(){onCx();},30000);});});chanName.keydown(function(event){if(event.which==13){if(this.value.length==0)return;buildRoom(this.value);chat.server.join(this.value).done(function(chatInfo){setActiveRoom(chatInfo.Name);});this.value='';}});var pvuis;var audio=new Audio('/sounds/bell.mp3');var sendPV=function(){var msg=$('#pv').val();$.each(pvuis.CXs,function(){chat.server.sendPV(this,msg);});$('#discussion').append('<li class="pv">'+htmlEncode(pvuis.UserName)+'<< '+htmlEncode(msg)+'</li>');$('#pv').val('');};$('#pv').keydown(function(event){if(event.which==13){sendPV();}});$('#command').keydown(function(event){if(event.which==13){}});var addChatUser=function(uname){$('#u_'+uname).remove();$('<li class="user"><img src="/Avatars/'+uname+'.xs.png"> '+uname+'</li>').prop('id','u_'+uname).css('cursor','pointer').click(function(){setPrivateTarget(this);}).appendTo(ulist);};var getUsers=function(){$.get('/api/chat/users').done(function(users){$.each(users,function(){var user=this;addChatUser(user.UserName);});});};function htmlEncode(value){var encodedValue=$('<div />').text(value).html();return encodedValue;}
var setPrivateTarget=function(li){$('#rooms').addClass('hidden');$('#sendpvbox').removeClass('hidden');pvuis={CXs:$(li).data('cxids'),UserName:$(li).data('name')};$('#sendpvdest').html(pvuis.UserName);$('#pvs').focus();};var setPublic=function(){$('#rooms').removeClass('hidden');$('#sendpvbox').addClass('hidden');$('#message').focus();};$('#pubChan').css('cursor','pointer');$('#pubChan').click(setPublic);setPublic();var onUserDisconnected=function(uname){$('#u_'+uname).remove();};var onUserConnected=function(username){addChatUser(username);};$(window).unload(function(){chat.server.abort();});};$(document).ready(function($){ChatView($('#chatview'),true);});})(window.jQuery);

View file

@ -1,3 +1,5 @@
/* eslint-disable sort-vars */
/* eslint-disable no-tabs */
/*!
* jQuery JavaScript Library v2.2.4
* http://jquery.com/
@ -12,30 +14,28 @@
* Date: 2016-05-20T17:23Z
*/
(function( global, factory ) {
if ( typeof module === "object" && typeof module.exports === "object" ) {
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory and get jQuery.
// For environments that do not have a `window` with a `document`
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
// See ticket #14549 for more info.
module.exports = global.document ?
factory( global, true ) :
function( w ) {
if ( !w.document ) {
throw new Error( "jQuery requires a window with a document" );
}
return factory( w );
};
} else {
factory( global );
}
(function(global, factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory and get jQuery.
// For environments that do not have a `window` with a `document`
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
// See ticket #14549 for more info.
module.exports = global.document ? factory(global, true) : function(w) {
if (!w.document) {
throw new Error('jQuery requires a window with a document');
}
return factory(w);
};
} else {
factory(global);
}
// Pass this if window is not defined yet
}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
// eslint-disable-next-line no-negated-condition
}(typeof window !== 'undefined' ? window : this, function(window, noGlobal) {
// Support: Firefox 18+
// Can't be in strict mode, several libs including ASP.NET trace
@ -62,29 +62,25 @@ var hasOwn = class2type.hasOwnProperty;
var support = {};
var version = '2.2.4';
// Define a local copy of jQuery
var jQuery = function(selector, contexts) {
// The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init(selector, contexts);
};
var
version = "2.2.4",
// Support: Android<4.1
// Make sure we trim BOM and NBSP
var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init( selector, context );
},
// Support: Android<4.1
// Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
// Matches dashed string for camelizing
rmsPrefix = /^-ms-/,
rdashAlpha = /-([\da-z])/gi,
// Matches dashed string for camelizing
var rmsPrefix = /^-ms-/;
var rdashAlpha = /-([\da-z])/gi;
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
var fcamelCase = function(all, letter) {
return letter.toUpperCase();
};
@ -96,33 +92,33 @@ jQuery.fn = jQuery.prototype = {
constructor: jQuery,
// Start with an empty selector
selector: "",
selector: '',
// The default length of a jQuery object is 0
length: 0,
toArray: function() {
return slice.call( this );
return slice.call(this);
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num != null ?
get: function(num) {
return num ?
// Return just the one element from the set
( num < 0 ? this[ num + this.length ] : this[ num ] ) :
(num < 0 ? this[num + this.length] : this[num]) :
// Return all the elements in a clean array
slice.call( this );
slice.call(this);
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems ) {
pushStack: function(elems) {
// Build a new jQuery matched element set
var ret = jQuery.merge( this.constructor(), elems );
var ret = jQuery.merge(this.constructor(), elems);
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
@ -133,32 +129,32 @@ jQuery.fn = jQuery.prototype = {
},
// Execute a callback for every element in the matched set.
each: function( callback ) {
return jQuery.each( this, callback );
each: function(callback) {
return jQuery.each(this, callback);
},
map: function( callback ) {
return this.pushStack( jQuery.map( this, function( elem, i ) {
return callback.call( elem, i, elem );
} ) );
map: function(callback) {
return this.pushStack(jQuery.map(this, function(elem, i) {
return callback.call(elem, i, elem);
}));
},
slice: function() {
return this.pushStack( slice.apply( this, arguments ) );
return this.pushStack(slice.apply(this, arguments));
},
first: function() {
return this.eq( 0 );
return this.eq(0);
},
last: function() {
return this.eq( -1 );
return this.eq(-1);
},
eq: function( i ) {
var len = this.length,
j = +i + ( i < 0 ? len : 0 );
return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
eq: function(i) {
var len = this.length;
var j = +i + (i < 0 ? len : 0);
return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
},
end: function() {
@ -174,38 +170,38 @@ jQuery.fn = jQuery.prototype = {
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[ 0 ] || {},
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
if (typeof target === 'boolean') {
deep = target;
// Skip the boolean and the target
target = arguments[ i ] || {};
target = arguments[i] || {};
i++;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
if (typeof target !== 'object' && !jQuery.isFunction(target)) {
target = {};
}
// Extend jQuery itself if only one argument is passed
if ( i === length ) {
if (i === length) {
target = this;
i--;
}
for ( ; i < length; i++ ) {
for (; i < length; i++) {
// Only deal with non-null/undefined values
if ( ( options = arguments[ i ] ) != null ) {
if ((options = arguments[i]) != null) {
// Extend the base object
for ( name in options ) {
for (name in options) {
src = target[ name ];
copy = options[ name ];
@ -3078,7 +3074,7 @@ jQuery.each( {
contents: function( elem ) {
return elem.contentDocument || jQuery.merge( [], elem.childNodes );
}
}, function( name, fn ) {
}, function(name, fn) {
jQuery.fn[ name ] = function( until, selector ) {
var matched = jQuery.map( this, fn, until );
@ -3093,17 +3089,17 @@ jQuery.each( {
if ( this.length > 1 ) {
// Remove duplicates
if ( !guaranteedUnique[ name ] ) {
jQuery.uniqueSort( matched );
if ( !guaranteedUnique[name] ) {
jQuery.uniqueSort(matched);
}
// Reverse order for parents* and prev-derivatives
if ( rparentsprev.test( name ) ) {
if ( rparentsprev.test(name) ) {
matched.reverse();
}
}
return this.pushStack( matched );
return this.pushStack(matched);
};
} );
var rnotwhite = ( /\S+/g );
@ -3267,7 +3263,7 @@ jQuery.Callbacks = function( options ) {
// Check if a given callback is in the list.
// If no argument is given, return whether or not list has callbacks attached.
has: function( fn ) {
has: function(fn) {
return fn ?
jQuery.inArray( fn, list ) > -1 :
list.length > 0;

File diff suppressed because one or more lines are too long

View file

@ -11,7 +11,7 @@
*
* Date: 2017-03-20T18:59Z
*/
( function( global, factory ) {
(function(global, factory) {
"use strict";

File diff suppressed because one or more lines are too long

View file

@ -2796,7 +2796,7 @@
// Wire up the received handler
connection.received(function (minData) {
var data, proxy, dataCallbackId, callback, hubName, eventName;
var callback, data, dataCallbackId, eventName, hubName, proxy;
if (!minData) {
return;
}
@ -2804,14 +2804,16 @@
// We have to handle progress updates first in order to ensure old clients that receive
// progress updates enter the return value branch and then no-op when they can't find
// the callback in the map (because the minData.I value will not be a valid callback ID)
if (typeof (minData.P) !== "undefined") {
// eslint-disable-next-line no-negated-condition
if (typeof (minData.P) !== 'undefined') {
// Process progress notification
dataCallbackId = minData.P.I.toString();
callback = connection._.invocationCallbacks[dataCallbackId];
if (callback) {
callback.method.call(callback.scope, minData);
}
} else if (typeof (minData.I) !== "undefined") {
// eslint-disable-next-line no-negated-condition
} else if (typeof (minData.I) !== 'undefined') {
// We received the return value from a server method invocation, look up callback by id and call it
dataCallbackId = minData.I.toString();
callback = connection._.invocationCallbacks[dataCallbackId];
@ -2827,7 +2829,7 @@
data = this._maximizeClientHubInvocation(minData);
// We received a client invocation request, i.e. broadcast from server hub
connection.log("Triggering client hub event '" + data.Method + "' on hub '" + data.Hub + "'.");
connection.log('Triggering client hub event \'' + data.Method + '\' on hub \'' + data.Hub + '\'.');
// Normalize the names to lowercase
hubName = data.Hub.toLowerCase();
@ -2840,10 +2842,11 @@
$.extend(proxy.state, data.State);
$(proxy).triggerHandler(makeEventName(eventName), [data.Args]);
}
});
connection.error(function (errData, origData) {
var callbackId, callback;
var callback, callbackId;
if (!origData) {
// No original data passed so this is not a send error
@ -2865,13 +2868,13 @@
});
connection.reconnecting(function () {
if (connection.transport && connection.transport.name === "webSockets") {
clearInvocationCallbacks(connection, "Connection started reconnecting before invocation result was received.");
if (connection.transport && connection.transport.name === 'webSockets') {
clearInvocationCallbacks(connection, 'Connection started reconnecting before invocation result was received.');
}
});
connection.disconnected(function () {
clearInvocationCallbacks(connection, "Connection was disconnected before invocation result was received.");
clearInvocationCallbacks(connection, 'Connection was disconnected before invocation result was received.');
});
};
@ -2942,6 +2945,7 @@
$.hubConnection = hubConnection;
}(window.jQuery, window));
/* jquery.signalR.version.js */
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
@ -2949,6 +2953,6 @@
/*global window:false */
/// <reference path="jquery.signalR.core.js" />
(function ($, undefined) {
$.signalR.version = "2.2.1";
(function ($) {
$.signalR.version = '2.2.1';
}(window.jQuery));

File diff suppressed because one or more lines are too long

80
src/Yavsc/yarn.lock Normal file
View file

@ -0,0 +1,80 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ansi-to-html@^0.6.4:
version "0.6.11"
resolved "https://registry.yarnpkg.com/ansi-to-html/-/ansi-to-html-0.6.11.tgz#5093fc4962186c0e9343dec572a4f71abdc93439"
integrity sha512-88XZtrcwrfkyn6fGstHnkaF1kl7hGtNCYh4vSmItgEV+6JnQHryDBf7udF4f2RhTRQmYvJvPcTtqgaqrxzc9oA==
dependencies:
entities "^1.1.1"
debug@^3.2.6:
version "3.2.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
dependencies:
ms "^2.1.1"
debug@~2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
integrity sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=
dependencies:
ms "0.7.1"
entities@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
follow-redirects@>=1.2.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.7.0.tgz#489ebc198dc0e7f64167bd23b03c4c19b5784c76"
integrity sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==
dependencies:
debug "^3.2.6"
ms@0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
integrity sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=
ms@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
node-rest-client@^2.0.1:
version "2.5.0"
resolved "https://registry.yarnpkg.com/node-rest-client/-/node-rest-client-2.5.0.tgz#3c53eadba2b2c3b3a4df2ba2f646acc23d8a0701"
integrity sha1-PFPq26Kyw7Ok3yui9kaswj2KBwE=
dependencies:
debug "~2.2.0"
follow-redirects ">=1.2.0"
xml2js ">=0.2.4"
paypal-permissions-sdk@^1.0.10:
version "1.0.10"
resolved "https://registry.yarnpkg.com/paypal-permissions-sdk/-/paypal-permissions-sdk-1.0.10.tgz#2b2713ab555647eacffd775fe33e11b233cfc18f"
integrity sha512-cNiQnDsrvWMuEwigR1lh+Ty4Y5J3ducRmbIQXH2K9oP8CjW3Tkf7cVk0IOBPH2a6N4D4tjGM4WDhMl68of1Z0A==
dependencies:
node-rest-client "^2.0.1"
sax@>=0.6.0:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
xml2js@>=0.2.4:
version "0.4.19"
resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7"
integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==
dependencies:
sax ">=0.6.0"
xmlbuilder "~9.0.1"
xmlbuilder@~9.0.1:
version "9.0.7"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=