This commit is contained in:
Zachary Carter 2014-07-28 17:42:45 -07:00
Родитель a8e003f44b
Коммит f2db968eae
15 изменённых файлов: 47 добавлений и 22 удалений

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

@ -6,7 +6,6 @@ require.config({
baseUrl: '/scripts', baseUrl: '/scripts',
paths: { paths: {
jquery: '../bower_components/jquery/dist/jquery', jquery: '../bower_components/jquery/dist/jquery',
'jquery-ui': '../bower_components/jquery-ui/jquery-ui',
backbone: '../bower_components/backbone/backbone', backbone: '../bower_components/backbone/backbone',
underscore: '../bower_components/underscore/underscore', underscore: '../bower_components/underscore/underscore',
fxaClient: '../bower_components/fxa-js-client/fxa-client', fxaClient: '../bower_components/fxa-js-client/fxa-client',
@ -20,17 +19,13 @@ require.config({
md5: '../bower_components/JavaScript-MD5/js/md5' md5: '../bower_components/JavaScript-MD5/js/md5'
}, },
shim: { shim: {
'jquery-ui': {
exports: '$',
deps: ['jquery']
},
underscore: { underscore: {
exports: '_' exports: '_'
}, },
backbone: { backbone: {
deps: [ deps: [
'underscore', 'underscore',
'jquery-ui' 'jquery'
], ],
exports: 'Backbone' exports: 'Backbone'
}, },

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

@ -10,7 +10,7 @@
<img src="{{ avatar }}" /> <img src="{{ avatar }}" />
{{/avatar}} {{/avatar}}
{{^avatar}} {{^avatar}}
<img src="/images/avatar.jpg" class="default"/> <img class="default"/>
{{/avatar}} {{/avatar}}
</p> </p>

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

@ -10,7 +10,7 @@
<img src="{{ avatar }}" /> <img src="{{ avatar }}" />
{{/avatar}} {{/avatar}}
{{^avatar}} {{^avatar}}
<img src="/images/avatar.jpg" class="default"/> <img class="default"/>
{{/avatar}} {{/avatar}}
<video id="video" class="hidden"></video> <video id="video" class="hidden"></video>
</p> </p>

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

@ -14,7 +14,7 @@
{{/avatar}} {{/avatar}}
{{^avatar}} {{^avatar}}
<p class="avatar-wrapper"> <p class="avatar-wrapper">
<img src="/images/avatar.jpg" class="default"/> <img class="default"/>
</p> </p>
{{/avatar}} {{/avatar}}
</div> </div>

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

@ -13,7 +13,7 @@
<img src="{{ avatar }}" id="avatar"/> <img src="{{ avatar }}" id="avatar"/>
{{/avatar}} {{/avatar}}
{{^avatar}} {{^avatar}}
<img src="/images/avatar.jpg" id="gravatar" /> <img class="default" />
{{/avatar}} {{/avatar}}
</div> </div>
<form novalidate> <form novalidate>

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

@ -69,10 +69,13 @@ function ($, _, FormView, Template, Session, AuthErrors) {
var img = new Image(); var img = new Image();
img.src = src; img.src = src;
img.onload = function () { img.onload = function () {
Session.set('cropImgWidth', img.width);
Session.set('cropImgHeight', img.height);
self.navigate('settings/avatar/crop'); require(['../bower_components/jquery-ui/ui/draggable'], function (ui) {
Session.set('cropImgWidth', img.width);
Session.set('cropImgHeight', img.height);
self.navigate('settings/avatar/crop');
});
}; };
img.onerror = function () { img.onerror = function () {
self.navigate('settings/avatar', { self.navigate('settings/avatar', {

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

@ -1,6 +1,12 @@
.avatar-wrapper img { .avatar-wrapper img {
width: $avatar-size; width: $avatar-size;
height: $avatar-size; height: $avatar-size;
display: block;
}
.avatar-wrapper img.default {
background-image: url(/images/avatar.jpg);
background-size: cover;
} }
.avatar-wrapper { .avatar-wrapper {
@ -45,6 +51,7 @@
display: inline-block; display: inline-block;
margin: 0px 0px 5px; margin: 0px 0px 5px;
border-radius: 50%; border-radius: 50%;
border-width: 0px;
height: $avatar-size; height: $avatar-size;
width: $avatar-size; width: $avatar-size;
} }

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

@ -39,11 +39,18 @@ module.exports = function (grunt) {
src: [ src: [
'*.{ico,png,txt}', '*.{ico,png,txt}',
'.htaccess', '.htaccess',
'images/{,*/}*.{webp,gif}', 'images/{,*/}*.{webp,gif,svg}',
'styles/fonts/{,*/}*.*', 'styles/fonts/{,*/}*.*',
'fonts/**/*.{woff,eot,ttf,svg,ofl}', 'fonts/**/*.{woff,eot,ttf,svg,ofl}',
'i18n/{,*/}{,*/}*.*' 'i18n/{,*/}{,*/}*.*'
] ]
},
{
// jquery ui
expand: true,
cwd: '<%= yeoman.app %>/bower_components/jquery-ui',
src: ['**/*.js'],
dest: '<%= yeoman.dist %>/bower_components/jquery-ui'
} }
] ]
}, },

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

@ -10,10 +10,10 @@ module.exports = function (grunt) {
files: { files: {
src: [ src: [
'<%= yeoman.dist %>/bower_components/**/*.js', '<%= yeoman.dist %>/bower_components/**/*.js',
'<%= yeoman.dist %>/bower_components/{,*/}*.js', '!<%= yeoman.dist %>/bower_components/jquery-ui/**/*.js',
'<%= yeoman.dist %>/scripts/{,*/}*.js', '<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css', '<%= yeoman.dist %>/styles/{,*/}*.css',
'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}', '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/fonts/{,*/}*.{woff,svg,ofl,eot,ttf}' '<%= yeoman.dist %>/fonts/{,*/}*.{woff,svg,ofl,eot,ttf}'
] ]
} }

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

@ -12,12 +12,20 @@ module.exports = function (grunt) {
*/ */
grunt.config('uglify', { grunt.config('uglify', {
dist: { dist: {
files: [{ files: [
expand: true, {
cwd: '<%= yeoman.tmp %>/scripts', expand: true,
src: ['**/*.js'], cwd: '<%= yeoman.tmp %>/scripts',
dest: '<%= yeoman.dist %>/scripts' src: ['**/*.js'],
}] dest: '<%= yeoman.dist %>/scripts'
},
{
expand: true,
cwd: '<%= yeoman.app %>/bower_components/jquery-ui',
src: ['**/*.js'],
dest: '<%= yeoman.dist %>/bower_components/jquery-ui'
}
]
} }
}); });
}; };

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

@ -12,6 +12,7 @@
<!-- build:css(.tmp) /styles/{{ locale }}.css --> <!-- build:css(.tmp) /styles/{{ locale }}.css -->
<link rel="stylesheet" href="/bower_components/normalize-css/normalize.css"> <link rel="stylesheet" href="/bower_components/normalize-css/normalize.css">
<link rel="stylesheet" href="/styles/fontello.css">
{{#if fontSupportDisabled}} {{#if fontSupportDisabled}}
<link rel="stylesheet" href="/styles/system-font-main.css"> <link rel="stylesheet" href="/styles/system-font-main.css">
{{else}} {{else}}

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

@ -12,6 +12,7 @@
<!-- build:css(.tmp) /styles/{{ locale }}.css --> <!-- build:css(.tmp) /styles/{{ locale }}.css -->
<link rel="stylesheet" href="/bower_components/normalize-css/normalize.css"> <link rel="stylesheet" href="/bower_components/normalize-css/normalize.css">
<link rel="stylesheet" href="/styles/fontello.css">
{{#if fontSupportDisabled}} {{#if fontSupportDisabled}}
<link rel="stylesheet" href="/styles/system-font-main.css"> <link rel="stylesheet" href="/styles/system-font-main.css">
{{else}} {{else}}

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

@ -12,6 +12,7 @@
<!-- build:css(.tmp) /styles/{{ locale }}.css --> <!-- build:css(.tmp) /styles/{{ locale }}.css -->
<link rel="stylesheet" href="/bower_components/normalize-css/normalize.css"> <link rel="stylesheet" href="/bower_components/normalize-css/normalize.css">
<link rel="stylesheet" href="/styles/fontello.css">
{{#if fontSupportDisabled}} {{#if fontSupportDisabled}}
<link rel="stylesheet" href="/styles/system-font-main.css"> <link rel="stylesheet" href="/styles/system-font-main.css">
{{else}} {{else}}

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

@ -13,6 +13,7 @@
<!-- build:css(.tmp) /styles/{{ locale }}.css --> <!-- build:css(.tmp) /styles/{{ locale }}.css -->
<link rel="stylesheet" href="/bower_components/normalize-css/normalize.css"> <link rel="stylesheet" href="/bower_components/normalize-css/normalize.css">
<link rel="stylesheet" href="/styles/fontello.css">
{{#if fontSupportDisabled}} {{#if fontSupportDisabled}}
<link rel="stylesheet" href="/styles/system-font-main.css"> <link rel="stylesheet" href="/styles/system-font-main.css">
{{else}} {{else}}

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

@ -13,6 +13,7 @@
<!-- build:css(.tmp) /styles/{{ locale }}.css --> <!-- build:css(.tmp) /styles/{{ locale }}.css -->
<link rel="stylesheet" href="/bower_components/normalize-css/normalize.css"> <link rel="stylesheet" href="/bower_components/normalize-css/normalize.css">
<link rel="stylesheet" href="/styles/fontello.css">
{{#if fontSupportDisabled}} {{#if fontSupportDisabled}}
<link rel="stylesheet" href="/styles/system-font-main.css"> <link rel="stylesheet" href="/styles/system-font-main.css">
{{else}} {{else}}