Skip to content

Commit

Permalink
Remove clutter from main directory by moving .js files to either impl…
Browse files Browse the repository at this point in the history
… or calendars directories. Fixes #28
  • Loading branch information
JCEmmons committed Jun 19, 2014
1 parent 8570897 commit d94069f
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 28 deletions.
4 changes: 3 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ module.exports = function (grunt) {
grunt.initConfig({
jshint: {
src: [
"*.js"
"*.js",
"calendars/*.js",
"impl/*.js"
],
options: {
jshintrc: ".jshintrc"
Expand Down
2 changes: 1 addition & 1 deletion Intl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define([ "./Record", "./calendars", "./common", "./locales!",
define([ "./impl/Record", "./impl/calendars", "./impl/common", "./locales!",
"requirejs-text/text!./cldr/supplemental/currencyData.json",
"requirejs-text/text!./cldr/supplemental/timeData.json",
"requirejs-text/text!./cldr/supplemental/calendarPreferenceData.json",
Expand Down
2 changes: 1 addition & 1 deletion buddhistCalendar.js → calendars/buddhistCalendar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define([ "./Record", "./calendarFunctions"],
define([ "../impl/Record", "../impl/calendarFunctions"],
function (Record, calendarFunctions) {
var calendarBuddhist = {
toLocalTime : function (date, timeZone) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define([ "./Record", "./calendarFunctions"], function (Record, calendarFunctions) {
define([ "../impl/Record", "../impl/calendarFunctions"], function (Record, calendarFunctions) {

return {

Expand Down
2 changes: 1 addition & 1 deletion gregorianCalendar.js → calendars/gregorianCalendar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(
[ "./Record", "./calendarFunctions" ],
[ "../impl/Record", "../impl/calendarFunctions" ],
function (Record, calendarFunctions) {
var gregorianCalendar = {
toLocalTime : function (date, timeZone) {
Expand Down
2 changes: 1 addition & 1 deletion hebrewCalendar.js → calendars/hebrewCalendar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(
[ "./Record", "./calendarFunctions" ], function (Record, calendarFunctions) {
[ "../impl/Record", "../impl/calendarFunctions" ], function (Record, calendarFunctions) {
// A helek ( plural halakim ) is the basic unit of time measurement in the Hebrew calendar.
// There are exactly 1080 halakim in an hour. Ref: http://en.wikipedia.org/wiki/Helek
var HALAKIM_PER_HOUR = 1080;
Expand Down
2 changes: 1 addition & 1 deletion islamicCalendar.js → calendars/islamicCalendar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(
[ "./Record", "./calendarFunctions"], function (Record, calendarFunctions) {
[ "../impl/Record", "../impl/calendarFunctions"], function (Record, calendarFunctions) {


return {
Expand Down
2 changes: 1 addition & 1 deletion japaneseCalendar.js → calendars/japaneseCalendar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(
[ "./Record", "./calendarFunctions" ],
[ "../impl/Record", "../impl/calendarFunctions" ],
function (Record, calendarFunctions) {
var japaneseCalendar = {
toLocalTime : function (date, timeZone) {
Expand Down
2 changes: 1 addition & 1 deletion rocCalendar.js → calendars/rocCalendar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(
[ "./Record", "./calendarFunctions"],
[ "../impl/Record", "../impl/calendarFunctions"],
function (Record, calendarFunctions) {
var rocCalendar = {
toLocalTime : function (date, timeZone) {
Expand Down
2 changes: 1 addition & 1 deletion umalquraCalendar.js → calendars/umalquraCalendar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(["./Record", "./calendarFunctions", "./gregorianCalendar", "./islamicCalendar"],
define(["../impl/Record", "../impl/calendarFunctions", "./gregorianCalendar", "./islamicCalendar"],
function (Record, calendarFunctions, gregorian, islamicCalendar) {

return {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion calendarFunctions.js → impl/calendarFunctions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define([ "./Record", "requirejs-text/text!./cldr/supplemental/calendarData.json"],
define([ "./Record", "requirejs-text/text!../cldr/supplemental/calendarData.json"],
function (Record, calendarDataJson) {
var calendarData = JSON.parse(calendarDataJson).supplemental.calendarData;
var calendarFunctions = {
Expand Down
18 changes: 9 additions & 9 deletions calendars.js → impl/calendars.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
define([ "./Record",
"requirejs-text/text!./cldr/supplemental/calendarData.json",
"./buddhistCalendar",
"./gregorianCalendar",
"./hebrewCalendar",
"./japaneseCalendar",
"./rocCalendar",
"./civilTabularCalendar",
"./islamicCalendar",
"./umalquraCalendar"],
"requirejs-text/text!../cldr/supplemental/calendarData.json",
"../calendars/buddhistCalendar",
"../calendars/gregorianCalendar",
"../calendars/hebrewCalendar",
"../calendars/japaneseCalendar",
"../calendars/rocCalendar",
"../calendars/civilTabularCalendar",
"../calendars/islamicCalendar",
"../calendars/umalquraCalendar"],
function (Record, calendarDataJson, buddhistCalendar, gregorianCalendar, hebrewCalendar,
japaneseCalendar, rocCalendar, civilTabularCalendar, islamicCalendar, umalquraCalendar) {
var calendars = {
Expand Down
8 changes: 4 additions & 4 deletions common.js → impl/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Commonly used routines throughout ECMA-402 package. Also referred to in the standard as "Abstract Operations"
*/
define(["./List", "./Record",
"requirejs-text/text!./cldr/config/availableLocales.json",
"requirejs-text/text!./cldr/supplemental/aliases.json",
"requirejs-text/text!./cldr/supplemental/localeAliases.json",
"requirejs-text/text!./cldr/supplemental/parentLocales.json" ],
"requirejs-text/text!../cldr/config/availableLocales.json",
"requirejs-text/text!../cldr/supplemental/aliases.json",
"requirejs-text/text!../cldr/supplemental/localeAliases.json",
"requirejs-text/text!../cldr/supplemental/parentLocales.json" ],
function (List, Record, availableLocalesJson, aliasesJson, localeAliasesJson, parentLocalesJson) {
var aliases = JSON.parse(aliasesJson).supplemental.metadata.alias;
var localeAliases = JSON.parse(localeAliasesJson).supplemental.metadata.alias;
Expand Down
2 changes: 1 addition & 1 deletion load.js → impl/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define([
jsonElements.push("ca-islamic", "ca-islamic-umalqura", "ca-islamic-civil", "ca-islamic-tbla");
}
var dependencies = jsonElements.map(function (element) {
return "requirejs-text/text!./cldr/" + locale + "/" + element + ".json";
return "requirejs-text/text!../cldr/" + locale + "/" + element + ".json";
});

// Load all the JSON files requested, and then return their data in a hash
Expand Down
6 changes: 3 additions & 3 deletions locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
define([
"module",
"require",
"./common",
"./load" // just so builder knows we will be using that module
"./impl/common",
"./impl/load" // just so builder knows we will be using that module
], function (module, require, common) {
// Compute locales to pre-load. Use hash to remove duplicates.
var localeHash = {};
Expand Down Expand Up @@ -40,7 +40,7 @@ define([
var locales = Object.keys(localeHash);

// Compute dependencies to require()
var dependencies = locales.map(function (locale) { return "./load!" + locale; });
var dependencies = locales.map(function (locale) { return "./impl/load!" + locale; });

return {
load: function (path, callerRequire, onload) {
Expand Down

0 comments on commit d94069f

Please sign in to comment.