Skip to content

Commit

Permalink
Merge pull request #46 from schadocalex/master
Browse files Browse the repository at this point in the history
Version 4.1.0
  • Loading branch information
schadocalex committed Feb 24, 2015
2 parents 41d6258 + 8178783 commit b56f61e
Show file tree
Hide file tree
Showing 70 changed files with 686 additions and 379 deletions.
26 changes: 16 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#### 4.1.0 (24/02/2015)
Fonctionnalités :
* Editeur multi-lignes
Correction de bugs :
* Les mots ne sont plus actifs dans la rechercher de l'éditeur

#### 4.0.1 (10/02/2015)
Features:
* Better size for first gui icon
* Reloading the app when the window is resized
Fonctionnalités :
* Meilleure taille pour les icônes
* Rechargement auto de l'application quand on redimensionne avant le menu

#### 4.0.0 (5/02/2015)
Features:
* Add Grunt
* Add node-webkit (with grunt)
* Upgrade to CreateJS 12/12/2014
* Upgrade to CocoonJS plugins 3.0.5
Bug Fixes:
* Functional Keyboard everywhere (especially iOS)
Fonctionnalités :
* Ajout de Grunt
* Ajout de node-webkit (avec grunt)
* Mis à jour pour CreateJS 12/12/2014
* Mis à jour pour CocoonJS plugins 3.0.5
Correction de bugs :
* Clavier fonctionnel partout (notamment sur iOs)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Application - La Séparation v4.0.1
Application - La Séparation v4.1.0
=======

Application web et tablette sur la poésie à deux mi-mots
1 change: 1 addition & 0 deletions build/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = function(grunt) {
// Editeur
'../src/editeur/editeur.js',
'../src/editeur/editeur_classic.js',
'../src/editeur/editeur_multilignes.js',
'../src/editeur/recherche.js',
// Database
'res/db/local_db.js',
Expand Down
1 change: 1 addition & 0 deletions build/res/img
Binary file removed build/res/img/font/centrale_b.png
Binary file not shown.
Binary file removed build/res/img/font/centrale_c.png
Binary file not shown.
Binary file removed build/res/img/font/centrale_h.png
Binary file not shown.
Binary file removed build/res/img/font/demibas_b.png
Binary file not shown.
Binary file removed build/res/img/font/demibas_h.png
Binary file not shown.
Binary file removed build/res/img/font/demihaut.png
Binary file not shown.
Binary file removed build/res/img/font/demihaut_b.png
Binary file not shown.
Binary file removed build/res/img/font/demihaut_h.png
Binary file not shown.
Binary file removed build/res/img/gui/arrow_left.png
Binary file not shown.
Binary file removed build/res/img/gui/arrow_right.png
Binary file not shown.
Binary file removed build/res/img/gui/back.png
Binary file not shown.
Binary file removed build/res/img/gui/cross.png
Binary file not shown.
Binary file removed build/res/img/gui/hand.png
Binary file not shown.
Binary file removed build/res/img/gui/logo_miniature.png
Binary file not shown.
Binary file removed build/res/img/gui/logo_miniature_old.png
Binary file not shown.
Binary file removed build/res/img/gui/roll_down.png
Binary file not shown.
Binary file removed build/res/img/gui/roll_down_left.png
Binary file not shown.
Binary file removed build/res/img/gui/roll_up.png
Binary file not shown.
Binary file removed build/res/img/gui/roll_up_left.png
Binary file not shown.
Binary file removed build/res/img/gui/sauvegarde.png
Binary file not shown.
Binary file removed build/res/img/gui/scroll_down.png
Binary file not shown.
Binary file removed build/res/img/gui/scroll_left.png
Binary file not shown.
Binary file removed build/res/img/gui/scroll_right.png
Binary file not shown.
Binary file removed build/res/img/gui/scroll_up.png
Binary file not shown.
Binary file removed build/res/img/logo/logo_48.png
Binary file not shown.
Binary file removed build/res/img/logo/logo_central.png
Diff not rendered.
Binary file removed build/res/img/logo/logo_down.png
Diff not rendered.
Binary file removed build/res/img/logo/logo_up.png
Diff not rendered.
Binary file removed build/res/img/menu_labo/checkbox.png
Diff not rendered.
Binary file removed build/res/img/menu_labo/checkbox_valid.png
Diff not rendered.
Binary file removed build/res/img/menu_labo/input_text.png
Diff not rendered.
Binary file removed build/res/img/menu_labo/input_text_working_on.png
Diff not rendered.
Binary file removed build/res/img/menu_recit/erase.png
Diff not rendered.
Binary file removed build/res/img/menu_recit/vignette.png
Diff not rendered.
Binary file removed build/res/img/menu_recit/vignette_working_on.png
Diff not rendered.
Binary file removed build/res/img/ombre/CYGNE.png
Diff not rendered.
Binary file removed build/res/img/ombre/OMBRE.png
Diff not rendered.
Binary file removed build/res/img/ombre/shading.png
Diff not rendered.
Binary file removed build/res/img/ombre/slicing.png
Diff not rendered.
1 change: 1 addition & 0 deletions build/res/story
15 changes: 0 additions & 15 deletions build/res/story/stories.js

This file was deleted.

28 changes: 14 additions & 14 deletions build/separation.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion index.PC.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<script type="text/javascript">
var loaded_scripts = 0;
var n_scripts = 56;
var n_scripts = 57;
function scriptLoaded(script_path) {
loaded_scripts++;
console.debug(loaded_scripts + '/' + n_scripts + " : " + script_path);
Expand Down Expand Up @@ -47,6 +47,7 @@
<!-- Editeur -->
<script type="text/javascript" src="src/editeur/editeur.js"></script>
<script type="text/javascript" src="src/editeur/editeur_classic.js"></script>
<script type="text/javascript" src="src/editeur/editeur_multilignes.js"></script>
<script type="text/javascript" src="src/editeur/recherche.js"></script>
<!-- Database --
<script type="text/javascript" src="res/db/local_db.js"></script>
Expand Down
Binary file added res/img/editeur/add.png
Binary file modified res/img/font/demihaut_b.png
Binary file modified res/img/font/demihaut_b_working_on.png
Binary file modified res/img/font/demihaut_h.png
Binary file modified res/img/font/demihaut_h_working_on.png
Binary file modified res/img/font/demihaut_working_on.png
105 changes: 62 additions & 43 deletions src/editeur/editeur.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,87 @@
var Editeur = new Object();
var available_editions = ["classic"]
var Editeur = {};
var available_editions = ["classic"];

var ask_to_scroll_up = 0;
var ask_to_scroll_down = 0;

Editeur.start = function() {
Editeur.displayMenu();
}
this.type = "multilignes";
Editeur.multilignes.start();
// Editeur.displayMenu();
}.bind(Editeur);

//Affiche le menu de choix des types de récits
//TODO - Pour l'instant, on bypass
Editeur.displayMenu = function() {
Destroy.all();
Editeur.displayEdition(available_editions[0]);
}
};

Editeur.displayEdition = function(type) {
Destroy.all();
this.type = type;
console.log('Ouverture d\'edition '+type);
Editeur[type+'_init']();
}
Editeur[type].init();
};

Editeur.textInputTitle = function(x, y, z) {
var lm = this;
var callback = function(text){
if (text != "" && text != null) {
Destroy.objet(lm.title);
lm.title = new Word(text);
lm.title.setCenterX(x);
lm.title.setCenterY(y);
lm.title.setZoom(z);
lm.title.display();
CocoonJS.App.onTextDialogFinished.removeEventListener(callback);
var callback_success = function (text){
if (text !== "" && text !== null) {
Destroy.objet(this.title);
this.title = new Word(text);
this.title.setCenterX(x);
this.title.setCenterY(y);
this.title.setZoom(z);
this.title.display();
} else {
lm.textInputTitle();
this.textInputTitle();
}
}.bind(this);
function callback_cancel() {
return;
}
CocoonJS.App.onTextDialogFinished.addEventListener(callback);
CocoonJS.App.onTextDialogCancelled.addEventListener( function() {
CocoonJS.App.onTextDialogFinished.removeEventListener(callback);
});
if (language == 'fr')
CocoonJS.App.showTextDialog("", "Tapez votre titre :", "");
else
CocoonJS.App.showTextDialog("", "Enter a title :", "");
}

if (language == 'fr') {
Cocoon.Dialog.prompt({
message : "Tapez un mot a transformer :",
type : Cocoon.Dialog.keyboardType.TEXT,
confirmText : "Ok",
cancelText : "Annuler"
},
{
success: callback_success
});
}
else {
Cocoon.Dialog.prompt({
message : "Write a word to be transformed:",
type : Cocoon.Dialog.keyboardType.TEXT,
confirmText : "Ok",
cancelText : "Cancel"
},
{
success: callback_success,
cancel: callback_cancel
});
}
};

Editeur.scrollUp = function() {
if(!this.recherche.inTransform) {
if(!this.recherche.inAnimation)
this.recherche.scrollUp();
if(!RechercheEditeur.inTransform) {
if(!RechercheEditeur.inAnimation)
RechercheEditeur.scrollUp();
else
ask_to_scroll_up++;
}
}
};
Editeur.scrollDown = function() {
if(!this.recherche.inTransform) {
if(!this.recherche.inAnimation)
this.recherche.scrollDown();
if(!RechercheEditeur.inTransform) {
if(!RechercheEditeur.inAnimation)
RechercheEditeur.scrollDown();
else
ask_to_scroll_down++;
}
}
};

Editeur.scrollFinish = function() {
// On annule les évènements contraires
Expand All @@ -76,22 +95,22 @@ Editeur.scrollFinish = function() {
ask_to_scroll_down--;
Editeur.scrollDown();
}
}
};

Editeur.handle_recherche = function() {
this.recherche.callback();
}
RechercheEditeur.callback();
};

Editeur.saveStory = function() {
story = Editeur[this.type+'_getStory']();
story = Editeur[this.type].getStory();
MyStorage.addStory(story);
console.log('Saved story');
}
};

Editeur.destroy = function() {
if (this.type != undefined) {
Editeur[this.type+'_destroy']();
if (this.type !== undefined) {
Editeur[this.type].destroy();
}
}
};

scriptLoaded('src/editeur/editeur.js');
73 changes: 37 additions & 36 deletions src/editeur/editeur_classic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Editeur.classic_init = function() {
Editeur.classic = {};

Editeur.classic.init = function() {
Destroy.all();
this.title_x = W/2;
this.title_y = H/3;
Expand All @@ -8,32 +10,32 @@ Editeur.classic_init = function() {
this.word_zoom = 2;
if (language == 'fr') {
this.title = new Word('Titre');
this.classic_word = new Word('Changez moi');
this.word = new Word('Changez moi');
this.word_save = new Word('Sauver');
} else {
this.title = new Word('Title');
this.classic_word = new Word('Change me');
this.word = new Word('Change me');
this.word_save = new Word('Save');
}
this.word_save.setCenterX(W/2);
this.word_save.setY(H-margin-this.word_save.getHeight());
this.word_save.generate();
createjs.Tween.get(this.word_save.getNode()).to({'alpha': 1,}, 500);
var o = this;
this.classic_word_copy = null;
Editeur.classic_display();
}
this.word_copy = null;
Editeur.classic.display();
};

Editeur.classic_recherche_result = function(word) {
Editeur.classic.recherche_result = function(word) {
Destroy.all();
Editeur.classic_word = word;
Editeur.classic_word_copy = new Word(word.getValue(), word.getNextValue(), word.getPolice(), word.getCode());
Editeur.classic_word_copy.setZoom(Editeur.classic_word.getZoom());
Editeur.classic_display();
}
Editeur.classic.word = word;
Editeur.classic.word_copy = new Word(word.getValue(), word.getNextValue(), word.getPolice(), word.getCode());
Editeur.classic.word_copy.setZoom(Editeur.classic.word.getZoom());
Editeur.classic.display();
};


Editeur.classic_display = function() {
Editeur.classic.display = function() {
this.title.setZoom(this.title_zoom);
this.title.setCenterXY(this.title_x, this.title_y);
this.title.display();
Expand All @@ -42,15 +44,15 @@ Editeur.classic_display = function() {
Editeur.textInputTitle(x, y, z);
}, true);

this.classic_word.setZoom(this.word_zoom);
this.classic_word.setCenterXY(this.word_x, this.word_y);
if (this.classic_word.getNextValue() != this.classic_word.getValue()) { //Animation possible
this.classic_word.addGesture();
this.word.setZoom(this.word_zoom);
this.word.setCenterXY(this.word_x, this.word_y);
if (this.word.getNextValue() != this.word.getValue()) { //Animation possible
this.word.addGesture();
}
Event.onTap('Editeur.classic_word', this.classic_word, function() {
Editeur.classic_changeWord();
Event.onTap('Editeur.classic.word', this.word, function() {
Editeur.classic.changeWord();
}, true);
this.classic_word.display();
this.word.display();
this.word_save.display();
var o = this;
Event.onTap('word_save', this.word_save, function() {
Expand All @@ -63,15 +65,14 @@ Editeur.classic_display = function() {
o.word_save.setCenterX(W/2);
o.word_save.setY(H-margin-o.word_save.getHeight());
o.word_save.generate();
o.word_save.display(); },
true);
o.word_save.display();
}, true);
gui.Editeur_displayAll();
}
};

Editeur.classic.changeWord = function(offset) {
offset = offset || 0;

Editeur.classic_changeWord = function(offset) {
if (offset == undefined) {
offset = 0;
}
var known_words = MyStorage.listWords().map(function(x) {return JsonHandler.wordFromJson(JSON.parse(MyStorage.getWord(x)));});
if (known_words.length <= 0) {
if (language == 'fr')
Expand All @@ -80,31 +81,31 @@ Editeur.classic_changeWord = function(offset) {
alert('No words saved, let\'s go to the Lab !');
Labo.start();
} else {
this.recherche = new RechercheEditeur(this.classic_recherche_result);
this.recherche = new RechercheEditeur(this.recherche_result);
Destroy.all();
this.recherche.setPossibilities(known_words);
this.recherche.generate(offset);
gui.Editeur_classic_displayRecherche();
gui.Editeur_classic.displayRecherche();
this.recherche.display();
}
}
};

Editeur.classic_getStory = function() {
Editeur.classic.getStory = function() {
story = new StoryOnePage();
page = new Page();
line = new Line();
line.add(this.title);
page.addLine(line);
line = new Line();
line.add(this.classic_word_copy);
line.add(this.word_copy);
page.addLine(line);
story.setName(this.title.getValue());
story.addPage(page);
return story;
}
};

Editeur.classic_destroy = function() {
Destroy.objet(this.classic_word);
}
Editeur.classic.destroy = function() {
Destroy.objet(Editeur.classic.word);
};

scriptLoaded('src/editeur/editeur_classic.js');
Loading

0 comments on commit b56f61e

Please sign in to comment.