A sample app to be a challange for a company.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
.bowerrc
.gitignore
LICENSE
README.md
bower.json
package.json
server.js

README.md

client-side-currency-converter

A sample app to be a challange for a company.

It is developed basicly on Node.js platform with Express in the server-side, Core.js in the client-side for publish / subscribe notification of custom events.

Free Currency Converter API is used to fetch data.

Note : The limits of the current weather API, the calls to the API is only for the Dollar to (=>) many currencies. For example, if you expect to get a conversion for Dollar to Euro, it can be possible but if you hope to do the opposite, the API policy does not allow us to fetch the data and return the same values as the same with the Dollar to Euro conversion query.

Module Usage

(function(Core) {
	
  Core.register('amountOfDollar', function (sandbox) {

    return {

      init : function () {
        console.log('This is the initialization method for the module.');
        this.$amountOfDollar = sandbox.use('$')('#amountOfDollar');
        this.addListeners();
        this.listen();
      },

      addListeners : function () {
        console.log('This is the method for binding current events with elements.');
      },

      listen : function () {
        console.log('This method is to listen custom events.');
      },

      onChange : function () {
        console.log('This is our change method for input text element with id amountofDollar.');
      },

      newEuroInputValue : function (data) {
        console.log('This method is fetch when notified if custom event with called newEuroInputValue is triggered.');
        console.dir(data.value);
      },

      notify : function (newValue) {
        console.log('This method is used to notify other modules listeners regards to its data within value property.');
        sandbox.notify({
          type : 'newDollarInputValue',
          data : {
            value : newValue
          }
        });
      }

    }

  });

}) (Core);

Extending Libraries, etc. (extensions.js)

  Core.extend('$', jQuery);
  Core.extend('numeral', numeral);
  Core.extend('config', config);

Getting modules worked, etc. (boot.js)

  /*Start all modules*/
  Core.startAll();

  /*Start specifically*/
  Core.start('moduleName');

  /*Stop all modules*/
  Core.stopAll();

  /*Stop specifically*/
  Core.stop('moduleName');