.'
+ );
+ }
}
+ el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
+ }
- // set target only if urlTarget is specified.
- if (options.urlTarget) {
- attrs.target = options.urlTarget;
- }
+ var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
+ if (styleBinding) {
+ el.styleBinding = styleBinding;
+ }
+}
- if (!options.title && urlEntity.display_url) {
- attrs.title = urlEntity.expanded_url;
- }
+function genData$2 (el) {
+ var data = '';
+ if (el.staticStyle) {
+ data += "staticStyle:" + (el.staticStyle) + ",";
+ }
+ if (el.styleBinding) {
+ data += "style:(" + (el.styleBinding) + "),";
+ }
+ return data
+}
- return twttr.txt.linkToText(entity, linkText, attrs, options);
- };
+var style$1 = {
+ staticKeys: ['staticStyle'],
+ transformNode: transformNode$1,
+ genData: genData$2
+};
- twttr.txt.linkTextWithEntity = function (entity, options) {
- var displayUrl = entity.display_url;
- var expandedUrl = entity.expanded_url;
+var modules$1 = [
+ klass$1,
+ style$1
+];
- // Goal: If a user copies and pastes a tweet containing t.co'ed link, the resulting paste
- // should contain the full original URL (expanded_url), not the display URL.
- //
- // Method: Whenever possible, we actually emit HTML that contains expanded_url, and use
- // font-size:0 to hide those parts that should not be displayed (because they are not part of display_url).
- // Elements with font-size:0 get copied even though they are not visible.
- // Note that display:none doesn't work here. Elements with display:none don't get copied.
- //
- // Additionally, we want to *display* ellipses, but we don't want them copied. To make this happen we
- // wrap the ellipses in a tco-ellipsis class and provide an onCopy handler that sets display:none on
- // everything with the tco-ellipsis class.
- //
- // Exception: pic.twitter.com images, for which expandedUrl = "https://twitter.com/#!/username/status/1234/photo/1
- // For those URLs, display_url is not a substring of expanded_url, so we don't do anything special to render the elided parts.
- // For a pic.twitter.com URL, the only elided part will be the "https://", so this is fine.
+/* */
- var displayUrlSansEllipses = displayUrl.replace(/…/g, ""); // We have to disregard ellipses for matching
- // Note: we currently only support eliding parts of the URL at the beginning or the end.
- // Eventually we may want to elide parts of the URL in the *middle*. If so, this code will
- // become more complicated. We will probably want to create a regexp out of display URL,
- // replacing every ellipsis with a ".*".
- if (expandedUrl.indexOf(displayUrlSansEllipses) != -1) {
- var displayUrlIndex = expandedUrl.indexOf(displayUrlSansEllipses);
- var v = {
- displayUrlSansEllipses: displayUrlSansEllipses,
- // Portion of expandedUrl that precedes the displayUrl substring
- beforeDisplayUrl: expandedUrl.substr(0, displayUrlIndex),
- // Portion of expandedUrl that comes after displayUrl
- afterDisplayUrl: expandedUrl.substr(displayUrlIndex + displayUrlSansEllipses.length),
- precedingEllipsis: displayUrl.match(/^…/) ? "…" : "",
- followingEllipsis: displayUrl.match(/…$/) ? "…" : ""
- };
- for (var k in v) {
- if (v.hasOwnProperty(k)) {
- v[k] = twttr.txt.htmlEscape(v[k]);
- }
- }
- // As an example: The user tweets "hi http://longdomainname.com/foo"
- // This gets shortened to "hi http://t.co/xyzabc", with display_url = "…nname.com/foo"
- // This will get rendered as:
- //
- // …
- //
- // http://longdomai
- //
- //
- // nname.com/foo
- //
- //
- //
- // …
- //
- v['invisible'] = options.invisibleTagAttrs;
- return stringSupplant("
#{precedingEllipsis} #{beforeDisplayUrl}#{displayUrlSansEllipses}#{afterDisplayUrl} #{followingEllipsis}", v);
- }
- return displayUrl;
- };
+function text (el, dir) {
+ if (dir.value) {
+ addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
+ }
+}
- twttr.txt.autoLinkEntities = function(text, entities, options) {
- options = clone(options || {});
+/* */
- options.hashtagClass = options.hashtagClass || DEFAULT_HASHTAG_CLASS;
- options.hashtagUrlBase = options.hashtagUrlBase || "https://twitter.com/#!/search?q=%23";
- options.cashtagClass = options.cashtagClass || DEFAULT_CASHTAG_CLASS;
- options.cashtagUrlBase = options.cashtagUrlBase || "https://twitter.com/#!/search?q=%24";
- options.listClass = options.listClass || DEFAULT_LIST_CLASS;
- options.usernameClass = options.usernameClass || DEFAULT_USERNAME_CLASS;
- options.usernameUrlBase = options.usernameUrlBase || "https://twitter.com/";
- options.listUrlBase = options.listUrlBase || "https://twitter.com/";
- options.htmlAttrs = twttr.txt.extractHtmlAttrsFromOptions(options);
- options.invisibleTagAttrs = options.invisibleTagAttrs || "style='position:absolute;left:-9999px;'";
+function html (el, dir) {
+ if (dir.value) {
+ addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
+ }
+}
- // remap url entities to hash
- var urlEntities, i, len;
- if(options.urlEntities) {
- urlEntities = {};
- for(i = 0, len = options.urlEntities.length; i < len; i++) {
- urlEntities[options.urlEntities[i].url] = options.urlEntities[i];
- }
- options.urlEntities = urlEntities;
- }
+var directives$1 = {
+ model: model,
+ text: text,
+ html: html
+};
- var result = "";
- var beginIndex = 0;
+/* */
- // sort entities by start index
- entities.sort(function(a,b){ return a.indices[0] - b.indices[0]; });
+var baseOptions = {
+ expectHTML: true,
+ modules: modules$1,
+ directives: directives$1,
+ isPreTag: isPreTag,
+ isUnaryTag: isUnaryTag,
+ mustUseProp: mustUseProp,
+ canBeLeftOpenTag: canBeLeftOpenTag,
+ isReservedTag: isReservedTag,
+ getTagNamespace: getTagNamespace,
+ staticKeys: genStaticKeys(modules$1)
+};
- var nonEntity = options.htmlEscapeNonEntities ? twttr.txt.htmlEscape : function(text) {
- return text;
- };
+var ref$1 = createCompiler(baseOptions);
+var compileToFunctions = ref$1.compileToFunctions;
- for (var i = 0; i < entities.length; i++) {
- var entity = entities[i];
- result += nonEntity(text.substring(beginIndex, entity.indices[0]));
+/* */
- if (entity.url) {
- result += twttr.txt.linkToUrl(entity, text, options);
- } else if (entity.hashtag) {
- result += twttr.txt.linkToHashtag(entity, text, options);
- } else if (entity.screenName) {
- result += twttr.txt.linkToMentionAndList(entity, text, options);
- } else if (entity.cashtag) {
- result += twttr.txt.linkToCashtag(entity, text, options);
- }
- beginIndex = entity.indices[1];
- }
- result += nonEntity(text.substring(beginIndex, text.length));
- return result;
- };
+var idToTemplate = cached(function (id) {
+ var el = query(id);
+ return el && el.innerHTML
+});
- twttr.txt.autoLinkWithJSON = function(text, json, options) {
- // map JSON entity to twitter-text entity
- if (json.user_mentions) {
- for (var i = 0; i < json.user_mentions.length; i++) {
- // this is a @mention
- json.user_mentions[i].screenName = json.user_mentions[i].screen_name;
- }
- }
+var mount = Vue$3.prototype.$mount;
+Vue$3.prototype.$mount = function (
+ el,
+ hydrating
+) {
+ el = el && query(el);
- if (json.hashtags) {
- for (var i = 0; i < json.hashtags.length; i++) {
- // this is a #hashtag
- json.hashtags[i].hashtag = json.hashtags[i].text;
- }
- }
+ /* istanbul ignore if */
+ if (el === document.body || el === document.documentElement) {
+ "development" !== 'production' && warn(
+ "Do not mount Vue to or - mount to normal elements instead."
+ );
+ return this
+ }
- if (json.symbols) {
- for (var i = 0; i < json.symbols.length; i++) {
- // this is a $CASH tag
- json.symbols[i].cashtag = json.symbols[i].text;
+ var options = this.$options;
+ // resolve template/el and convert to render function
+ if (!options.render) {
+ var template = options.template;
+ if (template) {
+ if (typeof template === 'string') {
+ if (template.charAt(0) === '#') {
+ template = idToTemplate(template);
+ /* istanbul ignore if */
+ if ("development" !== 'production' && !template) {
+ warn(
+ ("Template element not found or is empty: " + (options.template)),
+ this
+ );
+ }
+ }
+ } else if (template.nodeType) {
+ template = template.innerHTML;
+ } else {
+ if (true) {
+ warn('invalid template option:' + template, this);
+ }
+ return this
}
+ } else if (el) {
+ template = getOuterHTML(el);
}
+ if (template) {
+ /* istanbul ignore if */
+ if ("development" !== 'production' && config.performance && mark) {
+ mark('compile');
+ }
- // concatenate all entities
- var entities = [];
- for (var key in json) {
- entities = entities.concat(json[key]);
- }
-
- // modify indices to UTF-16
- twttr.txt.modifyIndicesFromUnicodeToUTF16(text, entities);
-
- return twttr.txt.autoLinkEntities(text, entities, options);
- };
+ var ref = compileToFunctions(template, {
+ shouldDecodeNewlines: shouldDecodeNewlines,
+ delimiters: options.delimiters
+ }, this);
+ var render = ref.render;
+ var staticRenderFns = ref.staticRenderFns;
+ options.render = render;
+ options.staticRenderFns = staticRenderFns;
- twttr.txt.extractHtmlAttrsFromOptions = function(options) {
- var htmlAttrs = {};
- for (var k in options) {
- var v = options[k];
- if (OPTIONS_NOT_ATTRIBUTES[k]) continue;
- if (BOOLEAN_ATTRIBUTES[k]) {
- v = v ? k : null;
+ /* istanbul ignore if */
+ if ("development" !== 'production' && config.performance && mark) {
+ mark('compile end');
+ measure(((this._name) + " compile"), 'compile', 'compile end');
}
- if (v == null) continue;
- htmlAttrs[k] = v;
}
- return htmlAttrs;
- };
+ }
+ return mount.call(this, el, hydrating)
+};
- twttr.txt.autoLink = function(text, options) {
- var entities = twttr.txt.extractEntitiesWithIndices(text, {extractUrlsWithoutProtocol: false});
- return twttr.txt.autoLinkEntities(text, entities, options);
- };
+/**
+ * Get outerHTML of elements, taking care
+ * of SVG elements in IE as well.
+ */
+function getOuterHTML (el) {
+ if (el.outerHTML) {
+ return el.outerHTML
+ } else {
+ var container = document.createElement('div');
+ container.appendChild(el.cloneNode(true));
+ return container.innerHTML
+ }
+}
- twttr.txt.autoLinkUsernamesOrLists = function(text, options) {
- var entities = twttr.txt.extractMentionsOrListsWithIndices(text);
- return twttr.txt.autoLinkEntities(text, entities, options);
- };
+Vue$3.compile = compileToFunctions;
- twttr.txt.autoLinkHashtags = function(text, options) {
- var entities = twttr.txt.extractHashtagsWithIndices(text);
- return twttr.txt.autoLinkEntities(text, entities, options);
- };
+module.exports = Vue$3;
- twttr.txt.autoLinkCashtags = function(text, options) {
- var entities = twttr.txt.extractCashtagsWithIndices(text);
- return twttr.txt.autoLinkEntities(text, entities, options);
- };
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
- twttr.txt.autoLinkUrlsCustom = function(text, options) {
- var entities = twttr.txt.extractUrlsWithIndices(text, {extractUrlsWithoutProtocol: false});
- return twttr.txt.autoLinkEntities(text, entities, options);
- };
+/***/ }),
+/* 41 */
+/***/ (function(module, exports, __webpack_require__) {
- twttr.txt.removeOverlappingEntities = function(entities) {
- entities.sort(function(a,b){ return a.indices[0] - b.indices[0]; });
+var disposed = false
+var Component = __webpack_require__(8)(
+ /* script */
+ __webpack_require__(42),
+ /* template */
+ __webpack_require__(43),
+ /* styles */
+ null,
+ /* scopeId */
+ null,
+ /* moduleIdentifier (server only) */
+ null
+)
+Component.options.__file = "/Users/aaronpk/Code/spy30/resources/assets/js/components/TweetQueue.vue"
+if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
+if (Component.options.functional) {console.error("[vue-loader] TweetQueue.vue: functional components are not supported with templates, they should use render functions.")}
- var prev = entities[0];
- for (var i = 1; i < entities.length; i++) {
- if (prev.indices[1] > entities[i].indices[0]) {
- entities.splice(i, 1);
- i--;
- } else {
- prev = entities[i];
- }
- }
- };
+/* hot reload */
+if (false) {(function () {
+ var hotAPI = require("vue-hot-reload-api")
+ hotAPI.install(require("vue"), false)
+ if (!hotAPI.compatible) return
+ module.hot.accept()
+ if (!module.hot.data) {
+ hotAPI.createRecord("data-v-1798c0a1", Component.options)
+ } else {
+ hotAPI.reload("data-v-1798c0a1", Component.options)
+ }
+ module.hot.dispose(function (data) {
+ disposed = true
+ })
+})()}
- twttr.txt.extractEntitiesWithIndices = function(text, options) {
- var entities = twttr.txt.extractUrlsWithIndices(text, options)
- .concat(twttr.txt.extractMentionsOrListsWithIndices(text))
- .concat(twttr.txt.extractHashtagsWithIndices(text, {checkUrlOverlap: false}))
- .concat(twttr.txt.extractCashtagsWithIndices(text));
+module.exports = Component.exports
- if (entities.length == 0) {
- return [];
- }
- twttr.txt.removeOverlappingEntities(entities);
- return entities;
- };
+/***/ }),
+/* 42 */
+/***/ (function(module, exports) {
- twttr.txt.extractMentions = function(text) {
- var screenNamesOnly = [],
- screenNamesWithIndices = twttr.txt.extractMentionsWithIndices(text);
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
- for (var i = 0; i < screenNamesWithIndices.length; i++) {
- var screenName = screenNamesWithIndices[i].screenName;
- screenNamesOnly.push(screenName);
- }
+module.exports = {
+ data: function data() {
+ return {
+ queue: [],
+ tweet: {},
+ show: false
+ };
+ },
- return screenNamesOnly;
- };
+ methods: {
+ loadQueue: function loadQueue() {
+ $.get('/dashboard/queue', function (tweets) {
+ var _this = this;
- twttr.txt.extractMentionsWithIndices = function(text) {
- var mentions = [],
- mentionOrList,
- mentionsOrLists = twttr.txt.extractMentionsOrListsWithIndices(text);
+ for (var i in tweets.queue) {
+ this.queue.push(tweets.queue[i]);
+ }
- for (var i = 0 ; i < mentionsOrLists.length; i++) {
- mentionOrList = mentionsOrLists[i];
- if (mentionOrList.listSlug == '') {
- mentions.push({
- screenName: mentionOrList.screenName,
- indices: mentionOrList.indices
+ // Listen for new items on the queue
+ Echo.channel('tweet-queue').listen('NewTweetEvent', function (e) {
+ if (_this.findTweetInQueue(e.tweet_id) === false) {
+ _this.queue.push(e);
+ // If the new tweet is one that timed out, dismiss it
+ if (_this.show && _this.tweet.tweet_id == e.tweet_id) {
+ _this.tweet = {};
+ _this.show = false;
+ }
+ }
+ }).listen('TweetClaimedEvent', function (e) {
+ _this.removeTweetFromQueue(e.tweet_id);
});
+ }.bind(this));
+ },
+ dashboardPing: function dashboardPing() {
+ setTimeout(function () {
+ $.get('/dashboard/ping', function () {
+ this.dashboardPing();
+ }.bind(this));
+ }.bind(this), 15000);
+ },
+ findTweetInQueue: function findTweetInQueue(tweet_id) {
+ var queueIndex = false;
+ for (var i in this.queue) {
+ if (parseInt(this.queue[i].tweet_id) == parseInt(tweet_id)) {
+ queueIndex = i;
+ }
+ }
+ return queueIndex;
+ },
+ removeTweetFromQueue: function removeTweetFromQueue(tweet_id) {
+ var queueIndex = this.findTweetInQueue(tweet_id);
+ if (queueIndex !== false) {
+ var removed = this.queue.splice(queueIndex, 1);
+ return removed[0];
+ }
+ },
+ clickedTweet: function clickedTweet(tweet_index) {
+ // If another tweet was already open, dismiss that first
+ if (this.show) {
+ this.dismissTweet();
}
- }
- return mentions;
- };
+ var tweet_data = this.queue[tweet_index];
+ var tweet_id = tweet_data.tweet_id;
- /**
- * Extract list or user mentions.
- * (Presence of listSlug indicates a list)
- */
- twttr.txt.extractMentionsOrListsWithIndices = function(text) {
- if (!text || !text.match(twttr.txt.regexen.atSigns)) {
- return [];
- }
+ if (tweet_data) {
+ // Mark this as claimed
+ $.post('/dashboard/claim-tweet', {
+ tweet_id: tweet_id
+ }, function (response) {});
- var possibleNames = [],
- slashListname;
+ this.removeTweetFromQueue(tweet_id);
- text.replace(twttr.txt.regexen.validMentionOrList, function(match, before, atSign, screenName, slashListname, offset, chunk) {
- var after = chunk.slice(offset + match.length);
- if (!after.match(twttr.txt.regexen.endMentionMatch)) {
- slashListname = slashListname || '';
- var startPosition = offset + before.length;
- var endPosition = startPosition + screenName.length + slashListname.length + 1;
- possibleNames.push({
- screenName: screenName,
- listSlug: slashListname,
- indices: [startPosition, endPosition]
- });
+ // Load in the scorecard viewer
+ this.tweet = tweet_data;
+ this.show = true;
+ } else {
+ console.log("Tweet not found: " + tweet_id);
}
- });
-
- return possibleNames;
- };
+ },
+ dismissTweet: function dismissTweet() {
+ this.queue.push(this.tweet);
+ // Mark as un-claimed
+ $.post('/dashboard/claim-tweet', {
+ tweet_id: this.tweet.tweet_id,
+ status: 'unclaimed'
+ }, function (response) {});
- twttr.txt.extractReplies = function(text) {
- if (!text) {
- return null;
+ this.tweet = {};
+ this.show = false;
+ },
+ completedTweet: function completedTweet() {
+ this.tweet = {};
+ this.show = false;
}
+ },
+ created: function created() {
+ this.loadQueue();
+ this.dashboardPing();
+ }
+};
- var possibleScreenName = text.match(twttr.txt.regexen.validReply);
- if (!possibleScreenName ||
- RegExp.rightContext.match(twttr.txt.regexen.endMentionMatch)) {
- return null;
- }
+/***/ }),
+/* 43 */
+/***/ (function(module, exports, __webpack_require__) {
- return possibleScreenName[1];
- };
+module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
+ return _c('div', {
+ staticClass: "container"
+ }, [_c('div', {
+ staticClass: "row"
+ }, [_c('div', {
+ staticClass: "col-xs-4 col-md-4"
+ }, [_c('div', {
+ staticClass: "panel panel-default"
+ }, [_c('div', {
+ staticClass: "panel-heading"
+ }, [_vm._v("Queue")]), _vm._v(" "), _c('div', {
+ staticClass: "panel-body tweet-queue"
+ }, _vm._l((_vm.queue), function(tweet, index) {
+ return _c('div', {
+ staticClass: "tweet",
+ on: {
+ "click": function($event) {
+ _vm.clickedTweet(index)
+ }
+ }
+ }, [_c('div', {
+ staticClass: "mission"
+ }, [_vm._v(_vm._s(tweet.mission))]), _vm._v(" "), _c('div', {
+ staticClass: "profile"
+ }, [_c('img', {
+ style: ('border-color: #' + tweet.team_color),
+ attrs: {
+ "src": tweet.player_photo
+ }
+ }), _vm._v(" "), _c('span', [_vm._v("@" + _vm._s(tweet.player_username))])]), _vm._v(" "), _c('div', {
+ staticClass: "text"
+ }, [_vm._v(_vm._s(tweet.text))])])
+ }))])]), _vm._v(" "), _c('div', {
+ staticClass: "col-xs-8 col-md-8"
+ }, [_c('scorecard', {
+ attrs: {
+ "show": _vm.show,
+ "tweet": _vm.tweet
+ },
+ on: {
+ "update:show": function($event) {
+ _vm.show = $event
+ },
+ "dismiss": _vm.dismissTweet,
+ "complete": _vm.completedTweet
+ }
+ })], 1)])])
+},staticRenderFns: []}
+module.exports.render._withStripped = true
+if (false) {
+ module.hot.accept()
+ if (module.hot.data) {
+ require("vue-hot-reload-api").rerender("data-v-1798c0a1", module.exports)
+ }
+}
- twttr.txt.extractUrls = function(text, options) {
- var urlsOnly = [],
- urlsWithIndices = twttr.txt.extractUrlsWithIndices(text, options);
+/***/ }),
+/* 44 */
+/***/ (function(module, exports, __webpack_require__) {
- for (var i = 0; i < urlsWithIndices.length; i++) {
- urlsOnly.push(urlsWithIndices[i].url);
- }
+var disposed = false
+var Component = __webpack_require__(8)(
+ /* script */
+ __webpack_require__(45),
+ /* template */
+ __webpack_require__(46),
+ /* styles */
+ null,
+ /* scopeId */
+ null,
+ /* moduleIdentifier (server only) */
+ null
+)
+Component.options.__file = "/Users/aaronpk/Code/spy30/resources/assets/js/components/Scorecard.vue"
+if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
+if (Component.options.functional) {console.error("[vue-loader] Scorecard.vue: functional components are not supported with templates, they should use render functions.")}
- return urlsOnly;
- };
+/* hot reload */
+if (false) {(function () {
+ var hotAPI = require("vue-hot-reload-api")
+ hotAPI.install(require("vue"), false)
+ if (!hotAPI.compatible) return
+ module.hot.accept()
+ if (!module.hot.data) {
+ hotAPI.createRecord("data-v-1098d79e", Component.options)
+ } else {
+ hotAPI.reload("data-v-1098d79e", Component.options)
+ }
+ module.hot.dispose(function (data) {
+ disposed = true
+ })
+})()}
- twttr.txt.extractUrlsWithIndices = function(text, options) {
- if (!options) {
- options = {extractUrlsWithoutProtocol: true};
- }
- if (!text || (options.extractUrlsWithoutProtocol ? !text.match(/\./) : !text.match(/:/))) {
- return [];
- }
+module.exports = Component.exports
- var urls = [];
- while (twttr.txt.regexen.extractUrl.exec(text)) {
- var before = RegExp.$2, url = RegExp.$3, protocol = RegExp.$4, domain = RegExp.$5, path = RegExp.$7;
- var endPosition = twttr.txt.regexen.extractUrl.lastIndex,
- startPosition = endPosition - url.length;
+/***/ }),
+/* 45 */
+/***/ (function(module, exports) {
- // if protocol is missing and domain contains non-ASCII characters,
- // extract ASCII-only domains.
- if (!protocol) {
- if (!options.extractUrlsWithoutProtocol
- || before.match(twttr.txt.regexen.invalidUrlWithoutProtocolPrecedingChars)) {
- continue;
- }
- var lastUrl = null,
- asciiEndPosition = 0;
- domain.replace(twttr.txt.regexen.validAsciiDomain, function(asciiDomain) {
- var asciiStartPosition = domain.indexOf(asciiDomain, asciiEndPosition);
- asciiEndPosition = asciiStartPosition + asciiDomain.length;
- lastUrl = {
- url: asciiDomain,
- indices: [startPosition + asciiStartPosition, startPosition + asciiEndPosition]
- };
- if (path
- || asciiDomain.match(twttr.txt.regexen.validSpecialShortDomain)
- || !asciiDomain.match(twttr.txt.regexen.invalidShortDomain)) {
- urls.push(lastUrl);
- }
- });
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
- // no ASCII-only domain found. Skip the entire URL.
- if (lastUrl == null) {
- continue;
- }
+module.exports = {
+ props: ['show', 'tweet'],
+ data: function data() {
+ return {
+ documents: [],
+ centers: [],
+ lines: [],
+ replyText: '',
+ replyTextCharsRemaining: 140,
+ replyInProgress: false,
+ showReplyBox: true,
+ selectedDocument: null,
+ selectedTransitCenter: null,
+ selectedTransitLine: null,
+ selectedNonTrimetLine: '',
+ selectedPhotoHasAnotherTeam: false,
+ selectedM5Singing: false,
+ selectedM5Tipping: false
+ };
+ },
- // lastUrl only contains domain. Need to add path and query if they exist.
- if (path) {
- lastUrl.url = url.replace(domain, lastUrl.url);
- lastUrl.indices[1] = endPosition;
+ computed: {
+ isAcceptDisabled: function isAcceptDisabled() {
+ if (this.show) {
+ switch (this.tweet.mission_id) {
+ case 1:
+ return this.selectedTransitLine == null && this.selectedNonTrimetLine == '';
+ case 2:
+ return this.selectedTransitCenter == null;
+ case 3:
+ case 4:
+ case 6:
+ // Nothing to check
+ return false;
+ case 5:
+ return this.selectedM5Singing == false && this.selectedM5Tipping == false;
+ case 7:
+ return this.selectedDocument == null;
+ default:
+ return true;
}
} else {
- // In the case of t.co URLs, don't allow additional path characters.
- if (url.match(twttr.txt.regexen.validTcoUrl)) {
- url = RegExp.lastMatch;
- endPosition = startPosition + url.length;
- }
- urls.push({
- url: url,
- indices: [startPosition, endPosition]
- });
+ return true;
}
+ },
+ isTweetReplyDisabled: function isTweetReplyDisabled() {
+ return this.replyText == '' || this.replyInProgress || this.replyTextCharsRemaining < 0;
}
+ },
+ methods: {
+ clearState: function clearState() {
+ this.selectedDocument = null;
+ this.selectedTransitCenter = null;
+ this.selectedTransitLine = null;
+ this.selectedNonTrimetLine = '';
+ this.selectedPhotoHasAnotherTeam = false;
+ this.selectedM5Singing = false;
+ this.selectedM5Tipping = false;
+ this.replyText = '';
+ this.showReplyBox = true;
+ },
+ dismiss: function dismiss() {
+ this.clearState();
+ this.$emit('dismiss');
+ },
+ rejectTweet: function rejectTweet() {
+ $.post("/dashboard/reject-tweet", {
+ tweet_id: this.tweet.tweet_id
+ }, function () {
+ this.clearState();
+ this.$emit('complete');
+ }.bind(this));
+ },
+ scoreTweet: function scoreTweet() {
+ var score_data = {};
- return urls;
- };
-
- twttr.txt.extractHashtags = function(text) {
- var hashtagsOnly = [],
- hashtagsWithIndices = twttr.txt.extractHashtagsWithIndices(text);
-
- for (var i = 0; i < hashtagsWithIndices.length; i++) {
- hashtagsOnly.push(hashtagsWithIndices[i].hashtag);
- }
+ switch (this.tweet.mission_id) {
+ case 1:
+ score_data['m1_complete'] = 1;
+ score_data['m1_transit_line_id'] = this.selectedTransitLine;
+ score_data['m1_non_trimet'] = this.selectedNonTrimetLine;
+ break;
+ case 2:
+ score_data['m2_complete'] = this.selectedTransitCenter ? 1 : 0;
+ score_data['m2_transit_center_id'] = this.selectedTransitCenter;
+ score_data['m2_with_other_team'] = this.selectedPhotoHasAnotherTeam ? 1 : 0;
+ break;
+ case 3:
+ score_data['m3_complete'] = 1;
+ break;
+ case 4:
+ score_data['m4_complete'] = 1;
+ break;
+ case 5:
+ score_data['m5_complete'] = this.selectedM5Singing ? 1 : 0;
+ score_data['m5_tip'] = this.selectedM5Tipping ? 1 : 0;
+ break;
+ case 6:
+ score_data['m6_complete'] = 1;
+ break;
+ case 7:
+ score_data['m7_document_id'] = this.selectedDocument;
+ break;
+ }
- return hashtagsOnly;
- };
+ $.post("/dashboard/score-tweet", {
+ tweet_id: this.tweet.tweet_id,
+ score_data: score_data
+ }, function () {
+ this.clearState();
+ this.$emit('complete');
+ }.bind(this));
+ },
+ sendReply: function sendReply() {
+ this.replyInProgress = true;
- twttr.txt.extractHashtagsWithIndices = function(text, options) {
- if (!options) {
- options = {checkUrlOverlap: true};
- }
+ $.post("/dashboard/reply", {
+ tweet_id: this.tweet.tweet_id,
+ text: this.replyText
+ }, function (response) {
+ if (response.result == "ok") {
+ this.replyText = '';
+ }
+ this.replyInProgress = false;
+ }.bind(this));
- if (!text || !text.match(twttr.txt.regexen.hashSigns)) {
- return [];
+ // setTimeout(function(){ this.replyInProgress = false; this.showReplyBox = false; }.bind(this), 1000);
}
-
- var tags = [];
-
- text.replace(twttr.txt.regexen.validHashtag, function(match, before, hash, hashText, offset, chunk) {
- var after = chunk.slice(offset + match.length);
- if (after.match(twttr.txt.regexen.endHashtagMatch))
- return;
- var startPosition = offset + before.length;
- var endPosition = startPosition + hashText.length + 1;
- tags.push({
- hashtag: hashText,
- indices: [startPosition, endPosition]
- });
- });
-
- if (options.checkUrlOverlap) {
- // also extract URL entities
- var urls = twttr.txt.extractUrlsWithIndices(text);
- if (urls.length > 0) {
- var entities = tags.concat(urls);
- // remove overlap
- twttr.txt.removeOverlappingEntities(entities);
- // only push back hashtags
- tags = [];
- for (var i = 0; i < entities.length; i++) {
- if (entities[i].hashtag) {
- tags.push(entities[i]);
- }
- }
+ },
+ watch: {
+ // https://vuejs.org/v2/guide/computed.html#Watchers
+ show: function show(val) {
+ if (val) {
+ // https://vuejs.org/v2/guide/reactivity.html#Async-Update-Queue
+ Vue.nextTick(function () {
+ $(".multi-photo .photo").featherlight();
+ }.bind(this));
}
+ },
+ replyText: function replyText(val) {
+ this.replyTextCharsRemaining = 140 - twitter.getTweetLength(val);
}
+ },
+ created: function created() {
+ $.get("/dashboard/dropdowns", function (response) {
+ this.centers = response.transit_centers;
+ this.lines = response.transit_lines;
+ this.documents = response.documents;
+ }.bind(this));
+ }
+};
- return tags;
- };
-
- twttr.txt.extractCashtags = function(text) {
- var cashtagsOnly = [],
- cashtagsWithIndices = twttr.txt.extractCashtagsWithIndices(text);
+/***/ }),
+/* 46 */
+/***/ (function(module, exports, __webpack_require__) {
- for (var i = 0; i < cashtagsWithIndices.length; i++) {
- cashtagsOnly.push(cashtagsWithIndices[i].cashtag);
+module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
+ return (_vm.show) ? _c('div', {
+ staticClass: "panel panel-default scorecard"
+ }, [_c('div', {
+ staticClass: "panel-heading"
+ }, [_c('div', {
+ staticClass: "team"
+ }, [_c('span', {
+ staticClass: "team-icon",
+ style: ('background-color: #' + _vm.tweet.team_color)
+ }), _vm._v(" "), _c('span', {
+ staticClass: "team-name"
+ }, [_vm._v(_vm._s(_vm.tweet.team_name))])]), _vm._v(" "), _c('h2', [_vm._v(_vm._s(_vm.tweet.mission))]), _vm._v(" "), _c('button', {
+ staticClass: "close",
+ attrs: {
+ "type": "button"
+ },
+ on: {
+ "click": _vm.dismiss
}
-
- return cashtagsOnly;
- };
-
- twttr.txt.extractCashtagsWithIndices = function(text) {
- if (!text || text.indexOf("$") == -1) {
- return [];
+ }, [_c('span', [_vm._v("×")])])]), _vm._v(" "), _c('div', {
+ staticClass: "panel-body"
+ }, [_c('div', {
+ staticClass: "row"
+ }, [_c('div', {
+ staticClass: "col-md-8"
+ }, [_c('div', {
+ staticClass: "profile"
+ }, [_c('img', {
+ style: ('border-color: #' + _vm.tweet.team_color),
+ attrs: {
+ "src": _vm.tweet.player_photo
}
-
- var tags = [];
-
- text.replace(twttr.txt.regexen.validCashtag, function(match, before, dollar, cashtag, offset, chunk) {
- var startPosition = offset + before.length;
- var endPosition = startPosition + cashtag.length + 1;
- tags.push({
- cashtag: cashtag,
- indices: [startPosition, endPosition]
- });
- });
-
- return tags;
- };
-
- twttr.txt.modifyIndicesFromUnicodeToUTF16 = function(text, entities) {
- twttr.txt.convertUnicodeIndices(text, entities, false);
- };
-
- twttr.txt.modifyIndicesFromUTF16ToUnicode = function(text, entities) {
- twttr.txt.convertUnicodeIndices(text, entities, true);
- };
-
- twttr.txt.getUnicodeTextLength = function(text) {
- return text.replace(twttr.txt.regexen.non_bmp_code_pairs, ' ').length;
- };
-
- twttr.txt.convertUnicodeIndices = function(text, entities, indicesInUTF16) {
- if (entities.length == 0) {
- return;
+ }), _vm._v(" "), _c('span', [_c('a', {
+ attrs: {
+ "href": 'https://twitter.com/' + _vm.tweet.player_username
}
-
- var charIndex = 0;
- var codePointIndex = 0;
-
- // sort entities by start index
- entities.sort(function(a,b){ return a.indices[0] - b.indices[0]; });
- var entityIndex = 0;
- var entity = entities[0];
-
- while (charIndex < text.length) {
- if (entity.indices[0] == (indicesInUTF16 ? charIndex : codePointIndex)) {
- var len = entity.indices[1] - entity.indices[0];
- entity.indices[0] = indicesInUTF16 ? codePointIndex : charIndex;
- entity.indices[1] = entity.indices[0] + len;
-
- entityIndex++;
- if (entityIndex == entities.length) {
- // no more entity
- break;
- }
- entity = entities[entityIndex];
+ }, [_vm._v("@" + _vm._s(_vm.tweet.player_username))])])]), _vm._v(" "), _c('div', {
+ staticClass: "tweet"
+ }, [_c('div', {
+ staticClass: "text"
+ }, [_vm._v(_vm._s(_vm.tweet.text))]), _vm._v(" "), (_vm.tweet.photos) ? _c('div', [(_vm.tweet.photos) ? _c('div', {
+ class: 'multi-photo photos-' + _vm.tweet.photos.length
+ }, _vm._l((_vm.tweet.photos), function(img) {
+ return _c('div', {
+ staticClass: "photo",
+ style: ('background-image:url(' + img + ')'),
+ attrs: {
+ "data-featherlight": img
}
-
- var c = text.charCodeAt(charIndex);
- if (0xD800 <= c && c <= 0xDBFF && charIndex < text.length - 1) {
- // Found high surrogate char
- c = text.charCodeAt(charIndex + 1);
- if (0xDC00 <= c && c <= 0xDFFF) {
- // Found surrogate pair
- charIndex++;
- }
+ }, [_c('img', {
+ attrs: {
+ "src": img
+ }
+ })])
+ })) : _vm._e(), _vm._v(" "), _c('div', {
+ staticClass: "multi-photo-clear"
+ })]) : _vm._e()]), _vm._v(" "), (_vm.showReplyBox) ? _c('div', {
+ staticClass: "tweet-reply"
+ }, [_c('div', {
+ staticClass: "top"
+ }, [_c('textarea', {
+ directives: [{
+ name: "model",
+ rawName: "v-model",
+ value: (_vm.replyText),
+ expression: "replyText"
+ }],
+ staticClass: "form-control",
+ staticStyle: {
+ "margin-bottom": "4px"
+ },
+ attrs: {
+ "rows": "2",
+ "disabled": _vm.replyInProgress
+ },
+ domProps: {
+ "value": (_vm.replyText)
+ },
+ on: {
+ "input": function($event) {
+ if ($event.target.composing) { return; }
+ _vm.replyText = $event.target.value
}
- codePointIndex++;
- charIndex++;
}
- };
-
- // this essentially does text.split(/<|>/)
- // except that won't work in IE, where empty strings are ommitted
- // so "<>".split(/<|>/) => [] in IE, but is ["", "", ""] in all others
- // but "<<".split("<") => ["", "", ""]
- twttr.txt.splitTags = function(text) {
- var firstSplits = text.split("<"),
- secondSplits,
- allSplits = [],
- split;
-
- for (var i = 0; i < firstSplits.length; i += 1) {
- split = firstSplits[i];
- if (!split) {
- allSplits.push("");
- } else {
- secondSplits = split.split(">");
- for (var j = 0; j < secondSplits.length; j += 1) {
- allSplits.push(secondSplits[j]);
- }
+ })]), _vm._v(" "), _c('div', {
+ staticClass: "bottom"
+ }, [_c('div', {
+ staticClass: "fill"
+ }), _vm._v(" "), _c('img', {
+ attrs: {
+ "src": "/twitter.ico",
+ "width": "16"
+ }
+ }), _vm._v(" "), _c('div', {
+ staticClass: "remaining-chars"
+ }, [_vm._v(_vm._s(_vm.replyTextCharsRemaining))]), _vm._v(" "), _c('button', {
+ staticClass: "btn btn-primary",
+ attrs: {
+ "disabled": _vm.isTweetReplyDisabled
+ },
+ on: {
+ "click": _vm.sendReply
+ }
+ }, [_vm._v("Reply")])])]) : _vm._e(), _vm._v(" "), _c('div', {
+ staticClass: "tweet-actions"
+ }, [_c('button', {
+ staticClass: "btn btn-success",
+ attrs: {
+ "type": "button",
+ "disabled": _vm.isAcceptDisabled
+ },
+ on: {
+ "click": _vm.scoreTweet
+ }
+ }, [_vm._v("Accept")]), _vm._v(" "), _c('button', {
+ staticClass: "btn btn-danger",
+ attrs: {
+ "type": "button"
+ },
+ on: {
+ "click": _vm.rejectTweet
+ }
+ }, [_vm._v("Reject")])])]), _vm._v(" "), _c('div', {
+ staticClass: "col-md-4"
+ }, [(_vm.tweet.mission_id == 1) ? [_c('p', {
+ staticClass: "instructions"
+ }, [_vm._v("\n The photo must show the sign with the transit line\n ")]), _vm._v(" "), _c('div', {
+ staticClass: "form-group"
+ }, [_c('select', {
+ directives: [{
+ name: "model",
+ rawName: "v-model",
+ value: (_vm.selectedTransitLine),
+ expression: "selectedTransitLine"
+ }],
+ staticClass: "form-control",
+ on: {
+ "change": function($event) {
+ var $$selectedVal = Array.prototype.filter.call($event.target.options, function(o) {
+ return o.selected
+ }).map(function(o) {
+ var val = "_value" in o ? o._value : o.value;
+ return val
+ });
+ _vm.selectedTransitLine = $event.target.multiple ? $$selectedVal : $$selectedVal[0]
}
}
-
- return allSplits;
- };
-
- twttr.txt.hitHighlight = function(text, hits, options) {
- var defaultHighlightTag = "em";
-
- hits = hits || [];
- options = options || {};
-
- if (hits.length === 0) {
- return text;
+ }, [_c('option', {
+ attrs: {
+ "value": ""
}
-
- var tagName = options.tag || defaultHighlightTag,
- tags = ["<" + tagName + ">", "" + tagName + ">"],
- chunks = twttr.txt.splitTags(text),
- i,
- j,
- result = "",
- chunkIndex = 0,
- chunk = chunks[0],
- prevChunksLen = 0,
- chunkCursor = 0,
- startInChunk = false,
- chunkChars = chunk,
- flatHits = [],
- index,
- hit,
- tag,
- placed,
- hitSpot;
-
- for (i = 0; i < hits.length; i += 1) {
- for (j = 0; j < hits[i].length; j += 1) {
- flatHits.push(hits[i][j]);
+ }), _vm._v(" "), _vm._l((_vm.lines), function(line) {
+ return _c('option', {
+ domProps: {
+ "value": line.id
+ }
+ }, [_vm._v(_vm._s(line.name))])
+ })], 2)]), _vm._v(" "), _c('div', {
+ staticClass: "form-group"
+ }, [_c('input', {
+ directives: [{
+ name: "model",
+ rawName: "v-model",
+ value: (_vm.selectedNonTrimetLine),
+ expression: "selectedNonTrimetLine"
+ }],
+ staticClass: "form-control",
+ attrs: {
+ "type": "text",
+ "placeholder": "Non-Trimet Line"
+ },
+ domProps: {
+ "value": (_vm.selectedNonTrimetLine)
+ },
+ on: {
+ "input": function($event) {
+ if ($event.target.composing) { return; }
+ _vm.selectedNonTrimetLine = $event.target.value
+ }
+ }
+ })])] : _vm._e(), _vm._v(" "), (_vm.tweet.mission_id == 2) ? [_vm._m(0), _vm._v(" "), _c('div', {
+ staticClass: "form-group"
+ }, [_c('select', {
+ directives: [{
+ name: "model",
+ rawName: "v-model",
+ value: (_vm.selectedTransitCenter),
+ expression: "selectedTransitCenter"
+ }],
+ staticClass: "form-control",
+ on: {
+ "change": function($event) {
+ var $$selectedVal = Array.prototype.filter.call($event.target.options, function(o) {
+ return o.selected
+ }).map(function(o) {
+ var val = "_value" in o ? o._value : o.value;
+ return val
+ });
+ _vm.selectedTransitCenter = $event.target.multiple ? $$selectedVal : $$selectedVal[0]
}
}
-
- for (index = 0; index < flatHits.length; index += 1) {
- hit = flatHits[index];
- tag = tags[index % 2];
- placed = false;
-
- while (chunk != null && hit >= prevChunksLen + chunk.length) {
- result += chunkChars.slice(chunkCursor);
- if (startInChunk && hit === prevChunksLen + chunkChars.length) {
- result += tag;
- placed = true;
- }
-
- if (chunks[chunkIndex + 1]) {
- result += "<" + chunks[chunkIndex + 1] + ">";
- }
-
- prevChunksLen += chunkChars.length;
- chunkCursor = 0;
- chunkIndex += 2;
- chunk = chunks[chunkIndex];
- chunkChars = chunk;
- startInChunk = false;
+ }, [_c('option', {
+ attrs: {
+ "value": ""
+ }
+ }), _vm._v(" "), _vm._l((_vm.centers), function(stop) {
+ return _c('option', {
+ domProps: {
+ "value": stop.id
}
-
- if (!placed && chunk != null) {
- hitSpot = hit - prevChunksLen;
- result += chunkChars.slice(chunkCursor, hitSpot) + tag;
- chunkCursor = hitSpot;
- if (index % 2 === 0) {
- startInChunk = true;
+ }, [_vm._v(_vm._s(stop.name))])
+ })], 2)]), _vm._v(" "), _c('div', {
+ staticClass: "form-group"
+ }, [_c('div', {
+ staticClass: "checkbox"
+ }, [_c('label', [_c('input', {
+ directives: [{
+ name: "model",
+ rawName: "v-model",
+ value: (_vm.selectedPhotoHasAnotherTeam),
+ expression: "selectedPhotoHasAnotherTeam"
+ }],
+ attrs: {
+ "type": "checkbox"
+ },
+ domProps: {
+ "checked": Array.isArray(_vm.selectedPhotoHasAnotherTeam) ? _vm._i(_vm.selectedPhotoHasAnotherTeam, null) > -1 : (_vm.selectedPhotoHasAnotherTeam)
+ },
+ on: {
+ "__c": function($event) {
+ var $$a = _vm.selectedPhotoHasAnotherTeam,
+ $$el = $event.target,
+ $$c = $$el.checked ? (true) : (false);
+ if (Array.isArray($$a)) {
+ var $$v = null,
+ $$i = _vm._i($$a, $$v);
+ if ($$c) {
+ $$i < 0 && (_vm.selectedPhotoHasAnotherTeam = $$a.concat($$v))
+ } else {
+ $$i > -1 && (_vm.selectedPhotoHasAnotherTeam = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
+ }
} else {
- startInChunk = false;
+ _vm.selectedPhotoHasAnotherTeam = $$c
}
- } else if(!placed) {
- placed = true;
- result += tag;
}
}
-
- if (chunk != null) {
- if (chunkCursor < chunkChars.length) {
- result += chunkChars.slice(chunkCursor);
- }
- for (index = chunkIndex + 1; index < chunks.length; index += 1) {
- result += (index % 2 === 0 ? chunks[index] : "<" + chunks[index] + ">");
+ }), _vm._v("\n Another team is in the photo\n ")])])])] : _vm._e(), _vm._v(" "), (_vm.tweet.mission_id == 3) ? [_vm._m(1)] : _vm._e(), _vm._v(" "), (_vm.tweet.mission_id == 4) ? [_vm._m(2)] : _vm._e(), _vm._v(" "), (_vm.tweet.mission_id == 5) ? [_c('p', {
+ staticClass: "instructions"
+ }, [_vm._v("\n Accept a photo of either a team member singing, or a photo of tipping the bus driver\n ")]), _vm._v(" "), _c('div', {
+ staticClass: "form-group"
+ }, [_c('label', [_c('input', {
+ directives: [{
+ name: "model",
+ rawName: "v-model",
+ value: (_vm.selectedM5Singing),
+ expression: "selectedM5Singing"
+ }],
+ attrs: {
+ "type": "checkbox"
+ },
+ domProps: {
+ "checked": Array.isArray(_vm.selectedM5Singing) ? _vm._i(_vm.selectedM5Singing, null) > -1 : (_vm.selectedM5Singing)
+ },
+ on: {
+ "__c": function($event) {
+ var $$a = _vm.selectedM5Singing,
+ $$el = $event.target,
+ $$c = $$el.checked ? (true) : (false);
+ if (Array.isArray($$a)) {
+ var $$v = null,
+ $$i = _vm._i($$a, $$v);
+ if ($$c) {
+ $$i < 0 && (_vm.selectedM5Singing = $$a.concat($$v))
+ } else {
+ $$i > -1 && (_vm.selectedM5Singing = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
+ }
+ } else {
+ _vm.selectedM5Singing = $$c
+ }
}
}
-
- return result;
- };
-
- var MAX_LENGTH = 140;
-
- // Returns the length of Tweet text with consideration to t.co URL replacement
- // and chars outside the basic multilingual plane that use 2 UTF16 code points
- twttr.txt.getTweetLength = function(text, options) {
- if (!options) {
- options = {
- // These come from https://api.twitter.com/1.1/help/configuration.json
- // described by https://dev.twitter.com/rest/reference/get/help/configuration
- short_url_length: 23,
- short_url_length_https: 23
- };
- }
- var textLength = twttr.txt.getUnicodeTextLength(text),
- urlsWithIndices = twttr.txt.extractUrlsWithIndices(text);
- twttr.txt.modifyIndicesFromUTF16ToUnicode(text, urlsWithIndices);
-
- for (var i = 0; i < urlsWithIndices.length; i++) {
- // Subtract the length of the original URL
- textLength += urlsWithIndices[i].indices[0] - urlsWithIndices[i].indices[1];
-
- // Add 23 characters for URL starting with https://
- // http:// URLs still use https://t.co so they are 23 characters as well
- if (urlsWithIndices[i].url.toLowerCase().match(twttr.txt.regexen.urlHasHttps)) {
- textLength += options.short_url_length_https;
- } else {
- textLength += options.short_url_length;
+ }), _vm._v("\n Singing\n ")]), _vm._v(" "), _c('br'), _vm._v(" "), _c('label', [_c('input', {
+ directives: [{
+ name: "model",
+ rawName: "v-model",
+ value: (_vm.selectedM5Tipping),
+ expression: "selectedM5Tipping"
+ }],
+ attrs: {
+ "type": "checkbox"
+ },
+ domProps: {
+ "checked": Array.isArray(_vm.selectedM5Tipping) ? _vm._i(_vm.selectedM5Tipping, null) > -1 : (_vm.selectedM5Tipping)
+ },
+ on: {
+ "__c": function($event) {
+ var $$a = _vm.selectedM5Tipping,
+ $$el = $event.target,
+ $$c = $$el.checked ? (true) : (false);
+ if (Array.isArray($$a)) {
+ var $$v = null,
+ $$i = _vm._i($$a, $$v);
+ if ($$c) {
+ $$i < 0 && (_vm.selectedM5Tipping = $$a.concat($$v))
+ } else {
+ $$i > -1 && (_vm.selectedM5Tipping = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
+ }
+ } else {
+ _vm.selectedM5Tipping = $$c
+ }
}
}
+ }), _vm._v("\n Tipping the driver\n ")])])] : _vm._e(), _vm._v(" "), (_vm.tweet.mission_id == 6) ? [_c('p', {
+ staticClass: "instructions"
+ }, [_vm._v("\n The photo must show all team members with their completed visas\n ")])] : _vm._e(), _vm._v(" "), (_vm.tweet.mission_id == 7) ? [_c('p', {
+ staticClass: "instructions"
+ }, [_vm._v("\n Accept a photo that completes one of the below documents:\n ")]), _vm._v(" "), _c('div', {
+ staticClass: "form-group"
+ }, _vm._l((_vm.documents), function(doc) {
+ return _c('div', {
+ staticClass: "radio"
+ }, [_c('label', [_c('input', {
+ directives: [{
+ name: "model",
+ rawName: "v-model",
+ value: (_vm.selectedDocument),
+ expression: "selectedDocument"
+ }],
+ attrs: {
+ "type": "radio",
+ "name": "selectedDocument"
+ },
+ domProps: {
+ "value": doc.id,
+ "checked": _vm._q(_vm.selectedDocument, doc.id)
+ },
+ on: {
+ "__c": function($event) {
+ _vm.selectedDocument = doc.id
+ }
+ }
+ }), _vm._v("\n " + _vm._s(doc.description) + "\n ")])])
+ }))] : _vm._e()], 2)])])]) : _vm._e()
+},staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
+ return _c('p', {
+ staticClass: "instructions"
+ }, [_c('ul', [_c('li', [_vm._v("Photo must show the sign with the transit center")]), _vm._v(" "), _c('li', [_vm._v("Bonus points if another team and their pennant are visible!")])])])
+},function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
+ return _c('p', {
+ staticClass: "instructions"
+ }, [_c('ul', [_c('li', [_vm._v("Make sure this photo is on the tram or at the top tram station")]), _vm._v(" "), _c('li', [_vm._v("Reject if it shows the rooftop with the code!")])])])
+},function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
+ return _c('p', {
+ staticClass: "instructions"
+ }, [_c('ul', [_c('li', [_vm._v("The photo must include the radio")]), _vm._v(" "), _c('li', [_vm._v("Reject if it shows the decoded message")])])])
+}]}
+module.exports.render._withStripped = true
+if (false) {
+ module.hot.accept()
+ if (module.hot.data) {
+ require("vue-hot-reload-api").rerender("data-v-1098d79e", module.exports)
+ }
+}
- return textLength;
- };
-
- // Check the text for any reason that it may not be valid as a Tweet. This is meant as a pre-validation
- // before posting to api.twitter.com. There are several server-side reasons for Tweets to fail but this pre-validation
- // will allow quicker feedback.
- //
- // Returns false if this text is valid. Otherwise one of the following strings will be returned:
- //
- // "too_long": if the text is too long
- // "empty": if the text is nil or empty
- // "invalid_characters": if the text contains non-Unicode or any of the disallowed Unicode characters
- twttr.txt.isInvalidTweet = function(text) {
- if (!text) {
- return "empty";
- }
-
- // Determine max length independent of URL length
- if (twttr.txt.getTweetLength(text) > MAX_LENGTH) {
- return "too_long";
- }
-
- if (twttr.txt.hasInvalidCharacters(text)) {
- return "invalid_characters";
- }
+/***/ }),
+/* 47 */
+/***/ (function(module, exports) {
- return false;
- };
+// removed by extract-text-webpack-plugin
- twttr.txt.hasInvalidCharacters = function(text) {
- return twttr.txt.regexen.invalid_chars.test(text);
- };
+/***/ }),
+/* 48 */,
+/* 49 */,
+/* 50 */,
+/* 51 */,
+/* 52 */,
+/* 53 */,
+/* 54 */,
+/* 55 */,
+/* 56 */,
+/* 57 */
+/***/ (function(module, exports, __webpack_require__) {
- twttr.txt.isValidTweetText = function(text) {
- return !twttr.txt.isInvalidTweet(text);
- };
+var disposed = false
+var Component = __webpack_require__(8)(
+ /* script */
+ __webpack_require__(58),
+ /* template */
+ __webpack_require__(59),
+ /* styles */
+ null,
+ /* scopeId */
+ null,
+ /* moduleIdentifier (server only) */
+ null
+)
+Component.options.__file = "/Users/aaronpk/Code/spy30/resources/assets/js/components/ImportTweet.vue"
+if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
+if (Component.options.functional) {console.error("[vue-loader] ImportTweet.vue: functional components are not supported with templates, they should use render functions.")}
- twttr.txt.isValidUsername = function(username) {
- if (!username) {
- return false;
- }
+/* hot reload */
+if (false) {(function () {
+ var hotAPI = require("vue-hot-reload-api")
+ hotAPI.install(require("vue"), false)
+ if (!hotAPI.compatible) return
+ module.hot.accept()
+ if (!module.hot.data) {
+ hotAPI.createRecord("data-v-48d8e2ca", Component.options)
+ } else {
+ hotAPI.reload("data-v-48d8e2ca", Component.options)
+ }
+ module.hot.dispose(function (data) {
+ disposed = true
+ })
+})()}
- var extracted = twttr.txt.extractMentions(username);
+module.exports = Component.exports
- // Should extract the username minus the @ sign, hence the .slice(1)
- return extracted.length === 1 && extracted[0] === username.slice(1);
- };
- var VALID_LIST_RE = regexSupplant(/^#{validMentionOrList}$/);
+/***/ }),
+/* 58 */
+/***/ (function(module, exports) {
- twttr.txt.isValidList = function(usernameList) {
- var match = usernameList.match(VALID_LIST_RE);
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
- // Must have matched and had nothing before or after
- return !!(match && match[1] == "" && match[4]);
- };
+module.exports = {
+ props: [],
+ data: function data() {
+ return {
+ error: false,
+ tweet: null,
+ tweetID: null,
+ previewTweet: false
+ };
+ },
- twttr.txt.isValidHashtag = function(hashtag) {
- if (!hashtag) {
- return false;
+ methods: {
+ loadTweet: function loadTweet(e) {
+ var tweetURL = $(e.target).val();
+ $.post("/import/preview", {
+ url: tweetURL
+ }, function (response) {
+ if (response.error) {
+ this.tweet = null;
+ this.tweetID = null, this.previewTweet = false;
+ this.error = response.error;
+ } else {
+ console.log(response);
+ this.tweet = response;
+ this.tweetID = response.twitter_id;
+ this.previewTweet = true;
+ this.error = false;
+ }
+ }.bind(this));
+ },
+ importTweet: function importTweet() {
+ $.post("/import/save", {
+ tweet_id: this.tweetID
+ }, function (response) {
+ if (response.error) {
+ this.tweet = null;
+ this.tweetID = null, this.previewTweet = false;
+ this.error = response.error;
+ } else {
+ this.tweet = null;
+ this.tweetID = null;
+ this.previewTweet = false;
+ this.error = false;
+ }
+ }.bind(this));
}
+ }
+};
- var extracted = twttr.txt.extractHashtags(hashtag);
-
- // Should extract the hashtag minus the # sign, hence the .slice(1)
- return extracted.length === 1 && extracted[0] === hashtag.slice(1);
- };
+/***/ }),
+/* 59 */
+/***/ (function(module, exports, __webpack_require__) {
- twttr.txt.isValidUrl = function(url, unicodeDomains, requireProtocol) {
- if (unicodeDomains == null) {
- unicodeDomains = true;
+module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
+ return _c('div', {
+ staticClass: "container"
+ }, [_c('div', {
+ staticClass: "row"
+ }, [_c('div', {
+ staticClass: "col-xs-8 col-md-8 panel scorecard"
+ }, [_c('div', {
+ staticClass: "panel-body"
+ }, [(_vm.previewTweet) ? _c('div', [_c('div', {
+ staticClass: "profile"
+ }, [_c('img', {
+ style: ('border-color: #' + _vm.tweet.team_color),
+ attrs: {
+ "src": _vm.tweet.player_photo
}
-
- if (requireProtocol == null) {
- requireProtocol = true;
+ }), _vm._v(" "), _c('span', [_c('a', {
+ attrs: {
+ "href": 'https://twitter.com/' + _vm.tweet.player_username
}
-
- if (!url) {
- return false;
+ }, [_vm._v("@" + _vm._s(_vm.tweet.player_username))])])]), _vm._v(" "), _c('div', {
+ staticClass: "tweet"
+ }, [_c('div', {
+ staticClass: "text"
+ }, [_vm._v(_vm._s(_vm.tweet.text))]), _vm._v(" "), (_vm.tweet.photos) ? _c('div', [(_vm.tweet.photos) ? _c('div', {
+ class: 'multi-photo photos-' + _vm.tweet.photos.length
+ }, _vm._l((_vm.tweet.photos), function(img) {
+ return _c('div', {
+ staticClass: "photo",
+ style: ('background-image:url(' + img + ')'),
+ attrs: {
+ "data-featherlight": img
+ }
+ }, [_c('img', {
+ attrs: {
+ "src": img
+ }
+ })])
+ })) : _vm._e(), _vm._v(" "), _c('div', {
+ staticClass: "multi-photo-clear"
+ })]) : _vm._e()]), _vm._v(" "), _c('div', {
+ staticClass: "tweet-actions"
+ }, [_c('button', {
+ staticClass: "btn btn-success",
+ attrs: {
+ "type": "button"
+ },
+ on: {
+ "click": _vm.importTweet
}
-
- var urlParts = url.match(twttr.txt.regexen.validateUrlUnencoded);
-
- if (!urlParts || urlParts[0] !== url) {
- return false;
+ }, [_vm._v("Import")])])]) : _c('div', [(_vm.error) ? _c('div', [_c('div', {
+ staticClass: "alert alert-danger",
+ attrs: {
+ "role": "alert"
}
-
- var scheme = urlParts[1],
- authority = urlParts[2],
- path = urlParts[3],
- query = urlParts[4],
- fragment = urlParts[5];
-
- if (!(
- (!requireProtocol || (isValidMatch(scheme, twttr.txt.regexen.validateUrlScheme) && scheme.match(/^https?$/i))) &&
- isValidMatch(path, twttr.txt.regexen.validateUrlPath) &&
- isValidMatch(query, twttr.txt.regexen.validateUrlQuery, true) &&
- isValidMatch(fragment, twttr.txt.regexen.validateUrlFragment, true)
- )) {
- return false;
+ }, [_vm._v(_vm._s(_vm.error))])]) : _vm._e(), _vm._v(" "), _c('form', {
+ on: {
+ "submit": function($event) {
+ $event.preventDefault();
+ }
}
-
- return (unicodeDomains && isValidMatch(authority, twttr.txt.regexen.validateUrlUnicodeAuthority)) ||
- (!unicodeDomains && isValidMatch(authority, twttr.txt.regexen.validateUrlAuthority));
- };
-
- function isValidMatch(string, regex, optional) {
- if (!optional) {
- // RegExp["$&"] is the text of the last match
- // blank strings are ok, but are falsy, so we check stringiness instead of truthiness
- return ((typeof string === "string") && string.match(regex) && RegExp["$&"] === string);
+ }, [_c('div', {
+ staticClass: "form-group"
+ }, [_c('label', {
+ attrs: {
+ "for": ""
}
-
- // RegExp["$&"] is the text of the last match
- return (!string || (string.match(regex) && RegExp["$&"] === string));
- }
-
- if (typeof module != 'undefined' && module.exports) {
- module.exports = twttr.txt;
- }
-
- if (true) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (twttr.txt),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- }
-
- if (typeof window != 'undefined') {
- if (window.twttr) {
- for (var prop in twttr) {
- window.twttr[prop] = twttr[prop];
+ }, [_vm._v("Tweet URL")]), _vm._v(" "), _c('input', {
+ staticClass: "form-control",
+ attrs: {
+ "type": "url",
+ "placeholder": "https://twitter.com/..."
+ },
+ on: {
+ "keyup": function($event) {
+ if (!('button' in $event) && _vm._k($event.keyCode, "enter", 13)) { return null; }
+ _vm.loadTweet($event)
}
- } else {
- window.twttr = twttr;
}
+ })])])])])])])])
+},staticRenderFns: []}
+module.exports.render._withStripped = true
+if (false) {
+ module.hot.accept()
+ if (module.hot.data) {
+ require("vue-hot-reload-api").rerender("data-v-48d8e2ca", module.exports)
}
-})();
-
+}
/***/ })
/******/ ]);
\ No newline at end of file
diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js
index acfd876..1ad42c0 100644
--- a/resources/assets/js/app.js
+++ b/resources/assets/js/app.js
@@ -22,6 +22,7 @@ window.Vue = require('vue');
*/
Vue.component('tweet-queue', require('./components/TweetQueue.vue'));
+Vue.component('import-tweet', require('./components/ImportTweet.vue'));
Vue.component('scorecard', require('./components/Scorecard.vue'));
var data = {
diff --git a/resources/assets/js/components/ImportTweet.vue b/resources/assets/js/components/ImportTweet.vue
new file mode 100644
index 0000000..e59dbd9
--- /dev/null
+++ b/resources/assets/js/components/ImportTweet.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
diff --git a/resources/assets/js/components/Mission1.vue b/resources/assets/js/components/Mission1.vue
deleted file mode 100644
index e69de29..0000000
diff --git a/resources/assets/sass/app.scss b/resources/assets/sass/app.scss
index 846480e..3512c37 100644
--- a/resources/assets/sass/app.scss
+++ b/resources/assets/sass/app.scss
@@ -259,17 +259,19 @@
}
-.tweet {
- border: 1px $laravel-border-color solid;
- border-radius: 4px;
- padding: 6px;
- margin-bottom: 6px;
-
- .text {
- white-space: pre-wrap;
- font-size: 1.5em;
- margin: 8px 0;
- }
+.tweet-list {
+ .tweet {
+ border: 1px $laravel-border-color solid;
+ border-radius: 4px;
+ padding: 6px;
+ margin-bottom: 6px;
+ .text {
+ white-space: pre-wrap;
+ font-size: 1.5em;
+ margin: 8px 0;
+ }
+
+ }
}
diff --git a/resources/views/import.blade.php b/resources/views/import.blade.php
new file mode 100644
index 0000000..a753daa
--- /dev/null
+++ b/resources/views/import.blade.php
@@ -0,0 +1,5 @@
+@extends('layouts.app')
+
+@section('content')
+
+@endsection
diff --git a/resources/views/team-tweets.blade.php b/resources/views/team-tweets.blade.php
index b3a7f3b..58d5cfa 100644
--- a/resources/views/team-tweets.blade.php
+++ b/resources/views/team-tweets.blade.php
@@ -3,7 +3,7 @@
@section('content')