Skip to content

Commit

Permalink
Finish v1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceFox committed Apr 14, 2015
2 parents eea8491 + 7bcb4da commit 72db708
Show file tree
Hide file tree
Showing 145 changed files with 3,352 additions and 2,149 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ python:

env:
- TEST_APP="-e back_mysql zds.tutorial"
CFLAGS="-O0"
- TEST_APP="-e back_mysql zds.article zds.forum zds.member zds.utils zds.gallery zds.mp zds.pages"
CFLAGS="-O0"
- TEST_APP="-e front"

notifications:
Expand Down
18 changes: 13 additions & 5 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ var gulp = require("gulp"),
var sourceDir = "assets/",
destDir = "dist/",
appFile = "js/app.js"
styleFile = "main.scss",
stylesFiles = ["main.scss", "only-ie.scss"],
sassDir = "scss/",
imagesDir = "images/",
scriptsDir = "js/",
vendorsDir = "vendors/",
spriteDir = "sprite/",
vendorsCSS = ["node_modules/normalize.css/normalize.css"],
vendorsJS = ["node_modules/jquery/dist/jquery.js"],
vendorsJS = ["node_modules/jquery/dist/jquery.js", "node_modules/cookies-eu-banner/dist/cookies-eu-banner.js"],
autoprefixerConfig = ["last 1 version", "> 1%", "ff >= 20", "ie >= 8", "opera >= 12", "Android >= 2.2"]
imageminConfig = { optimizationLevel: 3, progressive: true, interlaced: true };

Expand Down Expand Up @@ -113,7 +113,11 @@ gulp.task("vendors", ["vendors-js", "vendors-css"], function() {
* Compiles SASS files
*/
gulp.task("stylesheet", ["sprite", "vendors"], function() {
return gulp.src(sourceDir + sassDir + styleFile)
var files = [];
for (var i = 0; i < stylesFiles.length; i++) {
files.push(sourceDir + sassDir + stylesFiles[i]);
}
return gulp.src(files)
.pipe($.sass({
sass: sourceDir + sassDir,
imagePath: sourceDir + imagesDir
Expand All @@ -136,7 +140,11 @@ gulp.task("stylesheet", ["sprite", "vendors"], function() {
* Error-pages stylesheet
*/
gulp.task("errors", ["clean-errors"], function() {
return gulp.src(errorsDir + sassDir + styleFile)
var files = [];
for (var i = 0; i < stylesFiles.length; i++) {
files.push(sourceDir + sassDir + stylesFiles[i]);
}
return gulp.src(files)
.pipe($.sass({
sass: errorsDir + sassDir,
imagePath: errorsDir + imagesDir,
Expand All @@ -157,7 +165,7 @@ gulp.task("sprite", function() {
.pipe(sprite({
name: "sprite",
style: "_sprite.scss",
cssPath: "../images",
cssPath: "../" + imagesDir,
retina: true,
prefix: "sprite-icon",
processor: "scss",
Expand Down
Binary file added assets/images/sprite/diaspora-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/sprite/diaspora-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/sprite/diaspora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 46 additions & 1 deletion assets/js/ajax-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,19 @@
this.data(dataAttribute, text);
};

function synchText() {
$("#mobile-menu [data-ajax-input]").each(function () {
var dataAjaxInput = $(this).data("ajax-input");
console.log($(this).text(), $(".sidebar").find("button[data-ajax-input='" + dataAjaxInput + "']").text(), dataAjaxInput);

$(this).text($(".sidebar").find("button[data-ajax-input='" + dataAjaxInput + "']").text());
});
}

/**
* Karma of the messages
*/
$(".topic-message").on("click", ".upvote, .downvote", function(e){
$(".topic-message").on("click", "button.upvote, button.downvote", function(e){
var $thumb = $(this),
$form = $(this).parents("form:first"),
$karma = $thumb.parents(".message-karma:first"),
Expand Down Expand Up @@ -69,6 +78,8 @@
} else {
$downvote.removeClass("more-voted");
}

$thumb.blur();
}
});

Expand Down Expand Up @@ -115,6 +126,8 @@

$act.toggleText("content-on-click");
$act.toggleClass("blue yellow");

synchText();
}
});

Expand Down Expand Up @@ -162,6 +175,8 @@

$act.toggleText("content-on-click");
$act.toggleClass("blue");

synchText();
}
});
e.stopPropagation();
Expand Down Expand Up @@ -200,6 +215,8 @@
$act.toggleText("content-on-click");
$act.toggleClass("green blue");
$("[data-ajax-output='solve-topic']").toggleClass("empty");

synchText();
}
});
e.stopPropagation();
Expand Down Expand Up @@ -275,4 +292,32 @@
e.stopPropagation();
e.preventDefault();
});

/*
* Mark a message useful
*/
$(".topic-message").on("click", "[data-ajax-input='mark-message-as-useful']", function(e){
var $button = $(this),
$form = $button.parents("form:first"),
$message = $form.parents("article"),
$usefulText = $message.find("[data-ajax-output='mark-message-as-useful']"),
csrfmiddlewaretoken = $form.find("input[name=csrfmiddlewaretoken]").val();

$.ajax({
url: $form.attr("action"),
type: "POST",
data: {
"csrfmiddlewaretoken": csrfmiddlewaretoken
},
success: function(){
$message.toggleClass("helpful");
$button.toggleText("content-on-click");
$usefulText.toggleClass("hidden");
$button.blur();
}
});

e.stopPropagation();
e.preventDefault();
});
})(jQuery);
47 changes: 0 additions & 47 deletions assets/js/cookies-banner.js

This file was deleted.

6 changes: 4 additions & 2 deletions assets/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,10 @@
"use strict";

$(".md-editor").on("keydown", function(e){
// the message is submitted if the user is pressing Ctrl and Enter and isn't pressing Alt, Shift and Super
if(e.ctrlKey && e.which === 13 && !e.altKey && !e.shiftKey && !e.metaKey){
// the message is submitted if the user is pressing Ctrl or Cmd with Enter and isn't pressing Alt or Shift
if((e.ctrlKey || e.metaKey) && e.which === 13 && !e.altKey && !e.shiftKey){
e.preventDefault();

$(".message-submit > button[name=answer]").click();
}
});
Expand Down
34 changes: 34 additions & 0 deletions assets/js/forgot-password.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Display the form for recorvering a password.
*/
(function($, undefined){
"use strict";
if ($("#id_email").val() == '')
$("#form-email").addClass("hidden");
else
$("#form-email").removeClass("hidden");

$("[data-forgot-password-button=email]").on("click", function(e) {
$("#form-email").toggleClass("hidden");
$("#form-username").addClass("hidden");

$("#id_username").val('');

e.preventDefault();
});

if ($("#id_username").val() == '')
$("#form-username").addClass("hidden");
else
$("#form-username").removeClass("hidden");

$("[data-forgot-password-button=username]").on("click", function(e) {
$("#form-username").toggleClass("hidden");
$("#form-email").addClass("hidden");

$("#id_email").val('');

e.preventDefault();
});
})(jQuery);

3 changes: 3 additions & 0 deletions assets/scss/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ textarea {
color: #000;
padding: 0.2em 0;
text-align: center;
position: fixed;
z-index: 9999;
width: 100%;
}

.a11y {
Expand Down
4 changes: 2 additions & 2 deletions assets/scss/base/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ hr.clearfix {
display: none;
}

@media only screen and ($media-extra-wide) {
@media only screen and #{$media-extra-wide} {
.wide {
display: inline;
}
Expand All @@ -82,7 +82,7 @@ hr.clearfix {
}
}

@media only screen and ($media-wide) {
@media only screen and #{$media-wide} {
.screen {
display: inline;
}
Expand Down
14 changes: 13 additions & 1 deletion assets/scss/base/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
background-repeat: no-repeat;
@include sprite();
}

&.alert:after {
@include sprite-position($alert);
}
Expand Down Expand Up @@ -133,6 +133,18 @@
}
}

&.diaspora {
&:after {
@include sprite-position($diaspora);
}
&.blue:after {
@include sprite-position($diaspora-blue);
}
&.light:after {
@include sprite-position($diaspora-light);
}
}

&.facebook {
&:after {
@include sprite-position($facebook);
Expand Down
5 changes: 5 additions & 0 deletions assets/scss/base/_tables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.table-wrapper {
max-width: 100%;
overflow: auto;
}

table {
margin: 15px 0;
border-top: 1px solid #DDD;
Expand Down
20 changes: 10 additions & 10 deletions assets/scss/components/_cookies-banner.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#cookies-banner {
#cookies-eu-banner {
padding: 0 2.5%;
background: #062E41;
display: none;
Expand All @@ -11,7 +11,7 @@
line-height: 23px;
}

a {
#cookies-eu-more {
display: inline-block;
color: #EEE;
padding: 4px 13px;
Expand All @@ -26,7 +26,7 @@
}
}

#reject-cookies {
#cookies-eu-reject {
display: inline-block;
background: none;
border: none;
Expand All @@ -41,7 +41,7 @@
}
}

#accept-cookies {
#cookies-eu-accept {
text-decoration: none;
background: #EEE;
color: $color-primary;
Expand All @@ -59,36 +59,36 @@
}

@media only screen and #{$media-mega-wide} {
#cookies-banner {
#accept-cookies {
#cookies-eu-banner {
#cookies-eu-accept {
float: right;
}
}
}

@media only screen and #{$media-mobile} {
#cookies-banner {
#cookies-eu-banner {
position: absolute;
top: 50px;
right: 0;
bottom: 0;
left: 0;
z-index: 10;

p {
span {
margin-top: 40px;
padding: 0 20px;
}

a, #accept-cookies {
#cookies-eu-more, #cookies-eu-accept {
display: block;
width: 100%;
height: 40px;
padding: 0 !important;
margin: 15px 0 0 0 !important;
text-align: center;
}
a {
#cookies-eu-more {
margin-top: 40px !important;
line-height: 40px;
}
Expand Down
1 change: 0 additions & 1 deletion assets/scss/components/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
display: block;
float: left;
cursor: pointer;
background-color: #FFF;
border-bottom: 1px solid transparent;
text-decoration: none;
color: #999;
Expand Down
Loading

0 comments on commit 72db708

Please sign in to comment.