Tuesday, December 15, 2015

wysiwyg text editors for Angular 1.x

Besides most popular wysiwyg text editor for Angular 1.x - TextAngularhttps://github.com/fraywing/textAngular, I've recently discovered couple of other plugins.


Angular-trix
http://sachinchoolur.github.io/angular-trix/







Wednesday, November 18, 2015

Pascal's triangle drawing with JavaScript

Pascal's triangle is a triangular array of the binomial coefficients. It has a a long history and lots of interesting details related to calculus theory. Graphical implementation using svg library RaphaelJS can be fond here: http://codepen.io/shershen08/pen/Gpzzvp?editors=001


Tuesday, October 20, 2015

ReactJs component template


React.createClass({
//inheritance and used 'variables'
        propTypes: {},
        mixins : [],
//lifecycle, occur before an instance of the component is created
        getInitialState: function() {},
        getDefaultProps: function() {},
//lifecycle, occur during the mounting/updating/mounted cycle
        componentWillMount : function() {},
        componentWillReceiveProps: function() {},
        componentWillUnmount : function() {},
//handy to have your custom methods separate and named differently
        _myCustomParseData : function() {},
        _onSelect : function() {},
//min lifecycle method
        render : function() {}
    })
See the Pen jbYMoL by Mike (@shershen08) on CodePen.

Wednesday, September 16, 2015

Polymer project and polymer summit 2015


Polymer is a relatively new web framework by Google designed to leverage the evolving web platform. It has just released version 1.0, previously it was 0.5, the whole project is about 1.5 year old. Polymer in its core makes use of webcomponents specification
Below is short overview of the platform and some notes about the Polymer summit 2015 event.

Thursday, August 27, 2015

How to enable CORS in Chrome, Mozilla Firefox, Safari and IE

Source: https://vaadin.com/blog/

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated.

That can be extremely handy for development - when your page partly loads data from you main dev server and some API or resources are received from your local server with mocked APIs for example.

Below there instructions how to enable cross-domain requests (in other words disable default CORS policy) in all major browsers: Chrome, Mozilla Firefox, Safari and IE.


Monday, July 20, 2015

jQuery events triggers (mouse, keyboard, touchscreen) cheatsheet

jQuery :contains Case-Insensitive custom selector

Regular jQuery('div:contains("' + MY_TEXT + '")') for selecting nodes that contain specific piece of text is case sensitive by default. So when you try to perform for example text search in a list of blocks or the whole page - the following case insensitive modified selector can be extremely handy.

jQuery.expr[':'].containsi = function (a, i, m) {
    var sText   = (a.textContent || a.innerText || ""); 
    var zRegExp = new RegExp (m[3], 'i');
    return zRegExp.test (sText);
}

from : https://css-tricks.com/

Wednesday, July 8, 2015

ReactJS links and information collection

Open-source Javascript library for creating user interfaces developed by Facebook team. Its initial release was in 2013, and stable version was only in late 2014 (0.12.2). It has soft learning curve, thanks to simple idea of encapsulated UI-elements-and-JS-components communicating to each other using set of defined ways. ReactJS production is ~128 KiB.

First, to read

Saturday, May 23, 2015

Translation JSON APIs


While building my web-app for adding and learning new words vocEverywhere I've decided to integrate some freely available translator API so that in most case you won't need to use separate translator (in browser tab or as an app) first and the copy-paste the results to vocEverywhere.

Doing a bit of googling I came across quite a big list with variety of translation APIs available -
http://www.programmableweb.com/news/63-translation-apis-bing-google-translate-and-google-ajax-language/2013/01/15


Saturday, May 16, 2015

Monday, April 6, 2015

Decorators in AngularJS, $provide.decorator

$provide.decorator if defined in config section of the application code and modifies original object which is passed as $delegate argument into decorator.

Here is set of examples giving better view on a powerful feature of decorators, available in AngularJS:


Thursday, April 2, 2015

angularJS photoshop demo


This demo uses canvas drawing directive and bootstrap-css for UI.
It has basic palette of colours and brush sizes and also layers that can be added/removed, activated or hidden.
Check it here: http://embed.plnkr.co/sn5eZV/