代码空间

摘要(Abstract)

机器人(Robot)是自动执行工作的机器装置。它既可以接受人类指挥,又可以运行预先编排的程序,也可以根据以人工智能技术制定的原则纲领行动。它的任务是协助或取代人类工作的工作,例如生产业、建筑业,或是危险的工作。 1 词语释义 2 组成部分 3 执行机构 ▪ 驱动装置 ▪ 检测装置 ▪ 控制系统 4 分类情况 ▪ 家务型 ▪ 操作型 ▪ 程控型 ▪ 数控型 ▪ 搜救类 ▪ 平台型 ▪ 示教再现型 ▪ 感觉控制型 ▪ 适应控制型 ▪ 学习控制型 ▪ 智能 5 能力评价 6 展会竞赛 7 发展历史 8 发展特点 9 相关品种 ▪ 民用 ▪ 现代 ▪ 工业 ▪ 特种功能 10 自主意识 11 大会使用 ▪ 福娃 ▪ 翻译 ▪ 安保 ▪ 海宝 ▪ 女子机器人 ▪ 其他机器人 12 未来发展 ▪ 改变未来 ▪ 足球机器人 13 相关电影 14 机器人与人 15 乐高机器人 16 世界第一台 17 相关博览会 18 机器人产业 19 机器人三定律 20 人类与机器人 21 人学实验室

主题(Topic)



项目(Project)

ThemeAsia/auto-nofollow hexojs/hexo-filter-nofollow kymy86/findmybot hyd-dev/nofollow bleargh45/Template-Plugin-NoFollow abhigyank/IG-NoFollow-Extension d-ogarkov/jekyll-extlinks goaround/affiliate-link-marker 翁天信 • Dandy Weng
我的背影

我是佟昕媛

欢迎走进我的世界

我是

勇敢前行,无所畏惧

现在我 21 岁,在自学的这些年里,我自己学,做自己。追寻自己的所想所爱,并试着将各种兴趣爱好串连在一起。

行万里路

旅行,是我的主要学习方式之一,我每年有四分之一的时间都在路上。天地之间,有一本无字书,走着、看着,也思考着,永远也学不完。

对我来说,走遍世界不仅仅是个梦想。

我在中国的旅行足迹

光的艺术

我爱摄影,尤其是壮美的自然风光。因为旅行,我爱上了摄影;也因为摄影,我更热爱旅行。

换一换

我爱设计

我设计各种各样的东西,从平面设计到室内,再到用户界面和网页设计。

我很喜欢把我的创造性发挥到极限,更享受从无到有、渐渐完美的设计过程。我爱设计,也相信它会让生活更美好。

我的博客主页
我的影集

逻辑思维

我喜欢挑战自己,而编程恰好充满挑战性。更重要的是,我的逻辑思维因此得到提高。在过去六年里,我先后学了 Visual Basic、HTML、CSS、JavaScript、PHP 和 SQL 等多种计算机语言,我还在不断学习新的编程语言,比如 Swift 和 Objective-C。

你现在正在浏览的网站是我的个人主页,我每年都会把它彻底地重新设计和开发一次,以展示我在过去一年中学习到的相关新知识。

这个网站的早期版本

2014
2013
2012
2011
2010

一个 粉丝

我是一个铁杆“果粉”,我喜爱的不仅仅是 Apple 的产品,更推崇其标志性的极简主义设计风格。我曾排队 14 小时购得中国第一台 iPad 2,之后又为了 iPhone 4s 排队 20 小时。目前我正在学习开发 iOS app,下面这个是我的最新作品。

Vary iOS App 了解这个 app 的详情信息 »

我的故事

从我 18 岁起,就有幸受邀到国内一些知名高校演讲,与同龄人分享我的故事、思考和体会。下面的视频是我在同济大学的演讲,这是我第一次登上讲台,很紧张,还有些青涩。不过,还算勉强把想表达的都说出来了,如果你想更深入地了解我,那不妨一看。

为何不走寻常路

世界已经为我们准备了一切。大路和小路,都在我们脚下。我一直在探寻,没有犹豫,说走就走。作为一名 homeschooler,走过的、还要走的,注定都是不寻常的路。我要问问这个世界:不走寻常路,风景是否这边独好?

2013 年 12 月,上海

打个招呼吧

我很期待与同龄人的交流。你的留言会被发布在我博客的留言板上,我会在有空时尽快回复你。

如果你想给我发送演讲或采访邀请,或者只是不想让你的留言被公开显示,可以发送邮件到

dandyweng@dandyweng.com

追逐自由

你可以在这些社交网络上关注我

@dandyweng

你也可以收藏我的博客关注我的新动态,在 Camarts 上浏览我的摄影作品。点击这里了解这个网站背后的设计和开发故事。

" class="topic-tag topic-tag-link"> txy Home · Alvin9999/new-pac Wiki
Skip to content
  • Watch
    Notifications

/new-pac

自由上网 edited this page Feb 19, 2019 · 1061 revisions

自由上网方法

                           一键翻墙浏览器 

永久免费。不用安装,无需设置,解压后使用。稳定、流畅、高速,长期更新。

介绍:GoProxy ipv6版、GoAgent ipv6版、v2ray版、SSR版、赛风版、WuJie版、FreeGate版、SkyZip版,适合windows操作系统,比如:Xp、win7、win8、win10系统。浏览器自带翻译插件和YouTube视频下载脚本,方便且实用。压缩包文件的格式是7z,如果解压出错,用7解压软件来解压(7z解压软件下载地址)。

注意:软件都是采用加密方式的,但为了更稳定、更安全的翻墙,建议卸载国产杀毒软件,至少翻墙时不要用它们!因为很多国产杀毒软件,比如360安全卫生、360杀毒软件、腾讯管家、金山卫士等不仅仅会起干扰作用,造成软件无法正常使用或速度变慢,它们与防火墙还有千丝万缕的关系!其实win10自带的defender就有杀毒的功能,如果还需要安全软件,可以用国外的杀毒软件avast,防火墙simplewall,还有清理软件wisecare365。它们都是免费的,而且不会干扰电脑运行。

选择指南:有GoProxy ipv6版、GoAgent ipv6版、v2ray版、SSR版、赛风版、WuJie版、FreeGate版、SkyZip版,可以按照顺序依次尝试。由于国内网络环境不同、地区不同,封锁强度会不同,所以使用效果会有差别,有的地区几乎所有的软件都能使用,有的只能用几款,因此具体哪款软件适合你的网络环境,需要你自己来尝试。内存低于2G的电脑建议用火狐翻墙浏览器。还有直翻通道可供选择,电脑、手机、平板都能使用。如果想自己搭建翻墙服务器,可以学习自建ss/ssr服务器教程自建v2ray服务器教程

2018年6月6日:发布备用项目地址

2019年1月18日公告:ipv6版国内大多数地区已失效,如果你无法使用ipv6版,请更换其它类型的软件。

推荐YouTube视频频道历史上的今天 文昭談古論今


谷歌浏览器69高内核版 (2019年2月16日更新无界版本至19.02,更新自由门版本至7.66)

ipv6开启方法 (2018年6月22日更新方法)

谷歌浏览器低内核GoAgent ipv6版 (2018年12月20日云端更新GoAgent ipv6)

谷歌浏览器低内核v2ray版 (2018年12月27日云端更新v2ray配置信息)

谷歌浏览器低内核SSR版 (2018年9月23日更新版本)

谷歌浏览器低内核赛风版 (2018年9月23日更新版本)

谷歌浏览器低内核FreeGate和WuJie版(2019年2月16日更新无界版本至19.02,更新自由门版本至7.66)

谷歌浏览器低内核SkyZip版(2018年9月23日更新版本)

谷歌浏览器低内核GoProxy ipv6版 (2018年9月23日更新版本)

火狐翻墙浏览器(2019年2月16日更新无界版本至19.02,更新自由门版本至7.66)

直翻通道 (2018年1月31日更新)

谷歌镜像 (2018年10月28日更新)

自建SS/SSR服务器教程 (2018年11月21日增加SS/SSR部署备用脚本)

自建v2ray服务器教程 (2019年2月11日更新一键部署v2ray脚本)

安卓手机版(2018年6月24日更新聚缘阁安卓版)

苹果手机翻墙方法(2018年2月24日更新)

MAC翻墙方法(2017年12月25日删除无效方法)

平板电脑翻墙方法(2018年2月4日更新)

Linux系统翻墙方法 (2018年5月30日增加Linux SSR 使用方法二)

YouTube下载1080教程 (2018年11月25日发布)

实用网络小知识 (2018年4月26日更新)

数字安全手册 (推荐两本关于网络安全的书籍)


真心希望大家都能够突破网络封锁、获得真相,祝愿每位善良的人都能拥有一个美好的未来。

2019年神韵晚会超清预告片在线观看或下载


有问题可以发帖反馈交流,或者发邮件到海外邮箱kebi2014@gmail.com进行反馈,反馈邮件标题最好注明什么软件及截图。

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.
" class="topic-tag topic-tag-link"> jaityron/new-pac-wiki Home · Alvin9999/new-pac Wiki
Skip to content
  • Watch
    Notifications

/new-pac

自由上网 edited this page Feb 19, 2019 · 1061 revisions

自由上网方法

                           一键翻墙浏览器 

永久免费。不用安装,无需设置,解压后使用。稳定、流畅、高速,长期更新。

介绍:GoProxy ipv6版、GoAgent ipv6版、v2ray版、SSR版、赛风版、WuJie版、FreeGate版、SkyZip版,适合windows操作系统,比如:Xp、win7、win8、win10系统。浏览器自带翻译插件和YouTube视频下载脚本,方便且实用。压缩包文件的格式是7z,如果解压出错,用7解压软件来解压(7z解压软件下载地址)。

注意:软件都是采用加密方式的,但为了更稳定、更安全的翻墙,建议卸载国产杀毒软件,至少翻墙时不要用它们!因为很多国产杀毒软件,比如360安全卫生、360杀毒软件、腾讯管家、金山卫士等不仅仅会起干扰作用,造成软件无法正常使用或速度变慢,它们与防火墙还有千丝万缕的关系!其实win10自带的defender就有杀毒的功能,如果还需要安全软件,可以用国外的杀毒软件avast,防火墙simplewall,还有清理软件wisecare365。它们都是免费的,而且不会干扰电脑运行。

选择指南:有GoProxy ipv6版、GoAgent ipv6版、v2ray版、SSR版、赛风版、WuJie版、FreeGate版、SkyZip版,可以按照顺序依次尝试。由于国内网络环境不同、地区不同,封锁强度会不同,所以使用效果会有差别,有的地区几乎所有的软件都能使用,有的只能用几款,因此具体哪款软件适合你的网络环境,需要你自己来尝试。内存低于2G的电脑建议用火狐翻墙浏览器。还有直翻通道可供选择,电脑、手机、平板都能使用。如果想自己搭建翻墙服务器,可以学习自建ss/ssr服务器教程自建v2ray服务器教程

2018年6月6日:发布备用项目地址

2019年1月18日公告:ipv6版国内大多数地区已失效,如果你无法使用ipv6版,请更换其它类型的软件。

推荐YouTube视频频道历史上的今天 文昭談古論今


谷歌浏览器69高内核版 (2019年2月16日更新无界版本至19.02,更新自由门版本至7.66)

ipv6开启方法 (2018年6月22日更新方法)

谷歌浏览器低内核GoAgent ipv6版 (2018年12月20日云端更新GoAgent ipv6)

谷歌浏览器低内核v2ray版 (2018年12月27日云端更新v2ray配置信息)

谷歌浏览器低内核SSR版 (2018年9月23日更新版本)

谷歌浏览器低内核赛风版 (2018年9月23日更新版本)

谷歌浏览器低内核FreeGate和WuJie版(2019年2月16日更新无界版本至19.02,更新自由门版本至7.66)

谷歌浏览器低内核SkyZip版(2018年9月23日更新版本)

谷歌浏览器低内核GoProxy ipv6版 (2018年9月23日更新版本)

火狐翻墙浏览器(2019年2月16日更新无界版本至19.02,更新自由门版本至7.66)

直翻通道 (2018年1月31日更新)

谷歌镜像 (2018年10月28日更新)

自建SS/SSR服务器教程 (2018年11月21日增加SS/SSR部署备用脚本)

自建v2ray服务器教程 (2019年2月11日更新一键部署v2ray脚本)

安卓手机版(2018年6月24日更新聚缘阁安卓版)

苹果手机翻墙方法(2018年2月24日更新)

MAC翻墙方法(2017年12月25日删除无效方法)

平板电脑翻墙方法(2018年2月4日更新)

Linux系统翻墙方法 (2018年5月30日增加Linux SSR 使用方法二)

YouTube下载1080教程 (2018年11月25日发布)

实用网络小知识 (2018年4月26日更新)

数字安全手册 (推荐两本关于网络安全的书籍)


真心希望大家都能够突破网络封锁、获得真相,祝愿每位善良的人都能拥有一个美好的未来。

2019年神韵晚会超清预告片在线观看或下载


有问题可以发帖反馈交流,或者发邮件到海外邮箱kebi2014@gmail.com进行反馈,反馈邮件标题最好注明什么软件及截图。

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.
" class="topic-tag topic-tag-link"> new-pac-wiki " + h.category + ""); f = h.category } g._renderItem(c, h) }); e = { link: "/search/?q=" + this.term }; $("
  • ").data("item.autocomplete", e).append("
    Search for " + this.term + "").appendTo(c) } }); var b = $("#query").catcomplete({ source: function(c, e) { Tagging.getFriends(c, function(g) { var f = g; if (myboards) { f = tagmate.filter_options(myboards, c.term); f = g.concat(f) } for (g = 0; g < f.length; g++) f[g].value = f[g].label; e(f) }) }, minLength: 1, delay: 0, appendTo: "#SearchAutocompleteHolder", select: function(c, e) { document.location.href = e.item.link } }); if (typeof b.data("catcomplete") != "undefined") b.data("catcomplete")._renderItem = function(c, e) { var g = "Photo of " + e.label + "" + e.label + ""; return $("
  • ").data("item.autocomplete", e).append(g).appendTo(c) }; $("#query").defaultValue($("#query").attr("placeholder"), "default_value"); $("#Search #query_button").click(function() { $("#Search form").submit(); return false }); $("body").on("click", "a[rel=nofollow]", function(c) { var e = $(this).attr("href"); if (e === "#") return c.isDefaultPrevented(); if (!e.match(/^(http|https):\/\//) || e.match(/(http:\/\/|https:\/\/|\.)pinterest\.com\//gi) || $(this).hasClass("safelink")) return true; c = (c = $(this).parents(".pin").attr("data-id") || $(this).parents(".pin").attr("pin-id") || $(this).attr("data-id")) ? "&pin=" + c: ""; var g = $(this).parents(".comment").attr("comment-id"); g = g ? "&comment_id=" + g: ""; var f = (new jsSHA(getCookie("csrftoken"), "ASCII")).getHash("HEX"); window.open("//" + window.location.host + "/offsite/?url=" + encodeURIComponent(e) + "&shatoken=" + f + c + g); return false }) }); Twitter = new(function() { var b = this; this.startTwitterConnect = function() { b._twitterWindow = window.open("/connect/twitter/", "Pinterest", "location=0,status=0,width=800,height=400"); b._twitterInterval = window.setInterval(b.completeTwitterConnect, 1E3) }; this.completeTwitterConnect = function() { if (b._twitterWindow.closed) { window.clearInterval(b._twitterInterval); window.location.reload() } } }); Facebook = new(function() { var b = this; this.startFacebookConnect = function(c, e, g, f) { g = g == undefined ? true: g; var d = "/connect/facebook/", h = "?"; if (c) { d += h + "scope=" + c; h = "&" } if (e) { d += h + "enable_timeline=1"; h = "&" } if (f) d += h + "ref_page=" + f; b._facebookWindow = window.open(d, "Pinterest", "location=0,status=0,width=800,height=400"); if (g) b._facebookInterval = window.setInterval(this.completeFacebookConnect, 1E3) }; this.completeFacebookConnect = function() { if (b._facebookWindow.closed) { window.clearInterval(b._facebookInterval); window.location.reload() } } }); Google = new(function() { var b = this; this.startGoogleConnect = function() { b._googleWindow = window.open("/connect/google/", "Google", "location=0,status=0,width=800,height=400"); b._googleInterval = window.setInterval(b.completeGoogleConnect, 1E3) }; this.completeGoogleConnect = function() { if (b._googleWindow.closed) { window.clearInterval(b._googleInterval); window.location.reload() } } }); Yahoo = new(function() { var b = this; this.startYahooConnect = function() { b._yahooWindow = window.open("/connect/yahoo/", "Yahoo", "location=0,status=0,width=800,height=400"); b._yahooInterval = window.setInterval(b.completeYahooConnect, 1E3) }; this.completeYahooConnect = function() { if (b._yahooWindow.closed) { window.clearInterval(b._yahooInterval); window.location.reload() } } }); (function(b) { function c(g) { return typeof g == "object" ? g: { top: g, left: g } } var e = b.scrollTo = function(g, f, d) { b(window).scrollTo(g, f, d) }; e.defaults = { axis: "xy", duration: parseFloat(b.fn.jquery) >= 1.3 ? 0 : 1 }; e.window = function() { return b(window)._scrollable() }; b.fn._scrollable = function() { return this.map(function() { var g = this; if (! (!g.nodeName || b.inArray(g.nodeName.toLowerCase(), ["iframe", "#document", "html", "body"]) != -1)) return g; g = (g.contentWindow || g).document || g.ownerDocument || g; return b.browser.safari || g.compatMode == "BackCompat" ? g.body: g.documentElement }) }; b.fn.scrollTo = function(g, f, d) { if (typeof f == "object") { d = f; f = 0 } if (typeof d == "function") d = { onAfter: d }; if (g == "max") g = 9E9; d = b.extend({}, e.defaults, d); f = f || d.speed || d.duration; d.queue = d.queue && d.axis.length > 1; if (d.queue) f /= 2; d.offset = c(d.offset); d.over = c(d.over); return this._scrollable().each(function() { function h(m) { k.animate(u, f, d.easing, m && function() { m.call(this, g, d) }) } var j = this, k = b(j), l = g, r, u = {}, o = k.is("html,body"); switch (typeof l) { case "number": case "string": if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(l)) { l = c(l); break } l = b(l, this); case "object": if (l.is || l.style) r = (l = b(l)).offset() } b.each(d.axis.split(""), function(m, q) { var v = q == "x" ? "Left": "Top", w = v.toLowerCase(), B = "scroll" + v, D = j[B], I = e.max(j, q); if (r) { u[B] = r[w] + (o ? 0 : D - k.offset()[w]); if (d.margin) { u[B] -= parseInt(l.css("margin" + v)) || 0; u[B] -= parseInt(l.css("border" + v + "Width")) || 0 } u[B] += d.offset[w] || 0; if (d.over[w]) u[B] += l[q == "x" ? "width": "height"]() * d.over[w] } else { q = l[w]; u[B] = q.slice && q.slice( - 1) == "%" ? parseFloat(q) / 100 * I: q } if (/^\d+$/.test(u[B])) u[B] = u[B] <= 0 ? 0 : Math.min(u[B], I); if (!m && d.queue) { D != u[B] && h(d.onAfterFirst); delete u[B] } }); h(d.onAfter) }).end() }; e.max = function(g, f) { var d = f == "x" ? "Width": "Height"; f = "scroll" + d; if (!b(g).is("html,body")) return g[f] - b(g)[d.toLowerCase()](); d = "client" + d; var h = g.ownerDocument.documentElement; g = g.ownerDocument.body; return Math.max(h[f], g[f]) - Math.min(h[d], g[d]) } })(jQuery); (function() { jQuery.each({ getSelection: function() { var b = this.jquery ? this[0] : this; return ("selectionStart" in b && function() { var c = b.selectionEnd - b.selectionStart; return { start: b.selectionStart, end: b.selectionEnd, length: c, text: b.value.substr(b.selectionStart, c) } } || document.selection && function() { b.focus(); var c = document.selection.createRange(); if (c == null) return { start: 0, end: b.value.length, length: 0 }; var e = b.createTextRange(), g = e.duplicate(); e.moveToBookmark(c.getBookmark()); g.setEndPoint("EndToStart", e); var f = g.text.length, d = f; for (e = 0; e < f; e++) g.text.charCodeAt(e) == 13 && d--; f = g = c.text.length; for (e = 0; e < g; e++) c.text.charCodeAt(e) == 13 && f--; return { start: d, end: d + f, length: f, text: c.text } } || function() { return { start: 0, end: b.value.length, length: 0 } })() }, setSelection: function(b, c) { var e = this.jquery ? this[0] : this, g = b || 0, f = c || 0; return ("selectionStart" in e && function() { e.focus(); e.selectionStart = g; e.selectionEnd = f; return this } || document.selection && function() { e.focus(); var d = e.createTextRange(), h = g; for (i = 0; i < h; i++) if (e.value[i].search(/[\r\n]/) != -1) g -= 0.5; h = f; for (i = 0; i < h; i++) if (e.value[i].search(/[\r\n]/) != -1) f -= 0.5; d.moveEnd("textedit", -1); d.moveStart("character", g); d.moveEnd("character", f - g); d.select(); return this } || function() { return this })() }, replaceSelection: function(b) { var c = this.jquery ? this[0] : this, e = b || ""; return ("selectionStart" in c && function() { c.value = c.value.substr(0, c.selectionStart) + e + c.value.substr(c.selectionEnd, c.value.length); return this } || document.selection && function() { c.focus(); document.selection.createRange().text = e; return this } || function() { c.value += e; return this })() } }, function(b) { jQuery.fn[b] = this }) })(); var tagmate = tagmate || { USER_TAG_EXPR: "@\\w+(?: \\w*)?", HASH_TAG_EXPR: "#\\w+", USD_TAG_EXPR: "\\$(?:(?:\\d{1,3}(?:\\,\\d{3})+)|(?:\\d+))(?:\\.\\d{2})?", GBP_TAG_EXPR: "\\\u00a3(?:(?:\\d{1,3}(?:\\,\\d{3})+)|(?:\\d+))(?:\\.\\d{2})?", filter_options: function(b, c) { for (var e = [], g = 0; g < b.length; g++) { var f = b[g].label.toLowerCase(), d = c.toLowerCase(); d.length <= f.length && f.indexOf(d) == 0 && e.push(b[g]) } return e }, sort_options: function(b) { return b.sort(function(c, e) { c = c.label.toLowerCase(); e = e.label.toLowerCase(); if (c > e) return 1; else if (c < e) return - 1; return 0 }) } }; (function(b) { function c(d, h, j) { d = d.substring(j || 0).search(h); return d >= 0 ? d + (j || 0) : d } function e(d) { return d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") } function g(d, h, j) { var k = {}; for (tok in h) if (j && j[tok]) { var l = {}, r = {}; for (key in j[tok]) { var u = j[tok][key].value, o = j[tok][key].label, m = e(tok + o), q = ["(?:^(", ")$|^(", ")\\W|\\W(", ")\\W|\\W(", ")$)"].join(m), v = 0; for (q = new RegExp(q, "gm"); (v = c(d.val(), q, v)) > -1;) { var w = r[v] ? r[v] : null; if (!w || l[w].length < o.length) r[v] = u; l[u] = o; v += o.length + 1 } } for (v in r) k[tok + r[v]] = tok } else { l = null; for (q = new RegExp("(" + h[tok] + ")", "gm"); l = q.exec(d.val());) k[l[1]] = tok } d = []; for (m in k) d.push(m); return d } var f = { "@": tagmate.USER_TAG_EXPR, "#": tagmate.HASH_TAG_EXPR, $: tagmate.USD_TAG_EXPR, "\u00a3": tagmate.GBP_TAG_EXPR }; b.fn.extend({ getTags: function(d, h) { var j = b(this); d = d || j.data("_tagmate_tagchars"); h = h || j.data("_tagmate_sources"); return g(j, d, h) }, tagmate: function(d) { function h(o, m, q) { for (m = new RegExp("[" + m + "]"); q >= 0 && !m.test(o[q]); q--); return q } function j(o) { var m = o.val(), q = o.getSelection(), v = -1; o = null; for (tok in u.tagchars) { var w = h(m, tok, q.start); if (w > v) { v = w; o = tok } } m = m.substring(v + 1, q.start); if ((new RegExp("^" + u.tagchars[o])).exec(o + m)) return o + m; return null } function k(o, m, q) { var v = o.val(), w = o.getSelection(); w = h(v, m[0], w.start); var B = v.substr(0, w); v = v.substr(w + m.length); o.val(B + m[0] + q + v); v = w + q.length + 1; o.setSelection(v, v); u.replace_tag && u.replace_tag(m, q) } function l(o, m) { m = tagmate.sort_options(m); for (var q = 0; q < m.length; q++) { var v = m[q].label, w = m[q].image; q == 0 && o.html(""); var B = "" + v + ""; if (w) B = "" + v + "" + B; v = u.menu_option_class; if (q == 0) v += " " + u.menu_option_active_class; o.append("
    " + B + "
    ") } } function r(o, m) { var q = m == "down" ? ":first-child": ":last-child", v = m == "down" ? "next": "prev"; m = o.children("." + u.menu_option_active_class); if (m.length == 0) m = o.children(q); else { m.removeClass(u.menu_option_active_class); m = m[v]().length > 0 ? m[v]() : m } m.addClass(u.menu_option_active_class); v = o.children(); var w = Math.floor(b(o).height() / b(v[0]).height()) - 1; if (b(o).height() % b(v[0]).height() > 0) w -= 1; for (q = 0; q < v.length && b(v[q]).html() != b(m).html(); q++); q > w && q - w >= 0 && q - w < v.length && o.scrollTo(v[q - w]) } var u = { tagchars: f, sources: null, capture_tag: null, replace_tag: null, menu: null, menu_class: "tagmate-menu", menu_option_class: "tagmate-menu-option", menu_option_active_class: "tagmate-menu-option-active" }; return this.each(function() { function o() { w.hide(); var D = j(m); if (D) { var I = D[0], p = D.substr(1), n = m.getSelection(), z = h(m.val(), I, n.start); n.start - z <= D.length && function(A) { if (typeof u.sources[I] === "object") A(tagmate.filter_options(u.sources[I], p)); else typeof u.sources[I] === "function" ? u.sources[I]({ term: p }, A) : A() } (function(A) { if (A && A.length > 0) { l(w, A); w.css("top", m.outerHeight() - 1 + "px"); w.show(); for (var E = m.data("_tagmate_sources"), F = 0; F < A.length; F++) { for (var Q = false, H = 0; ! Q && H < E[I].length; H++) Q = E[I][H].value == A[F].value; Q || E[I].push(A[F]) } } D && u.capture_tag && u.capture_tag(D) }) } } d && b.extend(u, d); var m = b(this); m.data("_tagmate_tagchars", u.tagchars); var q = {}; for (var v in u.sources) q[v] = []; m.data("_tagmate_sources", q); var w = u.menu; if (!w) { w = b("
    "); m.after(w) } m.offset(); w.css("position", "absolute"); w.hide(); var B = false; b(m).unbind(".tagmate").bind("focus.tagmate", function() { o() }).bind("blur.tagmate", function() { setTimeout(function() { w.hide() }, 300) }).bind("click.tagmate", function() { o() }).bind("keydown.tagmate", function(D) { if (w.is(":visible")) if (D.keyCode == 40) { r(w, "down"); B = true; return false } else if (D.keyCode == 38) { r(w, "up"); B = true; return false } else if (D.keyCode == 13) { D = w.children("." + u.menu_option_active_class).text(); var I = j(m); if (I && D) { k(m, I, D); w.hide(); B = true; return false } } else if (D.keyCode == 27) { w.hide(); B = true; return false } }).bind("keyup.tagmate", function() { if (B) { B = false; return true } o() }); b("." + u.menu_class + " ." + u.menu_option_class).die("click.tagmate").live("click.tagmate", function() { var D = b(this).text(), I = j(m); k(m, I, D); w.hide(); B = true; return false }) }) } }) })(jQuery); (function(b) { function c(f) { var d; if (f && f.constructor == Array && f.length == 3) return f; if (d = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)) return [parseInt(d[1]), parseInt(d[2]), parseInt(d[3])]; if (d = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)) return [parseFloat(d[1]) * 2.55, parseFloat(d[2]) * 2.55, parseFloat(d[3]) * 2.55]; if (d = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)) return [parseInt(d[1], 16), parseInt(d[2], 16), parseInt(d[3], 16)]; if (d = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)) return [parseInt(d[1] + d[1], 16), parseInt(d[2] + d[2], 16), parseInt(d[3] + d[3], 16)]; return g[b.trim(f).toLowerCase()] } function e(f, d) { var h; do { h = b.curCSS(f, d); if (h != "" && h != "transparent" || b.nodeName(f, "body")) break; d = "backgroundColor" } while ( f = f . parentNode ); return c(h) } b.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "color", "outlineColor"], function(f, d) { b.fx.step[d] = function(h) { if (h.state == 0) { h.start = e(h.elem, d); h.end = c(h.end) } h.elem.style[d] = "rgb(" + [Math.max(Math.min(parseInt(h.pos * (h.end[0] - h.start[0]) + h.start[0]), 255), 0), Math.max(Math.min(parseInt(h.pos * (h.end[1] - h.start[1]) + h.start[1]), 255), 0), Math.max(Math.min(parseInt(h.pos * (h.end[2] - h.start[2]) + h.start[2]), 255), 0)].join(",") + ")" } }); var g = { aqua: [0, 255, 255], azure: [240, 255, 255], beige: [245, 245, 220], black: [0, 0, 0], blue: [0, 0, 255], brown: [165, 42, 42], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgrey: [169, 169, 169], darkgreen: [0, 100, 0], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkviolet: [148, 0, 211], fuchsia: [255, 0, 255], gold: [255, 215, 0], green: [0, 128, 0], indigo: [75, 0, 130], khaki: [240, 230, 140], lightblue: [173, 216, 230], lightcyan: [224, 255, 255], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightyellow: [255, 255, 224], lime: [0, 255, 0], magenta: [255, 0, 255], maroon: [128, 0, 0], navy: [0, 0, 128], olive: [128, 128, 0], orange: [255, 165, 0], pink: [255, 192, 203], purple: [128, 0, 128], violet: [128, 0, 128], red: [255, 0, 0], silver: [192, 192, 192], white: [255, 255, 255], yellow: [255, 255, 0] } })(jQuery); jQuery.cookie = function(b, c, e) { if (arguments.length > 1 && String(c) !== "[object Object]") { e = jQuery.extend({}, e); if (c === null || c === undefined) e.expires = -1; if (typeof e.expires === "number") { var g = e.expires, f = e.expires = new Date; f.setDate(f.getDate() + g) } c = String(c); return document.cookie = [encodeURIComponent(b), "=", e.raw ? c: encodeURIComponent(c), e.expires ? "; expires=" + e.expires.toUTCString() : "", e.path ? "; path=" + e.path: "", e.domain ? "; domain=" + e.domain: "", e.secure ? "; secure": ""].join("") } e = c || {}; f = e.raw ? function(d) { return d }: decodeURIComponent; return (g = (new RegExp("(?:^|; )" + encodeURIComponent(b) + "=([^;]*)")).exec(document.cookie)) ? f(g[1]) : null }; if (!window.JSON) window.JSON = {}; (function() { function b(r) { return r < 10 ? "0" + r: r } function c(r) { d.lastIndex = 0; return d.test(r) ? '"' + r.replace(d, function(u) { var o = k[u]; return typeof o === "string" ? o: "\\u" + ("0000" + u.charCodeAt(0).toString(16)).slice( - 4) }) + '"': '"' + r + '"' } function e(r, u) { var o, m, q = h, v, w = u[r]; if (w && typeof w === "object" && typeof w.toJSON === "function") w = w.toJSON(r); if (typeof l === "function") w = l.call(u, r, w); switch (typeof w) { case "string": return c(w); case "number": return isFinite(w) ? String(w) : "null"; case "boolean": case "null": return String(w); case "object": if (!w) return "null"; h += j; v = []; if (Object.prototype.toString.apply(w) === "[object Array]") { m = w.length; for (r = 0; r < m; r += 1) v[r] = e(r, w) || "null"; u = v.length === 0 ? "[]": h ? "[\n" + h + v.join(",\n" + h) + "\n" + q + "]": "[" + v.join(",") + "]"; h = q; return u } if (l && typeof l === "object") { m = l.length; for (r = 0; r < m; r += 1) { o = l[r]; if (typeof o === "string") if (u = e(o, w)) v.push(c(o) + (h ? ": ": ":") + u) } } else { for (o in w) if (Object.hasOwnProperty.call(w, o)) if (u = e(o, w)) { v.push(c(o) + (h ? ": ": ":") + u); } } u = v.length === 0 ? "{}": h ? "{\n" + h + v.join(",\n" + h) + "\n" + q + "}": "{" + v.join(",") + "}"; h = q; return u } } if (typeof Date.prototype.toJSON !== "function") { Date.prototype.toJSON = function() { return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + b(this.getUTCMonth() + 1) + "-" + b(this.getUTCDate()) + "T" + b(this.getUTCHours()) + ":" + b(this.getUTCMinutes()) + ":" + b(this.getUTCSeconds()) + "Z": null }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() { return this.valueOf() } } var g = window.JSON, f = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, d = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, h, j, k = { "\u0008": "\\b", "\t": "\\t", "\n": "\\n", "\u000c": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, l; if (typeof g.stringify !== "function") g.stringify = function(r, u, o) { var m; j = h = ""; if (typeof o === "number") for (m = 0; m < o; m += 1) j += " "; else if (typeof o === "string") j = o; if ((l = u) && typeof u !== "function" && (typeof u !== "object" || typeof u.length !== "number")) throw new Error("JSON.stringify"); return e("", { "": r }) }; if (typeof g.parse !== "function") g.parse = function(r, u) { function o(m, q) { var v, w, B = m[q]; if (B && typeof B === "object") for (v in B) if (Object.hasOwnProperty.call(B, v)) { w = o(B, v); if (w !== undefined) B[v] = w; else delete B[v] } return u.call(m, q, B) } r = String(r); f.lastIndex = 0; if (f.test(r)) r = r.replace(f, function(m) { return "\\u" + ("0000" + m.charCodeAt(0).toString(16)).slice( - 4) }); if (/^[\],:{}\s]*$/.test(r.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) { r = eval("(" + r + ")"); return typeof u === "function" ? o({ "": r }, "") : r } throw new SyntaxError("JSON.parse"); } })(); (function() { var b = function(o) { var m = [], q = o.length * 8, v; for (v = 0; v < q; v += 8) m[v >> 5] |= (o.charCodeAt(v / 8) & 255) << 24 - v % 32; return m }, c = function(o) { var m = [], q = o.length, v, w; for (v = 0; v < q; v += 2) { w = parseInt(o.substr(v, 2), 16); if (isNaN(w)) return "INVALID HEX STRING"; else m[v >> 3] |= w << 24 - 4 * (v % 8) } return m }, e = function(o) { var m = "", q = o.length * 4, v, w; for (v = 0; v < q; v += 1) { w = o[v >> 2] >> (3 - v % 4) * 8; m += "0123456789abcdef".charAt(w >> 4 & 15) + "0123456789abcdef".charAt(w & 15) } return m }, g = function(o) { var m = "", q = o.length * 4, v, w, B; for (v = 0; v < q; v += 3) { B = (o[v >> 2] >> 8 * (3 - v % 4) & 255) << 16 | (o[v + 1 >> 2] >> 8 * (3 - (v + 1) % 4) & 255) << 8 | o[v + 2 >> 2] >> 8 * (3 - (v + 2) % 4) & 255; for (w = 0; w < 4; w += 1) m += v * 8 + w * 6 <= o.length * 32 ? "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(B >> 6 * (3 - w) & 63) : "" } return m }, f = function(o, m) { return o << m | o >>> 32 - m }, d = function(o, m, q) { return o ^ m ^ q }, h = function(o, m, q) { return o & m ^ ~o & q }, j = function(o, m, q) { return o & m ^ o & q ^ m & q }, k = function(o, m) { var q = (o & 65535) + (m & 65535); return ((o >>> 16) + (m >>> 16) + (q >>> 16) & 65535) << 16 | q & 65535 }, l = function(o, m, q, v, w) { var B = (o & 65535) + (m & 65535) + (q & 65535) + (v & 65535) + (w & 65535); return ((o >>> 16) + (m >>> 16) + (q >>> 16) + (v >>> 16) + (w >>> 16) + (B >>> 16) & 65535) << 16 | B & 65535 }, r = function(o, m) { var q = [], v, w, B, D, I, p, n, z, A = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], E = [1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1518500249, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 1859775393, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 2400959708, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782, 3395469782]; o[m >> 5] |= 128 << 24 - m % 32; o[(m + 65 >> 9 << 4) + 15] = m; z = o.length; for (p = 0; p < z; p += 16) { m = A[0]; v = A[1]; w = A[2]; B = A[3]; D = A[4]; for (n = 0; n < 80; n += 1) { q[n] = n < 16 ? o[n + p] : f(q[n - 3] ^ q[n - 8] ^ q[n - 14] ^ q[n - 16], 1); I = n < 20 ? l(f(m, 5), h(v, w, B), D, E[n], q[n]) : n < 40 ? l(f(m, 5), d(v, w, B), D, E[n], q[n]) : n < 60 ? l(f(m, 5), j(v, w, B), D, E[n], q[n]) : l(f(m, 5), d(v, w, B), D, E[n], q[n]); D = B; B = w; w = f(v, 30); v = m; m = I } A[0] = k(m, A[0]); A[1] = k(v, A[1]); A[2] = k(w, A[2]); A[3] = k(B, A[3]); A[4] = k(D, A[4]) } return A }, u = function(o, m) { this.strToHash = this.strBinLen = this.sha1 = null; if ("HEX" === m) { if (0 !== o.length % 2) return "TEXT MUST BE IN BYTE INCREMENTS"; this.strBinLen = o.length * 4; this.strToHash = c(o) } else if ("ASCII" === m || "undefined" === typeof m) { this.strBinLen = o.length * 8; this.strToHash = b(o) } else return "UNKNOWN TEXT INPUT TYPE" }; u.prototype = { getHash: function(o) { var m = null, q = this.strToHash.slice(); switch (o) { case "HEX": m = e; break; case "B64": m = g; break; default: return "FORMAT NOT RECOGNIZED" } if (null === this.sha1) this.sha1 = r(q, this.strBinLen); return m(this.sha1) }, getHMAC: function(o, m, q) { var v; v = []; var w = []; switch (q) { case "HEX": q = e; break; case "B64": q = g; break; default: return "FORMAT NOT RECOGNIZED" } if ("HEX" === m) { if (0 !== o.length % 2) return "KEY MUST BE IN BYTE INCREMENTS"; m = c(o); o = o.length * 4 } else if ("ASCII" === m) { m = b(o); o = o.length * 8 } else return "UNKNOWN KEY INPUT TYPE"; if (64 < o / 8) { m = r(m, o); m[15] &= 4294967040 } else if (64 > o / 8) m[15] &= 4294967040; for (o = 0; o <= 15; o += 1) { v[o] = m[o] ^ 909522486; w[o] = m[o] ^ 1549556828 } v = r(v.concat(this.strToHash), 512 + this.strBinLen); v = r(w.concat(v), 672); return q(v) } }; window.jsSHA = u })(); var Router = function() { var b; if (!window.history.pushState) return null; b = new Backbone.Router({ routes: { "pin/:pinID/": "zoom", "pin/:pinID/repin/": "repin", ".*": "other" } }); Backbone.history.start({ pushState: true, silent: true }); return b } (); var BoardLayout = function() { return { setup: function(b) { if (!this.setupComplete) { this.setupFlow(); $(function() { if (window.userIsAuthenticated) { Like.gridListeners(); Follow.listeners(); Comment.gridComment(); RepinDialog2.setup() } Zoom.setup() }); this.center = !!b; this.setupComplete = true } }, setupFlow: function(b) { if (!this.flowSetupComplete) { BoardLayout.allPins(); b || $(window).resize(_.throttle(function() { BoardLayout.allPins() }, 200)); this.flowSetupComplete = true } }, pinsContainer: ".BoardLayout", pinArray: [], orderedPins: [], mappedPins: {}, nextPin: function(b) { b = this.orderedPins.indexOf(b) + 1; if (b >= this.orderedPins.length) return 0; return this.orderedPins[b] }, previousPin: function(b) { b = this.orderedPins.indexOf(b) - 1; if (b >= this.orderedPins.length) return 0; return this.orderedPins[b] }, columnCount: 4, columns: 0, columnWidthInner: 192, columnMargin: 15, columnPadding: 30, columnContainerWidth: 0, allPins: function() { var b = $(this.pinsContainer + " .pin"), c = this.getContentArea(); this.columnWidthOuter = this.columnWidthInner + this.columnMargin + this.columnPadding; this.columns = Math.max(this.columnCount, parseInt(c / this.columnWidthOuter, 10)); if (b.length < this.columns) this.columns = Math.max(this.columnCount, b.length); c = this.columnWidthOuter * this.columns - this.columnMargin; var e = document.getElementById("wrapper"); if (e) e.style.width = c + "px"; $(".LiquidContainer").css("width", c + "px"); for (c = 0; c < this.columns; c++) this.pinArray[c] = 0; document.getElementById("SortableButtons") ? this.showPins() : this.flowPins(b, true); if ($("#ColumnContainer .pin").length === 0 && window.location.pathname === "/") { $("#ColumnContainer").addClass("empty"); setTimeout(function() { window.location.reload() }, 5E3) } }, newPins: function() { var b = window.jQuery ? ":last": ":last-of-type", c = $(this.pinsContainer + b + " .pin"); c = c.length > 0 ? c: $(this.pinsContainer + b + " .pin"); this.flowPins(c) }, flowPins: function(b, c) { if (c) { this.mappedPins = {}; this.orderedPins = [] } if (this.pinArray.length > this.columns) this.pinArray = this.pinArray.slice(0, this.columns); for (c = 0; c < b.length; c++) this.positionPin(b[c]); this.updateContainerHeight(); this.showPins(); window.useLazyLoad && LazyLoad.invalidate() }, positionPin: function(b) { var c = $(b).attr("data-id"); if (c && this.mappedPins[c]) $(b).remove(); else { var e = _.indexOf(this.pinArray, Math.min.apply(Math, this.pinArray)), g = this.shortestColumnTop = this.pinArray[e]; b.style.top = g + "px"; b.style.left = e * this.columnWidthOuter + "px"; b.setAttribute("data-col", e); this.pinArray[e] = g + b.offsetHeight + this.columnMargin; this.mappedPins[c] = this.orderedPins.length; this.orderedPins.push(c) } }, showPins: function() { $.browser.msie && parseInt($.browser.version, 10) == 7 || $(this.pinsContainer).css("opacity", 1); var b = $(this.pinsContainer); setTimeout(function() { b.css({ visibility: "visible" }) }, 200) }, imageLoaded: function() { $(this).removeClass("lazy") }, getContentArea: function() { return this.contentArea || document.documentElement.clientWidth }, updateContainerHeight: function() { $("#ColumnContainer").height(Math.max.apply(Math, this.pinArray)) } } } (); var LazyLoad = new(function() { var b = this, c = 0, e = 0, g = 100, f = $(window); b.images = {}; b.invalidate = function() { $("img.lazy").each(function(u, o) { u = $(o); b.images[u.attr("data-id")] = u; h(u) && j(u) }) }; b.check = function() { var u, o = false; return function() { if (!o) { o = true; clearTimeout(u); u = setTimeout(function() { o = false; d() }, 200) } } } (); var d = function() { var u = 0, o = 0; for (var m in b.images) { var q = b.images[m]; u++; if (h(q)) { j(q); o++ } } }; b.stop = function() { f.unbind("scroll", k); f.unbind("resize", l) }; var h = function(u) { return u.offset().top <= g }, j = function(u) { if (u.hasClass("lazy")) { var o = u.attr("data-src"), m = u.attr("data-id"); u.load(function() { if (u[0]) u[0].style.opacity = "1"; delete b.images[m] }); u.attr("src", o); u.removeClass("lazy"); if (u[0]) u[0].style.opacity = "0" } }, k = function() { c = $(window).scrollTop(); r(); b.check() }, l = function() { e = $(window).height(); r(); b.check() }, r = function() { g = c + e + 600 }; if (window.useLazyLoad) { f.ready(function() { k(); l() }); f.scroll(k); f.resize(l) } }); var FancySelect = function() { var b; return { setup: function(c, e, g) { function f() { b.hide(); j.hide() } function d() { j.show(); b.show() } var h = $('
      '), j = $(".FancySelectList", h), k = $("ul", j), l = $(".CurrentSelection", h), r = "", u, o; b || (b = $('
      ').appendTo("body")); c = $(c); u = c.prop("selectedIndex"); e = e || function() { return '
    • ' + $(this).text() + "
    • " }; o = $("option", c); o.each(function(m) { r += e.call(this, m, m === u) }); k.html(r); l.text(o.eq(u).text()); c.before(h); c.hide(); h.click(function() { d() }); b.click(function() { f() }); k.on("click", "li", function() { var m = $(this).prevAll().length; l.text($(this).text()); c.prop("selectedIndex", m); f(); g && g($(this).attr("data")); return false }) } } } (); var boardPicker = function() { return { setup: function(b, c, e) { b = $(b); var g = $(".boardListOverlay", b.parent()), f = $(".boardList", b), d = $(".currentBoard", b), h = $("ul", f); b.click(function() { f.show(); g.show() }); g.click(function() { f.hide(); g.hide() }); $(h).on("click", "li", function() { if (!$(this).hasClass("noSelect")) { d.text($(this).text()); g.hide(); f.hide(); c && c($(this).attr("data")) } return false }); b = $(".createBoard", f); var j = $("input", b), k = $(".Button", b), l = $(".CreateBoardStatus", b); j.defaultValue("Create New Board"); k.click(function() { if (k.attr("disabled") == "disabled") return false; if (j.val() == "Create New Board") { l.html("Enter a board name").css("color", "red").show(); return false } l.html("").hide(); k.addClass("disabled").attr("disabled", "disabled"); $.post("/board/create/", { name: j.val(), pass_category: true }, function(r) { if (r && r.status == "success") { h.append("
    • " + $("
      ").text(r.name).html() + "
    • "); f.hide(); d.text(r.name); j.val("").blur(); k.removeClass("disabled").removeAttr("disabled"); e && e(r.id) } else { l.html(r.message).css("color", "red").show(); k.removeClass("disabled").removeAttr("disabled") } }, "json"); return false }) } } } (); var CropImage = function() { this.initialize.apply(this, arguments) }; (function() { var b = Backbone.View.extend({ el: "#CropImage", events: { "click .cancel": "onClose", "click .save": "onSave", "mousedown .drag": "onStartDrag" }, dragging: false, mousePosition: {}, initialize: function() { _.bindAll(this, "onDragging", "onStopDragging", "onImageLoaded"); _.defaults(this.options, { title: "Crop Image", buttonTitle: "Save", size: { width: 222, height: 150 } }); this.$holder = this.$el.find(".holder"); this.$bg = this.$el.find(".holder .bg"); this.$overlay = this.$el.find(".holder .overlayContent"); this.$frame = this.$el.find(".holder .frame"); this.$mask = this.$el.find(".holder .mask"); this.$footer = this.$el.find(".footer"); this.$button = this.$el.find(".footer .Button.save"); this.$spinner = this.$el.find(".holder .spinner") }, render: function() { this.$el.find(".header span").text(this.options.title); this.$button.text(this.options.buttonTitle).removeClass("disabled"); this.$holder.show().css("height", this.options.size.height + 120 + 40); this.$footer.find(".buttons").css("visibility", "visible"); this.$footer.find(".complete").hide(); this.$bg.html("").show(); this.$spinner.hide(); this.options.className && this.$el.addClass(this.options.className); this.options.overlay && this.$overlay.html("").append(this.options.overlay); var c = this.bounds = { left: this.$holder.width() / 2 - this.options.size.width / 2, width: this.options.size.width, top: 60, height: this.options.size.height }; c.ratio = c.height / c.width; this.$frame.css(c); this.$mask.find("span").each(function(e, g) { e === 0 && $(g).css({ top: 0, left: 0, right: 0, height: c.top }); e === 1 && $(g).css({ top: c.top, left: c.left + c.width, right: 0, height: c.height }); e === 2 && $(g).css({ top: c.top + c.height, left: 0, right: 0, bottom: 0 }); e === 3 && $(g).css({ top: c.top, left: 0, width: c.left, height: c.height }) }); this.options.image && this.setImage(this.options.image) }, onClose: function() { this.trigger("close"); return false }, onSave: function() { this.trigger("save"); return false }, onImageLoaded: function(c) { if (this.$img.height() === 0) return setTimeout(this.onImageLoaded, 200, c); this.$img.removeAttr("width").removeAttr("height"); c = this.imageBounds = { originalWidth: this.$img.width(), originalHeight: this.$img.height() }; c.ratio = c.originalHeight / c.originalWidth; this.$img.css({ visibility: "visible", opacity: 1 }); this.fitImage(); this.centerImage(); this.hideSpinner() }, onStartDrag: function(c) { this.mousePosition = { x: c.pageX, y: c.pageY }; this.startPosition = { x: parseInt(this.$bg.css("left"), 10), y: parseInt(this.$bg.css("top"), 10) }; this.trigger("startDrag"); this.dragging = true; $("body").on({ mousemove: this.onDragging, mouseup: this.onStopDragging }); c.preventDefault() }, onDragging: function(c) { var e = { top: this.startPosition.y + (c.pageY - this.mousePosition.y), left: this.startPosition.x + (c.pageX - this.mousePosition.x) }; if (this.enforceBounds(e)) { this.$bg.css(e); c.preventDefault() } }, onStopDragging: function() { this.trigger("stopDrag"); this.dragging = false; $("body").off({ mousemove: this.onDragging, mouseup: this.onStopDragging }) }, enforceBounds: function(c) { c.top = Math.min(c.top, this.bounds.top); c.left = Math.min(c.left, this.bounds.left); if (c.left + this.imageBounds.width < this.bounds.left + this.bounds.width) c.left = this.bounds.left + this.bounds.width - this.imageBounds.width + 1; if (c.top + this.imageBounds.height < this.bounds.top + this.bounds.height) c.top = this.bounds.top + this.bounds.height - this.imageBounds.height + 1; return c }, showComplete: function() { this.$footer.find(".buttons").css("visibility", "hidden"); this.$footer.find(".complete").fadeIn(300); this.hideSpinner() }, setImage: function(c) { this.showSpinner(); var e = this.$img = $(""); e.load(this.onImageLoaded).css({ opacity: "0.01", visibility: "hidden" }); e.attr("src", c); this.$bg.html(e) }, fitImage: function() { var c = 1; c = this.imageBounds.ratio >= this.bounds.ratio ? this.bounds.width / this.imageBounds.originalWidth: this.bounds.height / this.imageBounds.originalHeight; this.scaleImage(c, 10) }, centerImage: function() { var c = this.$holder.height() - 40, e = this.$holder.width(); this.$bg.css({ top: c / 2 - this.$bg.height() / 2 + 1, left: e / 2 - this.$bg.width() / 2 + 1 }) }, scaleImage: function(c, e) { var g = this.imageBounds.width = this.imageBounds.originalWidth * c + e || 0; c = this.imageBounds.height = this.imageBounds.originalHeight * c + e || 0; this.$img.attr("width", g); this.$img.attr("height", c) }, getOffset: function() { return { x: Math.abs(parseInt(this.$bg.css("left"), 10) - this.bounds.left), y: Math.abs(parseInt(this.$bg.css("top"), 10) - this.bounds.top) } }, getScale: function() { return this.$img.width() / this.imageBounds.originalWidth }, saving: function() { this.showSpinner(); this.$button.addClass("disabled") }, showSpinner: function() { this.$spinner.show() }, hideSpinner: function() { this.$spinner.hide() } }); CropImage.prototype = { initialize: function() { _.bindAll(this, "save", "close") }, show: function(c) { var e = this; c = this.view = new b(c); this.options = this.view.options; c.on("save", this.save); c.on("close", this.close); c.on("stopDrag", function() { e.trigger("dragComplete") }); Modal.show("CropImage"); c.render() }, setImage: function(c) { this.view.setImage(c) }, setParams: function(c) { this.options.params = c }, save: function() { var c = this, e = this.view.getOffset(), g = this.view.getScale(); e = _.extend({ x: e.x, y: e.y, width: this.options.size.width, height: this.options.size.height, scale: g }, this.options.params || {}); this.view.saving(); this.trigger("saving", e); $.ajax({ url: this.options.url, data: e, dataType: "json", type: "POST", success: function(f) { c.view.hideSpinner(); c.trigger("save", f); c.options.delay !== 0 && c.view.showComplete(); setTimeout(c.close, c.options.delay || 1200) } }) }, close: function() { Modal.close("CropImage"); this.view.undelegateEvents(); this.trigger("close"); delete this.view; delete this.options } }; _.extend(CropImage.prototype, Backbone.Events) })(); var BoardCoverSelector = function() { this.initialize.apply(this, arguments) }; (function() { var b = null; BoardCoverSelector.prototype = { pins: null, index: null, boardURL: null, initialize: function() { if (b) { b.cancel(); b = null } _.bindAll(this, "onKeyup", "onPinsLoaded", "onSave", "onSaving", "removeListeners", "next", "previous"); b = this; this.options = {}; this.imageCrop = new CropImage; this.imageCrop.on("close", this.removeListeners); this.imageCrop.on("save", this.onSave); this.imageCrop.on("saving", this.onSaving); this.imageCrop.on("dragComplete", function() { trackGAEvent("board_cover", "dragged") }); this.$img = $("") }, loadPins: function() { $.ajax({ url: this.options.boardURL + "pins/", dataType: "json", success: this.onPinsLoaded }); this.boardURL = this.options.boardURL }, show: function(c) { this.options = c; this.imageCrop.show({ className: "BoardCover", overlay: this.overlayContent(), params: { pin: c.pin }, image: this.options.image, size: { width: 222, height: 150 }, title: c.title || "Select a cover photo and drag to position it.", buttonTitle: c.buttonTitle || "Set Cover", url: this.options.boardURL + "cover/", delay: c.delay }); if (!this.pins || this.boardURL != this.options.boardURL) this.loadPins(); else this.options.image || this.setIndex(0); trackGAEvent("board_cover", "show"); $("body").keyup(this.onKeyup) }, onPinsLoaded: function(c) { var e = null; if (this.options.image) { var g = this.options.image; _.each(c.pins, function(f, d) { if (e == null && g.match(new RegExp(f.image_key, "gi"))) e = d }) } this.index = e || 0; this.pins = c.pins; if (this.pins.length !== 0) { this.pins.length === 1 ? this.hideArrows() : this.preload([e - 1, e + 1]); e === null && this.setIndex(0) } }, onKeyup: function(c) { if (this.index !== null) { c.keyCode === 37 && this.previous(); c.keyCode === 39 && this.next(); c.keyCode === 27 && this.imageCrop.close(); c.keyCode === 13 && this.imageCrop.save() } }, overlayContent: function() { var c = this.$holder = $("
      "), e = $('').click(this.previous), g = $('').click(this.next); c.append("

      " + this.options.boardName + "

      "); c.append(e, g); return c }, next: function() { this.index === this.pins.length - 1 ? this.setIndex(0) : this.setIndex(this.index + 1); trackGAEvent("board_cover", "toggle_pin"); return false }, previous: function() { this.index === 0 ? this.setIndex(this.pins.length - 1) : this.setIndex(this.index - 1); trackGAEvent("board_cover", "toggle_pin"); return false }, setIndex: function(c) { var e = this.pins[c]; if (e) { this.imageCrop.setImage(e.url); this.imageCrop.setParams({ pin: e.id }); this.index = c; this.preload([this.index - 2, this.index - 1, this.index + 1, this.index + 2]) } }, preload: function(c) { var e = this; _.each(c, function(g) { if (g = e.pins[g])(new Image).src = g.url }) }, hideArrows: function() { this.$holder.find(".arrow").hide() }, removeListeners: function() { $("body").unbind("keyup", this.onKeyup) }, onSaving: function() { this.hideArrows() }, onSave: function(c) { this.options.success && this.options.success(c); trackGAEvent("board_cover", "saved") } }; _.extend(BoardCoverSelector.prototype, Backbone.Events) })(); var AddDialog = function() { return { setup: function(b) { var c = "#" + b, e = $(c), g = $(".Buttons .RedButton", e), f = $(".mainerror", e), d = $(".DescriptionTextarea", e); BoardPicker.setup(c + " .BoardPicker", function(h) { $(c + " #id_board").val(h) }, function(h) { $(c + " #id_board").val(h) }); AddDialog.shareCheckboxes(b); Tagging.initTextarea(c + " .DescriptionTextarea"); Tagging.priceTag(c + " .DescriptionTextarea", c + " .ImagePicker"); CharacterCount.setup(c + " .DescriptionTextarea", c + " .CharacterCount", c + " .Button"); g.click(function() { if (g.hasClass("disabled")) return false; trackGAEvent("pin", "clicked", "add_dialogue"); if (d.val() === "" || d.val() === "Describe your pin...") { f.html("Please describe your pin").slideDown(300); return false } else f.slideUp(300, function() { f.html("") }); g.addClass("disabled").html("Pinning..."); $("#id_details", e).val(d.val()); Tagging.loadTags(c + " .DescriptionTextarea", c + " #peeps_holder", c + " #id_tags", c + " #currency_holder"); $("form", e).ajaxSubmit({ url: "/pin/create/", type: "POST", dataType: "json", iframe: true, success: function(h) { if (h.status == "success") { trackGAEvent("pin", "success", "add_dialogue"); window.location = h.url } else if (h.captcha) { RecaptchaDialog.challenge(); AddDialog.reset(b) } else f.html(h.message).slideDown(300) } }); return false }) }, reset: function(b) { b === "CreateBoard" && CreateBoardDialog.reset(); b === "ScrapePin" && ScrapePinDialog.reset(); b === "UploadPin" && UploadPinDialog.reset(); AddDialog._resets[b] && AddDialog._resets[b]() }, close: function(b, c) { $("#" + b).addClass("super"); Modal.show(c) }, childClose: function(b, c) { var e = this, g = $("#" + c); $(".ModalContainer", g); e.reset(c); $("#" + b).removeClass("super"); Modal.close(b); Modal.close(c) }, pinBottom: function(b) { var c = $("#" + b); $(".PinBottom", c).slideDown(300, function() { var e = $(".modal:first", c);" class="topic-tag topic-tag-link"> joenali/waterfall