Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ! function(e, t) {
- "use strict";
- function n() {
- this.$get = ["$$sanitizeUri",
- function(e) {
- return function(t) {
- var n = [];
- return a(t, l(n, function(t, n) {
- return !/^unsafe/.test(e(t, n))
- })), n.join("")
- }
- }
- ]
- }
- function r(e) {
- var n = [],
- r = l(n, t.noop);
- return r.chars(e), n.join("")
- }
- function i(e) {
- var t, n = {},
- r = e.split(",");
- for (t = 0; t < r.length; t++) n[r[t]] = !0;
- return n
- }
- function a(e, n) {
- function r(e, r, a, o) {
- if (r = t.lowercase(r), q[r])
- for (; x.last() && $[x.last()];) i("", x.last());
- z[r] && x.last() == r && i("", r), o = v[r] || !!o, o || x.push(r);
- var l = {};
- a.replace(p, function(e, t, n, r, i) {
- var a = n || r || i || "";
- l[t] = s(a)
- }), n.start && n.start(r, l, o)
- }
- function i(e, r) {
- var i, a = 0;
- if (r = t.lowercase(r))
- for (a = x.length - 1; a >= 0 && x[a] != r; a--);
- if (a >= 0) {
- for (i = x.length - 1; i >= a; i--) n.end && n.end(x[i]);
- x.length = a
- }
- }
- "string" != typeof e && (e = null === e || "undefined" == typeof e ? "" : "" + e);
- var a, o, l, k, x = [],
- y = e;
- for (x.last = function() {
- return x[x.length - 1]
- }; e;) {
- if (k = "", o = !0, x.last() && C[x.last()] ? (e = e.replace(new RegExp("(.*)<\\s*\\/\\s*" + x.last() + "[^>]*>", "i"), function(e, t) {
- return t = t.replace(h, "$1").replace(b, "$1"), n.chars && n.chars(s(t)), ""
- }), i("", x.last())) : (0 === e.indexOf("<!--") ? (a = e.indexOf("--", 4), a >= 0 && e.lastIndexOf("-->", a) === a && (n.comment && n.comment(e.substring(4, a)), e = e.substring(a + 3), o = !1)) : m.test(e) ? (l = e.match(m), l && (e = e.replace(l[0], ""), o = !1)) : d.test(e) ? (l = e.match(g), l && (e = e.substring(l[0].length), l[0].replace(g, i), o = !1)) : f.test(e) && (l = e.match(u), l ? (l[4] && (e = e.substring(l[0].length), l[0].replace(u, r)), o = !1) : (k += "<", e = e.substring(1))), o && (a = e.indexOf("<"), k += 0 > a ? e : e.substring(0, a), e = 0 > a ? "" : e.substring(a), n.chars && n.chars(s(k)))), e == y) throw c("badparse", "The sanitizer was unable to parse the following block of html: {0}", e);
- y = e
- }
- i()
- }
- function s(e) {
- if (!e) return "";
- var t = F.exec(e),
- n = t[1],
- r = t[3],
- i = t[2];
- return i && (E.innerHTML = i.replace(/</g, "<"), i = "textContent" in E ? E.textContent : E.innerText), n + i + r
- }
- function o(e) {
- return e.replace(/&/g, "&").replace(k, function(e) {
- var t = e.charCodeAt(0),
- n = e.charCodeAt(1);
- return "&#" + (1024 * (t - 55296) + (n - 56320) + 65536) + ";"
- }).replace(x, function(e) {
- return "&#" + e.charCodeAt(0) + ";"
- }).replace(/</g, "<").replace(/>/g, ">")
- }
- function l(e, n) {
- var r = !1,
- i = t.bind(e, e.push);
- return {
- start: function(e, a, s) {
- e = t.lowercase(e), !r && C[e] && (r = e), r || D[e] !== !0 || (i("<"), i(e), t.forEach(a, function(r, a) {
- var s = t.lowercase(a),
- l = "img" === e && "src" === s || "background" === s;
- j[s] !== !0 || M[s] === !0 && !n(r, l) || (i(" "), i(a), i('="'), i(o(r)), i('"'))
- }), i(s ? "/>" : ">"))
- },
- end: function(e) {
- e = t.lowercase(e), r || D[e] !== !0 || (i("</"), i(e), i(">")), e == r && (r = !1)
- },
- chars: function(e) {
- r || i(o(e))
- }
- }
- }
- var c = t.$$minErr("$sanitize"),
- u = /^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,
- g = /^<\/\s*([\w:-]+)[^>]*>/,
- p = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,
- f = /^</,
- d = /^<\//,
- h = /<!--(.*?)-->/g,
- m = /<!DOCTYPE([^>]*?)>/i,
- b = /<!\[CDATA\[(.*?)]]>/g,
- k = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
- x = /([^\#-~| |!])/g,
- v = i("area,br,col,hr,img,wbr"),
- y = i("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),
- w = i("rp,rt"),
- z = t.extend({}, w, y),
- q = t.extend({}, y, i("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),
- $ = t.extend({}, w, i("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var,audio,source")),
- S = i("animate,animateColor,animateMotion,animateTransform,circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,set,stop,svg,switch,text,title,tspan,use"),
- C = i("script,style"),
- D = t.extend({}, v, q, $, z, S),
- M = i("background,cite,href,longdesc,src,usemap,xlink:href"),
- A = i("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width,controls"),
- T = i("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,attributeName,attributeType,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan"),
- j = t.extend({}, M, T, A),
- E = document.createElement("pre"),
- F = /^(\s*)([\s\S]*?)(\s*)$/;
- t.module("ngSanitize", []).provider("$sanitize", n), t.module("ngSanitize").filter("linky", ["$sanitize",
- function(e) {
- var n = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/,
- i = /^mailto:/;
- return function(a, s) {
- function o(e) {
- e && f.push(r(e))
- }
- function l(e, n) {
- f.push("<a "), t.isDefined(s) && f.push('target="', s, '" '), f.push('href="', e.replace(/"/g, """), '">'), o(n), f.push("</a>")
- }
- if (!a) return a;
- for (var c, u, g, p = a, f = []; c = p.match(n);) u = c[0], c[2] == c[3] && (u = "mailto:" + u), g = c.index, o(p.substr(0, g)), l(u, c[0].replace(i, "")), p = p.substring(g + c[0].length);
- return o(p), e(f.join(""))
- }
- }
- ])
- }(window, window.angular),
- function() {
- ! function() {
- var e, t, n;
- return t = "https://ask.cardsagainsthumanity.com", n = "//dopp0jlzdkkkq.cloudfront.net", e = function(e, r) {
- return e.single = {}, e.multi = {}, e.submitSingle = function(i) {
- return i.preventDefault(), e.invalidSingle = !1, e.loadingSingle = !0, e.formSingle.$valid ? r.get("" + t + "/single", {
- params: {
- q: e.single.q
- }
- }).success(function(t) {
- return e.single.img = "" + n + "/single/" + t.a + ".jpg"
- }).error(function(t) {
- return e.single.img = null, alert(t)
- })["finally"](function() {
- return e.loadingSingle = !1
- }) : (e.invalidSingle = !0, e.loadingSingle = !1)
- }, e.submitMulti = function(n) {
- return n.preventDefault(), e.invalidMulti = !1, e.loadingMulti = !0, e.showGuessing = !1, e.formMulti.$valid ? r.get("" + t + "/multi", {
- params: {
- q1: e.multi.q1,
- q2: e.multi.q2,
- q3: e.multi.q3,
- q4: e.multi.q4
- }
- }).success(function(t) {
- return e.multi.content = t
- }).error(function(t) {
- return e.multi.content = null, alert(t)
- })["finally"](function() {
- return e.loadingMulti = !1
- }) : (e.invalidMulti = !0, e.loadingMulti = !1)
- }
- }, e.$inject = ["$scope", "$http"], angular.module("puzzle", ["ngSanitize"]).controller("PuzzleCtrl", e)
- }()
- }.call(this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement