Skip to content

Instantly share code, notes, and snippets.

@mfrancois
mfrancois / app_etape_4.js
Last active August 29, 2015 13:56
Tutorial javascript step_0
document.getElementById('hello').innerHTML = "Hello World !";
document.getElementById('hello').addEventListener('click',function(event){
event.preventDefault();
event.target.style.backgroundColor = "#00FFFF";
});
@mfrancois
mfrancois / app.js
Last active August 29, 2015 13:56
Bootstrap application javascript (with jQuery)
// Check instance
if (typeof dist == "undefined" || !dist) {
var dist = {};
}
if (typeof dist.Project == "undefined" || !dist.Project) {
dist.Project = {};
}
dist.Project.Global = function () {
this.init();
};
@mfrancois
mfrancois / distExemple.js
Last active August 29, 2015 13:56
Bootstrap Plugin jQuery
(function($)
{
$.distExemple = function(element, options)
{
this.settings = $.extend(true, {}, $.distExemple.defaults, options);
this.element = element;
this.init();
}
$.extend($.distExemple,
{
@mfrancois
mfrancois / javascript_resources.md
Created December 2, 2013 09:26 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@mfrancois
mfrancois / 0_reuse_code.js
Created December 2, 2013 09:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mfrancois
mfrancois / app.js
Last active December 29, 2015 18:19
Angular directive for send end when render is finish
var main = angular.module('main', []).controller('mainCtrl', function ($scope) {
$scope.initTransformation = function () {
jQuery($element).jqTransform();
$scope.isStarted = true;
};
});
main.directive('onFinishRender', function ($timeout) {
return {
@mfrancois
mfrancois / app.js
Created November 29, 2013 17:54
Angular directive for adding jConfirm into element
angular.directive('ngConfirmClick', [
function () {
return {
priority: 100,
restrict: 'A',
link: function (scope, element, attrs) {
element.bind('click', function (e) {
var message = attrs.ngConfirmClick;
var title = attrs.title;
var link = attrs.href;