Les fichiers index, module1 et module2 doivent être dans le même répertoire moduleTest
.
moduleTest
|__module1
|__module2
test.js
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta content="yes" name="apple-mobile-web-app-capable"> | |
<title></title> | |
<!-- iPhone --> | |
<link href="http://taylor.fausak.me/static/images/apple-touch-icon-57x57.png" |
(function($) { | |
// Used by dateinput | |
$.expr = {':': {}}; | |
// Used by bootstrap | |
$.support = {}; | |
// Used by dateinput | |
$.fn.clone = function(){ | |
var ret = $(); |
## Pierre | |
# Implémentation d'un médiateur | |
### | |
Mediator | |
publish (event [args]) | |
subscribe (event, cb) | |
unsubscribe (event, cb) | |
### | |
## Correction de Chistophe | |
Mediator = |
/* global _ , window, Promise */ | |
(function (NS) { | |
"use strict"; | |
//Filename: helpers/message_helper.js | |
var isInBrowser = typeof module === 'undefined' && typeof window !== 'undefined'; | |
//create a modal in the DOM. | |
var ModalView = isInBrowser ? NS.Views.ModalView : require('../views/modal-view'); | |
var confirmView = new ModalView({ modalTitle: i18n.t('modal.confirm'), templateConsult: function () { return "" } }); | |
//if (!$('div[data-modal-confirm]').length) { | |
//Register the modal in the DOM. |
# Rules |
//Template d'une page de contact. | |
var templateContact = require('./template/contact'); | |
//Vue représentact la page de contact. | |
var ContactView = Backbone.View.extend({ | |
template: templateContact, | |
//Fonction d'initialisation de la vue de contact. | |
initialize: function initializeContactView(){ | |
this.listenTo(this.model, 'model:invalid', this.renderErrors, this); | |
this.listenTo(this.model, 'model:valid', this.save, this); |
{ | |
/** | |
* Does the view has to load the model from the service define in `getModelSvc`. | |
* @type {Boolean} | |
*/ | |
isModelToLoad: true, //By default the model is loaded. | |
/** | |
* If true, there is an edit mode in the view. | |
* @type {Boolean} | |
*/ |
PATH=/c/Users/{userName}/AppData/Roaming/npm/:$PATH |
function(){ | |
if(!jQuery){ | |
throw new Error('JQuery should be define'); | |
} | |
$.fn.percentify = function(options){ | |
function parseValue(value){ | |
//Code à faire pour parser la valeur. | |
return value.slice(0,-1); | |
} |