From 916b5da5077544a2d57116864025750da83d60b0 Mon Sep 17 00:00:00 2001 From: Meysam GanJi Date: Wed, 7 Sep 2016 09:24:45 +0430 Subject: [PATCH] Create master branch via GitHub --- images/arrow-down.png | Bin 0 -> 216 bytes images/octocat-small.png | Bin 0 -> 357 bytes index.html | 372 ++++++++++++++++++++++++++++++ javascripts/scale.fix.js | 20 ++ params.json | 6 + stylesheets/github-light.css | 124 ++++++++++ stylesheets/styles.css | 423 +++++++++++++++++++++++++++++++++++ 7 files changed, 945 insertions(+) create mode 100644 images/arrow-down.png create mode 100644 images/octocat-small.png create mode 100644 index.html create mode 100644 javascripts/scale.fix.js create mode 100644 params.json create mode 100644 stylesheets/github-light.css create mode 100644 stylesheets/styles.css diff --git a/images/arrow-down.png b/images/arrow-down.png new file mode 100644 index 0000000000000000000000000000000000000000..5c55c6a8c9edfaa47379862d770304c36c3ac7ff GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^JU}eW!3HFke0{SLNX_?jaSYLzn4I9i%II*Xp^aIh zpz+6!8``B?P5)0c^x#?E7OdXC_y6D5zw1+Ygru)Ji1RWzykR(WyifLD&pJjGw#n?P zLqkH=Y}vm3H~*pZ^K<_6Lqu1mGH{74&_2}6eISp?=$Y`s3cD`%ef7U|_uU`DGt*!YlC@Am|DD>an&JK*_ z<>mi__UCKux;y>4Pqor7j|)IU*M9Gw z-IGbu2m_ZdUGO1GBT$h55cdP|c_4ld#Or}LA6*>)0_L))J+G2e00000NkvXXu0mjf DP-vTT literal 0 HcmV?d00001 diff --git a/index.html b/index.html new file mode 100644 index 0000000..642aced --- /dev/null +++ b/index.html @@ -0,0 +1,372 @@ + + + + + + Intldate by meysampg + + + + + + + + +
+
+

Intldate

+

A small php library for date converting between multiple calendar

+ + + +

This project is maintained by meysampg

+ + +
+
+

+Intl. Date

+ +

PHP Library for Converting Date to Multiple Calendars

+ +

+Installation

+ +

The preferred way to install this extension is through composer.

+ +

Either run

+ +
composer require --prefer-dist meysampg/intldate "*"
+ +

or add

+ +
"meysampg/intldate": "*"
+ +

to the require section of your composer.json file.

+ +

Also easily you can Download and use it.

+ +

+Usage

+ +

Once the library is installed, simply use it in your php file:

+ +
use meysampg\intldate\IntlDateTrait;
+ +

and use it on your desired class:

+ +
<?php
+
+namespace foo\bar;
+
+use meysampg\intldate\IntlDateTrait;
+
+class Bar
+{
+  use IntlDateTrait;
+  // Some codes are here!
+
+  echo $this->fromGregorian([2017, 9, 7, 12, 23, 45])->toPersian('en')->asDateTime();
+}
+ +

+Anathomy

+ +

IntlDateTrait has a simple logic for naming methods: "A date starts from origin and ends to final. So all methods (setters and getters) that are related to incoming date are named by setOriginXXXX and getOriginXXXX (which XXXX shows a feature of time, like timezone or locale) and all methods that are corresponded to outgoing date are regarded as setFinalXXXX and getFinalXXXX. A list of available methods can be find in bottom of this document.

+ +

+Conversion

+ +

At first I must note that incoming date must be an array in this form:

+ +
[
+    year, // 2016
+    month, // 2
+    day, // 23
+    hour, // 12
+    minute, // 23
+    second // 4
+]
+ +

Currently, the library CAN'T parse a string as time (See ToDo section), so before converting a date, you MUST parse it on a acceptable array (It can be done with preg_match or each tools that you know). Now you can easily use +IntlDateTrait::from($datetimeArray, $locale, $calendar) for importing an incoming date and IntlDateTrait::to($locale, $calendar) for converting it to another system. We disccuesed about $datetimeArray in the first of this section, it's our date for converting on a accepted format. $locale is the regional information of a language. For example for The English it's en, for Farsi it's fa, for Spanish it's es and so on. You can find a complete list of them at this link. And finally calendar is your desired date system. This library use the Intl* family of php and so you can use all supported calendar in ICU project. Now this calendars are supported:

+ +
    +
  • persian
  • +
  • gregorian
  • +
  • japanese
  • +
  • buddhist
  • +
  • chinese
  • +
  • indian
  • +
  • islamic
  • +
  • hebrew
  • +
  • coptic
  • +
  • ethiopic
  • +
+ +

It's better to use their handler in code instead of using direct name. These handlers are:

+ +
// Use them in `self::$CAL_CALENDAR, for example `$calendar = self::$CAL_HEBREW`.
+$CAL_PERSIAN
+$CAL_JAPANESE
+$CAL_BUDDHIST
+$CAL_CHINESE
+$CAL_INDIAN
+$CAL_ISLAMIC
+$CAL_HEBREW
+$CAL_COPTIC
+$CAL_ETHIOPIC
+$CAL_GREGORIAN
+ +

+ShortHands

+ +

There are some shorthands for converting dates in a painless way (Yeah! With all of my proud, I'm a Lazy man :D). This shorthands are formatted as fromYyyy() for incoming date function and toZzzz() for outgoing date function such that, Yyyy and Zzzz are the name of calendars. For incoming function, the signature is fromYyyy($datetimeArray, $locale = 'en_US') and for outgoing is toZzzz($locale = 'fa'). Use $locale in incoming function if you have non-latin digits and use it on outgoing function, if you wanna show the converted date by latin digits (Based on region of calendar, $locales are defined, for example the default locate of Persian calendar for outgoing function is fa). Shorthands are listed in table.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IncomingOutgoing
fromPersiantoPersian
fromJapanesetoJapanese
fromBuddhisttoBuddhist
fromChinesetoChinese
fromIndiantoIndian
fromIslamictoIslamic
fromHebrewtoHebrew
fromCoptictoCoptic
fromEthiopictoEthiopic
fromGregoriantoGregorian
+ +

+Showing Date

+ +

There are two functions for showing converted dates. The first is asDateTime and the last one is asTimestamp.

+ +

Signature of asDateTime is asDateTime($pattern = 'yyyy/MM/dd, HH:mm:ss'). This function accepts an ICU-acceptable format. You can find more info from this link. Also it's good idea for implementing a function that parse traditional php date-acceptable format (See ToDo section).

+ +

asTimestamp function return the unix epoch, positive integer for time after that and negative integer for before that.

+ +

+Examples

+ +

There are some examples for using IntlDateTrait. I think they are necessary and sufficent.

+ +
$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toPersian('en')->asDateTime();
+// '1396/06/16, 07:53:45'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toPersian()->asDateTime();
+// '۱۳۹۶/۰۶/۱۶, ۰۷:۵۳:۴۵'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toJapanese()->asDateTime();
+// '0029/09/07, 07:53:45'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toIslamic()->asDateTime();
+// '١٤٣٨/١٢/١٧, ٠٧:٥٣:٤٥'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toBuddhist()->asDateTime();
+// '2560/09/07, 07:53:45'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toChinese()->asDateTime();
+// '0034/07/17, 07:53:45'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toIndian()->asDateTime();
+// '1939/06/16, 07:53:45'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toHebrew()->asDateTime();
+// 'תשע״ז/י״ב/ט״ז, 07:53:45'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toCoptic()->asDateTime();
+// '1733/13/02, 07:53:45'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toEthiopic()->asDateTime();
+// '2009/13/02, 07:53:45'
+
+$this->fromPersian([1396, 6, 16, 12, 23, 45])->toIslamic()->asDateTime();
+// '١٤٣٨/١٢/١٧, ٠٧:٥٣:٤٥'
+
+$this->fromPersian([1396, 6, 16, 12, 23, 45])->toGregorian()->asDateTime();
+// '2017/09/07, 07:53:45'
+
+$this->fromPersian([1396, 6, 16, 12, 23, 45])->toGregorian()->setFinalTimeZone('Asia/Tehran')->asDateTime();
+// '2017/09/07, 12:23:45'
+
+$this->fromPersian([1396, 6, 16, 12, 23, 45])->toGregorian()->setFinalTimeZone('Asia/Tehran')->asDateTime('yyyy');
+// '2017'
+
+$this->fromGregorian([2017, 9, 7, 12, 23, 45])->asTimestamp();
+// '1504770825'
+
+$this->fromPersian([1396, 6, 16, 12, 23, 45])->asTimestamp();
+// '1504770825'
+ +

+IntlDateTrait API

+ +

There are some methods that help to control more on converting process. I just list them in this section. I think thier name complain their usages, If it's not, please write document for them :D.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettersGettes
setOriginDate($datetimeArray)getFinalDate()
setFromLocale($locale)getFromLocale()
setFromCalendar($calendar)getFromCalendar()
setToLocale($locale)getToLocale()
setToCalendar($calendar)getToCalendar()
getFromLocaleAndCalendar()getToLocaleAndCalendar()
setOriginTimeZone($timezone)getOriginTimeZone()
setFinalTimeZone($timezone)getFinalTimeZone()
setOriginCalendar($locale)getOriginCalendar()
setFinalCalendar($locale)getFinalCalendar()
setFinalDateType($datetype)getFinalDateType()
setFinalTimeType($timetype)getFinalTimeType()
setFinalCalendarType($calendarType)getFinalCalendarType()
setFinalPattern($pattern)getFinalPattern()
setIntlDateFormatter($locale = "en_US", $datetype = IntlDateFormatter::FULL, $timetype = IntlDateFormatter::FULL, $timezone = 'UTC', $calendar = IntlDateFormatter::GREGORIAN, $pattern = 'yyyy/MM/dd HH:mm:ss')getIntlDateFormatter()
setIntlCalendar($timezone = 'Asia/Tehran', $locale = 'fa_IR@calendar=persian')getIntlCalendar()
+ +

+ToDo

+ +
    +
  • +

    Implement parsePattern($pattern) method.

    + +
    /**
    +* Implement a function to parse both ICU patterns and php date
    +* function patterns and return a pattern that is compatible on
    +* ICU format. The php pattern must start with php keyword, for
    +* example `php:Y-F-d, H:i:s` is a php pattern.
    +*/
    +
  • +
  • +

    Implement guessDateTime($timestring) method.

    + +
    /**
    +* Implement a function to convert '2016/01/22 11:43:24' to an array
    +* like
    +* [
    +*      0 => 2016, // Year
    +*      1 => 0, // Month. IntlCalendar use 0 for first month and so on.
    +*      2 => 22, // Day
    +*      3 => 11, // Hour
    +*      4 => 43, // Minute
    +*      5 => 24, // Seconds
    +* ]
    +*/
    +
  • +
  • +

    Write tests!

    + +

    +Contribute

    + +

    Just fork this repository, do your modification or addition and send a pull request!

    +
  • +
+
+ +
+ + + + diff --git a/javascripts/scale.fix.js b/javascripts/scale.fix.js new file mode 100644 index 0000000..08716c0 --- /dev/null +++ b/javascripts/scale.fix.js @@ -0,0 +1,20 @@ +fixScale = function(doc) { + + var addEvent = 'addEventListener', + type = 'gesturestart', + qsa = 'querySelectorAll', + scales = [1, 1], + meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; + + function fix() { + meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; + doc.removeEventListener(type, fix, true); + } + + if ((meta = meta[meta.length - 1]) && addEvent in doc) { + fix(); + scales = [.25, 1.6]; + doc[addEvent](type, fix, true); + } + +}; \ No newline at end of file diff --git a/params.json b/params.json new file mode 100644 index 0000000..df39951 --- /dev/null +++ b/params.json @@ -0,0 +1,6 @@ +{ + "name": "Intldate", + "tagline": "A small php library for date converting between multiple calendar", + "body": "Intl. Date\r\n==========\r\nPHP Library for Converting Date to Multiple Calendars\r\n\r\nInstallation\r\n------------\r\n\r\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\r\n\r\nEither run\r\n\r\n```bash\r\ncomposer require --prefer-dist meysampg/intldate \"*\"\r\n```\r\n\r\nor add\r\n\r\n```json\r\n\"meysampg/intldate\": \"*\"\r\n```\r\n\r\nto the require section of your `composer.json` file.\r\n\r\nAlso easily you can [Download](https://github.com/meysampg/intldate/archive/master.zip) and use it.\r\n\r\nUsage\r\n-----\r\n\r\nOnce the library is installed, simply use it in your php file:\r\n\r\n```php\r\nuse meysampg\\intldate\\IntlDateTrait;\r\n```\r\nand use it on your desired class:\r\n\r\n```php\r\nfromGregorian([2017, 9, 7, 12, 23, 45])->toPersian('en')->asDateTime();\r\n}\r\n```\r\n\r\nAnathomy\r\n--------\r\n\r\n`IntlDateTrait` has a simple logic for naming methods: \"A date starts from *origin* and ends to *final*. So all methods (setters and getters) that are related to incoming date are named by `setOriginXXXX` and `getOriginXXXX` (which `XXXX` shows a feature of time, like *timezone* or *locale*) and all methods that are corresponded to outgoing date are regarded as `setFinalXXXX` and `getFinalXXXX`. A list of available methods can be find in bottom of this document.\r\n\r\nConversion\r\n----------\r\nAt first I must note that incoming date must be an array in this form:\r\n\r\n```php\r\n[\r\n year, // 2016\r\n month, // 2\r\n day, // 23\r\n hour, // 12\r\n minute, // 23\r\n second // 4\r\n]\r\n```\r\nCurrently, the library **CAN'T** parse a string as time (See ToDo section), so before converting a date, you **MUST** parse it on a acceptable array (It can be done with `preg_match` or each tools that you know). Now you can easily use\r\n`IntlDateTrait::from($datetimeArray, $locale, $calendar)` for importing an incoming date and `IntlDateTrait::to($locale, $calendar)` for converting it to another system. We disccuesed about `$datetimeArray` in the first of this section, it's our date for converting on a accepted format. `$locale` is the regional information of a language. For example for The *English* it's `en`, for *Farsi* it's `fa`, for *Spanish* it's `es` and so on. You can find a complete list of them at [this link](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). And finally calendar is your desired date system. This library use the `Intl*` family of `php` and so you can use all supported calendar in `ICU` project. Now this calendars are supported:\r\n - persian\r\n - gregorian\r\n - japanese\r\n - buddhist\r\n - chinese\r\n - indian\r\n - islamic\r\n - hebrew\r\n - coptic\r\n - ethiopic\r\n\r\nIt's better to use their handler in code instead of using direct name. These handlers are:\r\n\r\n```php\r\n// Use them in `self::$CAL_CALENDAR, for example `$calendar = self::$CAL_HEBREW`.\r\n$CAL_PERSIAN\r\n$CAL_JAPANESE\r\n$CAL_BUDDHIST\r\n$CAL_CHINESE\r\n$CAL_INDIAN\r\n$CAL_ISLAMIC\r\n$CAL_HEBREW\r\n$CAL_COPTIC\r\n$CAL_ETHIOPIC\r\n$CAL_GREGORIAN\r\n```\r\n\r\nShortHands\r\n----------\r\nThere are some shorthands for converting dates in a painless way (Yeah! With all of my proud, I'm a **Lazy** man :D). This shorthands are formatted as `fromYyyy()` for incoming date function and `toZzzz()` for outgoing date function such that, `Yyyy` and `Zzzz` are the name of calendars. For incoming function, the signature is `fromYyyy($datetimeArray, $locale = 'en_US')` and for outgoing is `toZzzz($locale = 'fa')`. Use `$locale` in incoming function if you have non-latin digits and use it on outgoing function, if you wanna show the converted date by latin digits (Based on region of calendar, `$locales` are defined, for example the default locate of `Persian` calendar for outgoing function is `fa`). Shorthands are listed in table.\r\n\r\n| Incoming | Outgoing |\r\n|---------------|---------------|\r\n|fromPersian | toPersian |\r\n|fromJapanese |toJapanese |\r\n|fromBuddhist |toBuddhist |\r\n|fromChinese |toChinese |\r\n|fromIndian |toIndian |\r\n|fromIslamic |toIslamic |\r\n|fromHebrew |toHebrew |\r\n|fromCoptic |toCoptic |\r\n|fromEthiopic |toEthiopic |\r\n|fromGregorian |toGregorian |\r\n\r\nShowing Date\r\n------------\r\nThere are two functions for showing converted dates. The first is `asDateTime` and the last one is `asTimestamp`.\r\n\r\nSignature of `asDateTime` is `asDateTime($pattern = 'yyyy/MM/dd, HH:mm:ss')`. This function accepts an `ICU`-acceptable format. You can find more info from [this link](http://www.icu-project.org/apiref/icu4c/classSimpleDateFormat.html#details). Also it's good idea for implementing a function that parse traditional php `date`-acceptable format (See ToDo section).\r\n\r\n`asTimestamp` function return the unix epoch, positive integer for time after that and negative integer for before that.\r\n\r\nExamples\r\n--------\r\nThere are some examples for using `IntlDateTrait`. I think they are necessary and sufficent.\r\n\r\n```php\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toPersian('en')->asDateTime();\r\n// '1396/06/16, 07:53:45'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toPersian()->asDateTime();\r\n// '۱۳۹۶/۰۶/۱۶, ۰۷:۵۳:۴۵'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toJapanese()->asDateTime();\r\n// '0029/09/07, 07:53:45'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toIslamic()->asDateTime();\r\n// '١٤٣٨/١٢/١٧, ٠٧:٥٣:٤٥'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toBuddhist()->asDateTime();\r\n// '2560/09/07, 07:53:45'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toChinese()->asDateTime();\r\n// '0034/07/17, 07:53:45'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toIndian()->asDateTime();\r\n// '1939/06/16, 07:53:45'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toHebrew()->asDateTime();\r\n// 'תשע״ז/י״ב/ט״ז, 07:53:45'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toCoptic()->asDateTime();\r\n// '1733/13/02, 07:53:45'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->toEthiopic()->asDateTime();\r\n// '2009/13/02, 07:53:45'\r\n\r\n$this->fromPersian([1396, 6, 16, 12, 23, 45])->toIslamic()->asDateTime();\r\n// '١٤٣٨/١٢/١٧, ٠٧:٥٣:٤٥'\r\n\r\n$this->fromPersian([1396, 6, 16, 12, 23, 45])->toGregorian()->asDateTime();\r\n// '2017/09/07, 07:53:45'\r\n\r\n$this->fromPersian([1396, 6, 16, 12, 23, 45])->toGregorian()->setFinalTimeZone('Asia/Tehran')->asDateTime();\r\n// '2017/09/07, 12:23:45'\r\n\r\n$this->fromPersian([1396, 6, 16, 12, 23, 45])->toGregorian()->setFinalTimeZone('Asia/Tehran')->asDateTime('yyyy');\r\n// '2017'\r\n\r\n$this->fromGregorian([2017, 9, 7, 12, 23, 45])->asTimestamp();\r\n// '1504770825'\r\n\r\n$this->fromPersian([1396, 6, 16, 12, 23, 45])->asTimestamp();\r\n// '1504770825'\r\n```\r\n\r\nIntlDateTrait API\r\n-----------------\r\nThere are some methods that help to control more on converting process. I just list them in this section. I think thier name complain their usages, If it's not, please write document for them :D.\r\n\r\n|Setters |Gettes |\r\n|--------------------------------|--------------------------|\r\n|`setOriginDate($datetimeArray)` | `getFinalDate()` |\r\n|`setFromLocale($locale)` |`getFromLocale()` |\r\n|`setFromCalendar($calendar)` |`getFromCalendar()` |\r\n|`setToLocale($locale)` |`getToLocale()` |\r\n|`setToCalendar($calendar)` |`getToCalendar()` |\r\n|`getFromLocaleAndCalendar()` |`getToLocaleAndCalendar()`|\r\n|`setOriginTimeZone($timezone)` |`getOriginTimeZone()` |\r\n|`setFinalTimeZone($timezone)` |`getFinalTimeZone()` |\r\n|`setOriginCalendar($locale)` |`getOriginCalendar()` |\r\n|`setFinalCalendar($locale)` |`getFinalCalendar()` |\r\n|`setFinalDateType($datetype)` |`getFinalDateType()` |\r\n|`setFinalTimeType($timetype)` |`getFinalTimeType()` |\r\n|`setFinalCalendarType($calendarType)`|`getFinalCalendarType()`|\r\n|`setFinalPattern($pattern)` |`getFinalPattern()` |\r\n|`setIntlDateFormatter($locale = \"en_US\", $datetype = IntlDateFormatter::FULL, $timetype = IntlDateFormatter::FULL, $timezone = 'UTC', $calendar = IntlDateFormatter::GREGORIAN, $pattern = 'yyyy/MM/dd HH:mm:ss')`|`getIntlDateFormatter()`|\r\n|`setIntlCalendar($timezone = 'Asia/Tehran', $locale = 'fa_IR@calendar=persian')`|`getIntlCalendar()`|\r\n\r\nToDo\r\n----\r\n - Implement `parsePattern($pattern)` method.\r\n\r\n ```php\r\n/**\r\n * Implement a function to parse both ICU patterns and php date\r\n * function patterns and return a pattern that is compatible on\r\n * ICU format. The php pattern must start with php keyword, for\r\n * example `php:Y-F-d, H:i:s` is a php pattern.\r\n */\r\n ```\r\n\r\n - Implement `guessDateTime($timestring)` method.\r\n\r\n ```php\r\n /**\r\n * Implement a function to convert '2016/01/22 11:43:24' to an array\r\n * like\r\n * [\r\n * 0 => 2016, // Year\r\n * 1 => 0, // Month. IntlCalendar use 0 for first month and so on.\r\n * 2 => 22, // Day\r\n * 3 => 11, // Hour\r\n * 4 => 43, // Minute\r\n * 5 => 24, // Seconds\r\n * ]\r\n */\r\n ```\r\n\r\n - Write tests!\r\n \r\n Contribute\r\n ----------\r\n Just fork this repository, do your modification or addition and send a pull request!", + "note": "Don't delete this file! It's used internally to help with page regeneration." +} \ No newline at end of file diff --git a/stylesheets/github-light.css b/stylesheets/github-light.css new file mode 100644 index 0000000..0c6b24d --- /dev/null +++ b/stylesheets/github-light.css @@ -0,0 +1,124 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 GitHub, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +.pl-c /* comment */ { + color: #969896; +} + +.pl-c1 /* constant, variable.other.constant, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header */, +.pl-s .pl-v /* string variable */ { + color: #0086b3; +} + +.pl-e /* entity */, +.pl-en /* entity.name */ { + color: #795da3; +} + +.pl-smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */, +.pl-s .pl-s1 /* string source */ { + color: #333; +} + +.pl-ent /* entity.name.tag */ { + color: #63a35c; +} + +.pl-k /* keyword, storage, storage.type */ { + color: #a71d5d; +} + +.pl-s /* string */, +.pl-pds /* punctuation.definition.string, string.regexp.character-class */, +.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */, +.pl-sr /* string.regexp */, +.pl-sr .pl-cce /* string.regexp constant.character.escape */, +.pl-sr .pl-sre /* string.regexp source.ruby.embedded */, +.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */ { + color: #183691; +} + +.pl-v /* variable */ { + color: #ed6a43; +} + +.pl-id /* invalid.deprecated */ { + color: #b52a1d; +} + +.pl-ii /* invalid.illegal */ { + color: #f8f8f8; + background-color: #b52a1d; +} + +.pl-sr .pl-cce /* string.regexp constant.character.escape */ { + font-weight: bold; + color: #63a35c; +} + +.pl-ml /* markup.list */ { + color: #693a17; +} + +.pl-mh /* markup.heading */, +.pl-mh .pl-en /* markup.heading entity.name */, +.pl-ms /* meta.separator */ { + font-weight: bold; + color: #1d3e81; +} + +.pl-mq /* markup.quote */ { + color: #008080; +} + +.pl-mi /* markup.italic */ { + font-style: italic; + color: #333; +} + +.pl-mb /* markup.bold */ { + font-weight: bold; + color: #333; +} + +.pl-md /* markup.deleted, meta.diff.header.from-file */ { + color: #bd2c00; + background-color: #ffecec; +} + +.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ { + color: #55a532; + background-color: #eaffea; +} + +.pl-mdr /* meta.diff.range */ { + font-weight: bold; + color: #795da3; +} + +.pl-mo /* meta.output */ { + color: #1d3e81; +} + diff --git a/stylesheets/styles.css b/stylesheets/styles.css new file mode 100644 index 0000000..647f08d --- /dev/null +++ b/stylesheets/styles.css @@ -0,0 +1,423 @@ +@import url(https://fonts.googleapis.com/css?family=Arvo:400,700,400italic); + +/* MeyerWeb Reset */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font: inherit; + vertical-align: baseline; +} + + +/* Base text styles */ + +body { + padding:10px 50px 0 0; + font-family:"Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + color: #232323; + background-color: #FBFAF7; + margin: 0; + line-height: 1.8em; + -webkit-font-smoothing: antialiased; + +} + +h1, h2, h3, h4, h5, h6 { + color:#232323; + margin:36px 0 10px; +} + +p, ul, ol, table, dl { + margin:0 0 22px; +} + +h1, h2, h3 { + font-family: Arvo, Monaco, serif; + line-height:1.3; + font-weight: normal; +} + +h1,h2, h3 { + display: block; + border-bottom: 1px solid #ccc; + padding-bottom: 5px; +} + +h1 { + font-size: 30px; +} + +h2 { + font-size: 24px; +} + +h3 { + font-size: 18px; +} + +h4, h5, h6 { + font-family: Arvo, Monaco, serif; + font-weight: 700; +} + +a { + color:#C30000; + font-weight:200; + text-decoration:none; +} + +a:hover { + text-decoration: underline; +} + +a small { + font-size: 12px; +} + +em { + font-style: italic; +} + +strong { + font-weight:700; +} + +ul { + list-style-position: inside; + list-style: disc; + padding-left: 25px; +} + +ol { + list-style-position: inside; + list-style: decimal; + padding-left: 25px; +} + +blockquote { + margin: 0; + padding: 0 0 0 20px; + font-style: italic; +} + +dl, dt, dd, dl p { + font-color: #444; +} + +dl dt { + font-weight: bold; +} + +dl dd { + padding-left: 20px; + font-style: italic; +} + +dl p { + padding-left: 20px; + font-style: italic; +} + +hr { + border:0; + background:#ccc; + height:1px; + margin:0 0 24px; +} + +/* Images */ + +img { + position: relative; + margin: 0 auto; + max-width: 650px; + padding: 5px; + margin: 10px 0 32px 0; + border: 1px solid #ccc; +} + +p img { + display: inline; + margin: 0; + padding: 0; + vertical-align: middle; + text-align: center; + border: none; +} + +/* Code blocks */ + +code, pre { + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace; + color:#000; + font-size:14px; +} + +pre { + padding: 4px 12px; + background: #FDFEFB; + border-radius:4px; + border:1px solid #D7D8C8; + overflow: auto; + overflow-y: hidden; + margin-bottom: 32px; +} + + +/* Tables */ + +table { + width:100%; +} + +table { + border: 1px solid #ccc; + margin-bottom: 32px; + text-align: left; + } + +th { + font-family: 'Arvo', Helvetica, Arial, sans-serif; + font-size: 18px; + font-weight: normal; + padding: 10px; + background: #232323; + color: #FDFEFB; + } + +td { + padding: 10px; + background: #ccc; + } + + +/* Wrapper */ +.wrapper { + width:960px; +} + + +/* Header */ + +header { + background-color: #171717; + color: #FDFDFB; + width:170px; + float:left; + position:fixed; + border: 1px solid #000; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + padding: 34px 25px 22px 50px; + margin: 30px 25px 0 0; + -webkit-font-smoothing: antialiased; +} + +p.header { + font-size: 16px; +} + +h1.header { + font-family: Arvo, sans-serif; + font-size: 30px; + font-weight: 300; + line-height: 1.3em; + border-bottom: none; + margin-top: 0; +} + + +h1.header, a.header, a.name, header a{ + color: #fff; +} + +a.header { + text-decoration: underline; +} + +a.name { + white-space: nowrap; +} + +header ul { + list-style:none; + padding:0; +} + +header li { + list-style-type: none; + width:132px; + height:15px; + margin-bottom: 12px; + line-height: 1em; + padding: 6px 6px 6px 7px; + + background: #AF0011; + background: -moz-linear-gradient(top, #AF0011 0%, #820011 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd)); + background: -webkit-linear-gradient(top, #AF0011 0%,#820011 100%); + background: -o-linear-gradient(top, #AF0011 0%,#820011 100%); + background: -ms-linear-gradient(top, #AF0011 0%,#820011 100%); + background: linear-gradient(top, #AF0011 0%,#820011 100%); + + border-radius:4px; + border:1px solid #0D0D0D; + + -webkit-box-shadow: inset 0px 1px 1px 0 rgba(233,2,38, 1); + box-shadow: inset 0px 1px 1px 0 rgba(233,2,38, 1); + +} + +header li:hover { + background: #C3001D; + background: -moz-linear-gradient(top, #C3001D 0%, #950119 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd)); + background: -webkit-linear-gradient(top, #C3001D 0%,#950119 100%); + background: -o-linear-gradient(top, #C3001D 0%,#950119 100%); + background: -ms-linear-gradient(top, #C3001D 0%,#950119 100%); + background: linear-gradient(top, #C3001D 0%,#950119 100%); +} + +a.buttons { + -webkit-font-smoothing: antialiased; + background: url(../images/arrow-down.png) no-repeat; + font-weight: normal; + text-shadow: rgba(0, 0, 0, 0.4) 0 -1px 0; + padding: 2px 2px 2px 22px; + height: 30px; +} + +a.github { + background: url(../images/octocat-small.png) no-repeat 1px; +} + +a.buttons:hover { + color: #fff; + text-decoration: none; +} + + +/* Section - for main page content */ + +section { + width:650px; + float:right; + padding-bottom:50px; +} + + +/* Footer */ + +footer { + width:170px; + float:left; + position:fixed; + bottom:10px; + padding-left: 50px; +} + +@media print, screen and (max-width: 960px) { + + div.wrapper { + width:auto; + margin:0; + } + + header, section, footer { + float:none; + position:static; + width:auto; + } + + footer { + border-top: 1px solid #ccc; + margin:0 84px 0 50px; + padding:0; + } + + header { + padding-right:320px; + } + + section { + padding:20px 84px 20px 50px; + margin:0 0 20px; + } + + header a small { + display:inline; + } + + header ul { + position:absolute; + right:130px; + top:84px; + } +} + +@media print, screen and (max-width: 720px) { + body { + word-wrap:break-word; + } + + header { + padding:10px 20px 0; + margin-right: 0; + } + + section { + padding:10px 0 10px 20px; + margin:0 0 30px; + } + + footer { + margin: 0 0 0 30px; + } + + header ul, header p.view { + position:static; + } +} + +@media print, screen and (max-width: 480px) { + + header ul li.download { + display:none; + } + + footer { + margin: 0 0 0 20px; + } + + footer a{ + display:block; + } + +} + +@media print { + body { + padding:0.4in; + font-size:12pt; + color:#444; + } +} \ No newline at end of file