Renommage projet en Pitaya

This commit is contained in:
wpetit 2015-08-26 14:08:12 +02:00
parent 30092c25f3
commit cdf967750d
6 changed files with 41 additions and 41 deletions

View File

@ -7,7 +7,7 @@ module.exports = function(grunt) {
var NW_VERSION = '0.12.2'; var NW_VERSION = '0.12.2';
var BUILD_DIR = 'build'; var BUILD_DIR = 'build';
var BUILD_TARGETS = { var BUILD_TARGETS = {
linux_ia32: false, linux_ia32: true,
linux_x64: true, linux_x64: true,
win: false, win: false,
osx: false osx: false
@ -104,12 +104,12 @@ module.exports = function(grunt) {
}); });
grunt.registerTask('papaye:run', ['download', 'run']); grunt.registerTask('pitaya:run', ['download', 'run']);
grunt.registerTask( grunt.registerTask(
'papaye:build', 'pitaya:build',
['download', 'build', 'copy:build'] ['download', 'build', 'copy:build']
); );
grunt.registerTask('default', ['papaye:run']); grunt.registerTask('default', ['pitaya:run']);
grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-copy');

View File

@ -1,4 +1,4 @@
# Papaye # Pitaya
Lanceur d'application pour Linux Lanceur d'application pour Linux
@ -13,7 +13,7 @@ Lanceur d'application pour Linux
``` ```
git clone <repo> git clone <repo>
cd papaye cd pitaya
git checkout develop git checkout develop
npm install npm install
npm start npm start
@ -42,7 +42,7 @@ npm start -- --profile=my-profile.json
npm run build npm run build
``` ```
Un dossier `papaye-<version>-<target>-<arch>` sera créé dans le répertoire `./build`. Celui ci contient tous les fichiers nécessaires à l'application. Un dossier `pitaya-<version>-<target>-<arch>` sera créé dans le répertoire `./build`. Celui ci contient tous les fichiers nécessaires à l'application.
## Comment contribuer ## Comment contribuer

View File

@ -1,12 +1,12 @@
<html> <html>
<head> <head>
<title>Lanceur - Papaye</title> <title>Lanceur - Pitaya</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
</head> </head>
<body> <body>
<!-- Application root element --> <!-- Application root element -->
<div id="papaye"></div> <div id="pitaya"></div>
<!-- Templates --> <!-- Templates -->
<script id="items-list-tpl" type="text/x-template"> <script id="items-list-tpl" type="text/x-template">
@ -26,7 +26,7 @@
<!-- Application bootstrapping --> <!-- Application bootstrapping -->
<script type="text/javascript"> <script type="text/javascript">
Papaye.start('#papaye') Pitaya.start('#pitaya')
.then(function() { .then(function() {
console.info('Application started.'); console.info('Application started.');
}) })

View File

@ -1,4 +1,4 @@
(function(Papaye, window) { (function(Pitaya, window) {
"use strict"; "use strict";
@ -11,7 +11,7 @@
var minimist = require('minimist'); var minimist = require('minimist');
// Load templates // Load templates
var itemsListTpl = Handlebars.compile(Papaye.DOM.select('#items-list-tpl').innerHTML); var itemsListTpl = Handlebars.compile(Pitaya.DOM.select('#items-list-tpl').innerHTML);
// Internal constants // Internal constants
var DEFAULT_PROFILE = './default-profile.json'; var DEFAULT_PROFILE = './default-profile.json';
@ -20,19 +20,19 @@
* Start the app * Start the app
* *
* @param rootEl The application root element selector * @param rootEl The application root element selector
* @return Papaye * @return Pitaya
*/ */
Papaye.start = function(rootEl) { Pitaya.start = function(rootEl) {
Papaye._opts = minimist(gui.App.argv); Pitaya._opts = minimist(gui.App.argv);
Papaye._rootEl = Papaye.DOM.select(rootEl); Pitaya._rootEl = Pitaya.DOM.select(rootEl);
Papaye._initListeners(); Pitaya._initListeners();
var profilePath = Papaye._opts.profile || DEFAULT_PROFILE; var profilePath = Pitaya._opts.profile || DEFAULT_PROFILE;
return Papaye.loadProfile(profilePath) return Pitaya.loadProfile(profilePath)
.then(function() { .then(function() {
return Papaye; return Pitaya;
}) })
; ;
@ -44,11 +44,11 @@
* @param profilePath The path of the profile file * @param profilePath The path of the profile file
* @return Promise * @return Promise
*/ */
Papaye.loadProfile = function(profilePath) { Pitaya.loadProfile = function(profilePath) {
return Papaye._loadJSONFile(profilePath) return Pitaya._loadJSONFile(profilePath)
.then(function(profile) { .then(function(profile) {
Papaye._profile = profile; Pitaya._profile = profile;
Papaye.render(); Pitaya.render();
return profile; return profile;
}) })
; ;
@ -57,11 +57,11 @@
/** /**
* Update the application view * Update the application view
* *
* @return Papaye * @return Pitaya
*/ */
Papaye.render = function() { Pitaya.render = function() {
var rootEl = Papaye._rootEl; var rootEl = Pitaya._rootEl;
var profile = Papaye._profile; var profile = Pitaya._profile;
rootEl.innerHTML = itemsListTpl(profile); rootEl.innerHTML = itemsListTpl(profile);
}; };
@ -70,19 +70,19 @@
* Initialize DOM event listeners * Initialize DOM event listeners
* @private * @private
*/ */
Papaye._initListeners = function() { Pitaya._initListeners = function() {
var rootEl = Papaye._rootEl; var rootEl = Pitaya._rootEl;
rootEl.addEventListener('click', Papaye._onItemClick); rootEl.addEventListener('click', Pitaya._onItemClick);
}; };
/** /**
* App item click handler * App item click handler
* @private * @private
*/ */
Papaye._onItemClick = function(evt) { Pitaya._onItemClick = function(evt) {
var appItemEl = evt.srcElement.matches( '.app-item') ? evt.srcElement : var appItemEl = evt.srcElement.matches( '.app-item') ? evt.srcElement :
Papaye.DOM.getClosestAncestor(evt.srcElement, '.app-item') Pitaya.DOM.getClosestAncestor(evt.srcElement, '.app-item')
; ;
if( !appItemEl ) return; if( !appItemEl ) return;
@ -109,7 +109,7 @@
* @param filePath The path of the json file * @param filePath The path of the json file
* @return Promise * @return Promise
*/ */
Papaye._loadJSONFile = function(filePath) { Pitaya._loadJSONFile = function(filePath) {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
fs.readFile(filePath, 'utf8', function(err, fileContent) { fs.readFile(filePath, 'utf8', function(err, fileContent) {
if(err) return reject(err); if(err) return reject(err);
@ -123,4 +123,4 @@
}); });
}; };
}(window.Papaye = window.Papaye || {}, window)); }(window.Pitaya = window.Pitaya || {}, window));

View File

@ -1,8 +1,8 @@
(function(Papaye, window) { (function(Pitaya, window) {
"use strict"; "use strict";
var DOM = Papaye.DOM = {}; var DOM = Pitaya.DOM = {};
/** /**
* Select an element in the DOM by its CSS selector * Select an element in the DOM by its CSS selector
@ -50,4 +50,4 @@
}; };
}(window.Papaye = window.Papaye || {}, window)); }(window.Pitaya = window.Pitaya || {}, window));

View File

@ -1,5 +1,5 @@
{ {
"name": "papaye", "name": "pitaya",
"version": "0.0.0", "version": "0.0.0",
"private": "true", "private": "true",
"main": "index.html", "main": "index.html",
@ -12,8 +12,8 @@
"lodash": "^3.0.1" "lodash": "^3.0.1"
}, },
"scripts": { "scripts": {
"start": "./node_modules/.bin/grunt papaye:run", "start": "./node_modules/.bin/grunt pitaya:run",
"build": "./node_modules/.bin/grunt papaye:build" "build": "./node_modules/.bin/grunt pitaya:build"
}, },
"chromium-args": "--ignore-certificate-errors", "chromium-args": "--ignore-certificate-errors",
"window": { "window": {