/*
 * This is some sample code to illustrate how things look!
 */
import * as templates from './somewhere';
import Musician from './musician';

const something = true;
export let blah = 123;
var somethingElse = false;

function test() {
    return new Promise((resolve, reject) => {
        resolve();
    });
}

class SomeClass {
    render() {
        return templates.helloWorld();
    }
}

class TaylorSwift extends Musician {
    constructor(position) {
        super(position);
    }

    get yearOfBirth() {
        return 1989;
    }

    perform(song) {
        this.sing(song)
    }
}

export default Paul;
/**
 * test function
 *
 * @param string
 * @return string
 */
function blah(foo, blah) {
    var test = 25;

    console.log(test.length);

    // if foo is true then return this string
    if (foo === true) {
        return 'foo is true';
    }
    return 'foo is false';
}

$(document).ready(function() {
    $("table").on("click", "td", function() {
        console.log('td click');
    });
});
window.Rainbow = {
    whatever: function(param) {

    },

    another: function(param) {

    }
};
window.Rainbow = window.Rainbow || {};

Rainbow.extend('javascript', [
    {
        'name': 'selector',
        'pattern': /\$(?=\.|\()/g
    }
]);
/**
 * cross browser get attribute for an element
 *
 * @see http://stackoverflow.com/questions/3755227/cross-browser-javascript-getattribute-method
 *
 * @param {Element} el
 * @param {string} attr     attribute you are trying to get
 * @returns {string}
 */
function _attr(el, attr) {
    var result = (el.getAttribute && el.getAttribute(attr)) || null;

    if (!result) {
        var attrs = el.attributes,
            length = attrs.length,
            i;

        for (i = 0; i < length; ++i) {
            if (attr[i].nodeName === attr) {
                result = attr[i].nodeValue;
            }
        }
    }

    return result;
}