Bug 647578: [meta] twitter ui tracking, intermediate merge for UI testing, r=mixedpuppy.

Merge branch 'bug/647578-twitterui' into develop
This commit is contained in:
jrburke 2011-05-02 12:20:35 -07:00
Родитель 9e6303499a d5ef833f0e
Коммит b2bb779f6e
16 изменённых файлов: 401 добавлений и 49 удалений

Просмотреть файл

@ -1,4 +1,4 @@
version = $(shell cat version.txt)
version=$(shell cat version.txt)
ifeq ($(TOPSRCDIR),)
export TOPSRCDIR = $(shell pwd)
@ -15,10 +15,8 @@ $(static_dir):
find $(static_dir) -name \*.html | xargs perl -i -pe 's:/dev/:/$(version)/:go'
perl -i -pe 's:/dev/:/$(version)/:go' $(static_dir)/scripts/oauth.js
cd $(static_dir) && $(requirejs_dir)/build/build.sh build.js
cd $(static_dir)/settings && $(requirejs_dir)/build/build.sh build.js
cd $(static_dir)/share && $(requirejs_dir)/build/build.sh build.js
cd $(static_dir)/share/panel && $(requirejs_dir)/build/build.sh build.js
cd $(static_dir)/1/settings && $(requirejs_dir)/build/build.sh build.js
cd $(static_dir)/1/share/panel && $(requirejs_dir)/build/build.sh build.js
dist: web
mkdir -p dist

Просмотреть файл

@ -49,6 +49,8 @@ function ($, object, fn, module, dispatch,
this.attachedWidget = false;
this.acOptions = [];
this.orient = contactService.svc.features.subject ? 'below' : 'above';
// Listen for changes to the contacts.
contactService.notify(fn.bind(this, this.attachAutoComplete));
@ -127,6 +129,13 @@ function ($, object, fn, module, dispatch,
}))
.autocomplete({
minLength: 0,
position: this.orient === 'above' ? {
my: 'right bottom',
at: 'right top'
} : {
my: 'right top',
at: 'right bottom'
},
source: fn.bind(this, function (request, response) {
// delegate back to autocomplete, but extract the last term
this.filtered = $.ui.autocomplete.filter(this.acOptions, extractLast(request.term));
@ -202,6 +211,7 @@ function ($, object, fn, module, dispatch,
if (!this.refreshDom) {
this.refreshDom = $(refreshHtml)
.addClass(this.orient)
.css({
width: this.relatedWidth + 'px'
})

Просмотреть файл

@ -11,13 +11,19 @@
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
height: 24px;
cursor: pointer;
color: #e2e2e2;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #767676), color-stop(100%, #545454));
background-image: -moz-linear-gradient(center top , #767676 0%, #545454 100%);
text-align: left;
border-radius: 4px;
}
.win .Select,
.linux .Select {
border: 1px solid #85818C;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #FDFDFD), color-stop(100%, #DDDBDC));
background-image: -moz-linear-gradient(center top , #FDFDFD 0%, #DDDBDC 100%);
}
.Select.open {
padding-right: 0;
border: 0;
@ -36,6 +42,12 @@
border: 1px solid gray;
}
.win .Select.open ul,
.linux .Select.open ul {
background-image: none;
background-color: white;
}
.Select li {
display: none;
height: 0;
@ -66,6 +78,14 @@
background-color: #2b2b2b;
}
.win .Select.open li.selected:hover,
.win .Select.open li:hover,
.linux .Select.open li.selected:hover,
.linux .Select.open li:hover {
color: inherit;
background-color: #E1E9F6;
}
.Select .triangle {
position: absolute;
right: 0;

73
dev/1/scripts/less.js Normal file
Просмотреть файл

@ -0,0 +1,73 @@
//
// LESS - Leaner CSS v1.0.41
// http://lesscss.org
//
// Copyright (c) 2010, Alexis Sellier
// Licensed under the Apache 2.0 License.
//
(function(z){function s(d){return z.less[d.split("/")[1]]}function U(){for(var d=document.getElementsByTagName("style"),b=0;b<d.length;b++)if(d[b].type.match(V))(new o.Parser).parse(d[b].innerHTML||"",function(a,g){d[b].type="text/css";d[b].innerHTML=g.toCSS()})}function W(d,b){for(var a=0;a<o.sheets.length;a++)X(o.sheets[a],d,b,o.sheets.length-(a+1))}function X(d,b,a,g){var e=z.location.href.replace(/[#?].*$/,""),h=d.href.replace(/\?.*$/,""),i=B&&B.getItem(h),k=B&&B.getItem(h+":timestamp"),n={css:i,
timestamp:k};/^(https?|file):/.test(h)||(h=e.slice(0,e.lastIndexOf("/")+1)+h);Z(d.href,d.type,function(r,p){if(!a&&n&&p&&(new Date(p)).valueOf()===(new Date(n.timestamp)).valueOf()){N(n.css,d);b(null,d,{local:true,remaining:g})}else try{(new o.Parser({optimization:o.optimization,paths:[h.replace(/[\w\.-]+$/,"")],mime:d.type})).parse(r,function(K,O){if(K)return Q(K,h);try{b(O,d,{local:false,lastModified:p,remaining:g});var F=document.getElementById("less-error-message:"+R(h));F&&F.parentNode.removeChild(F)}catch(f){Q(f,
h)}})}catch(t){Q(t,h)}},function(r,p){throw Error("Couldn't load "+p+" ("+r+")");})}function R(d){return d.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function N(d,b,a){var g,e=b.href?b.href.replace(/\?.*$/,""):"",h="less:"+(b.title||R(e));if((g=document.getElementById(h))===null){g=document.createElement("style");g.type="text/css";g.media=b.media||"screen";g.id=h;document.getElementsByTagName("head")[0].appendChild(g)}if(g.styleSheet)try{g.styleSheet.cssText=
d}catch(i){throw Error("Couldn't reassign styleSheet.cssText.");}else(function(k){if(g.childNodes.length>0)g.firstChild.nodeValue!==k.nodeValue&&g.replaceChild(k,g.firstChild);else g.appendChild(k)})(document.createTextNode(d));if(a&&B){H("saving "+e+" to cache.");B.setItem(e,d);B.setItem(e+":timestamp",a)}}function Z(d,b,a,g){function e(k,n,r){if(k.status>=200&&k.status<300)n(k.responseText,k.getResponseHeader("Last-Modified"));else typeof r==="function"&&r(k.status,d)}var h=$(),i=P?false:o.async;
typeof h.overrideMimeType==="function"&&h.overrideMimeType("text/css");h.open("GET",d,i);h.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5");h.send(null);if(P)h.status===0?a(h.responseText):g(h.status,d);else if(i)h.onreadystatechange=function(){h.readyState==4&&e(h,a,g)};else e(h,a,g)}function $(){if(z.XMLHttpRequest)return new XMLHttpRequest;else try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(d){H("browser doesn't support AJAX.");return null}}function H(d){o.env==
"development"&&typeof console!=="undefined"&&console.log("less: "+d)}function Q(d,b){var a="less-error-message:"+R(b),g=document.createElement("div"),e,h;g.id=a;g.className="less-error-message";h="<h3>"+(d.message||"There is an error in your .less file")+'</h3><p><a href="'+b+'">'+b+"</a> ";if(d.extract)h+="on line "+d.line+", column "+(d.column+1)+":</p>"+'<ul>\n<li><label>[-1]</label><pre class="ctx">{0}</pre></li>\n<li><label>[0]</label><pre>{current}</pre></li>\n<li><label>[1]</label><pre class="ctx">{2}</pre></li>\n</ul>'.replace(/\[(-?\d)\]/g,
function(i,k){return parseInt(d.line)+parseInt(k)||""}).replace(/\{(\d)\}/g,function(i,k){return d.extract[parseInt(k)]||""}).replace(/\{current\}/,d.extract[1].slice(0,d.column)+'<span class="error">'+d.extract[1].slice(d.column)+"</span>");g.innerHTML=h;N(".less-error-message ul, .less-error-message li {\nlist-style-type: none;\nmargin-right: 15px;\npadding: 4px 0;\nmargin: 0;\n}\n.less-error-message label {\nfont-size: 12px;\nmargin-right: 15px;\npadding: 4px 0;\ncolor: #cc7777;\n}\n.less-error-message pre {\ncolor: #ee4444;\npadding: 4px 0;\nmargin: 0;\ndisplay: inline-block;\n}\n.less-error-message pre.ctx {\ncolor: #dd4444;\n}\n.less-error-message h3 {\nfont-size: 20px;\nfont-weight: bold;\npadding: 15px 0 5px 0;\nmargin: 0;\n}\n.less-error-message a {\ncolor: #10a\n}\n.less-error-message .error {\ncolor: red;\nfont-weight: bold;\npadding-bottom: 2px;\nborder-bottom: 1px dashed red;\n}",
{title:"error-message"});g.style.cssText="font-family: Arial, sans-serif;border: 1px solid #e00;background-color: #eee;border-radius: 5px;-webkit-border-radius: 5px;-moz-border-radius: 5px;color: #e00;padding: 15px;margin-bottom: 15px";if(o.env=="development")e=setInterval(function(){if(document.body){document.getElementById(a)?document.body.replaceChild(g,document.getElementById(a)):document.body.insertBefore(g,document.body.firstChild);clearInterval(e)}},10)}if(!Array.isArray)Array.isArray=function(d){return Object.prototype.toString.call(d)===
"[object Array]"||d instanceof Array};if(!Array.prototype.forEach)Array.prototype.forEach=function(d,b){for(var a=this.length>>>0,g=0;g<a;g++)g in this&&d.call(b,this[g],g,this)};if(!Array.prototype.map)Array.prototype.map=function(d,b){for(var a=this.length>>>0,g=Array(a),e=0;e<a;e++)if(e in this)g[e]=d.call(b,this[e],e,this);return g};if(!Array.prototype.filter)Array.prototype.filter=function(d,b){for(var a=[],g=0;g<this.length;g++)d.call(b,this[g])&&a.push(this[g]);return a};if(!Array.prototype.reduce)Array.prototype.reduce=
function(d){var b=this.length>>>0,a=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var g=arguments[1];else{do{if(a in this){g=this[a++];break}if(++a>=b)throw new TypeError;}while(1)}for(;a<b;a++)if(a in this)g=d.call(null,g,this[a],a,this);return g};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(d,b){var a=this.length,g=b||0;if(!a)return-1;if(g>=a)return-1;if(g<0)g+=a;for(;g<a;g++)if(Object.prototype.hasOwnProperty.call(this,g))if(d===this[g])return g;return-1};
if(!Object.keys)Object.keys=function(d){var b=[],a;for(a in d)Object.prototype.hasOwnProperty.call(d,a)&&b.push(a);return b};if(!String.prototype.trim)String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var o,m;if(typeof z==="undefined"){o=exports;m=s("less/tree")}else{if(typeof z.less==="undefined")z.less={};o=z.less;m=z.less.tree={}}o.Parser=function(d){function b(){if(h>t){p[i]=p[i].slice(h-t);t=h}}function a(f){var j,l,q;if(f instanceof Function)return f.call(K.parsers);
else if(typeof f==="string"){f=e.charAt(h)===f?f:null;j=1;b()}else{b();if(f=f.exec(p[i]))j=f[0].length;else return null}if(f){mem=h+=j;for(q=h+p[i].length-j;h<q;){l=e.charCodeAt(h);if(!(l===32||l===10||l===9))break;h++}p[i]=p[i].slice(j+(h-mem));t=h;p[i].length===0&&i<p.length-1&&i++;return typeof f==="string"?f:f.length===1?f[0]:f}}function g(f){return typeof f==="string"?e.charAt(h)===f:f.test(p[i])?true:false}var e,h,i,k,n,r,p,t,K,O=function(){},F=this.imports={paths:d&&d.paths||[],queue:[],files:{},
mime:d&&d.mime,push:function(f,j){var l=this;this.queue.push(f);o.Parser.importer(f,this.paths,function(q){l.queue.splice(l.queue.indexOf(f),1);l.files[f]=q;j(q);l.queue.length===0&&O()},d)}};this.env=d=d||{};this.optimization="optimization"in this.env?this.env.optimization:1;this.env.filename=this.env.filename||null;return K={imports:F,parse:function(f,j){var l,q,I,S=null;h=i=t=r=0;p=[];e=f.replace(/\r\n/g,"\n");p=function(L){for(var D=0,E=/[^"'`\{\}\/]+/g,G=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
A=0,w,x=L[0],y,u=0,v;u<e.length;u++){E.lastIndex=u;if(w=E.exec(e))if(w.index===u){u+=w[0].length;x.push(w[0])}v=e.charAt(u);G.lastIndex=u;if(!y&&v==="/"){w=e.charAt(u+1);if(w==="/"||w==="*")if(w=G.exec(e))if(w.index===u){u+=w[0].length;x.push(w[0]);v=e.charAt(u)}}if(v==="{"&&!y){A++;x.push(v)}else if(v==="}"&&!y){A--;x.push(v);L[++D]=x=[]}else{if(v==='"'||v==="'"||v==="`")y=y?y===v?false:y:v;x.push(v)}}if(A>0)throw{type:"Syntax",message:"Missing closing `}`",filename:d.filename};return L.map(function(C){return C.join("")})}([[]]);
l=new m.Ruleset([],a(this.parsers.primary));l.root=true;l.toCSS=function(L){var D,E;return function(G,A){function w(v){return v?(e.slice(0,v).match(/\n/g)||"").length:null}var x=[];G=G||{};if(typeof A==="object"&&!Array.isArray(A)){A=Object.keys(A).map(function(v){var C=A[v];if(!(C instanceof m.Value)){C instanceof m.Expression||(C=new m.Expression([C]));C=new m.Value([C])}return new m.Rule("@"+v,C,false,0)});x=[new m.Ruleset(null,A)]}try{var y=L.call(this,{frames:x}).toCSS([],{compress:G.compress||
false})}catch(u){E=e.split("\n");D=w(u.index);x=u.index;for(y=-1;x>=0&&e.charAt(x)!=="\n";x--)y++;throw{type:u.type,message:u.message,filename:d.filename,index:u.index,line:typeof D==="number"?D+1:null,callLine:u.call&&w(u.call)+1,callExtract:E[w(u.call)],stack:u.stack,column:y,extract:[E[D-1],E[D],E[D+1]]};}return G.compress?y.replace(/(\s)+/g,"$1"):y}}(l.eval);if(h<e.length-1){h=r;I=e.split("\n");q=(e.slice(0,h).match(/\n/g)||"").length+1;for(var T=h,Y=-1;T>=0&&e.charAt(T)!=="\n";T--)Y++;S={name:"ParseError",
message:"Syntax Error on line "+q,filename:d.filename,line:q,column:Y,extract:[I[q-2],I[q-1],I[q]]}}if(this.imports.queue.length>0)O=function(){j(S,l)};else j(S,l)},parsers:{primary:function(){for(var f,j=[];(f=a(this.mixin.definition)||a(this.rule)||a(this.ruleset)||a(this.mixin.call)||a(this.comment)||a(this.directive))||a(/^[\s\n]+/);)f&&j.push(f);return j},comment:function(){var f;if(e.charAt(h)==="/")if(e.charAt(h+1)==="/")return new m.Comment(a(/^\/\/.*/),true);else if(f=a(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new m.Comment(f)},
entities:{quoted:function(){var f;if(!(e.charAt(h)!=='"'&&e.charAt(h)!=="'"))if(f=a(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new m.Quoted(f[0],f[1]||f[2])},keyword:function(){var f;if(f=a(/^[A-Za-z-]+/))return new m.Keyword(f)},call:function(){var f,j;if(f=/^([\w-]+|%)\(/.exec(p[i])){f=f[1].toLowerCase();if(f==="url")return null;else h+=f.length+1;if(f==="alpha")return a(this.alpha);j=a(this.entities.arguments);if(a(")"))if(f)return new m.Call(f,j)}},arguments:function(){for(var f=
[],j;j=a(this.expression);){f.push(j);if(!a(","))break}return f},literal:function(){return a(this.entities.dimension)||a(this.entities.color)||a(this.entities.quoted)},url:function(){var f;if(!(e.charAt(h)!=="u"||!a(/^url\(/))){f=a(this.entities.quoted)||a(this.entities.variable)||a(this.entities.dataURI)||a(/^[-\w%@$\/.&=:;#+?]+/)||"";if(!a(")"))throw Error("missing closing ) for url()");return new m.URL(f.value||f.data||f instanceof m.Variable?f:new m.Anonymous(f),F.paths)}},dataURI:function(){var f;
if(a(/^data:/)){f={};f.mime=a(/^[^\/]+\/[^,;)]+/)||"";f.charset=a(/^;\s*charset=[^,;)]+/)||"";f.base64=a(/^;\s*base64/)||"";f.data=a(/^,\s*[^)]+/);if(f.data)return f}},variable:function(){var f,j=h;if(e.charAt(h)==="@"&&(f=a(/^@[\w-]+/)))return new m.Variable(f,j)},color:function(){var f;if(e.charAt(h)==="#"&&(f=a(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new m.Color(f[1])},dimension:function(){var f;f=e.charCodeAt(h);if(!(f>57||f<45||f===47))if(f=a(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new m.Dimension(f[1],
f[2])},javascript:function(){var f;if(e.charAt(h)==="`")if(f=a(/^`([^`]*)`/))return new m.JavaScript(f[1],h)}},variable:function(){var f;if(e.charAt(h)==="@"&&(f=a(/^(@[\w-]+)\s*:/)))return f[1]},shorthand:function(){var f,j;if(g(/^[@\w.%-]+\/[@\w.-]+/))if((f=a(this.entity))&&a("/")&&(j=a(this.entity)))return new m.Shorthand(f,j)},mixin:{call:function(){var f=[],j,l,q,I=h;j=e.charAt(h);if(!(j!=="."&&j!=="#")){for(;j=a(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/);){f.push(new m.Element(l,
j));l=a(">")}a("(")&&(q=a(this.entities.arguments))&&a(")");if(f.length>0&&(a(";")||g("}")))return new m.mixin.Call(f,q,I)}},definition:function(){var f,j=[],l,q;if(!(e.charAt(h)!=="."&&e.charAt(h)!=="#"||g(/^[^{]*(;|})/)))if(f=a(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)){for(f=f[1];l=a(this.entities.variable)||a(this.entities.literal)||a(this.entities.keyword);){if(l instanceof m.Variable)if(a(":"))if(q=a(this.expression))j.push({name:l.name,value:q});else throw Error("Expected value");
else j.push({name:l.name});else j.push({value:l});if(!a(","))break}if(!a(")"))throw Error("Expected )");if(l=a(this.block))return new m.mixin.Definition(f,j,l)}}},entity:function(){return a(this.entities.literal)||a(this.entities.variable)||a(this.entities.url)||a(this.entities.call)||a(this.entities.keyword)||a(this.entities.javascript)},end:function(){return a(";")||g("}")},alpha:function(){var f;if(a(/^opacity=/i))if(f=a(/^\d+/)||a(this.entities.variable)){if(!a(")"))throw Error("missing closing ) for alpha()");
return new m.Alpha(f)}},element:function(){var f;c=a(this.combinator);if(f=a(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)||a("*")||a(this.attribute)||a(/^\([^)@]+\)/))return new m.Element(c,f)},combinator:function(){var f=e.charAt(h);if(f===">"||f==="&"||f==="+"||f==="~"){for(h++;e.charAt(h)===" ";)h++;return new m.Combinator(f)}else if(f===":"&&e.charAt(h+1)===":"){for(h+=2;e.charAt(h)===" ";)h++;return new m.Combinator("::")}else return e.charAt(h-1)===" "?new m.Combinator(" "):
new m.Combinator(null)},selector:function(){for(var f,j=[],l;f=a(this.element);){l=e.charAt(h);j.push(f);if(l==="{"||l==="}"||l===";"||l===",")break}if(j.length>0)return new m.Selector(j)},tag:function(){return a(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||a("*")},attribute:function(){var f="",j,l,q;if(a("[")){if(j=a(/^[a-zA-Z-]+/)||a(this.entities.quoted))f=(q=a(/^[|~*$^]?=/))&&(l=a(this.entities.quoted)||a(/^[\w-]+/))?[j,q,l.toCSS?l.toCSS():l].join(""):j;if(a("]"))if(f)return"["+f+"]"}},block:function(){var f;
if(a("{")&&(f=a(this.primary))&&a("}"))return f},ruleset:function(){var f=[],j,l;k=p[i];t=n=h;if(j=/^([.#: \w-]+)[\s\n]*\{/.exec(p[i])){h+=j[0].length-1;f=[new m.Selector([new m.Element(null,j[1])])]}else{for(;j=a(this.selector);){f.push(j);if(!a(","))break}j&&a(this.comment)}if(f.length>0&&(l=a(this.block)))return new m.Ruleset(f,l);else{r=h;p[i]=k;t=h=n}},rule:function(){var f,j;f=e.charAt(h);var l;k=p[i];t=n=h;if(!(f==="."||f==="#"||f==="&"))if(f=a(this.variable)||a(this.property)){if(f.charAt(0)!=
"@"&&(match=/^([^@+\/'"*`(;{}-]*);/.exec(p[i]))){h+=match[0].length-1;j=new m.Anonymous(match[1])}else j=f==="font"?a(this.font):a(this.value);l=a(this.important);if(j&&a(this.end))return new m.Rule(f,j,l,n);else{r=h;p[i]=k;t=h=n}}},"import":function(){var f;if(a(/^@import\s+/)&&(f=a(this.entities.quoted)||a(this.entities.url))&&a(";"))return new m.Import(f,F)},directive:function(){var f,j,l;if(e.charAt(h)==="@")if(j=a(this["import"]))return j;else if(f=a(/^@media|@page/)){l=(a(/^[^{]+/)||"").trim();
if(j=a(this.block))return new m.Directive(f+" "+l,j)}else if(f=a(/^@[-a-z]+/))if(f==="@font-face"){if(j=a(this.block))return new m.Directive(f,j)}else if((j=a(this.entity))&&a(";"))return new m.Directive(f,j)},font:function(){for(var f=[],j=[],l;l=a(this.shorthand)||a(this.entity);)j.push(l);f.push(new m.Expression(j));if(a(","))for(;l=a(this.expression);){f.push(l);if(!a(","))break}return new m.Value(f)},value:function(){for(var f,j=[];f=a(this.expression);){j.push(f);if(!a(","))break}if(j.length>
0)return new m.Value(j)},important:function(){if(e.charAt(h)==="!")return a(/^! *important/)},sub:function(){var f;if(a("(")&&(f=a(this.expression))&&a(")"))return f},multiplication:function(){var f,j,l,q;if(f=a(this.operand)){for(;(l=a("/")||a("*"))&&(j=a(this.operand));)q=new m.Operation(l,[q||f,j]);return q||f}},addition:function(){var f,j,l,q;if(f=a(this.multiplication)){for(;(l=a(/^[-+]\s+/)||e.charAt(h-1)!=" "&&(a("+")||a("-")))&&(j=a(this.multiplication));)q=new m.Operation(l,[q||f,j]);return q||
f}},operand:function(){return a(this.sub)||a(this.entities.dimension)||a(this.entities.color)||a(this.entities.variable)||a(this.entities.call)},expression:function(){for(var f,j=[];f=a(this.addition)||a(this.entity);)j.push(f);if(j.length>0)return new m.Expression(j)},property:function(){var f;if(f=a(/^(\*?-?[-a-z_0-9]+)\s*:/))return f[1]}}}};if(typeof z!=="undefined")o.Parser.importer=function(d,b,a,g){if(d.charAt(0)!=="/"&&b.length>0)d=b[0]+d;X({href:d,title:d,type:g.mime},a,true)};(function(d){function b(e){return d.functions.hsla(e.h,
e.s,e.l,e.a)}function a(e){if(e instanceof d.Dimension)return parseFloat(e.unit=="%"?e.value/100:e.value);else if(typeof e==="number")return e;else throw{error:"RuntimeError",message:"color functions take numbers as parameters"};}function g(e){return Math.min(1,Math.max(0,e))}d.functions={rgb:function(e,h,i){return this.rgba(e,h,i,1)},rgba:function(e,h,i,k){e=[e,h,i].map(function(n){return a(n)});k=a(k);return new d.Color(e,k)},hsl:function(e,h,i){return this.hsla(e,h,i,1)},hsla:function(e,h,i,k){function n(t){t=
t<0?t+1:t>1?t-1:t;return t*6<1?p+(r-p)*t*6:t*2<1?r:t*3<2?p+(r-p)*(2/3-t)*6:p}e=a(e)%360/360;h=a(h);i=a(i);k=a(k);var r=i<=0.5?i*(h+1):i+h-i*h,p=i*2-r;return this.rgba(n(e+1/3)*255,n(e)*255,n(e-1/3)*255,k)},hue:function(e){return new d.Dimension(Math.round(e.toHSL().h))},saturation:function(e){return new d.Dimension(Math.round(e.toHSL().s*100),"%")},lightness:function(e){return new d.Dimension(Math.round(e.toHSL().l*100),"%")},alpha:function(e){return new d.Dimension(e.toHSL().a)},saturate:function(e,
h){var i=e.toHSL();i.s+=h.value/100;i.s=g(i.s);return b(i)},desaturate:function(e,h){var i=e.toHSL();i.s-=h.value/100;i.s=g(i.s);return b(i)},lighten:function(e,h){var i=e.toHSL();i.l+=h.value/100;i.l=g(i.l);return b(i)},darken:function(e,h){var i=e.toHSL();i.l-=h.value/100;i.l=g(i.l);return b(i)},fadein:function(e,h){var i=e.toHSL();i.a+=h.value/100;i.a=g(i.a);return b(i)},fadeout:function(e,h){var i=e.toHSL();i.a-=h.value/100;i.a=g(i.a);return b(i)},spin:function(e,h){var i=e.toHSL(),k=(i.h+h.value)%
360;i.h=k<0?360+k:k;return b(i)},mix:function(e,h,i){i=i.value/100;var k=i*2-1,n=e.toHSL().a-h.toHSL().a;k=((k*n==-1?k:(k+n)/(1+k*n))+1)/2;n=1-k;return new d.Color([e.rgb[0]*k+h.rgb[0]*n,e.rgb[1]*k+h.rgb[1]*n,e.rgb[2]*k+h.rgb[2]*n],e.alpha*i+h.alpha*(1-i))},greyscale:function(e){return this.desaturate(e,new d.Dimension(100))},e:function(e){return new d.Anonymous(e instanceof d.JavaScript?e.evaluated:e)},"%":function(e){for(var h=Array.prototype.slice.call(arguments,1),i=e.value,k=0;k<h.length;k++)i=
i.replace(/%s/,h[k].value).replace(/%[da]/,h[k].toCSS());i=i.replace(/%%/g,"%");return new d.Quoted('"'+i+'"',i)}}})(s("less/tree"));(function(d){d.Alpha=function(b){this.value=b};d.Alpha.prototype={toCSS:function(){return"alpha(opacity="+(this.value.toCSS?this.value.toCSS():this.value)+")"},eval:function(){return this}}})(s("less/tree"));(function(d){d.Anonymous=function(b){this.value=b.value||b};d.Anonymous.prototype={toCSS:function(){return this.value},eval:function(){return this}}})(s("less/tree"));
(function(d){d.Call=function(b,a){this.name=b;this.args=a};d.Call.prototype={eval:function(b){var a=this.args.map(function(g){return g.eval(b)});return this.name in d.functions?d.functions[this.name].apply(d.functions,a):new d.Anonymous(this.name+"("+a.map(function(g){return g.toCSS()}).join(", ")+")")},toCSS:function(b){return this.eval(b).toCSS()}}})(s("less/tree"));(function(d){d.Color=function(b,a){this.rgb=Array.isArray(b)?b:b.length==6?b.match(/.{2}/g).map(function(g){return parseInt(g,16)}):
b.split("").map(function(g){return parseInt(g+g,16)});this.alpha=typeof a==="number"?a:1};d.Color.prototype={eval:function(){return this},toCSS:function(){return this.alpha<1?"rgba("+this.rgb.map(function(b){return Math.round(b)}).concat(this.alpha).join(", ")+")":"#"+this.rgb.map(function(b){b=Math.round(b);b=(b>255?255:b<0?0:b).toString(16);return b.length===1?"0"+b:b}).join("")},operate:function(b,a){var g=[];a instanceof d.Color||(a=a.toColor());for(var e=0;e<3;e++)g[e]=d.operate(b,this.rgb[e],
a.rgb[e]);return new d.Color(g)},toHSL:function(){var b=this.rgb[0]/255,a=this.rgb[1]/255,g=this.rgb[2]/255,e=this.alpha,h=Math.max(b,a,g),i=Math.min(b,a,g),k,n=(h+i)/2,r=h-i;if(h===i)k=i=0;else{i=n>0.5?r/(2-h-i):r/(h+i);switch(h){case b:k=(a-g)/r+(a<g?6:0);break;case a:k=(g-b)/r+2;break;case g:k=(b-a)/r+4}k/=6}return{h:k*360,s:i,l:n,a:e}}}})(s("less/tree"));(function(d){d.Comment=function(b,a){this.value=b;this.silent=!!a};d.Comment.prototype={toCSS:function(b){return b.compress?"":this.value},eval:function(){return this}}})(s("less/tree"));
(function(d){d.Dimension=function(b,a){this.value=parseFloat(b);this.unit=a||null};d.Dimension.prototype={eval:function(){return this},toColor:function(){return new d.Color([this.value,this.value,this.value])},toCSS:function(){return this.value+this.unit},operate:function(b,a){return new d.Dimension(d.operate(b,this.value,a.value),this.unit||a.unit)}}})(s("less/tree"));(function(d){d.Directive=function(b,a){this.name=b;if(Array.isArray(a))this.ruleset=new d.Ruleset([],a);else this.value=a};d.Directive.prototype=
{toCSS:function(b,a){if(this.ruleset){this.ruleset.root=true;return this.name+(a.compress?"{":" {\n ")+this.ruleset.toCSS(b,a).trim().replace(/\n/g,"\n ")+(a.compress?"}":"\n}\n")}else return this.name+" "+this.value.toCSS()+";\n"},eval:function(b){b.frames.unshift(this);this.ruleset=this.ruleset&&this.ruleset.eval(b);b.frames.shift();return this},variable:function(b){return d.Ruleset.prototype.variable.call(this.ruleset,b)},find:function(){return d.Ruleset.prototype.find.apply(this.ruleset,arguments)},
rulesets:function(){return d.Ruleset.prototype.rulesets.apply(this.ruleset)}}})(s("less/tree"));(function(d){d.Element=function(b,a){this.combinator=b instanceof d.Combinator?b:new d.Combinator(b);this.value=a.trim()};d.Element.prototype.toCSS=function(b){return this.combinator.toCSS(b||{})+this.value};d.Combinator=function(b){this.value=b===" "?" ":b?b.trim():""};d.Combinator.prototype.toCSS=function(b){return{"":""," ":" ","&":"",":":" :","::":"::","+":b.compress?"+":" + ","~":b.compress?"~":" ~ ",
">":b.compress?">":" > "}[this.value]}})(s("less/tree"));(function(d){d.Expression=function(b){this.value=b};d.Expression.prototype={eval:function(b){return this.value.length>1?new d.Expression(this.value.map(function(a){return a.eval(b)})):this.value[0].eval(b)},toCSS:function(b){return this.value.map(function(a){return a.toCSS(b)}).join(" ")}}})(s("less/tree"));(function(d){d.Import=function(b,a){var g=this;this._path=b;this.path=b instanceof d.Quoted?/\.(le?|c)ss$/.test(b.value)?b.value:b.value+
".less":b.value.value||b.value;(this.css=/css$/.test(this.path))||a.push(this.path,function(e){if(!e)throw Error("Error parsing "+g.path);g.root=e})};d.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(b){var a;if(this.css)return this;else{a=new d.Ruleset(null,this.root.rules.slice(0));for(var g=0;g<a.rules.length;g++)a.rules[g]instanceof d.Import&&Array.prototype.splice.apply(a.rules,[g,1].concat(a.rules[g].eval(b)));return a.rules}}}})(s("less/tree"));
(function(d){d.JavaScript=function(b,a){this.expression=b;this.index=a};d.JavaScript.prototype={toCSS:function(){return JSON.stringify(this.evaluated)},eval:function(b){var a=new Function("return ("+this.expression+")"),g={},e;for(e in b.frames[0].variables())g[e.slice(1)]={value:b.frames[0].variables()[e].value,toJS:function(){return this.value.eval(b).toCSS()}};try{this.evaluated=a.call(g)}catch(h){throw{message:"JavaScript evaluation error: '"+h.name+": "+h.message+"'",index:this.index};}return this}}})(s("less/tree"));
(function(d){d.Keyword=function(b){this.value=b};d.Keyword.prototype={eval:function(){return this},toCSS:function(){return this.value}}})(s("less/tree"));(function(d){d.mixin={};d.mixin.Call=function(b,a,g){this.selector=new d.Selector(b);this.arguments=a;this.index=g};d.mixin.Call.prototype={eval:function(b){for(var a,g=[],e=false,h=0;h<b.frames.length;h++)if((a=b.frames[h].find(this.selector)).length>0){for(h=0;h<a.length;h++)if(a[h].match(this.arguments,b))try{Array.prototype.push.apply(g,a[h].eval(b,
this.arguments).rules);e=true}catch(i){throw{message:i.message,index:i.index,stack:i.stack,call:this.index};}if(e)return g;else throw{message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+this.arguments.map(function(k){return k.toCSS()}).join(", ")+")`",index:this.index};}throw{message:this.selector.toCSS().trim()+" is undefined",index:this.index};}};d.mixin.Definition=function(b,a,g){this.name=b;this.selectors=[new d.Selector([new d.Element(null,b)])];this.params=a;this.arity=
a.length;this.rules=g;this._lookups={};this.required=a.reduce(function(e,h){return!h.name||h.name&&!h.value?e+1:e},0);this.parent=d.Ruleset.prototype;this.frames=[]};d.mixin.Definition.prototype={toCSS:function(){return""},variable:function(b){return this.parent.variable.call(this,b)},variables:function(){return this.parent.variables.call(this)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},eval:function(b,a){for(var g=
new d.Ruleset(null,[]),e=0,h;e<this.params.length;e++)if(this.params[e].name)if(h=a&&a[e]||this.params[e].value)g.rules.unshift(new d.Rule(this.params[e].name,h.eval(b)));else throw{message:"wrong number of arguments for "+this.name+" ("+a.length+" for "+this.arity+")"};return(new d.Ruleset(null,this.rules.slice(0))).eval({frames:[this,g].concat(this.frames,b.frames)})},match:function(b,a){var g=b&&b.length||0;if(g<this.required)return false;if(this.required>0&&g>this.params.length)return false;g=
Math.min(g,this.arity);for(var e=0;e<g;e++)if(!this.params[e].name)if(b[e].eval(a).toCSS()!=this.params[e].value.eval(a).toCSS())return false;return true}}})(s("less/tree"));(function(d){d.Operation=function(b,a){this.op=b.trim();this.operands=a};d.Operation.prototype.eval=function(b){var a=this.operands[0].eval(b);b=this.operands[1].eval(b);var g;if(a instanceof d.Dimension&&b instanceof d.Color)if(this.op==="*"||this.op==="+"){g=b;b=a;a=g}else throw{name:"OperationError",message:"Can't substract or divide a color from a number"};
return a.operate(this.op,b)};d.operate=function(b,a,g){switch(b){case "+":return a+g;case "-":return a-g;case "*":return a*g;case "/":return a/g}}})(s("less/tree"));(function(d){d.Quoted=function(b,a){this.value=a||"";this.quote=b.charAt(0)};d.Quoted.prototype={toCSS:function(){return this.quote+this.value+this.quote},eval:function(){return this}}})(s("less/tree"));(function(d){d.Rule=function(b,a,g,e){this.name=b;this.value=a instanceof d.Value?a:new d.Value([a]);this.important=g?" "+g.trim():"";
this.index=e;this.variable=b.charAt(0)==="@"?true:false};d.Rule.prototype.toCSS=function(b){return this.variable?"":this.name+(b.compress?":":": ")+this.value.toCSS(b)+this.important+";"};d.Rule.prototype.eval=function(b){return new d.Rule(this.name,this.value.eval(b),this.important,this.index)};d.Shorthand=function(b,a){this.a=b;this.b=a};d.Shorthand.prototype={toCSS:function(b){return this.a.toCSS(b)+"/"+this.b.toCSS(b)},eval:function(){return this}}})(s("less/tree"));(function(d){d.Ruleset=function(b,
a){this.selectors=b;this.rules=a;this._lookups={}};d.Ruleset.prototype={eval:function(b){var a=new d.Ruleset(this.selectors,this.rules.slice(0));a.root=this.root;b.frames.unshift(a);if(a.root)for(var g=0;g<a.rules.length;g++)a.rules[g]instanceof d.Import&&Array.prototype.splice.apply(a.rules,[g,1].concat(a.rules[g].eval(b)));for(g=0;g<a.rules.length;g++)if(a.rules[g]instanceof d.mixin.Definition)a.rules[g].frames=b.frames.slice(0);for(g=0;g<a.rules.length;g++)a.rules[g]instanceof d.mixin.Call&&Array.prototype.splice.apply(a.rules,
[g,1].concat(a.rules[g].eval(b)));g=0;for(var e;g<a.rules.length;g++){e=a.rules[g];e instanceof d.mixin.Definition||(a.rules[g]=e.eval?e.eval(b):e)}b.frames.shift();return a},match:function(b){return!b||b.length===0},variables:function(){return this._variables?this._variables:this._variables=this.rules.reduce(function(b,a){if(a instanceof d.Rule&&a.variable===true)b[a.name]=a;return b},{})},variable:function(b){return this.variables()[b]},rulesets:function(){return this._rulesets?this._rulesets:this._rulesets=
this.rules.filter(function(b){return b instanceof d.Ruleset||b instanceof d.mixin.Definition})},find:function(b,a){a=a||this;var g=[],e=b.toCSS();if(e in this._lookups)return this._lookups[e];this.rulesets().forEach(function(h){if(h!==a)for(var i=0;i<h.selectors.length;i++)if(b.match(h.selectors[i])){b.elements.length>1?Array.prototype.push.apply(g,h.find(new d.Selector(b.elements.slice(1)),a)):g.push(h);break}});return this._lookups[e]=g},toCSS:function(b,a){var g=[],e=[],h=[],i=[],k;if(!this.root)if(b.length===
0)i=this.selectors.map(function(r){return[r]});else for(k=0;k<this.selectors.length;k++)for(var n=0;n<b.length;n++)i.push(b[n].concat([this.selectors[k]]));for(n=0;n<this.rules.length;n++){k=this.rules[n];if(k.rules||k instanceof d.Directive)h.push(k.toCSS(i,a));else if(k instanceof d.Comment)k.silent||(this.root?h.push(k.toCSS(a)):e.push(k.toCSS(a)));else if(k.toCSS&&!k.variable)e.push(k.toCSS(a));else k.value&&!k.variable&&e.push(k.value.toString())}h=h.join("");if(this.root)g.push(e.join(a.compress?
"":"\n"));else if(e.length>0){i=i.map(function(r){return r.map(function(p){return p.toCSS(a)}).join("").trim()}).join(a.compress?",":i.length>3?",\n":", ");g.push(i,(a.compress?"{":" {\n ")+e.join(a.compress?"":"\n ")+(a.compress?"}":"\n}\n"))}g.push(h);return g.join("")+(a.compress?"\n":"")}}})(s("less/tree"));(function(d){d.Selector=function(b){this.elements=b;if(this.elements[0].combinator.value==="")this.elements[0].combinator.value=" "};d.Selector.prototype.match=function(b){return this.elements[0].value===
b.elements[0].value?true:false};d.Selector.prototype.toCSS=function(b){if(this._css)return this._css;return this._css=this.elements.map(function(a){return typeof a==="string"?" "+a.trim():a.toCSS(b)}).join("")}})(s("less/tree"));(function(d){d.URL=function(b,a){if(b.data)this.attrs=b;else{if(!/^(?:https?:\/|file:\/)?\//.test(b.value)&&a.length>0&&typeof z!=="undefined")b.value=a[0]+(b.value.charAt(0)==="/"?b.value.slice(1):b.value);this.value=b;this.paths=a}};d.URL.prototype={toCSS:function(){return"url("+
(this.attrs?"data:"+this.attrs.mime+this.attrs.charset+this.attrs.base64+this.attrs.data:this.value.toCSS())+")"},eval:function(b){return this.attrs?this:new d.URL(this.value.eval(b),this.paths)}}})(s("less/tree"));(function(d){d.Value=function(b){this.value=b;this.is="value"};d.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new d.Value(this.value.map(function(a){return a.eval(b)}))},toCSS:function(b){return this.value.map(function(a){return a.toCSS(b)}).join(b.compress?
",":", ")}}})(s("less/tree"));(function(d){d.Variable=function(b,a){this.name=b;this.index=a};d.Variable.prototype={eval:function(b){var a,g,e=this.name;if(a=d.find(b.frames,function(h){if(g=h.variable(e))return g.value.eval(b)}))return a;else throw{message:"variable "+this.name+" is undefined",index:this.index};}}})(s("less/tree"));s("less/tree").find=function(d,b){for(var a=0,g;a<d.length;a++)if(g=b.call(d,d[a]))return g;return null};var P=location.protocol==="file:"||location.protocol==="chrome:"||
location.protocol==="resource:";o.env=o.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||P?"development":"production");o.async=false;o.poll=o.poll||(P?1E3:1500);o.watch=function(){return this.watchMode=true};o.unwatch=function(){return this.watchMode=false};if(o.env==="development"){o.optimization=0;/!watch/.test(location.hash)&&o.watch();o.watchTimer=setInterval(function(){o.watchMode&&W(function(d,b,a){d&&N(d.toCSS(),b,a.lastModified)})},
o.poll)}else o.optimization=3;var B;try{B=typeof z.localStorage==="undefined"?null:z.localStorage}catch(aa){B=null}var M=document.getElementsByTagName("link"),V=/^text\/(x-)?less$/;o.sheets=[];for(var J=0;J<M.length;J++)if(M[J].rel==="stylesheet/less"||M[J].rel.match(/stylesheet/)&&M[J].type.match(V))o.sheets.push(M[J]);o.refresh=function(d){var b=endTime=new Date;W(function(a,g,e){if(e.local)H("loading "+g.href+" from cache.");else{H("parsed "+g.href+" successfully.");N(a.toCSS(),g,e.lastModified)}H("css for "+
g.href+" generated in "+(new Date-endTime)+"ms");e.remaining===0&&H("css generated in "+(new Date-b)+"ms");endTime=new Date},d);U()};o.refreshStyles=U;o.refresh(o.env==="development")})(window);
define(function () {
return window.less;
});

55
dev/1/scripts/osTheme.js Normal file
Просмотреть файл

@ -0,0 +1,55 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Raindrop.
*
* The Initial Developer of the Original Code is
* Mozilla Messaging, Inc..
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* */
/*jslint indent: 2 */
/*global document: false, navigator: false, define: false */
'use strict';
/**
* Sets up a class on the documentElement that is based on the OS theme.
* this right away, not part of a module, to a flash of unstyled content.
*
* Also returns the name of the OS theme as the module value.
*/
(function () {
var platform = navigator.platform,
map = {
'Win': 'win',
'Mac': 'mac',
'Linux': 'linux'
},
theme, prop;
for (prop in map) {
if (map.hasOwnProperty(prop) && platform.indexOf(prop) !== -1) {
theme = map[prop];
document.documentElement.className += ' ' + theme;
break;
}
}
define(function () {
return theme;
});
}());

Просмотреть файл

@ -125,7 +125,8 @@ function (object) {
value: true
},
overlays: {
'Contacts': 'ContactsTwitter'
'Contacts': 'ContactsTwitter',
'widgets/AccountPanel': 'widgets/AccountPanelTwitter'
}
}),
'facebook.com': new SvcBase('Facebook', {

Просмотреть файл

@ -28,7 +28,7 @@
define([ "require", "jquery", "blade/fn", "rdapi", "oauth", "blade/jig",
"dispatch", "storage", "accounts", "blade/url",
"services", "placeholder", "jquery.textOverflow"],
"services", "placeholder", "osTheme", "jquery.textOverflow"],
function (require, $, fn, rdapi, oauth, jig,
dispatch, storage, accounts, url,
services, placeholder) {

Просмотреть файл

@ -2,12 +2,15 @@
baseUrl: "../../scripts/",
paths: {
"index": "../share/panel/index",
"style": "../share/panel/style",
"jquery": "jqueryStub",
"widgets": "../share/panel/scripts/widgets"
},
name: "index",
include: ['widgets/AccountPanelLinkedIn', 'widgets/AccountPanelFaceBook',
'ContactsEmail', 'ContactsTwitter', 'ContactsLinkedIn'],
'widgets/AccountPanelTwitter', 'ContactsEmail', 'ContactsTwitter',
'ContactsLinkedIn', 'text!style.css', 'text!style/win.css',
'text!style/mac.css', 'text!style/linux.css'],
exclude: ['jquery', 'require/text'],
out: './index.js'
})

Просмотреть файл

@ -2,12 +2,12 @@
<html>
<head>
<title>Share</title>
<link rel="stylesheet" type="text/css" href="/dev/1/share/panel/style.css">
<script src="/dev/1/scripts/requireplugins-jquery.js" charset="utf-8"></script>
<script>
require({
baseUrl: '/dev/1/scripts',
paths: {
style: '../share/panel/style',
widgets: '../share/panel/scripts/widgets'
}
});
@ -24,13 +24,15 @@
require(['/dev/1/share/panel/index.js']);
</script>
</head>
<body>
<body style="visibility: hidden">
<noscript>
Please enable JavaScript to use F1. If you are using NoScript or another script
blocking add-on, please allow "mozillamessaging.com" and try again.
</noscript>
<a class="close" href="#close" title="Close">x</a>
<div id="wrapper" class="wrapper hbox">
<div id="tabs">
</div>

Просмотреть файл

@ -23,7 +23,8 @@
/*jslint plusplus: false, indent: 2, nomen: false */
/*global require: false, define: false, location: true, window: false, alert: false,
document: false, setTimeout: false, localStorage: false, parent: false */
document: false, setTimeout: false, localStorage: false, parent: false,
console: false */
"use strict";
/*
@ -37,11 +38,12 @@
define([ "require", "jquery", "blade/object", "blade/fn", "rdapi", "oauth",
"blade/jig", "blade/url", "placeholder", "dispatch", "accounts",
"storage", "services", "widgets/AccountPanel", "widgets/TabButton",
"widgets/AddAccount", "jquery-ui-1.8.7.min", "jquery.textOverflow"],
"widgets/AddAccount", "less", "osTheme", "jquery-ui-1.8.7.min",
"jquery.textOverflow"],
function (require, $, object, fn, rdapi, oauth,
jig, url, placeholder, dispatch, accounts,
storage, services, AccountPanel, TabButton,
AddAccount) {
AddAccount, less, osTheme) {
var actions = services.domains,
onFirstShareState = null,
@ -64,6 +66,24 @@ function (require, $, object, fn, rdapi, oauth,
options, bodyDom, sendData, tabButtonsDom,
servicePanelsDom;
//Start processing of less files right away.
require(['text!style/' + osTheme + '.css', 'text!style.css'],
function (osText, styleText) {
(new less.Parser()).parse(osText + styleText, function (err, css) {
if (err) {
if (typeof console !== 'undefined' && console.error) {
console.error(err);
}
} else {
var style = document.createElement('style');
style.type = 'text/css';
style.textContent = css.toCSS();
document.head.appendChild(style);
document.body.style.visibility = 'visible';
}
});
});
function checkBase64Preview() {
//Ask extension to generate base64 data if none available.
//Useful for sending previews in email.
@ -224,10 +244,17 @@ function (require, $, object, fn, rdapi, oauth,
// This method assumes the sendData object has already been set up.
// You probably want sendMessage, not this call.
function callSendApi() {
var data = object.create(sendData);
//For now strip out the bitly placeholder since the backend does
//not support it. This is being tracked in:
//https://bugzilla.mozilla.org/show_bug.cgi?id=653277
data.message = data.message.replace(/http\:\/\/bit\.ly\/XXXXXX/, '');
rdapi('send', {
type: 'POST',
domain: sendData.domain,
data: sendData,
data: data,
success: function (json) {
// {'message': u'Status is a duplicate.', 'provider': u'twitter.com'}
var code, prop;
@ -529,10 +556,6 @@ function (require, $, object, fn, rdapi, oauth,
onFirstShareState = function () {
// Wait until DOM ready to start the DOM work.
$(function () {
if (options.ui === 'sidebar') {
$("#panelHeader").text('');
$("#closeLink").addClass('hidden');
}
//Listen to sendMessage events from the AccountPanels
dispatch.sub('sendMessage', function (data) {
@ -578,7 +601,10 @@ function (require, $, object, fn, rdapi, oauth,
evt.preventDefault();
dispatch.pub('openPrefs');
})
.delegate('nav .close', 'click', close);
.delegate('.close', 'click', function (evt) {
evt.preventDefault();
close();
});
$('#authOkButton').click(function (evt) {
oauth(sendData.domain, false, function (success) {

Просмотреть файл

@ -396,6 +396,8 @@ function (object, Widget, $, template,
//Kick the placeholder logic to recompute, to avoid gray text issues.
placeholder(this.node);
return opts;
},
getFormData: function () {

Просмотреть файл

@ -0,0 +1,65 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Raindrop.
*
* The Initial Developer of the Original Code is
* Mozilla Messaging, Inc..
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* */
/*jslint indent: 2 */
/*global define: false */
"use strict";
define([ 'blade/object', './AccountPanel', 'jquery'],
function (object, AccountPanel, $) {
var shortLinkPlaceholder = 'http://bit.ly/XXXXXX';
/**
* Just overrides a text string.
*/
return object(AccountPanel, null, function (parent) {
return {
onRender: function () {
parent(this, 'onRender', arguments);
this.setDefaultTwitterMessage(this.options);
},
optionsChanged: function (options) {
// Get the options out of the super's optionsChanged, since that
// method may have restored some saved state.
var opts = parent(this, 'optionsChanged', arguments);
this.setDefaultTwitterMessage(opts);
},
setDefaultTwitterMessage: function (options) {
var message;
// Only set the default message if there is not already a message.
// There could be a restored-data message.
if (!options.message) {
message = options.title + ' - ' + shortLinkPlaceholder + ' ';
$(this.node).find('[name="message"]').val(message);
}
}
};
});
});

Просмотреть файл

@ -10,7 +10,7 @@
/* Fix the height of the autocomplete */
.ui-autocomplete {
max-height: 85px;
max-height: 65px;
overflow-x: hidden;
overflow-y: auto;
@ -20,7 +20,6 @@
.ui-menu {
list-style:none;
padding: 2px;
margin: 0;
display:block;
float: left;
@ -103,7 +102,7 @@
display: none;
border-color: #A6AFB6;
border-style: solid;
border-width: 0 1px 1px 1px;
border-width: 1px;
margin: 0;
padding: 2px;
background: white;
@ -111,12 +110,12 @@
z-index: 100;
}
.addressing .AutoCompleteRefresh {
top: 26px;
.addressing .AutoCompleteRefresh.below {
top: 24px;
}
.addressing .toSection .AutoCompleteRefresh {
top: 45px;
.addressing .AutoCompleteRefresh.above {
top: -54px;
}
.AutoCompleteRefresh button {
@ -125,7 +124,7 @@
.addressing .AutoCompleteSpinner {
position: absolute;
top: 6px;
top: 4px;
right: 3px;
width: 16px;
height: 16px;
@ -134,7 +133,7 @@
}
.addressing .toSection .AutoCompleteSpinner {
top: 25px;
top: 4px;
}
* {
@ -159,7 +158,8 @@ body {
width: 100%;
height: 100%;
min-height: 120px;
background-color: #505050;
color: @color;
background: @background;
}
noscript {
@ -182,8 +182,9 @@ noscript {
-moz-box-sizing: border-box;
box-sizing: border-box;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #515151), color-stop(100%, #2b2b2b));
background-image: -moz-linear-gradient(center top , #515151 0%, #2b2b2b 100%);
background: @tabsBackgroundWebKit;
background: @tabsBackground;
border-right: @tabsBorderRight;
}
button::-moz-focus-inner {
@ -216,8 +217,8 @@ button:active {
}
#tabContent {
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6f6f6f), color-stop(100%, #444444));
background-image: -moz-linear-gradient(center top , #6f6f6f 0%, #444444 100%);
background: @tabContentBackgroundWebKit;
background: @tabContentBackground;
}
@ -234,6 +235,14 @@ h3 {
color: #535f6d;
}
.close {
position: absolute;
top: 0;
right: 3px;
text-decoration: none;
color: @color;
}
/* Tab Buttons */
.widgets-TabButton {
display: block;
@ -244,16 +253,19 @@ h3 {
line-height: 18px;
text-decoration: none;
text-align: center;
color: white;
color: @tabButtonColor;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-repeat: no-repeat;
}
.widgets-TabButton.selected {
border: 1px solid #577894;
border: @tabButtonBorder;
box-shadow: 0 0 5px rgba(87, 120, 148, 1);
background-color: #303333;
background: @tabButtonBackgroundWebKit;
background: @tabButtonBackground;
background-repeat: no-repeat;
}
@ -277,7 +289,6 @@ h3 {
height: 24px;
margin-right: 5px;
line-height: 24px;
color: #e2e2e2;
}
.widgets-AddAccount .add li {
@ -394,7 +405,6 @@ span.icon {
.widgets-AccountPanel .user {
width: 60px;
color: #e2e2e2;
text-align: center;
}
@ -449,6 +459,7 @@ img.avatar {
}
.toSection {
position: relative;
width: 150px;
padding-left: 10px;
}
@ -457,13 +468,17 @@ body .toSection input[type="text"] {
width: 100%;
}
.shareTypeSection input[name="to"] {
background: @shareTypeSectionInputBackground;
}
.lineSeparatorOption {
border-top: 1px solid #CCCCCC;
}
.widgets-AccountPanel .inputError[type="text"] {
border: 1px solid #C26464;
background-color: #893232;
border: @accountPanelInputErrorBorder;
background-color: @accountPanelInputErrorBackground;
}
.widgets-AccountPanel .accountActions {
@ -494,7 +509,6 @@ body .toSection input[type="text"] {
display: inline;
padding-left: 5px;
line-height: 24px;
color: #e2e2e2;
}
.widgets-AccountPanel div.counter.TextCountOver {
@ -512,7 +526,7 @@ body .toSection input[type="text"] {
}
.widgets-AccountPanel div.status.error {
color: #C26464;
color: @accountPanelErrorColor;
background-color: transparent;
box-shadow: none;
}
@ -525,7 +539,7 @@ body .toSection input[type="text"] {
padding: 2px;
border: 1px solid #383838;
border-radius: 4px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) inset;
}
.widgets-AccountPanel .placeholder {
@ -552,12 +566,12 @@ body .toSection input[type="text"] {
}
.widgets-AccountPanel button.share {
border: 1px solid #57BCFF;
color: #005796;
border: @buttonShareBorder;
color: @buttonShareColor;
font-weight: bold;
text-shadow: 0 1px 1px #47AFF8;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #0097F1), color-stop(100%, #545454));
background-image: -moz-linear-gradient(center top , #23AEFF 0%, #0097F1 100%);
text-shadow: @buttonShareTextShadow;
background: @buttonShareBackgroundWebKit;
background: @buttonShareBackground;
}
/*

Просмотреть файл

@ -0,0 +1,27 @@
@color: #454545;
@background: white;
@tabsBackgroundWebKit: #E1E9F6;
@tabsBackground: #E1E9F6;
@tabsBorderRight: 1px solid #BDCFE8;
@tabButtonBorder: 1px solid #6490C5;
@tabButtonColor: #688FC2;
@tabButtonBackgroundWebKit: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #DEE9F8), color-stop(100%, #B6DCF9));
@tabButtonBackground: -moz-linear-gradient(center top , #DEE9F8 0%, #B6DCF9 100%);
@tabContentBackgroundWebKit: white;
@tabContentBackground: white;
@shareTypeSectionInputBackground: white;
@accountPanelInputErrorBorder: 1px solid #FC0000;
@accountPanelInputErrorBackground: white;
@accountPanelErrorColor: #FC0000;
@buttonShareBorder: 1px solid #1C92C2;
@buttonShareColor: #252525;
@buttonShareTextShadow: 0;
@buttonShareBackgroundWebKit: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #EDF7F9), color-stop(100%, #9BDCF5));
@buttonShareBackground: -moz-linear-gradient(center top , #EDF7F9 0%, #9BDCF5 100%);

Просмотреть файл

@ -0,0 +1,29 @@
@color: #e2e2e2;
@background: #505050;
@tabsBackgroundWebKit: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #515151), color-stop(100%, #2b2b2b));
@tabsBackground: -moz-linear-gradient(center top , #515151 0%, #2b2b2b 100%);
@tabsBorderRight: 0;
@tabButtonBorder: 1px solid #577894;
@tabButtonColor: white;
@tabButtonBackgroundWebKit: #303333;
@tabButtonBackground: #303333;
@tabContentBackgroundWebKit: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6f6f6f), color-stop(100%, #444444));
@tabContentBackground: -moz-linear-gradient(center top , #6f6f6f 0%, #444444 100%);
@addAccountSelectBackgroundWebKit: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #767676), color-stop(100%, #545454));
@addAccountSelectBackground: -moz-linear-gradient(center top , #767676 0%, #545454 100%);
@shareTypeSectionInputBackground: #848484;
@accountPanelInputErrorBorder: 1px solid #C26464;
@accountPanelInputErrorBackground: #893232;
@accountPanelErrorColor: #C26464;
@buttonShareBorder: 1px solid #57BCFF;
@buttonShareTextShadow: 0 1px 1px #47AFF8;
@buttonShareColor: #005796;
@buttonShareBackgroundWebKit: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #0097F1), color-stop(100%, #545454));
@buttonShareBackground: -moz-linear-gradient(center top , #23AEFF 0%, #0097F1 100%);

Просмотреть файл

@ -0,0 +1,27 @@
@color: #454545;
@background: white;
@tabsBackgroundWebKit: #E1E9F6;
@tabsBackground: #E1E9F6;
@tabsBorderRight: 1px solid #BDCFE8;
@tabButtonBorder: 1px solid #6490C5;
@tabButtonColor: #688FC2;
@tabButtonBackgroundWebKit: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #DEE9F8), color-stop(100%, #B6DCF9));
@tabButtonBackground: -moz-linear-gradient(center top , #DEE9F8 0%, #B6DCF9 100%);
@tabContentBackgroundWebKit: white;
@tabContentBackground: white;
@shareTypeSectionInputBackground: white;
@accountPanelInputErrorBorder: 1px solid #FC0000;
@accountPanelInputErrorBackground: white;
@accountPanelErrorColor: #FC0000;
@buttonShareBorder: 1px solid #1C92C2;
@buttonShareColor: #252525;
@buttonShareTextShadow: 0;
@buttonShareBackgroundWebKit: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #EDF7F9), color-stop(100%, #9BDCF5));
@buttonShareBackground: -moz-linear-gradient(center top , #EDF7F9 0%, #9BDCF5 100%);