diff --git a/MacInstallation.md b/MacInstallation.md index 1333ed77..a6e47436 100644 --- a/MacInstallation.md +++ b/MacInstallation.md @@ -1 +1,40 @@ -TODO +install homebrew + + \curl -sSL https://get.rvm.io | bash -s stable --rails + + rvm install 1.9.3 --with-gcc=clang + + rvm use 1.9.3 + + gem install lunchy + +(http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/) + + + brew install postgresql + ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents + createuser metamaps -P -s -d + +set a password + + lunchy start postgres + + +cd into the metamaps directory + + bundle install + + +copy the database.yml.default file and rename it database.yml +make sure the username and password match the POSTGRES username and password you set + + +http://nodejs.org/ hit install, download, open, install + + + rake db:create + rake db:schema:load + rake db:fixtures:load + rails s + +( to start the server) diff --git a/app/assets/images/mCSB_buttons.png b/app/assets/images/mCSB_buttons.png deleted file mode 100644 index 44388680..00000000 Binary files a/app/assets/images/mCSB_buttons.png and /dev/null differ diff --git a/app/assets/javascripts/lib/cloudcarousel.js b/app/assets/javascripts/lib/cloudcarousel.js index 8cfe5ae0..31a9aa7a 100644 --- a/app/assets/javascripts/lib/cloudcarousel.js +++ b/app/assets/javascripts/lib/cloudcarousel.js @@ -177,10 +177,20 @@ jQuery.browser = browser; // You will need this plugin for the mousewheel to work: http://plugins.jquery.com/project/mousewheel if (options.mouseWheel) { + // START METAMAPS CODE + $('body').bind('mousewheel',this,function(event, delta) { + if (Metamaps.Create.newTopic.beingCreated && !Metamaps.Create.isSwitchingSet) { + event.data.rotate(delta); + return false; + } + }); + // END METAMAPS CODE + /* ORIGINAL CODE $(container).bind('mousewheel',this,function(event, delta) { event.data.rotate(delta); return false; }); + */ } $(container).bind('mouseover click',this,function(event){ diff --git a/app/assets/javascripts/lib/embedly.js b/app/assets/javascripts/lib/embedly.js new file mode 100644 index 00000000..65b52d0f --- /dev/null +++ b/app/assets/javascripts/lib/embedly.js @@ -0,0 +1,2 @@ +!function(){var a=function b(c,d,e){function f(h,i){if(!d[h]){if(!c[h]){var j="function"==typeof a&&a;if(!i&&j)return j(h,!0);if(g)return g(h,!0);throw new Error("Cannot find module '"+h+"'")}var k=d[h]={exports:{}};c[h][0].call(k.exports,function(a){var b=c[h][1][a];return f(b?b:a)},k,k.exports,b,c,d,e)}return d[h].exports}for(var g="function"==typeof a&&a,h=0;ha};0>k&&(l=function(b){return a>b});var m=function(){clearInterval(c),g.console.log("duration",(new Date).getTime()-i),d.detachEvent("scroll",e)};c=setInterval(function(){return f+=k,l(f)?(m(),!1):(window.scrollTo(0,f),void(j=!0))},10),e=function(){j&&f!==g.window.scrollY()&&m()},d.addEvent("scroll",e)},b.exports=g},{"./dom.js":5,"./urlparse.js":14,"./utils.js":15,conf:"AqyHQT"}],3:[function(a,b){var c=!1,d=/xyz/.test(function(){})?/\b_super\b/:/.*/,e=function(){};e.extend=function(a){function b(){!c&&this.init&&this.init.apply(this,arguments)}var e=this.prototype;c=!0;var f=new this;c=!1;for(var g in a)f[g]="function"==typeof a[g]&&"function"==typeof e[g]&&d.test(a[g])?function(a,b){return function(){var c=this._super;this._super=e[a];var d=b.apply(this,arguments);return this._super=c,d}}(g,a[g]):a[g];return b.prototype=f,b.prototype.constructor=b,b.extend=arguments.callee,b},b.exports=e},{}],4:[function(a,b){var c=a("./iframe.js"),d=a("./utils.js"),e={started:!1,instance:null};e.EVENTS=["xcomm.stats.access","xcomm.stats.card.realtime","xcomm.stats.card.week","xcomm.stats.media.realtime","xcomm.stats.media.week","xcomm.stats.media.recommend","xcomm.user.set","xcomm.user.get","xcomm.user.remove","xcomm.page.progress"],e.clear=function(){e.instance&&(e.instance.remove(),e.instance=null),e.started=!1},e.connect=function(a){if(!a||e.started)return!1;e.started=!0;var b=c.createComm(a);return d.each(e.EVENTS,function(c){b.on(c,function(b){a.notify(c+".response",b)}),a.on(c,function(a){b.send(c,a)})}),b.on("xcomm.ready",function(b){a.notify("xcomm.ready",b)}),e.instance=b,b},b.exports=e},{"./iframe.js":6,"./utils.js":15}],5:[function(a,b){var c=a("./utils.js"),d={};d.toArray=function(a){return c.map(a,function(a){return a})},d.all=function(a){var b=[];return document.querySelectorAll?d.toArray(document.querySelectorAll(a)):b},d.one=function(a,b){var c=d.all(a,b);return 0===c.length?null:c[0]},d.create=function(a,b,e,f){if(!a||!c.isString(a))return null;c.isString(b)&&c.isNone(e)&&(e=b,b={});var g;return g=f?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a),c.each(b,function(a,b){g.setAttribute(b,a)}),e&&d.text(g,e),g},d.set=function(a,b,e){if(!a||!c.isString(a))return null;c.isString(b)&&c.isNone(e)&&(e=b,b={});var f=d.one(a);return f?(c.each(b,function(a,b){f.setAttribute(b,a)}),c.isNone(e)||d.text(f,e),f):null},d.replace=function(a,b){c.assert(c.isElement(a),"replace requires an element to be replaced"),c.assert(c.isElement(b),"replace requires an element to replace with."),a.parentNode.replaceChild(b,a)},d.remove=function(a){return c.isElement(a)&&c.isElement(a.parentNode)?void a.parentNode.removeChild(a):!1},d.hide=function(a){return c.isString(a)&&(a=d.one(a)),c.isElement(a)&&(a.style.display="none"),a},d.show=function(a,b){return c.isString(a)&&(a=d.one(a)),c.isElement(a)&&(a.style.display=b?"inline-block":"block"),a},d.svg=function(a,b,c){return d.create(a,b,c,"http://www.w3.org/2000/svg")},d.children=function(a,b){return c.isElement(a)?c.reduce(a.childNodes,function(a,d){if(c.isElement(d)){if(!c.isNone(b))if(d.namespaceURI&&"http://www.w3.org/2000/svg"===d.namespaceURI){if(d.nodeName!==b)return a}else if(b.toUpperCase()!==d.nodeName)return a;a.push(d)}return a},[]):[]},d.child=function(a,b){var c=d.children(a,b);return 0!==c.length?c[0]:null},d.text=function(a,b){if(!a||!c.isElement(a))return null;if(c.isNone(b))return a.innerText||a.textContent;var d=void 0===a.textContent?"innerText":"textContent";a[d]=b},d.hasClass=function(a,b){if(c.isString(a)&&(a=d.one(a)),!c.isElement(a)||!c.isString(b)||!b)return!1;var e=a.getAttribute("class");return c.isNone(e)?!1:(" "+e+" ").indexOf(" "+b+" ")>-1?!0:!1},d.addClass=function(a,b){if(c.isString(a)&&(a=d.one(a)),!c.isElement(a)||!c.isString(b)||!b)return!1;if(d.hasClass(a,b))return!1;var e=a.getAttribute("class");if(c.isNone(e))return a.setAttribute("class",b),!0;var f=e.split(" "),g=[];return c.map(f,function(a){var b=c.trim(a);""!==b&&g.push(b)}),g.push(b),a.setAttribute("class",g.join(" ")),!0},d.removeClass=function(a,b){if(c.isString(a)&&(a=d.one(a)),!c.isElement(a)||!c.isString(b)||!b)return!1;var e=a.getAttribute("class");if(c.isNone(e))return!1;var f=!1,g=c.reduce(e.split(" "),function(a,d){var e=c.trim(d);return e?e===b?(f=!0,a):(a.push(e),a):a},[]);return a.setAttribute("class",g.join(" ")),f},d.data=function(a,b,d){c.assert(a&&c.isElement(a),"dom.data needs an element."),c.assert(b&&c.isString(b),"dom.data needs an attr.");var e=c.camelCase(b);return c.isNone(d)?c.isNone(a.dataset)?a.getAttribute("data-"+b):c.isNone(a.dataset[e])?null:a.dataset[e]:void(c.isNone(a.dataset)?a.setAttribute("data-"+b,d):a.dataset[e]=d)},d.attrize=function(a){return a&&c.isObject(a)?c.map(a,function(a,b){return b+'="'+a+'"'}).sort().join(" "):""},d.event=function(a){var b=c.extend({},a||window.event);return b.target||(b.target=b.srcElement||document),3===b.target.nodeType&&(b.target=b.target.parentNode),!a.metaKey&&a.ctrlKey&&(b.metaKey=b.ctrlKey),b.stop=function(){a.preventDefault?a.preventDefault():a.returnValue=!1},b.pageX||b.pageY||!b.clientX&&!b.clientY||(b.pageX=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,b.pageY=b.clientY+document.body.scrollTop+document.documentElement.scrollTop),b},d.addEvent=function(a,b,d){c.isNone(a)||(a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent?a.attachEvent("on"+b,d):a["on"+b]=d)},d.detachEvent=function(a,b,d){c.isNone(a)||(a.removeEventListener?a.removeEventListener(b,d,!1):a.detachEvent?a.detachEvent("on"+b,d):a["on"+b]=null)},d.trigger=function(a,b){c.assert(c.contains(["click"],b),"Not a valid event");var d;a.dispatchEvent?(d=document.createEvent("MouseEvents"),d.initEvent(b,!0,!0),a.dispatchEvent(d,!0)):(d=document.createEventObject(),a.fireEvent("on"+b,d))},d.rect=function(a){try{return a.getBoundingClientRect()}catch(b){}return!1},b.exports=d},{"./utils.js":15}],6:[function(a,b){var c=a("./utils.js"),d=a("./dom.js"),e=a("./urlparse.js"),f=a("./browser.js"),g=a("./class.js"),h=a("./json.js"),i=a("./a.js"),j=a("conf"),k={};k.connect=function(a,b){if(!a||!c.isElement(a.elem))return!1;var d=new i,g=[],j=a.elem.src,k=!1,l=e.getOrigin(j);a.on=function(a,b,c){d.on(a,b,c)},a.one=function(a,b,c){d.one(a,b,c)},a.off=function(a,b){d.off(a,b)},a.send=function(b,d){if(c.isNone(d)&&(d={}),c.isString(d)&&(d={msg:d}),d.method=b,k===!1)return f.console.log("Iframe.queue",d),g.push(d),!1;a.sid&&(d.sid=a.sid),f.console.log("iframe.send",d);var e=h.stringify(d);a.elem.contentWindow&&a.elem.contentWindow.postMessage&&a.elem.contentWindow.postMessage(e,l)},a.ready=function(){k||(f.console.log("iframe.ready",a.name),k=!0,c.each(g,function(b){a.send(b.method,b)}))};var m=function(b,c){if(b.origin===l){if(f.console.log("iframe.message",c),!c.src&&!c.sid&&!c.listener)return!1;if(a.sid&&c.sid!==a.sid)return!1;if(c.src&&c.src!==j)return!1;if(c.listener&&c.listener!==j)return!1;"resize"===c.method&&a.resize&&a.resize(c),!c.method&&c.event&&c.listener?d.notify(c.event,c):c.method&&d.notify(c.method,c)}};return b.on("window.message",m),a._remove=function(){b.off("window.message",m)},a},k.rendering=function(a){return"1"===d.data(a,"rendering")?!0:(d.data(a,"rendering","1"),!1)};var l=g.extend({secure:null,rendered:!1,init:function(a,b){this.sid=c.getUUID(),this.query=a,this.create(b)},getSrc:function(){var a="";return a=this.secure===!0||j.EMB_HTTPS?j.EMB_SECURE_FRAME_SRC:/https?:\/\/sulia\.com\/embed/.test(this.query.url)?"http://embed.sulia.com/widgets/":j.EMB_FRAME_SRC,a+=this.name+".html?"+e.createQuery(this.query)+"#sid="+this.sid},create:function(a){var b=c.extend({},this.attrs);return this.src=this.getSrc(),b.src=this.src,b.id="emb_"+(this.query&&this.query.url?c.hash(this.query.url):this.sid),b["class"]="embedly-"+this.name,this.elem=d.create("iframe",b),c.each(this.style,function(a,b){this.elem.style[b]=a},this),k.connect(this,a),this.after(),this.elem},after:function(){},replace:function(a){d.replace(a,this.elem)},append:function(a){a.appendChild(this.elem)},resize:function(a){a.width&&this.elem.setAttribute("width",a.width),a.height&&this.elem.setAttribute("height",a.height)},remove:function(){d.remove(this.elem),this._remove&&this._remove()}}),m=l.extend({name:"card",attrs:{frameborder:"0",scrolling:"no",allowtransparency:"true",allowfullscreen:"true"},style:{width:"1px",height:"0px",border:"none",position:"absolute",visibility:"hidden"}});k.createCard=function(a,b,f){if(!j.EMB_POST_MESSAGE)return null;if(!c.isElement(a)||!c.isElement(a.parentNode))return null;if(k.rendering(a))return null;var g={};if(b&&c.isFunction(b.off)&&(f=b,b=null),!c.isNone(b)&&b.url)g=b;else if(c.each(["type","via","chrome","theme","image","description","embed","controls","analytics"],function(b){var e=d.data(a,"card-"+b);c.isNone(e)||(g[b]=e)}),"BLOCKQUOTE"===a.nodeName){var h,i=d.child(a,"h4"),l=d.child(a,"p");if(c.isNone(i)){if(!l)return!1;var n=a.getElementsByTagName("a");if(0===n.length)return!1;h=n[n.length-1],g.url=h.getAttribute("href")}else h=d.child(i,"a"),g.url=h.getAttribute("href"),g.title=d.text(h),g.description=c.isNone(l)?"0":d.text(l)}else"A"===a.nodeName&&(g.url=a.getAttribute("href"));var o,p,q;if(c.each(document.getElementsByTagName("meta"),function(a){q=[a.getAttribute("name"),a.getAttribute("property")],c.contains(q,"twitter:site")?p=a.getAttribute("content"):c.contains(q,"twitter:creator")&&(o=a.getAttribute("content"))}),o?g.twitter_via=o:p&&(g.twitter_via=p),!g.url)return null;var r=e.parse(g.url);if(!r.valid())return null;g.url=r.url;var s={url:g.url};c.isNone(g.type)||(s.type=g.type);var t=new m(s,f);t.send("card.content",g);var u=a.parentNode;return u&&u.offsetWidth&&(t.elem.style.width=u.offsetWidth>600?"600px":u.offsetWidth+"px"),u.insertBefore(t.elem,a),t.on("card.repeat",function(a){var b={url:a.url,via:document.location.toString()};a.embed&&(b.embed=a.embed),k.createCardModal(b,f)}),t.on("modal.stats",function(a){k.createStatsModal(a,f)}),t.on("card.ready",function(){t.ready()}),t.on("card.rendered",function(e){return"error"===e.name?(t.remove(),!1):b&&c.isArray(b.types)&&b.types.length>0&&!c.contains(b.types,e.type)?(t.remove(),!1):(t.rendered=!0,t.elem.style.display="block",t.elem.style.margin="10px auto",t.elem.style.visibility="visible",t.elem.style.position="relative",t.elem.width="600",t.elem.height=e.height?e.height:"300",t.elem.style.width=null,t.elem.style.height=null,t.elem.style.maxWidth="99%",t.elem.style.minWidth="200px",void d.remove(a))}),t};var n=l.extend({name:"button",attrs:{frameborder:"0",scrolling:"no",allowtransparency:"true",height:"20",width:"80"},style:{border:"none"}});k.createButton=function(a,b){if(!c.isElement(a))return null;if(k.rendering(a))return null;var e=d.data(a,"url");c.isNone(e)&&(e=document.location.toString());var g,h={url:e};c.each(["theme","target","lang"],function(b){g=d.data(a,b),c.isNone(g)||(h[b]=g)});var i=f.window.center(635,500);h.left=i.left,h.top=i.top;var j=new n({url:e},b);return j.replace(a),j.on("button.click",c.bind(function(){f.window.innerWidth()<=768||f.mobile()?window.location="http://embed.ly/code?url="+encodeURIComponent(h.url):k.createCardModal(this,b)},h)),j.send("button.data",h),j.on("button.ready",function(){j.ready()}),j};var o=l.extend({name:"modal",attrs:{frameborder:"0",allowtransparency:"true"},style:{border:"none",position:"fixed",top:"0",left:"0",zIndex:"2147483647"},after:function(){this.elem.style.width=f.window.innerWidth()+"px",this.elem.style.height=f.window.innerHeight()+"px"}});k.createCardModal=function(a,b){if(c.isNone(a)&&(a={url:document.location.toString()}),c.isNone(a.url)&&(a.url=document.location.toString()),"window"===a.target)return f.open("http://cdn.embedly.com/widgets/embed?url="+encodeURIComponent(a.url),"Embed Code",635,500),!1;a.t="card";var e=new o(a,b);return e.append(document.body),d.addEvent(window,"resize",function(){e.elem.style.width=f.window.innerWidth()+"px",e.elem.style.height=f.window.innerHeight()+"px"}),e.on("modal.close",function(){document.body.removeChild(e.elem)}),e.on("modal.ready",function(){e.ready()}),e},k.createStatsModal=function(a,b){a.t="stats";var c=new o(a,b);c.append(document.body),c.on("modal.close",function(){document.body.removeChild(c.elem)}),c.on("modal.ready",function(){c.ready()}),d.addEvent(window,"resize",function(){c.elem.style.width=f.window.innerWidth()+"px",c.elem.style.height=f.window.innerHeight()+"px"})};var p=l.extend({name:"xcomm",attrs:{frameborder:"0",allowtransparency:"true"},style:{border:"none",position:"absolute",top:"-9999em",width:"10px",height:"10px"},secure:!0});k.createComm=function(a){var b=new p({},a);return b.append(document.body),b.on("xcomm.ready",function(){b.ready()}),b},b.exports=k},{"./a.js":1,"./browser.js":2,"./class.js":3,"./dom.js":5,"./json.js":7,"./urlparse.js":14,"./utils.js":15,conf:"AqyHQT"}],7:[function(a,b){var c=a("./browser.js");b.exports=function(a){function b(a){return 10>a?"0"+a:a}function c(a){return h.lastIndex=0,h.test(a)?'"'+a.replace(h,function(a){var b=i[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function d(a,e){var h,i,j,k,l,m=f,n=e[a];switch(n&&"[object Date]"===Object.prototype.toString.call(n)&&(n=isFinite(this.valueOf())?this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"Z":null),typeof n){case"string":return c(n);case"number":return isFinite(n)?String(n):"null";case"boolean":case"null":return String(n);case"object":if(!n)return"null";if(f+=g,l=[],"[object Array]"===Object.prototype.toString.apply(n)){for(k=n.length,h=0;k>h;h+=1)l[h]=d(h,n)||"null";return j=0===l.length?"[]":f?"[\n"+f+l.join(",\n"+f)+"\n"+m+"]":"["+l.join(",")+"]",f=m,j}for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(j=d(i,n),j&&l.push(c(i)+(f?": ":":")+j));return j=0===l.length?"{}":f?"{\n"+f+l.join(",\n"+f)+"\n"+m+"}":"{"+l.join(",")+"}",f=m,j}}var e={};if(window.JSON&&JSON.parse&&JSON.stringify)return window.JSON;var f,g,h=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return e.stringify=function(a,b){var c;if(f="",g="","number"==typeof b)for(c=0;b>c;c+=1)g+=" ";else"string"==typeof b&&(g=b);return d("",{"":a})},e.parse=function(){var b,c,d,e,f={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},g=function(c){a.console.error({name:"SyntaxError",message:c,at:b,text:d})},h=function(a){return a&&a!==c&&g("Expected '"+a+"' instead of '"+c+"'"),c=d.charAt(b),b+=1,c},i=function(){var a,b="";for("-"===c&&(b="-",h("-"));c>="0"&&"9">=c;)b+=c,h();if("."===c)for(b+=".";h()&&c>="0"&&"9">=c;)b+=c;if("e"===c||"E"===c)for(b+=c,h(),("-"===c||"+"===c)&&(b+=c,h());c>="0"&&"9">=c;)b+=c,h();return a=+b,isFinite(a)?a:void g("Bad number")},j=function(){var a,b,d,e="";if('"'===c)for(;h();){if('"'===c)return h(),e;if("\\"===c)if(h(),"u"===c){for(d=0,b=0;4>b&&(a=parseInt(h(),16),isFinite(a));b+=1)d=16*d+a;e+=String.fromCharCode(d)}else{if("string"!=typeof f[c])break;e+=f[c]}else e+=c}g("Bad string")},k=function(){for(;c&&" ">=c;)h()},l=function(){switch(c){case"t":return h("t"),h("r"),h("u"),h("e"),!0;case"f":return h("f"),h("a"),h("l"),h("s"),h("e"),!1;case"n":return h("n"),h("u"),h("l"),h("l"),null}g("Unexpected '"+c+"'")},m=function(){var a=[];if("["===c){if(h("["),k(),"]"===c)return h("]"),a;for(;c;){if(a.push(e()),k(),"]"===c)return h("]"),a;h(","),k()}}g("Bad array")},n=function(){var a,b={};if("{"===c){if(h("{"),k(),"}"===c)return h("}"),b;for(;c;){if(a=j(),k(),h(":"),Object.hasOwnProperty.call(b,a)&&g('Duplicate key "'+a+'"'),b[a]=e(),k(),"}"===c)return h("}"),b;h(","),k()}}g("Bad object")};return e=function(){switch(k(),c){case"{":return n();case"[":return m();case'"':return j();case"-":return i();default:return c>="0"&&"9">=c?i():l()}},function(a){var f;return d=a,b=0,c=" ",f=e(),k(),c&&g("Syntax error"),f}}(),e}(c)},{"./browser.js":2}],8:[function(a,b){var c=a("./browser.js"),d=a("./utils.js"),e=a("./dom.js"),f={_data:null};f.COOKIE_NAME="em_p_uid",f.format=function(a){return a&&d.isObject(a)?d.map(a,function(a,b){return b+":"+a}).sort().join("|"):null},f.parse=function(a){if(!a)return null;var b;return d.reduce(a.split("|"),function(a,c){return null===a?null:(b=c.split(":"),2!==b.length?null:(a[b[0]]=b[1],a))},{})},f.timestamp=function(a){var b;try{b=parseInt(a,10)}catch(c){return!1}return b},f.get=function(){var a=c.cookie.get(f.COOKIE_NAME);if(d.isNone(a))return f.set();var b=f.parse(a),e=f.timestamp(b.t);return e===!1?f.set():d.getTimestamp()-e>15552e6?f.set({u:b.u,l:b.l}):b},f.set=function(a){var b={u:d.getUUID(),t:d.getTimestamp(),l:0};a&&(b=d.extend(b,a));var e=f.format(b);return c.cookie.set(f.COOKIE_NAME,e,365,"https:"===window.location.protocol),e=c.cookie.get(f.COOKIE_NAME),d.isNone(e)?null:f.parse(e)},f.update=function(a){var b=f.get();return b?(b=d.extend(b,a),f.set(b)):!1},f.data=function(){if(f._data)return f._data;var a={mt:d.getTimestamp(),mr:document.referrer,msw:c.window.innerWidth(),msh:c.window.innerHeight()},b=f.get();return b?(a.muu=b.u,a.mut=b.t,a.mul=b.l):a.muu=0,f._data=a,f.update({l:d.getTimestamp()}),f._data},f.send=function(a,b){if(!b||!d.isElement(b.elem))return!1;var c=d.extend(f.data(),{}),g=e.rect(b.elem);g&&(c.mft=g.top,c.mfl=g.left,c.mfw=g.width,c.mfh=g.height),b.send(a,c)},b.exports=f},{"./browser.js":2,"./dom.js":5,"./utils.js":15}],9:[function(a,b){var c=a("./dom.js"),d=a("./utils"),e={_event:null,_observer:null};e.nodeNames=["iframe","a","blockquote"],e.html=function(){var a=document.getElementsByTagName("html");return 0===a.length?null:a[0]},e.recurse=function(a){var b=[];return d.isElement(a)&&b.push(a),d.reduce(a.childNodes,function(a,b){return d.isElement(b)?a.concat(e.recurse(b)):a},b)},e.observer=function(a){var b=e.html();if(null===b)return!1;if(!window.MutationObserver)return!1;e._observer=new window.MutationObserver(function(b){d.each(b,function(b){if("childList"===b.type&&b.addedNodes){var c=Array.prototype.slice.call(b.addedNodes);d.each(c,function(b){d.each(e.recurse(b),function(b){b.nodeName&&d.contains(e.nodeNames,b.nodeName.toLowerCase())&&a.notify("mutation.insert."+b.nodeName.toLowerCase(),b)})})}})});var c={childList:!0,subtree:!0};return e._observer.observe(b,c),!0},e.events=function(a){var b=e.html();return null===b?!1:(e._event=function(b){d.each(e.recurse(b.target),function(b){b.nodeName&&d.contains(e.nodeNames,b.nodeName.toLowerCase())&&a.notify("mutation.insert."+b.nodeName.toLowerCase(),b)})},c.addEvent(b,"DOMNodeInserted",e._event),!0)},e.stop=function(){var a=e.html();return null===a?!1:(e._event&&(c.detachEvent(a,"DOMNodeInserted",e._event),e._event=null),void(e._observer&&(e._observer.disconnect(),e._observer=null)))},e.connect=function(a){return e._event||e._observer?!1:void(e.observer(a)||e.events(a))},b.exports=e},{"./dom.js":5,"./utils":15}],10:[function(a,b){var c=a("./utils.js"),d=a("./urlparse.js"),e=a("./comms.js"),f=a("conf"),g={started:!1};g.connect=function(a,b){var h=d.getDomain(document.location.toString());if(!b&&f.PAGE_PROGRESS_DOMAINS&&!c.contains(f.PAGE_PROGRESS_DOMAINS,h))return!1;if(g.started)return!1;g.started=!0;var i=function(){a.notify("xcomm.page.progress")};e.started?i():(e.connect(a),a.one("xcomm.ready",i))},b.exports=g},{"./comms.js":4,"./urlparse.js":14,"./utils.js":15,conf:"AqyHQT"}],11:[function(a,b){var c=a("./utils.js"),d=a("./dom.js"),e=function(){this.init()};e.prototype.init=function(){var a=this;document.addEventListener?document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,!1),a.ready()},!1):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",arguments.callee),a.ready())}),document.documentElement.doScroll&&window===window.top&&!function(){if(!a.isReady){try{document.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a.ready()}}()),d.addEvent(window,"load",a.ready)},e.prototype.ready=function(){return this.isReady?!1:(this.isReady=!1,void(this.callback&&this.callback()))},e.prototype.bind=function(a){this.isReady&&a(),this.callback=a},e.prototype.elem=function(a,b,c){var e=!1,f=function(){e===!1&&(e=!0,b.call(c))};a.onload=f,d.addEvent(a,"load",f),a.onreadystatechange=function(){var b=a.readyState;("loaded"===b||"complete"===b)&&(a.onreadystatechange=null,f())}},e.prototype.firstNode=function(){var a=document.getElementsByTagName("head")[0],b=d.child(a,"link");if(b)return b;var c=d.child(a,"style");if(c)return c;var e=d.child(a,"script");return e?e:null},e.prototype.script=function(a,b,d,e){var f=this.firstNode(),g=document.createElement("script");g.type="text/javascript",g.src=a,c.isNone(e)||(g.async=1),this.elem(g,b,d),f.parentNode.insertBefore(g,f)},e.prototype.css=function(a,b,c){var d=this.firstNode(),e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=a,this.elem(e,b,c),d.parentNode.insertBefore(e,d)},b.exports=new e},{"./dom.js":5,"./utils.js":15}],12:[function(a,b){var c=a("./urlparse.js"),d={data:{},results:{},enabled:!1};d.show=function(a){var b=d.data[a],c=d.results[a];d.hub.notify("recommend.show",b,c)},d.add=function(a){var b=c.getQuery(a.elem.src);d.data[b.url]=a,d.enabled&&(a.on("media.stats.recommend",function(c){d.results[c.url]=c.results,a.on("pause",function(){d.show(b.url)}),a.send("addEventListener",{context:"player.js",version:"0.0.8",method:"addEventListener",value:"pause",listener:a.elem.src})}),a.send("media.stats.recommend",{key:b.key,url:b.url}))},d.connect=function(a){a.on("recommend",function(){d.enabled=!0}),a.on("recommend.add",function(a){d.add(a)}),d.hub=a},b.exports=d},{"./urlparse.js":14}],13:[function(a,b){var c=a("./utils.js"),d=a("./urlparse.js"),e=a("conf"),f={};f.youtube={schema:"youtube",re:/youtube\.com\/embed\/([^\/?#]+)/i,url:function(a){var b=f.youtube.re.exec(a);return 2!==b.length?a:"http://www.youtube.com/watch?v="+b[1]}},f.vimeo={schema:"vimeo",re:/player\.vimeo\.com\/video\/([^\/?#]+)/i,url:function(a){var b=f.vimeo.re.exec(a);return 2!==b.length?a:"http://vimeo.com/"+b[1]}},f.soundcloud={schema:"soundcloud",re:/w\.soundcloud\.com\/player\/\?/,url:function(a){var b=d.getQuery(a);if(b.url){var c=/api\.soundcloud\.com\/tracks\/([^\/?#]+)/.exec(b.url);if(2===c.length)return"https://soundcloud.com/track/"+c[1]}return a}},f.providers=[f.youtube,f.vimeo,f.soundcloud],f.provider=function(a){return c.reduce(f.providers,function(b,c){return c.re.test(a)?c:b},null)},f.replace=function(a,b){if(c.isNone(a)||!c.isElement(a))return null;if("IFRAME"!==a.nodeName)return null;if(!a.src||!c.isString(a.src))return null;if(!b.key)return!1;var g=a.src;g=g.replace(/&/g,"&");var h=f.provider(g);if(null===h)return null;var i="https:"===window.location.protocol?"https:":"http:";"file://"===g.substr(0,7)&&(g=g.substr(5)),"//"===g.substr(0,2)&&(g=i+g);var j=c.extend({},b,{url:h.url(g),src:g,schema:h.schema,type:"text/html"}),k=i+"//cdn.embedly.com/widgets/";e.EMB_DEBUG&&(k=e.EMB_FRAME_SRC);var l=k+"media.html?"+d.createQuery(j);return a.src=l,a},b.exports=f},{"./urlparse.js":14,"./utils.js":15,conf:"AqyHQT"}],14:[function(a,b){var c=a("./utils.js"),d={};d.createQuery=function(a){var b=[],d="";return a&&c.isObject(a)&&!c.isEmptyObject(a)?(c.each(a,function(a,c){b.push(encodeURIComponent(c)+"="+encodeURIComponent(a))}),b.sort(),b.join("&")):d},d.parseQuery=function(a){var b={};if(!a||!c.isString(a))return b;("#"===a.substr(0,1)||"?"===a.substr(0,1))&&(a=a.substr(1));var d=a.split("&");return c.each(d,function(a){if(!a)return!0;var c=a.split("="),d=decodeURIComponent(c[0]);b[d]=1===c.length?"":decodeURIComponent(2===c.length?c[1]:c.slice(1).join("="))}),b},d.getQuery=function(a){if(!a||!c.isString(a))return{};var b=a.split("?");return 2===b.length?d.parseQuery(b[1]):b.length>2?d.parseQuery(b.slice(1).join("?")):{}},d.appendQuery=function(a,b){if(!a||!c.isString(a))return null;var e=a.split("?"),f=e[0];if(!b||!c.isObject(b)||c.isEmptyObject(b))return a;var g=d.getQuery(a);return g=c.extend(g,b),c.isEmptyObject(g)?a:[f,d.createQuery(g)].join("?")},d.removeQuery=function(a,b){if(!a||!c.isString(a))return null;var e=a.split("?"),f=e[0],g=d.getQuery(a);return g.hasOwnProperty(b)&&delete g[b],c.isEmptyObject(g)?f:[f,d.createQuery(g)].join("?")},d.getOrigin=function(a){if(!a||!c.isString(a))return null;if(!/^https?:\/\//.test(a))return null;var b=a.split("/").slice(0,3).join("/");return-1===b.indexOf(".")?null:b},d.getDomain=function(a){var b=d.getOrigin(a);return b?b.replace(/^https?:\/\//,""):null},d.Parsed=function(a,b){this.init(a,b)},d.Parsed.prototype.init=function(a,b){this.original=a,this.url=b,this._valid=!1,this.url=b},d.Parsed.prototype.valid=function(a){return(a===!0||a===!1)&&(this._valid=a),this._valid},d.parse=function(a){var b=a,e="https:"===window.location.protocol?"https:":"http:";a=a?c.trim(a):a;var f=new d.Parsed(b,a);return a?/^https?:\/\/[^\/]+\.[^\/]/i.test(a)?(f.valid(!0),f):/^\w+:/i.test(a)?f:"#"===a[0]?f:/^\/\/[^\/]+\.[^\/]/i.test(a)?(f.valid(!0),f.url=e+a,f):/^\/([^\/]+|$)/i.test(a)?(f.valid(!0),f.url=d.getOrigin(window.location.toString())+a,f):/^[^\/]+\.[^\/]/i.test(a)?(f.valid(!0),f.url="http://"+a,f):f:f},d.addHash=function(a,b){return-1===a.indexOf("#")?a+"#"+b:a+"&"+b},b.exports=d},{"./utils.js":15}],15:[function(a,b){var c=a("conf"),d={},e={},f=Array.prototype,g=Object.prototype,h=Function.prototype,i=(f.push,f.slice),j=(f.concat,g.toString),k=f.forEach,l=(f.map,f.reduce),m=(f.reduceRight,f.filter,f.every),n=(f.some,f.indexOf),o=(f.lastIndexOf,Array.isArray,Object.keys,h.bind);d.identity=function(a){return a},d.each=function(a,b,c){if(null!=a)if(k&&a.forEach===k)a.forEach(b,c);else if(a.length===+a.length){for(var d=0,f=a.length;f>d;d++)if(d in a&&b.call(c,a[d],d,a)===e)return}else for(var h in a)if(g.hasOwnProperty.call(a,h)&&b.call(c,a[h],h,a)===e)return},d.map=function(a,b,c){var e=[];return null==a?e:Array.prototype.map&&a.map===Array.prototype.map?a.map(b,c):(d.each(a,function(a,d,f){e[e.length]=b.call(c,a,d,f)}),e)},d.reduce=function(a,b,c,e){var f=arguments.length>2;if(null==a&&(a=[]),l&&a.reduce===l)return e&&(b=d.bind(b,e)),f?a.reduce(b,c):a.reduce(b); +if(d.each(a,function(a,d,g){f?c=b.call(e,c,a,d,g):(c=a,f=!0)}),!f)throw new TypeError("Reduce of empty array with no initial value");return c},d.zip=function(a){return d.map(a[0],function(b,c){return b.map(a,function(a){return a[c]})})},d.extend=function(a){return d.each(Array.prototype.slice.call(arguments,1),function(b){for(var c in b)void 0!==b[c]&&(a[c]=b[c])}),a},d.contains=function(a,b){if(!n){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1}return a.indexOf(b)>-1},d.every=function(a,b,c){b||(b=d.identity);var f=!0;return null==a?f:m&&a.every===m?a.every(b,c):(d.each(a,function(a,d,g){return(f=f&&b.call(c,a,d,g))?void 0:e}),!!f)},d.indexOf=function(a,b){if(null==a)return-1;var c=0,d=a.length;if(n&&a.indexOf===n)return a.indexOf(b);for(;d>c;c++)if(a[c]===b)return c;return-1};var p=function(){};d.bind=function(a,b){var c,e;if(o&&a.bind===o)return o.apply(a,i.call(arguments,1));if(!d.isFunction(a))throw new TypeError;return c=i.call(arguments,2),e=function(){if(!(this instanceof e))return a.apply(b,c.concat(i.call(arguments)));p.prototype=a.prototype;var d=new p;p.prototype=null;var f=a.apply(d,c.concat(i.call(arguments)));return Object(f)===f?f:d}},d.get=function(a,b,c){if(c=d.isNone(c)?null:c,d.isNone(b)||!d.isString(b)||!a)return c;if(""===b)return a;var e=b.split("."),f=e.splice(0,1)[0];return a.hasOwnProperty(f)?d.get(a[f],e.join("."),c):c},d.isFunction=function(a){try{return/^\s*\bfunction\b/.test(a)}catch(b){return!1}},d.isNone=function(a){return null===a||void 0===a},d.isString=function(a){return"[object String]"===j.call(a)},d.isNumber=function(a){return"[object Number]"===j.call(a)},d.isDate=function(a){return"[object Date]"===j.call(a)},d.isObject=function(a){return"[object Object]"===j.call(a)},d.isArray=function(a){return"[object Array]"===j.call(a)},d.isElement=function(a){return!d.isNone(a)&&!d.isNone(a.nodeType)&&1===a.nodeType},d.isEmptyObject=function(a){if(d.isObject(a)){for(var b in a)if(g.hasOwnProperty.call(a,b))return!1;return!0}return!1},d.bool=function(a){return d.isNone(a)?null:"true"===a||"1"===a||1===a||a===!0?!0:"false"===a||"0"===a||0===a||a===!1?!1:null},d.assert=function(a,b){if(!a)throw b||"Assertion Failed"},d.getUUID=function(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"===a?b:3&b|8;return c.toString(16)})},d.getTimestamp=function(){var a=new Date;return a.getTime()},d.trim=function(a){return a.replace(/^\s+|\s+$/g,"")},d.capitalize=function(a){return a.charAt(0).toUpperCase()+a.substr(1)},d.camelCase=function(a){var b=a.split("-");return b.length>1&&(a=b[0],a+=d.map(b.slice(1),function(a){return a[0].toUpperCase()+a.substr(1)}).join("")),a},d.truncate=function(a,b){return a?(b=b?b:50,a.lengthc;c++)b=31*b+a.charCodeAt(c)<<0;return(Math.pow(2,31)+b).toString()},d.rgbToHex=function(a,b,c){return"#"+((1<<24)+(a<<16)+(b<<8)+c).toString(16).slice(1)},c.EMB_DEBUG===!0&&(window._=d),b.exports=d},{conf:"AqyHQT"}],16:[function(a,b){var c=a("./utils.js"),d=a("./dom.js"),e=a("./browser.js"),f=function(){this.init()};f.prototype.init=function(){this._elements=[],this._listening=!1},f.prototype.viewable=function(a){if(!a.getBoundingClientRect)return!0;var b;try{b=a.getBoundingClientRect()}catch(c){return!1}return b.bottom>=0&&b.right>=0&&b.top<=(window.innerHeight||document.documentElement.clientHeight)&&b.left<=(window.innerWidth||document.documentElement.clientWidth)},f.prototype.check=function(){this.freeze=!0;var a=[];c.each(this._elements,c.bind(function(b,c){if(this.viewable(b.elem)){try{b.func.call(this)}catch(d){e.console.log(d)}a.push(c)}},this)),c.each(a,function(a){this._elements.splice(a,1)},this),0===this._elements.length&&this.stop(),this.freeze=!1},f.prototype.stop=function(){try{d.detachEvent(window,"DOMContentLoaded",this.handler),d.detachEvent(window,"load",this.handler),d.detachEvent(window,"resize",this.handler),d.detachEvent(window,"scroll",this.handler)}catch(a){}this.handler=null,this._listening=!1},f.prototype.listen=function(){return this._listening?!1:(this._listening=!0,this.handler=c.bind(function(){!this.freeze&&this._elements.length&&this.check()},this),d.addEvent(window,"DOMContentLoaded",this.handler),d.addEvent(window,"load",this.handler),d.addEvent(window,"resize",this.handler),void d.addEvent(window,"scroll",this.handler))},f.prototype.on=function(a,b,c){"viewable"===a&&(this._elements.push({elem:b,func:c}),this.listen(),this.check())},b.exports=f},{"./browser.js":2,"./dom.js":5,"./utils.js":15}],conf:[function(a,b){b.exports=a("AqyHQT")},{}],AqyHQT:[function(a,b){!function(a){a.EMB_DEBUG=!1,a.EMB_HTTPS="https:"===window.location.protocol?!0:!1,a.EMB_ORIGIN=(a.EMB_HTTPS?"https":"http")+"://cdn.embedly.com",a.EMB_FRAME_SRC=a.EMB_ORIGIN+"/widgets/",a.EMB_SECURE_FRAME_SRC="https://cdn.embedly.com/widgets/",a.EMB_POST_MESSAGE=!!window.postMessage,a.EMB_PROGRESS=!0,a.EMB_APP_API="https://app.embed.ly",a.EMB_API_KEY="fd92ebbc52fc43fb98f69e50e7893c13";var b=window.location.pathname.split(".")[0].split("/");a.EMB_GROUP=b[b.length-1].toLowerCase(),a.PAGE_PROGRESS_DOMAINS=[]}("undefined"==typeof b?this.conf={}:b.exports)},{}],19:[function(a){if(window.embedly&&window.embedly.look)return window.embedly.look(),!1;var b=a("./common/iframe.js"),c=a("./common/browser.js"),d=a("./common/utils.js"),e=a("./common/a.js"),f=a("./common/dom.js"),g=a("./common/ready.js"),h=a("./common/mutations.js"),i=a("./common/swap.js"),j=a("./common/meta.js"),k=a("./common/json.js"),l=a("./common/viewport.js"),m=a("./common/page.js"),n=a("./common/recommend.js"),o=new e,p=new l;n.connect(o);var q=function(){var a=/emb_(\d+)/.exec(c.location.hash());return a?a[1]:null},r={cardSelectors:[{selector:".embedly-card"}],buttonSelectors:[".embedly-button"],analytics:null,recommend:!1,shared:q()},s=function(a){var b;try{b=k.parse(a.data)}catch(d){return c.console.error(d),!1}o.notify("window.message",a,b)};f.addEvent(window,"message",s);var t=function(a,c,e){var f;if(d.isFunction(c)&&(e=c,c={}),d.isString(a))return".embedly-card"===a?!1:(r.cardSelectors.push({selector:a}),B(),!0);if(!d.isElement(a)&&d.isObject(a)){if(!a.selector&&!a.types)return!1;var g={};if(d.isArray(a.types)&&a.types.length>0&&(g.types=a.types),a.selector)g.selector=a.selector,r.cardSelectors.push(g);else{var h=r.cardSelectors.reduce(function(a,b){return".embedly-card"===b.selector?b:a},{});if(!h)return!1;h.types=g.types}}return!d.isElement(a)||"a"!==a.nodeName.toLowerCase()&&"blockquote"!==a.nodeName.toLowerCase()||(f=b.createCard(a,c,o)),f&&(f.one("card.rendered",function(){o.notify("card.rendered",f.elem,f),p.on("viewable",f.elem,function(){f.send("card.view")})}),f.on("resize",function(){o.notify("card.resize",f.elem,f)})),d.isFunction(e)&&e.call(f,f),o.notify("card.created",f),f},u=function(a){var c;return d.isString(a)?(r.buttonSelectors.push(a),B(),!0):(d.isElement(a)&&"a"===a.nodeName.toLowerCase()&&(c=b.createButton(a,o)),o.notify("button.created",c),c)},v=function(a,c){var e;e=d.isString(a)?{url:a}:a;var f=b.createCardModal(e,o);return d.isFunction(c)&&c.call(f,f),f},w=function(a){if("1"===f.data(a,"connected"))return!1;f.data(a,"connected","1");var c=b.connect({elem:a},o);c.one("media.ready",function(){c.ready(),p.on("viewable",c.elem,function(){c.send("media.view")}),o.notify("recommend.add",c),o.notify("media.ready",c)}),c.send("media.ready")},x=function(a){return a&&a.key?(r.analytics=a,void B()):!1},y=function(){o.notify("recommend"),B()},z=function(a,b){return"."===a.substr(0,1)?f.hasClass(b,a.substr(1))?!0:!1:d.contains(f.all(a),b)?!0:!1},A=function(a){if(("A"===a.nodeName||"BLOCKQUOTE"===a.nodeName)&&d.each(r.cardSelectors,function(b){z(b.selector,a)&&t(a,b)}),"A"===a.nodeName&&d.each(r.buttonSelectors,function(b){z(b,a)&&u(a)}),"IFRAME"===a.nodeName)if("embedly-embed"===a.className)w(a);else if(a.src&&/\/\/cdn\.embedly\.com\/widgets\/media\.html/.test(a.src))w(a);else if(null!==r.analytics&&r.analytics.replace){var b=i.replace(a,r.analytics);null!==b&&w(b)}},B=function(){d.each(r.cardSelectors,function(a){d.each(f.all(a.selector),function(a){A(a)})}),d.each(r.buttonSelectors,function(a){d.each(f.all(a),function(a){A(a)})}),d.each(f.all("iframe"),function(a){A(a)}),o.notify("look.done")};o.on("mutation.insert.a",A),o.on("mutation.insert.blockquote",A),o.on("mutation.insert.iframe",A),o.on("media.ready",function(a){j.send("media.meta",a)}),o.on("card.rendered",function(a,b){j.send("card.meta",b)}),o.on("card.rendered",function(a,b){if(!r.shared)return!1;if(!b.query||!b.query.url)return!1;var e=d.hash(b.query.url);return e!==r.shared?!1:(r.shared=null,void setTimeout(function(){var a=f.rect(b.elem);return a&&a.top?void c.animateScroll(a.top-5,500):!1},500))});var C=function(a,b){o.on(a,b)},D=function(a,b){o.off(a,b)},E=function(){f.detachEvent(window,"message",s),h.stop(),o.data={},window.embedly=null},F=function(){var a=Array.prototype.slice.call(arguments,0);if(0===a.length)return null;var b=a.splice(0,1)[0];switch(b){case"card":return t.apply(window,a);case"button":return u.apply(window,a);case"modal":return v.apply(window,a);case"look":return B.apply(window,a);case"on":return C.apply(window,a);case"off":return D.apply(window,a);case"kill":return E.apply(window,a);case"analytics":return x.apply(window,a);case"recommend":return y.apply(window,a)}return null},G=[];window.embedly&&d.isFunction(window.embedly)&&d.isArray(window.embedly.q)&&(G=window.embedly.q),window.embedly=function(){return F.apply(window,arguments)},window.embedly.card=function(a){return t(a)},window.embedly.button=function(a){return u(a)},window.embedly.modal=function(a){return v(a)},window.embedly.look=function(a){return B(a)},d.each(G,function(a){window.embedly.apply(window,a)}),h.connect(o),m.connect(o),g.bind(B),B(),d.isFunction(window.onEmbedlyReady)&&window.onEmbedlyReady.apply(this,[window.embedly])},{"./common/a.js":1,"./common/browser.js":2,"./common/dom.js":5,"./common/iframe.js":6,"./common/json.js":7,"./common/meta.js":8,"./common/mutations.js":9,"./common/page.js":10,"./common/ready.js":11,"./common/recommend.js":12,"./common/swap.js":13,"./common/utils.js":15,"./common/viewport.js":16}]},{},[19])}(); \ No newline at end of file diff --git a/app/assets/javascripts/src/JIT.js b/app/assets/javascripts/src/JIT.js index de6aacb7..1f1c6333 100644 --- a/app/assets/javascripts/src/JIT.js +++ b/app/assets/javascripts/src/JIT.js @@ -2450,9 +2450,13 @@ Extras.Classes.Navigation = new Class({ // START METAMAPS CODE if (e.target.id != 'infovis-canvas') return; + if (Metamaps.Create.newTopic.beingCreated) return; // END METAMAPS CODE - $.event.stop($.event.get(e, win)); + //$.event.stop($.event.get(e, win)); + // END METAMAPS CODE + // ORIGINAL CODE $.event.stop($.event.get(e, win)); + var val = this.config.zooming / 1000, ans = 1 + scroll * val; diff --git a/app/assets/javascripts/src/Metamaps.GlobalUI.js b/app/assets/javascripts/src/Metamaps.GlobalUI.js index b0b5e1b8..fc8f46ea 100644 --- a/app/assets/javascripts/src/Metamaps.GlobalUI.js +++ b/app/assets/javascripts/src/Metamaps.GlobalUI.js @@ -107,16 +107,7 @@ Metamaps.GlobalUI = { $('#lightbox_screen').animate({ 'opacity': '0.42' }, 200); - - if (Metamaps.Create && !Metamaps.Create.metacodeScrollerInit) { - $('.customMetacodeList, .metacodeSetList').mCustomScrollbar({ - mouseWheelPixels: 200, - advanced: { - updateOnContentResize: true - } - }); - Metamaps.Create.metacodeScrollerInit = true; - } + if (which == "switchMetacodes") { Metamaps.Create.isSwitchingSet = true; } diff --git a/app/assets/javascripts/src/Metamaps.JIT.js b/app/assets/javascripts/src/Metamaps.JIT.js index 5b9f7458..7cd25ef8 100644 --- a/app/assets/javascripts/src/Metamaps.JIT.js +++ b/app/assets/javascripts/src/Metamaps.JIT.js @@ -11,7 +11,6 @@ Metamaps.JIT = { $(".zoomIn").click(self.zoomIn); $(".zoomOut").click(self.zoomOut); - $(".centerMap").click(self.centerMap); $(".zoomExtents").click(self.zoomExtents); }, /** @@ -690,8 +689,6 @@ Metamaps.JIT = { var self = Metamaps.JIT; if (node && !node.nodeFrom) { - Metamaps.Create.newTopic.hide(); - Metamaps.Create.newSynapse.hide(); var pos = eventInfo.getPos(); // if it's a left click, or a touch, move the node if (e.touches || (e.button == 0 && !e.altKey && (e.buttons == 0 || e.buttons == 1 || e.buttons == undefined))) { @@ -738,6 +735,8 @@ Metamaps.JIT = { tempNode = node; tempInit = true; + Metamaps.Create.newTopic.hide(); + Metamaps.Create.newSynapse.hide(); // set the draw synapse start positions var l = Metamaps.Selected.Nodes.length; if (l > 0) { @@ -763,8 +762,7 @@ Metamaps.JIT = { temp = eventInfo.getNode(); if (temp != false && temp.id != node.id && Metamaps.Selected.Nodes.indexOf(temp) == -1) { // this means a Node has been returned tempNode2 = temp; - Metamaps.Visualize.mGraph.plot(); - + Metamaps.Mouse.synapseEndCoordinates = { x: tempNode2.pos.getc().x, y: tempNode2.pos.getc().y @@ -775,8 +773,7 @@ Metamaps.JIT = { n.setData('dim', 25, 'current'); }); temp.setData('dim', 35, 'current'); - Metamaps.Visualize.mGraph.fx.plotNode(tempNode, Metamaps.Visualize.mGraph.canvas); - Metamaps.Visualize.mGraph.fx.plotNode(temp, Metamaps.Visualize.mGraph.canvas); + Metamaps.Visualize.mGraph.plot(); } else if (!temp) { tempNode2 = null; Metamaps.Visualize.mGraph.graph.eachNode(function (n) { @@ -787,8 +784,6 @@ Metamaps.JIT = { var myY = e.clientY - 30; $('#new_topic').css('left', myX + "px"); $('#new_topic').css('top', myY + "px"); - $('#new_synapse').css('left', myX + "px"); - $('#new_synapse').css('top', myY + "px"); Metamaps.Create.newTopic.x = eventInfo.getPos().x; Metamaps.Create.newTopic.y = eventInfo.getPos().y; Metamaps.Visualize.mGraph.plot(); @@ -803,6 +798,7 @@ Metamaps.JIT = { }, // onDragMoveTopicHandler onDragCancelHandler: function (node, eventInfo, e) { tempNode = null; + if (tempNode2) tempNode2.setData('dim', 25, 'current'); tempNode2 = null; tempInit = false; // reset the draw synapse positions to false @@ -811,7 +807,7 @@ Metamaps.JIT = { Metamaps.Visualize.mGraph.plot(); }, // onDragCancelHandler onDragEndTopicHandler: function (node, eventInfo, e) { - var mapping; + var midpoint = {}, pixelPos, mapping; if (tempInit && tempNode2 == null) { // this means you want to add a new topic, and then a synapse @@ -822,6 +818,13 @@ Metamaps.JIT = { Metamaps.Create.newTopic.addSynapse = false; Metamaps.Create.newSynapse.topic1id = tempNode.id; Metamaps.Create.newSynapse.topic2id = tempNode2.id; + tempNode2.setData('dim', 25, 'current'); + Metamaps.Visualize.mGraph.plot(); + midpoint.x = tempNode.pos.getc().x + (tempNode2.pos.getc().x - tempNode.pos.getc().x) / 2; + midpoint.y = tempNode.pos.getc().y + (tempNode2.pos.getc().y - tempNode.pos.getc().y) / 2; + pixelPos = Metamaps.Util.coordsToPixels(midpoint); + $('#new_synapse').css('left', pixelPos.x + "px"); + $('#new_synapse').css('top', pixelPos.y + "px"); Metamaps.Create.newSynapse.open(); tempNode = null; tempNode2 = null; @@ -830,11 +833,22 @@ Metamaps.JIT = { // this means you dragged an existing node, autosave that to the database if (Metamaps.Active.Map) { mapping = node.getData('mapping'); - mapping.set({ + mapping.save({ xloc: node.getPos().x, yloc: node.getPos().y }); - mapping.save(); + // also save any other selected nodes that also got dragged along + var l = Metamaps.Selected.Nodes.length; + for (var i = l - 1; i >= 0; i -= 1) { + var n = Metamaps.Selected.Nodes[i]; + if (n !== node) { + mapping = n.getData('mapping'); + mapping.save({ + xloc: n.getPos().x, + yloc: n.getPos().y + }); + } + }; } } }, //onDragEndTopicHandler @@ -1114,6 +1128,9 @@ Metamaps.JIT = { if (Metamaps.Visualize.mGraph.busy) return; + // select the node + Metamaps.Control.selectNode(node, e); + // delete old right click menu $('.rightclickmenu').remove(); // create new menu for clicked on node diff --git a/app/assets/javascripts/src/Metamaps.js b/app/assets/javascripts/src/Metamaps.js index 45c6240c..63d63b38 100644 --- a/app/assets/javascripts/src/Metamaps.js +++ b/app/assets/javascripts/src/Metamaps.js @@ -360,7 +360,6 @@ Metamaps.Backbone.init = function () { */ Metamaps.Create = { isSwitchingSet: false, // indicates whether the metacode set switch lightbox is open - metacodeScrollerInit: false, // indicates whether the scrollbar in the custom metacode set space has been init selectedMetacodeSet: null, selectedMetacodeSetIndex: null, selectedMetacodeNames: [], @@ -438,7 +437,8 @@ Metamaps.Create = { $('#metacodeImg').empty().append(newMetacodes).CloudCarousel({ titleBox: $('#metacodeImgTitle'), yRadius: 40, - xPos: 150, + xRadius: 190, + xPos: 170, yPos: 40, speed: 0.3, mouseWheel: true, @@ -522,7 +522,8 @@ Metamaps.Create = { $("#metacodeImg").CloudCarousel({ titleBox: $('#metacodeImgTitle'), yRadius: 40, - xPos: 150, + xRadius: 190, + xPos: 170, yPos: 40, speed: 0.3, mouseWheel: true, @@ -611,6 +612,8 @@ Metamaps.Create = { Metamaps.Create.newTopic.addSynapse = false; Metamaps.Create.newSynapse.topic1id = 0; Metamaps.Create.newSynapse.topic2id = 0; + Metamaps.Mouse.synapseStartCoordinates = []; + Metamaps.Visualize.mGraph.plot(); }, getSearchQuery: function () { var self = Metamaps.Create.newSynapse; @@ -632,9 +635,10 @@ Metamaps.Create = { * */ Metamaps.TopicCard = { - openTopicCard: null, //stores the JIT local ID of the topic with the topic card open - linkActionsString: '
Remove
', + openTopicCard: null, //stores the topic that's currently open + authorizedToEdit: false, // stores boolean for edit permission for open topic card init: function () { + var self = Metamaps.TopicCard; // initialize best_in_place editing $('.authenticated div.permission.canEdit .best_in_place').best_in_place(); @@ -645,31 +649,57 @@ Metamaps.TopicCard = { $('.showcard').draggable({ handle: ".metacodeImage" }); - }, - fadeInShowCard: function (topic) { - $('.showcard').fadeIn('fast'); - Metamaps.TopicCard.openTopicCard = topic.isNew() ? topic.cid : topic.id; + + embedly('on', 'card.rendered', self.embedlyCardRendered); }, /** * Will open the Topic Card for the node that it's passed * @param {$jit.Graph.Node} node */ showCard: function (node) { + var self = Metamaps.TopicCard; var topic = node.getData('topic'); + self.openTopicCard = topic; + self.authorizedToEdit = topic.authorizeToEdit(Metamaps.Active.Mapper); //populate the card that's about to show with the right topics data - Metamaps.TopicCard.populateShowCard(topic); - Metamaps.TopicCard.fadeInShowCard(topic); + self.populateShowCard(topic); + $('.showcard').fadeIn('fast'); }, hideCard: function () { + var self = Metamaps.TopicCard; + $('.showcard').fadeOut('fast'); - Metamaps.TopicCard.openTopicCard = null; + self.openTopicCard = null; + self.authorizedToEdit = false; + }, + embedlyCardRendered: function (iframe) { + var self = Metamaps.TopicCard; + + $('#embedlyLinkLoader').hide(); + $('#embedlyLink').fadeIn('fast'); + if (self.authorizedToEdit) { + $('.embeds').append('
'); + $('#linkremove').click(self.removeLink); + } + }, + removeLink: function () { + var self = Metamaps.TopicCard; + self.openTopicCard.save({ + link: null + }); + $('.embeds').empty(); + $('.attachments').removeClass('hidden'); + $('.addAttachment').show(); + $('.CardOnGraph').removeClass('hasAttachment'); }, bindShowCardListeners: function (topic) { var self = Metamaps.TopicCard; var showCard = document.getElementById('showcard'); + var authorized = self.authorizedToEdit; + // get mapper image var setMapperImage = function (mapper) { $('.contributorIcon').attr('src', mapper.get('image')); @@ -687,7 +717,6 @@ Metamaps.TopicCard = { $('.attachments').append(addLinkDiv); $('.showcard #addLinkReset').click(resetFunc); $('.showcard #addLinkInput input').bind("paste keyup",inputEmbedFunc); - $('#addLinkInput input').focus(); }; var resetFunc = function () { @@ -712,38 +741,31 @@ Metamaps.TopicCard = { 'data-card-description': '0', href: text }).html(text); - //embedlyEl.embedly({ - // query: {maxwidth: 300}, - // key: '7983300f4c1f48569ca242e3d6bff1e9' - //}); $('.addLink').remove(); + $('.attachments').addClass('hidden'); $('.embeds').append(embedlyEl); + $('.embeds').append('
'); + var loader = new CanvasLoader('embedlyLinkLoader'); + loader.setColor('#4fb5c0'); // default is '#000000' + loader.setDiameter(28); // default is 40 + loader.setDensity(41); // default is 40 + loader.setRange(0.9); // default is 1.3 + loader.show(); // Hidden by default embedly('card', document.getElementById('embedlyLink')); $('.CardOnGraph').addClass('hasAttachment'); - $('.attachments').append(self.linkActionsString); - bindLinkActionListeners(); } }, 100); }; - var removeLinkFunc = function () { - topic.save({ - link: null - }); - $('.embeds').empty(); - $('.linkActions').remove(); - $('.addAttachment').show(); - $('.CardOnGraph').removeClass('hasAttachment'); - }; - var bindLinkActionListeners = function () { - $('#linkremove').click(removeLinkFunc); - }; - if (topic.get('link')) { - //$('#embedlyLink').embedly({ - // query: {maxwidth: 300}, - // key: '7983300f4c1f48569ca242e3d6bff1e9' - //}); + + // initialize the link card, if there is a link + if (topic.get('link') && topic.get('link') !== '') { + var loader = new CanvasLoader('embedlyLinkLoader'); + loader.setColor('#4fb5c0'); // default is '#000000' + loader.setDiameter(28); // default is 40 + loader.setDensity(41); // default is 40 + loader.setRange(0.9); // default is 1.3 + loader.show(); // Hidden by default embedly('card', document.getElementById('embedlyLink')); - bindLinkActionListeners(); } $('.showcard #addlink').click(addLinkFunc); @@ -761,38 +783,79 @@ Metamaps.TopicCard = { } }); - $('.showcard .metacodeTitle').click(function () { + var metacodeLiClick = function () { + selectingMetacode = false; + var metacodeName = $(this).find('.mSelectName').text(); + var metacode = Metamaps.Metacodes.findWhere({ + name: metacodeName + }); + $('.CardOnGraph').find('.metacodeTitle').html(metacodeName) + .append('
') + .attr('class', 'metacodeTitle mbg' + metacodeName.replace(/\s/g, '')); + $('.CardOnGraph').find('.metacodeImage').css('background-image', 'url(' + metacode.get('icon') + ')'); + topic.save({ + metacode_id: metacode.id + }); + Metamaps.Visualize.mGraph.plot(); + $('.metacodeSelect').hide(); + $('.metacodeTitle').hide(); + $('.showcard .icon').css('z-index', '1'); + }; + + var openMetacodeSelect = function (event) { if (!selectingMetacode) { selectingMetacode = true; - $(this).addClass('minimize'); // this line flips the drop down arrow to a pull up arrow $('.metacodeSelect').show(); - $('.metacodeSelect li').click(function () { - selectingMetacode = false; - var metacodeName = $(this).find('.mSelectName').text(); - var metacode = Metamaps.Metacodes.findWhere({ - name: metacodeName - }); - $('.CardOnGraph').find('.metacodeTitle').text(metacodeName) - .attr('class', 'metacodeTitle mbg' + metacodeName.replace(/\s/g, '')); - $('.CardOnGraph').find('.metacodeImage').css('background-image', 'url(' + metacode.get('icon') + ')'); - topic.save({ - metacode_id: metacode.id - }); - Metamaps.Visualize.mGraph.plot(); - $('.metacodeTitle').removeClass('minimize'); // this line flips the pull up arrow to a drop down arrow - $('.metacodeSelect').hide(); - setTimeout(function () { - $('.metacodeTitle').hide(); - $('.showcard .icon').css('z-index', '1'); - }, 500); - }); - } else { - selectingMetacode = false; - $(this).removeClass('minimize'); // this line flips the pull up arrow to a drop down arrow - $('.metacodeSelect').hide(); + event.stopPropagation(); } - }); + }; + var hideMetacodeSelect = function () { + selectingMetacode = false; + $('.metacodeSelect').hide(); + $('.metacodeTitle').hide(); + $('.showcard .icon').css('z-index', '1'); + }; + + if (authorized) { + $('.showcard .metacodeTitle').click(openMetacodeSelect); + $('.showcard').click(hideMetacodeSelect); + $('.metacodeSelect > ul li').click(function (event){ + event.stopPropagation(); + }); + $('.metacodeSelect li li').click(metacodeLiClick); + + var bipName = $(showCard).find('.best_in_place_name'); + bipName.best_in_place(); + bipName.bind("best_in_place:activate", function () { + var $el = bipName.find('textarea'); + var el = $el[0]; + + $el.attr('maxlength', '140'); + + $('.showcard .title').append('
'); + + var callback = function (data) { + $('.titleCounter').html(data.all + '/140'); + }; + Countable.live(el, callback); + }); + bipName.bind("best_in_place:deactivate", function () { + $('.titleCounter').remove(); + }); + + //bind best_in_place ajax callbacks + bipName.bind("ajax:success", function () { + var name = Metamaps.Util.decodeEntities($(this).html()); + topic.set("name", name); + }); + + $(showCard).find('.best_in_place_desc').bind("ajax:success", function () { + this.innerHTML = this.innerHTML.replace(/\r/g, '') + var desc = $(this).html(); + topic.set("desc", desc); + }); + } // ability to change permission var selectingPermission = false; @@ -825,39 +888,6 @@ Metamaps.TopicCard = { } }); } - - if (topic.authorizeToEdit(Metamaps.Active.Mapper)) { - var bipName = $(showCard).find('.best_in_place_name'); - bipName.best_in_place(); - bipName.bind("best_in_place:activate", function () { - var $el = bipName.find('textarea'); - var el = $el[0]; - - $el.attr('maxlength', '140'); - - $('.showcard .title').append('
'); - - var callback = function (data) { - $('.titleCounter').html(data.all + '/140'); - }; - Countable.live(el, callback); - }); - bipName.bind("best_in_place:deactivate", function () { - $('.titleCounter').remove(); - }); - - //bind best_in_place ajax callbacks - bipName.bind("ajax:success", function () { - var name = Metamaps.Util.decodeEntities($(this).html()); - topic.set("name", name); - }); - - $(showCard).find('.best_in_place_desc').bind("ajax:success", function () { - this.innerHTML = this.innerHTML.replace(/\r/g, '') - var desc = $(this).html(); - topic.set("desc", desc); - }); - } }, populateShowCard: function (topic) { var self = Metamaps.TopicCard; @@ -902,24 +932,28 @@ Metamaps.TopicCard = { } var desc_nil = "Click to add description..."; - var addAttachmentHidden=''; - nodeValues.attachments = ''; - if (topic.get('link') && topic.get('link')!=='') { + nodeValues.attachmentsHidden = ''; + if (topic.get('link') && topic.get('link')!== '') { nodeValues.embeds = ''; nodeValues.embeds += topic.get('link'); - nodeValues.embeds += ''; - addAttachmentHidden='hidden'; - nodeValues.attachments += self.linkActionsString; + nodeValues.embeds += '
'; + nodeValues.attachmentsHidden = 'hidden'; nodeValues.hasAttachment = "hasAttachment"; } else { nodeValues.embeds = ''; nodeValues.hasAttachment = ''; } - nodeValues.attachments += '
'; - nodeValues.attachments+= ''; - nodeValues.attachments+= '
Upload a file
'; + + if (authorized) { + nodeValues.attachments = '
'; + nodeValues.attachments += ''; + nodeValues.attachments += '
Upload a file
'; + } else { + nodeValues.attachmentsHidden = 'hidden'; + nodeValues.attachments = ''; + } nodeValues.permission = topic.get("permission"); nodeValues.mk_permission = topic.get("permission").substring(0, 2); @@ -1369,6 +1403,20 @@ Metamaps.Util = { getDistance: function (p1, p2) { return Math.sqrt(Math.pow((p2.x - p1.x), 2) + Math.pow((p2.y - p1.y), 2)); }, + coordsToPixels: function (coords) { + var canvas = Metamaps.Visualize.mGraph.canvas, + s = canvas.getSize(), + p = canvas.getPos(), + ox = canvas.translateOffsetX, + oy = canvas.translateOffsetY, + sx = canvas.scaleOffsetX, + sy = canvas.scaleOffsetY; + var pixels = { + x: (coords.x / (1/sx)) + p.x + s.width/2 + ox, + y: (coords.y / (1/sy)) + p.y + s.height/2 + oy + }; + return pixels; + }, generateOptionsList: function (data) { var newlist = ""; for (var i = 0; i < data.length; i++) { @@ -1591,9 +1639,11 @@ Metamaps.Realtime = { mapperListItem += '
'; mapperListItem += ''; - $('#mapper' + data.userid).remove(); - $('.realtimeMapperList ul').append(mapperListItem); + if (data.userid !== Metamaps.Active.Mapper.id) { + $('#mapper' + data.userid).remove(); + $('.realtimeMapperList ul').append(mapperListItem); +<<<<<<< HEAD // create a div for the collaborators compass $('#compass' + data.userid).remove(); $('
', { @@ -1601,6 +1651,16 @@ Metamaps.Realtime = { class: 'collabCompass' }).html('

'+data.username+'

').appendTo('#wrapper'); +======= + // create a div for the collaborators compass + $('#compass' + data.userid).remove(); + $('
', { + id: 'compass' + data.userid, + text: data.username, + class: 'collabCompass' + }).appendTo('#wrapper'); + } +>>>>>>> fe1f35d63eda20b39e97f11c8bb75135281d5b98 }, newPeerOnMap: function (data) { var self = Metamaps.Realtime; @@ -1617,6 +1677,7 @@ Metamaps.Realtime = { }; // create an item for them in the realtime box +<<<<<<< HEAD var mapperListItem = '
  • '; mapperListItem += ''; mapperListItem += data.username; @@ -1644,6 +1705,38 @@ Metamaps.Realtime = { mapid: Metamaps.Active.Map.id }; socket.emit('updateNewMapperList', update); +======= + if (data.userid !== Metamaps.Active.Mapper.id) { + var mapperListItem = '
  • '; + mapperListItem += ''; + mapperListItem += data.username; + mapperListItem += '
    '; + mapperListItem += '
  • '; + $('#mapper' + data.userid).remove(); + $('.realtimeMapperList ul').append(mapperListItem); + + // create a div for the collaborators compass + $('#compass' + data.userid).remove(); + $('
    ', { + id: 'compass' + data.userid, + text: data.username, + class: 'collabCompass' + }).appendTo('#wrapper'); + + Metamaps.GlobalUI.notifyUser(data.username + ' just joined the map'); + + // send this new mapper back your details, and the awareness that you've loaded the map + var update = { + userToNotify: data.userid, + username: Metamaps.Active.Mapper.get("name"), + userimage: Metamaps.Active.Mapper.get("image"), + userid: Metamaps.Active.Mapper.id, + userrealtime: self.status, + mapid: Metamaps.Active.Map.id + }; + socket.emit('updateNewMapperList', update); + } +>>>>>>> fe1f35d63eda20b39e97f11c8bb75135281d5b98 }, lostPeerOnMap: function (data) { var self = Metamaps.Realtime; @@ -1691,18 +1784,7 @@ Metamaps.Realtime = { var self = Metamaps.Realtime; var socket = Metamaps.Realtime.socket; - var c = data.usercoords, - canvas = Metamaps.Visualize.mGraph.canvas, - s = canvas.getSize(), - p = canvas.getPos(), - ox = canvas.translateOffsetX, - oy = canvas.translateOffsetY, - sx = canvas.scaleOffsetX, - sy = canvas.scaleOffsetY; - var pixels = { - x: (c.x / (1/sx)) + p.x + s.width/2 + ox, - y: (c.y / (1/sy)) + p.y + s.height/2 + oy - }; + var pixels = Metamaps.Util.coordsToPixels(data.usercoords); $('#compass' + data.userid).css({ left: pixels.x + 'px', top: pixels.y + 'px' @@ -3063,6 +3145,8 @@ Metamaps.Map = { $('.rightclickmenu').remove(); Metamaps.TopicCard.hideCard(); Metamaps.SynapseCard.hideCard(); + Metamaps.Create.newTopic.hide(); + Metamaps.Create.newSynapse.hide(); Metamaps.Realtime.endActiveMap(); } }, diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3474ec04..bf6b19fb 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -183,12 +183,20 @@ input[type="submit"]:active { .edit_user, .forgotPassword { display: block; - width: 250px; + width: 300px; background-color: #E0E0E0; - padding: 20px; + padding: 16px; border-radius: 5px; color: black; box-shadow: 6px 6px 8px rgba(0, 0, 0, 0.4); + top: 50%; + left:50%; + position:absolute; + margin-left: -166px; +} +.forgotPassword { + height: 134px; + margin-top: -83px; } .centerGreyForm input[type="text"], .centerGreyForm input[type="email"], @@ -230,57 +238,55 @@ input[type="submit"]:active { -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } -#closenewtopic, -#closenewsynapse { - position: absolute; - top: 3px; - right: 3px; -} .new_topic { /* start it off screen while it initializes the spinner, then it will be hidden with jquery */ top: -1000px; left: -1000px; display: block; position: absolute; - width: 300px; - margin: -40px 0 0 -50px; -} -.new_synapse { - display: none; - position: absolute; + width: 340px; + margin: -40px 0 0 -35px; + z-index: 1; } + #new_topic .twitter-typeahead { position: absolute !important; top: 40px; - left: 50px; + left: 35px; z-index: 9999; - width: 202px; - height: 37px; - font-family: ':atp'; + width: 270px; + height: 42px; } .new_topic #topic_name, .new_topic .tt-hint { - width: 190px; - background: rgba(0, 0, 0, 0.8); - height: 25px; + width: 254px; + background: #FFFFFF; + height: 14px; margin: 0; - padding: 5px 5px; - border: 1px solid black; + padding: 14px 8px; + border: none; + border-radius: 2px; outline: none; - font-size: 25px; - line-height: 35px; - color: rgba(255, 255, 255, 0.7); + font-size: 14px; + line-height: 14px; + color: #424242; + font-family: 'din-medium', helvetica, sans-serif; +} +.new_topic .tt-hint { + color: #BDBDBD; } .openMetacodeSwitcher { display: block; - height: 20px; - width: 20px; - background-image: url('MMCCicon_metacode_set_change.png'); - background-size: contain; + height: 16px; + width: 16px; + background-image: url(metacodesettings_sprite.png); position: absolute; z-index: 2; top: 20px; - left: 30px; + left: 16px; +} +.openMetacodeSwitcher:hover { + background-position: -16px 0; } #metacodeImg { height: 120px; @@ -289,27 +295,15 @@ input[type="submit"]:active { float: left; width: 120px; text-align: center; - margin-left: 90px; + margin-left: 110px; } /* synapse autocomplete */ - -.new_topic #topic_name { - color: white; -} -.new_topic .tt-hint { - color: grey; -} -.new_topic #topic_name, -.new_topic .tt-hint { - width: 190px; - background: rgba(0, 0, 0, 0.8); - height: 25px; - margin: 0; - padding: 5px 5px; - border: 1px solid black; - outline: none; - font-size: 18px; - line-height: 35px; +.new_synapse { + display: none; + position: absolute; + z-index: 1; + margin-left: -135px; + margin-top: -21px; } .new_synapse #synapse_desc { color: rgba(255, 255, 255, 0.7); @@ -319,15 +313,18 @@ input[type="submit"]:active { } .new_synapse #synapse_desc, .new_synapse .tt-hint { - width: 200px; - background: rgba(0, 0, 0, 0.8); - height: 18px; + width: 254px; + background: #FFFFFF; + height: 14px; margin: 0; - padding: 5px 5px; - border: 1px solid black; + padding: 14px 8px; + border: none; + border-radius: 2px; outline: none; - font-size: 16px; - line-height: 20px; + font-size: 14px; + line-height: 14px; + color: #424242; + font-family: 'din-medium', helvetica, sans-serif; } label, select, @@ -907,35 +904,98 @@ float: left; #new_topic .tt-suggestion.tt-is-under-cursor, #new_topic .tt-suggestion.tt-is-under-mouse-cursor { - background: #0E161D; + background: #E0E0E0; } #new_topic .tt-suggestion { - padding: 5px; - background: rgba(42, 52, 60, 0.9); - ; + background: #F5F5F5; + width: 270px; + position: relative; } #new_topic .autocompleteSection { float: left; } +#new_topic .topicType { + padding: 4px 0 0 4px; +} #new_topic .topicTitle { - width: 130px; - line-height: 22px; + width: 190px; + line-height: 14px; + font-size: 14px; + padding: 9px 0 9px 4px; +} +#new_topic .expandTopicMetadata { + display:none; + width: 16px; + height: 16px; + position: absolute; + top: 8px; + right: 8px; + background-repeat: no-repeat; + background-image: url(arrowright_sprite.png); + background-position: 0 -32px; +} +#new_topic .tt-suggestion.tt-is-under-cursor .expandTopicMetadata, +#new_topic .tt-suggestion.tt-is-under-mouse-cursor .expandTopicMetadata { + display: block; +} +#new_topic .tt-suggestion.tt-is-under-cursor .topicMetadata, +#new_topic .tt-suggestion.tt-is-under-mouse-cursor .topicMetadata { + display: block; +} +#new_topic .topicMetadata { + position: absolute; + display: none; + top: -18px; + right: -100px; + width: 100px; + height: 70px; + background-color: #E0E0E0; + font-family: 'din-regular', helvetica, sans-serif; + font-size: 14px; } #new_topic .topicPermission { - width: 20px; - height: 20px; + width: 32px; + height: 32px; background-repeat: no-repeat; - background-position: center center; - background-size: 16px 16px; + background-image: url(permissions32_sprite.png); + position: absolute; + bottom: 4px; + right: 4px; +} +#new_topic .topicPermission.commons { + background-position: 0 0; +} +#new_topic .topicPermission.public { + background-position: -64px 0; +} +#new_topic .topicPermission.private { + background-position: -32px 0; +} +#new_topic .topicNumMaps { + height: 14px; + padding: 1px 0 1px 32px; + background-image: url(metamap16.png); + background-repeat: no-repeat; + background-position: 8px 0; + position: absolute; + top: 10px; +} +#new_topic .topicNumSynapses { + height: 14px; + padding: 1px 0 1px 32px; + background-image: url(synapse16.png); + background-repeat: no-repeat; + background-position: 8px 0; + position: absolute; + bottom: 10px; } #new_topic .topicOriginatorIcon { - position: relative; - width: 20px; - height: 20px; - background-repeat: no-repeat; - background-position: center center; - background-size: 16px 16px; - background-image: url(MMCCicon_mapper.png); + position: absolute; + top: 8px; + right: 8px; +} +#new_topic .topicOriginatorIcon img { + border-radius: 12px; } #new_topic .topicOriginatorIcon:hover .tip { display: block; @@ -1195,7 +1255,7 @@ float: left; display: none; } #lightbox_main { - width: 770px; + width: 800px; height: auto; margin: 0 auto; z-index: 2; @@ -1223,24 +1283,22 @@ float: left; border: solid 2px #000; } #lightbox_overlay #lightbox_main a#lightbox_close { - /*background-image: url(../images/barometer_close.png);*/ + background-image: url(xlightbox.png); cursor: pointer; - height: 42px; - outline-color: -moz-use-text-color; + height: 32px; outline-style: none; outline-width: medium; overflow: hidden; position: absolute; - top: -23px; - right: -22px; - width: 42px; + top: -8px; + right: -32px; + width: 32px; z-index: 4; border: none; + background-repeat: no-repeat; + background-position: center center; } #lightbox_content { -/* background: white url(metacode-watermark.png) 443px -30px no-repeat; - padding: 20px; - border-radius: 5px;*/ width: 552px; height: 434px; background-color: #e0e0e0; @@ -1429,6 +1487,7 @@ float: left; } #metacodeSwitchTabs > ul li { font-size: 14px; + text-transform: uppercase; } #metacodeSwitchTabs li.ui-state-active a { color: #00BCD4; @@ -1436,9 +1495,8 @@ float: left; .customMetacodeList, .metacodeSetList { height: 301px; - overflow: hidden; + overflow-y: auto; margin: 5px 0 15px 0; - /* border-bottom: 1px solid #BBB;*/ } .customMetacodeList ul li { cursor: pointer; @@ -1657,6 +1715,7 @@ float: left; } .permText { width: 360px; + height: 32px; margin: 16px 20px 0; text-align: center; float: right; @@ -1734,6 +1793,9 @@ float: left; #helpWrapper li:hover, #helpWrapper li.ui-state-active { border-bottom: 2px solid #00BCD4; } +#helpWrapper li.ui-state-active a, #helpWrapper li.ui-state-hover a { + color: #424242; +} #helpWrapper li a { padding: 0; font-family: 'din-medium', helvetica, sans-serif; @@ -1742,6 +1804,9 @@ float: left; #quickReference { padding: 32px 0 0 0; } +#quickReference .ui-widget-content { + color: #424242; +} #quickReference ul { width: 150px; } @@ -1768,6 +1833,35 @@ float: left; #upYourSkillz { margin: 0 68px; } +#moreResources { + padding: 16px 0 0 0; + font-size: 14px; + line-height: 18px; + color: #424242; +} +.resourcesColumn { + margin-top: 32px; + width: 273px; + display: inline-block; + text-align: center; + text-transform: uppercase; +} +.resourcesColumn ul { + list-style: none; +} +.resourcesColumn li { + margin-top: 16px; +} +.resourcesColumn a.button { + background-color: #00BCD4; + color: #FFF; + padding-top: 8px; + height: 24px; +} +.resourcesColumn li a { + color: #424242; +} + /* Admin Pages */ .blackBox { @@ -1900,8 +1994,8 @@ float: left; #wrapper .requestInvite { width: 700px; margin: 0 auto; - padding: 20px; - background: rgba(0, 0, 0, 0.4); + padding: 0 0 60px 0; + background: #FFFFFF; color: white; height: 100%; overflow: hidden; @@ -1948,4 +2042,4 @@ float: left; border: 2px solid #4fb5c0; z-index: 2; -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/base.css b/app/assets/stylesheets/base.css index eccc8365..cfa49d44 100644 --- a/app/assets/stylesheets/base.css +++ b/app/assets/stylesheets/base.css @@ -288,21 +288,29 @@ cursor: pointer; position: absolute; line-height: 24px; height:24px; - font-size: 20px; + font-size: 24px; display: none; width: 90%; - padding: 11px 0 11px 10%; + padding: 13px 0 9px 10%; background-color: #64BC61; - color: #000; + color: #424242; } .permission.canEdit .metacodeTitle { cursor:pointer; - background-image: url(MMCCicon_maximize_arrow_black.png); - background-repeat:no-repeat; - background-position: right center; } -.permission.canEdit .metacodeTitle.minimize { - background-image: url(MMCCicon_minimize_arrow_black.png); + +.permission.canEdit .expandMetacodeSelect { + position: absolute; + top: 16px; + right: 16px; + width: 16px; + height: 16px; + background-image: url(arrowright_sprite.png); + background-repeat: no-repeat; + background-position: 0 -32px; +} +.permission.canEdit .minimize .expandMetacodeSelect { + } .CardOnGraph .metacodeImage { @@ -322,38 +330,61 @@ cursor: pointer; } .CardOnGraph .metacodeSelect { display:none; - width:100%; + width:200px; z-index: 2; position: absolute; background: #EAEAEA; - height: 150px; + left: 300px; } .CardOnGraph .metacodeSelect ul { -font-style: italic; -font-family: 'vinyl'; -text-transform: uppercase; -position: absolute; -line-height: 36px; -font-size: 20px; -display:block; -width: 100%; -margin:0; -padding: 0; -list-style:none; -height:150px; -overflow:hidden; + position: relative; + line-height: 14px; + font-size: 14px; + font-family: helvetica, sans-serif; + display:block; + width: 100%; + margin:0; + padding: 0; + list-style:none; + border: 1px solid #BDBDBD; } .CardOnGraph .metacodeSelect ul li { -background-color: #EAEAEA; -width:100%; -border-bottom:1px solid #AAAAAA; +background-color: #F5F5F5; cursor:pointer; +position: relative; +padding: 9px 12px; } .CardOnGraph .metacodeSelect ul li:hover { -background-color: #F8F8F8; +background-color: #E0E0E0; } -.CardOnGraph .metacodeSelect ul li img, .CardOnGraph .metacodeSelect ul li .mSelectName { -float:left; +.CardOnGraph .metacodeSelect ul li img { + position: absolute; + top: 4px; + left: 8px; +} +.CardOnGraph .metacodeSelect ul li .mSelectName { + padding-left: 28px; +} +.CardOnGraph .metacodeSelect ul ul { + display:none; + position: absolute; + left: 200px; + top: 0; + max-height: 270px; + overflow-y: auto; +} +.CardOnGraph .metacodeSelect li:hover ul { + display: block; +} +.CardOnGraph .metacodeSelect .expandMetacodeSet { + position: absolute; + top: 8px; + right: 8px; + width: 16px; + height: 16px; + background-image: url(arrowright_sprite.png); + background-repeat: no-repeat; + background-position: 0 -32px; } .CardOnGraph .hoverForTip:hover .tip, .mapCard .hoverForTip:hover .tip { @@ -373,6 +404,13 @@ float:left; z-index:100; } +#embedlyLink { + display: none; +} +#embedlyLinkLoader { + margin: 0 auto; + width: 28px; +} .CardOnGraph .attachments { border-top: 1px solid #BDBDBD; @@ -479,23 +517,19 @@ font-family: 'din-regular', helvetica, sans-serif; position: relative; } +.CardOnGraph .embeds { + position: relative; +} #linkremove { - height: 12px; - padding: 26px 0 10px; - font-size: 12px; background-image: url(/assets/remove.png); background-repeat: no-repeat; - background-position: center 8px; - width: 48px; - text-align: center; + background-position: center center; + width: 24px; + height: 24px; position: absolute; - top: 0; - right: 8px; + top: 3px; + right: 0; cursor: pointer; - color: #9E9E9E; -} -#linkremove:hover { - color: #616161; } .cardSettings { diff --git a/app/helpers/topics_helper.rb b/app/helpers/topics_helper.rb index f6587c4c..84c0d9a7 100644 --- a/app/helpers/topics_helper.rb +++ b/app/helpers/topics_helper.rb @@ -15,6 +15,7 @@ module TopicsHelper topic['mapCount'] = t.maps.count topic['synapseCount'] = t.synapses.count topic['originator'] = t.user.name + topic['originatorImage'] = t.user.image topic['rtype'] = "topic" temp.push topic diff --git a/app/views/layouts/_templates.html.erb b/app/views/layouts/_templates.html.erb index e48dc57b..a8f10590 100644 --- a/app/views/layouts/_templates.html.erb +++ b/app/views/layouts/_templates.html.erb @@ -167,11 +167,17 @@ @@ -191,8 +197,12 @@