diff --git a/apidocs/api.js b/apidocs/api.js new file mode 100644 index 0000000..9d4e9ed --- /dev/null +++ b/apidocs/api.js @@ -0,0 +1,10 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "HotkeysMixin", + "StyleBindingsMixin" + ], + "modules": [], + "allModules": [] +} }; +}); \ No newline at end of file diff --git a/apidocs/assets/css/external-small.png b/apidocs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd Binary files /dev/null and b/apidocs/assets/css/external-small.png differ diff --git a/apidocs/assets/css/logo.png b/apidocs/assets/css/logo.png new file mode 100644 index 0000000..609b336 Binary files /dev/null and b/apidocs/assets/css/logo.png differ diff --git a/apidocs/assets/css/main.css b/apidocs/assets/css/main.css new file mode 100644 index 0000000..cdfe209 --- /dev/null +++ b/apidocs/assets/css/main.css @@ -0,0 +1,783 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + /*font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;*/ + font: 13px/1.4 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp, li code { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
+   blocks. */
+pre code, pre kbd, pre samp { font-size: 100%; }
+
+/* Used to denote text that shouldn't be selectable, such as line numbers or
+   shell prompts. Guess which browser this doesn't work in. */
+.noselect {
+    -moz-user-select: -moz-none;
+    -khtml-user-select: none;
+    -webkit-user-select: none;
+    -o-user-select: none;
+    user-select: none;
+}
+
+/* -- Lists ----------------------------------------------------------------- */
+dd { margin: 0.2em 0 0.7em 1em; }
+dl { margin: 1em 0; }
+dt { font-weight: bold; }
+
+/* -- Tables ---------------------------------------------------------------- */
+caption, th { text-align: left; }
+
+table {
+    border-collapse: collapse;
+    width: 100%;
+}
+
+td, th {
+    border: 1px solid #fff;
+    padding: 5px 12px;
+    vertical-align: top;
+}
+
+td { background: #E6E9F5; }
+td dl { margin: 0; }
+td dl dl { margin: 1em 0; }
+td pre:first-child { margin-top: 0; }
+
+th {
+    background: #D2D7E6;/*#97A0BF*/
+    border-bottom: none;
+    border-top: none;
+    color: #000;/*#FFF1D5*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.3;
+    white-space: nowrap;
+}
+
+
+/* -- Layout and Content ---------------------------------------------------- */
+#doc {
+    margin: auto;
+    min-width: 1024px;
+}
+
+.content { padding: 0 20px 0 25px; }
+
+.sidebar {
+    padding: 0 15px 0 10px;
+}
+#bd {
+    padding: 7px 0 130px;
+    position: relative;
+    width: 99%;
+}
+
+/* -- Table of Contents ----------------------------------------------------- */
+
+/* The #toc id refers to the single global table of contents, while the .toc
+   class refers to generic TOC lists that could be used throughout the page. */
+
+.toc code, .toc kbd, .toc samp { font-size: 100%; }
+.toc li { font-weight: bold; }
+.toc li li { font-weight: normal; }
+
+/* -- Intro and Example Boxes ----------------------------------------------- */
+/*
+.intro, .example { margin-bottom: 2em; }
+.example {
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
+    border-radius: 4px;
+    -moz-box-shadow: 0 0 5px #bfbfbf;
+    -webkit-box-shadow: 0 0 5px #bfbfbf;
+    box-shadow: 0 0 5px #bfbfbf;
+    padding: 1em;
+}
+.intro {
+    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
+}
+*/
+
+/* -- Other Styles ---------------------------------------------------------- */
+
+/* These are probably YUI-specific, and should be moved out of Selleck's default
+   theme. */
+
+.button {
+    border: 1px solid #dadada;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    color: #444;
+    display: inline-block;
+    font-family: Helvetica, Arial, sans-serif;
+    font-size: 92.308%;
+    font-weight: bold;
+    padding: 4px 13px 3px;
+    -moz-text-shadow: 1px 1px 0 #fff;
+    -webkit-text-shadow: 1px 1px 0 #fff;
+    text-shadow: 1px 1px 0 #fff;
+    white-space: nowrap;
+
+    background: #EFEFEF; /* old browsers */
+    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
+}
+
+.button:hover {
+    border-color: #466899;
+    color: #fff;
+    text-decoration: none;
+    -moz-text-shadow: 1px 1px 0 #222;
+    -webkit-text-shadow: 1px 1px 0 #222;
+    text-shadow: 1px 1px 0 #222;
+
+    background: #6396D8; /* old browsers */
+    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+}
+
+.newwindow { text-align: center; }
+
+.header .version em {
+    display: block;
+    text-align: right;
+}
+
+
+#classdocs .item {
+    border-bottom: 1px solid #466899;
+    margin: 1em 0;
+    padding: 1.5em;
+}
+
+#classdocs .item .params p,
+    #classdocs .item .returns p,{
+    display: inline;
+}
+
+#classdocs .item em code, #classdocs .item em.comment {
+    color: green;
+}
+
+#classdocs .item em.comment a {
+    color: green;
+    text-decoration: underline;
+}
+
+#classdocs .foundat {
+    font-size: 11px;
+    font-style: normal;
+}
+
+.attrs .emits {
+    margin-left: 2em;
+    padding: .5em;
+    border-left: 1px dashed #ccc;
+}
+
+abbr {
+    border-bottom: 1px dashed #ccc;
+    font-size: 80%;
+    cursor: help;
+}
+
+.prettyprint li.L0, 
+.prettyprint li.L1, 
+.prettyprint li.L2, 
+.prettyprint li.L3, 
+.prettyprint li.L5, 
+.prettyprint li.L6, 
+.prettyprint li.L7, 
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+ul li p {
+    margin-top: 0;
+}
+
+.method .name {
+    font-size: 110%;
+}
+
+.apidocs .methods .extends .method,
+.apidocs .properties .extends .property,
+.apidocs .attrs .extends .attr,
+.apidocs .events .extends .event {
+    font-weight: bold;
+}
+
+.apidocs .methods .extends .inherited,
+.apidocs .properties .extends .inherited,
+.apidocs .attrs .extends .inherited,
+.apidocs .events .extends .inherited {
+    font-weight: normal;
+}
+
+#hd {
+    background: whiteSmoke;
+    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
+    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
+    border-bottom: 1px solid #DFDFDF;
+    padding: 0 15px 1px 20px;
+    margin-bottom: 15px;
+}
+
+#hd img {
+    margin-right: 10px;
+    vertical-align: middle;
+}
+
+
+/* -- API Docs CSS ---------------------------------------------------------- */
+
+/*
+This file is organized so that more generic styles are nearer the top, and more
+specific styles are nearer the bottom of the file. This allows us to take full
+advantage of the cascade to avoid redundant style rules. Please respect this
+convention when making changes.
+*/
+
+/* -- Generic TabView styles ------------------------------------------------ */
+
+/*
+These styles apply to all API doc tabviews. To change styles only for a
+specific tabview, see the other sections below.
+*/
+
+.yui3-js-enabled .apidocs .tabview {
+    visibility: hidden; /* Hide until the TabView finishes rendering. */
+    _visibility: visible;
+}
+
+.apidocs .tabview.yui3-tabview-content { visibility: visible; }
+.apidocs .tabview .yui3-tabview-panel { background: #fff; }
+
+/* -- Generic Content Styles ------------------------------------------------ */
+
+/* Headings */
+h2, h3, h4, h5, h6 {
+    border: none;
+    color: #30418C;
+    font-weight: bold;
+    text-decoration: none;
+}
+
+.link-docs {
+    float: right;
+    font-size: 15px;
+    margin: 4px 4px 6px;
+    padding: 6px 30px 5px;
+}
+
+.apidocs { zoom: 1; }
+
+/* Generic box styles. */
+.apidocs .box {
+    border: 1px solid;
+    border-radius: 3px;
+    margin: 1em 0;
+    padding: 0 1em;
+}
+
+/* A flag is a compact, capsule-like indicator of some kind. It's used to
+   indicate private and protected items, item return types, etc. in an
+   attractive and unobtrusive way. */
+.apidocs .flag {
+    background: #bababa;
+    border-radius: 3px;
+    color: #fff;
+    font-size: 11px;
+    margin: 0 0.5em;
+    padding: 2px 4px 1px;
+}
+
+/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
+.apidocs .meta {
+    background: #f9f9f9;
+    border-color: #efefef;
+    color: #555;
+    font-size: 11px;
+    padding: 3px 6px;
+}
+
+.apidocs .meta p { margin: 0; }
+
+/* Deprecation warning. */
+.apidocs .box.deprecated,
+.apidocs .flag.deprecated {
+    background: #fdac9f;
+    border: 1px solid #fd7775;
+}
+
+.apidocs .box.deprecated p { margin: 0.5em 0; }
+.apidocs .flag.deprecated { color: #333; }
+
+/* Module/Class intro description. */
+.apidocs .intro {
+    background: #f0f1f8;
+    border-color: #d4d8eb;
+}
+
+/* Loading spinners. */
+#bd.loading .apidocs,
+#api-list.loading .yui3-tabview-panel {
+    background: #fff url(../img/spinner.gif) no-repeat center 70px;
+    min-height: 150px;
+}
+
+#bd.loading .apidocs .content,
+#api-list.loading .yui3-tabview-panel .apis {
+    display: none;
+}
+
+.apidocs .no-visible-items { color: #666; }
+
+/* Generic inline list. */
+.apidocs ul.inline {
+    display: inline;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.apidocs ul.inline li { display: inline; }
+
+/* Comma-separated list. */
+.apidocs ul.commas li:after { content: ','; }
+.apidocs ul.commas li:last-child:after { content: ''; }
+
+/* Keyboard shortcuts. */
+kbd .cmd { font-family: Monaco, Helvetica; }
+
+/* -- Generic Access Level styles ------------------------------------------- */
+.apidocs .item.protected,
+.apidocs .item.private,
+.apidocs .index-item.protected,
+.apidocs .index-item.deprecated,
+.apidocs .index-item.private {
+    display: none;
+}
+
+.show-deprecated .item.deprecated,
+.show-deprecated .index-item.deprecated,
+.show-protected .item.protected,
+.show-protected .index-item.protected,
+.show-private .item.private,
+.show-private .index-item.private {
+    display: block;
+}
+
+.hide-inherited .item.inherited,
+.hide-inherited .index-item.inherited {
+    display: none;
+}
+
+/* -- Generic Item Index styles --------------------------------------------- */
+.apidocs .index { margin: 1.5em 0 3em; }
+
+.apidocs .index h3 {
+    border-bottom: 1px solid #efefef;
+    color: #333;
+    font-size: 13px;
+    margin: 2em 0 0.6em;
+    padding-bottom: 2px;
+}
+
+.apidocs .index .no-visible-items { margin-top: 2em; }
+
+.apidocs .index-list {
+    border-color: #efefef;
+    font-size: 12px;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+    -moz-column-count: 4;
+    -moz-column-gap: 10px;
+    -moz-column-width: 170px;
+    -ms-column-count: 4;
+    -ms-column-gap: 10px;
+    -ms-column-width: 170px;
+    -o-column-count: 4;
+    -o-column-gap: 10px;
+    -o-column-width: 170px;
+    -webkit-column-count: 4;
+    -webkit-column-gap: 10px;
+    -webkit-column-width: 170px;
+    column-count: 4;
+    column-gap: 10px;
+    column-width: 170px;
+}
+
+.apidocs .no-columns .index-list {
+    -moz-column-count: 1;
+    -ms-column-count: 1;
+    -o-column-count: 1;
+    -webkit-column-count: 1;
+    column-count: 1;
+}
+
+.apidocs .index-item { white-space: nowrap; }
+
+.apidocs .index-item .flag {
+    background: none;
+    border: none;
+    color: #afafaf;
+    display: inline;
+    margin: 0 0 0 0.2em;
+    padding: 0;
+}
+
+/* -- Generic API item styles ----------------------------------------------- */
+.apidocs .args {
+    display: inline;
+    margin: 0 0.5em;
+}
+
+.apidocs .flag.chainable { background: #46ca3b; }
+.apidocs .flag.protected { background: #9b86fc; }
+.apidocs .flag.private { background: #fd6b1b; }
+.apidocs .flag.async { background: #356de4; }
+.apidocs .flag.required { background: #e60923; }
+
+.apidocs .item {
+    border-bottom: 1px solid #efefef;
+    margin: 1.5em 0 2em;
+    padding-bottom: 2em;
+}
+
+.apidocs .item h4,
+.apidocs .item h5,
+.apidocs .item h6 {
+    color: #333;
+    font-family: inherit;
+    font-size: 100%;
+}
+
+.apidocs .item .description p,
+.apidocs .item pre.code {
+    margin: 1em 0 0;
+}
+
+.apidocs .item .meta {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+.apidocs .item .name {
+    display: inline;
+    font-size: 14px;
+}
+
+.apidocs .item .type,
+.apidocs .item .type a,
+.apidocs .returns-inline {
+    color: #555;
+}
+
+.apidocs .item .type,
+.apidocs .returns-inline {
+    font-size: 11px;
+    margin: 0 0 0 0;
+}
+
+.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
+.apidocs .item .type a:hover { border: none; }
+
+/* -- Item Parameter List --------------------------------------------------- */
+.apidocs .params-list {
+    list-style: square;
+    margin: 1em 0 0 2em;
+    padding: 0;
+}
+
+.apidocs .param { margin-bottom: 1em; }
+
+.apidocs .param .type,
+.apidocs .param .type a {
+    color: #666;
+}
+
+.apidocs .param .type {
+    margin: 0 0 0 0.5em;
+    *margin-left: 0.5em;
+}
+
+.apidocs .param-name { font-weight: bold; }
+
+/* -- Item "Emits" block ---------------------------------------------------- */
+.apidocs .item .emits {
+    background: #f9f9f9;
+    border-color: #eaeaea;
+}
+
+/* -- Item "Returns" block -------------------------------------------------- */
+.apidocs .item .returns .type,
+.apidocs .item .returns .type a {
+    font-size: 100%;
+    margin: 0;
+}
+
+/* -- Class Constructor block ----------------------------------------------- */
+.apidocs .constructor .item {
+    border: none;
+    padding-bottom: 0;
+}
+
+/* -- File Source View ------------------------------------------------------ */
+.apidocs .file pre.code,
+#doc .apidocs .file pre.prettyprint {
+    background: inherit;
+    border: none;
+    overflow: visible;
+    padding: 0;
+}
+
+.apidocs .L0,
+.apidocs .L1,
+.apidocs .L2,
+.apidocs .L3,
+.apidocs .L4,
+.apidocs .L5,
+.apidocs .L6,
+.apidocs .L7,
+.apidocs .L8,
+.apidocs .L9 {
+    background: inherit;
+}
+
+/* -- Submodule List -------------------------------------------------------- */
+.apidocs .module-submodule-description {
+    font-size: 12px;
+    margin: 0.3em 0 1em;
+}
+
+.apidocs .module-submodule-description p:first-child { margin-top: 0; }
+
+/* -- Sidebar TabView ------------------------------------------------------- */
+#api-tabview { margin-top: 0.6em; }
+
+#api-tabview-filter,
+#api-tabview-panel {
+    border: 1px solid #dfdfdf;
+}
+
+#api-tabview-filter {
+    border-bottom: none;
+    border-top: none;
+    padding: 0.6em 10px 0 10px;
+}
+
+#api-tabview-panel { border-top: none; }
+#api-filter { width: 97%; }
+
+/* -- Content TabView ------------------------------------------------------- */
+#classdocs .yui3-tabview-panel { border: none; }
+
+/* -- Source File Contents -------------------------------------------------- */
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+/* -- API options ----------------------------------------------------------- */
+#api-options {
+    font-size: 11px;
+    margin-top: 2.2em;
+    position: absolute;
+    right: 1.5em;
+}
+
+/*#api-options label { margin-right: 0.6em; }*/
+
+/* -- API list -------------------------------------------------------------- */
+#api-list {
+    margin-top: 1.5em;
+    *zoom: 1;
+}
+
+.apis {
+    font-size: 12px;
+    line-height: 1.4;
+    list-style: none;
+    margin: 0;
+    padding: 0.5em 0 0.5em 0.4em;
+}
+
+.apis a {
+    border: 1px solid transparent;
+    display: block;
+    margin: 0 0 0 -4px;
+    padding: 1px 4px 0;
+    text-decoration: none;
+    _border: none;
+    _display: inline;
+}
+
+.apis a:hover,
+.apis a:focus {
+    background: #E8EDFC;
+    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
+    border-color: #AAC0FA;
+    border-radius: 3px;
+    color: #333;
+    outline: none;
+}
+
+.api-list-item a:hover,
+.api-list-item a:focus {
+    font-weight: bold;
+    text-shadow: 1px 1px 1px #fff;
+}
+
+.apis .message { color: #888; }
+.apis .result a { padding: 3px 5px 2px; }
+
+.apis .result .type {
+    right: 4px;
+    top: 7px;
+}
+
+.api-list-item .yui3-highlight {
+    font-weight: bold;
+}
+
diff --git a/apidocs/assets/favicon.png b/apidocs/assets/favicon.png
new file mode 100644
index 0000000..5a95dda
Binary files /dev/null and b/apidocs/assets/favicon.png differ
diff --git a/apidocs/assets/img/spinner.gif b/apidocs/assets/img/spinner.gif
new file mode 100644
index 0000000..44f96ba
Binary files /dev/null and b/apidocs/assets/img/spinner.gif differ
diff --git a/apidocs/assets/index.html b/apidocs/assets/index.html
new file mode 100644
index 0000000..487fe15
--- /dev/null
+++ b/apidocs/assets/index.html
@@ -0,0 +1,10 @@
+
+
+    
+        Redirector
+        
+    
+    
+        Click here to redirect
+    
+
diff --git a/apidocs/assets/js/api-filter.js b/apidocs/assets/js/api-filter.js
new file mode 100644
index 0000000..37aefba
--- /dev/null
+++ b/apidocs/assets/js/api-filter.js
@@ -0,0 +1,52 @@
+YUI.add('api-filter', function (Y) {
+
+Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
+    // -- Initializer ----------------------------------------------------------
+    initializer: function () {
+        this._bindUIACBase();
+        this._syncUIACBase();
+    },
+    getDisplayName: function(name) {
+
+        Y.each(Y.YUIDoc.meta.allModules, function(i) {
+            if (i.name === name && i.displayName) {
+                name = i.displayName;
+            }
+        });
+
+        return name;
+    }
+
+}, {
+    // -- Attributes -----------------------------------------------------------
+    ATTRS: {
+        resultHighlighter: {
+            value: 'phraseMatch'
+        },
+
+        // May be set to "classes" or "modules".
+        queryType: {
+            value: 'classes'
+        },
+
+        source: {
+            valueFn: function() {
+                var self = this;
+                return function(q) {
+                    var data = Y.YUIDoc.meta[self.get('queryType')],
+                        out = [];
+                    Y.each(data, function(v) {
+                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
+                            out.push(v);
+                        }
+                    });
+                    return out;
+                };
+            }
+        }
+    }
+});
+
+}, '3.4.0', {requires: [
+    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
+]});
diff --git a/apidocs/assets/js/api-list.js b/apidocs/assets/js/api-list.js
new file mode 100644
index 0000000..88905b5
--- /dev/null
+++ b/apidocs/assets/js/api-list.js
@@ -0,0 +1,251 @@
+YUI.add('api-list', function (Y) {
+
+var Lang   = Y.Lang,
+    YArray = Y.Array,
+
+    APIList = Y.namespace('APIList'),
+
+    classesNode    = Y.one('#api-classes'),
+    inputNode      = Y.one('#api-filter'),
+    modulesNode    = Y.one('#api-modules'),
+    tabviewNode    = Y.one('#api-tabview'),
+
+    tabs = APIList.tabs = {},
+
+    filter = APIList.filter = new Y.APIFilter({
+        inputNode : inputNode,
+        maxResults: 1000,
+
+        on: {
+            results: onFilterResults
+        }
+    }),
+
+    search = APIList.search = new Y.APISearch({
+        inputNode : inputNode,
+        maxResults: 100,
+
+        on: {
+            clear  : onSearchClear,
+            results: onSearchResults
+        }
+    }),
+
+    tabview = APIList.tabview = new Y.TabView({
+        srcNode  : tabviewNode,
+        panelNode: '#api-tabview-panel',
+        render   : true,
+
+        on: {
+            selectionChange: onTabSelectionChange
+        }
+    }),
+
+    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
+        circular   : true,
+        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
+        keys       : {next: 'down:40', previous: 'down:38'}
+    }).focusManager,
+
+    LIST_ITEM_TEMPLATE =
+        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/apidocs/assets/js/api-search.js b/apidocs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/apidocs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/apidocs/assets/js/apidocs.js b/apidocs/assets/js/apidocs.js new file mode 100644 index 0000000..e00591c --- /dev/null +++ b/apidocs/assets/js/apidocs.js @@ -0,0 +1,370 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + // When the `defaultTab` node isn't found, `localStorage` is stale. + if (!tab && defaultTab !== 'index') { + tab = Y.one('#classdocs .api-class-tab.index'); + } + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/apidocs/assets/js/yui-prettify.js b/apidocs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/apidocs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/apidocs/assets/vendor/prettify/CHANGES.html b/apidocs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/apidocs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    + + +

    Change Log

    +

    29 March 2007

    + +

    4 Jul 2008

    + +

    5 Jul 2008

    +
    +

    14 Jul 2008

    + +

    6 Jan 2009

    + +

    21 May 2009

    + +

    14 August 2009

    + +

    3 October 2009

    + +

    19 July 2010

    + + + diff --git a/apidocs/assets/vendor/prettify/COPYING b/apidocs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/apidocs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apidocs/assets/vendor/prettify/README.html b/apidocs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/apidocs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/apidocs/assets/vendor/prettify/prettify-min.css b/apidocs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/apidocs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/apidocs/assets/vendor/prettify/prettify-min.js b/apidocs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/apidocs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/apidocs/classes/HotkeysMixin.html b/apidocs/classes/HotkeysMixin.html new file mode 100644 index 0000000..8fc3dba --- /dev/null +++ b/apidocs/classes/HotkeysMixin.html @@ -0,0 +1,239 @@ + + + + + HotkeysMixin - Ember Utils + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 0.0.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    HotkeysMixin Class

    +
    + + + + + + + + + + + +
    + + + +
    +

    A mixin to enhance an Ember.View with hotkey support.

    +

    To use, inherit this mixin in your view:

    +
    MyView = Em.View.extend(HotkeysMixin, {
    +  hotkeysBindings: ['ctrl-a']
    +
    +  actions: {
    +      'ctrl-a': function() {
    +          console.log("Ctrl-a was pressed!");
    +      }
    +  }
    +});
    + +
    + + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    concatenatedProperties

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + lib/hotkeys_bindings_mixin.coffee:26 + +

    + + + + +
    + +
    +

    Add hotkeysBindings property as a concatenatedProperties.

    + +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/apidocs/classes/StyleBindingsMixin.html b/apidocs/classes/StyleBindingsMixin.html new file mode 100644 index 0000000..a89c555 --- /dev/null +++ b/apidocs/classes/StyleBindingsMixin.html @@ -0,0 +1,537 @@ + + + + + StyleBindingsMixin - Ember Utils + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 0.0.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    StyleBindingsMixin Class

    +
    + + + + + + + + + + + +
    + + + +
    +

    Provides styleBindings property to bind style +properties based on object properties.

    + +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    applyBindings

    + + + () + + + + + + + + private + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + lib/style_bindings_mixin.coffee:48 + +

    + + + + + +
    + +
    +

    Apply the style bindings during the view init phase.

    +

    This method assumes that the attribute styleBindings is defined as an array of strings where +each string is a property name that should be resolved as a style option.

    + +
    + + + + + + +
    + + +
    +

    buildStyleString

    + + +
    + (
      + +
    • + + style + +
    • + +
    • + + property + +
    • + +
    ) +
    + + + + + + + + private + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + lib/style_bindings_mixin.coffee:34 + +

    + + + + + +
    + +
    +

    Build a style property and its value as a string.

    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + style + String + + + + +
      +

      property name

      + +
      + + +
    • + +
    • + + property + String + + + + +
      +

      name in the current object that should be resolved as the +value of the style property.

      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    attributeBindings

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + lib/style_bindings_mixin.coffee:20 + +

    + + + + +
    + +
    +

    Apply the style attribute to the DOM element.

    + +
    + + + + + + +
    + + +
    +

    concatenatedProperties

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + lib/style_bindings_mixin.coffee:13 + +

    + + + + +
    + +
    +

    Add styleBindings property as a concatenatedProperties.

    + +
    + + + + + + +
    + + +
    +

    unit

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + lib/style_bindings_mixin.coffee:27 + +

    + + + + +
    + +
    +

    The default unit for numbered value.

    + +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/apidocs/classes/index.html b/apidocs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/apidocs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/apidocs/data.json b/apidocs/data.json new file mode 100644 index 0000000..382227b --- /dev/null +++ b/apidocs/data.json @@ -0,0 +1,130 @@ +{ + "project": { + "name": "Ember Utils", + "description": "A set of utilities for Ember.js", + "version": "0.0.1", + "url": "http://www.github.com/indexiatech/ember-utils/apidocs" + }, + "files": { + "lib/hotkeys_bindings_mixin.coffee": { + "name": "lib/hotkeys_bindings_mixin.coffee", + "modules": {}, + "classes": { + "HotkeysMixin": 1 + }, + "fors": {}, + "namespaces": {} + }, + "lib/style_bindings_mixin.coffee": { + "name": "lib/style_bindings_mixin.coffee", + "modules": {}, + "classes": { + "StyleBindingsMixin": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": {}, + "classes": { + "HotkeysMixin": { + "name": "HotkeysMixin", + "shortname": "HotkeysMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "file": "lib/hotkeys_bindings_mixin.coffee", + "line": 5, + "description": "A mixin to enhance an `Ember.View` with hotkey support.\n\nTo use, inherit this mixin in your view:\n\n```javascript\nMyView = Em.View.extend(HotkeysMixin, {\n hotkeysBindings: ['ctrl-a']\n\n actions: {\n 'ctrl-a': function() {\n console.log(\"Ctrl-a was pressed!\");\n }\n }\n});\n```", + "access": "public", + "tagname": "" + }, + "StyleBindingsMixin": { + "name": "StyleBindingsMixin", + "shortname": "StyleBindingsMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "file": "lib/style_bindings_mixin.coffee", + "line": 5, + "description": "Provides styleBindings property to bind style \nproperties based on object properties.", + "access": "public", + "tagname": "" + } + }, + "classitems": [ + { + "file": "lib/hotkeys_bindings_mixin.coffee", + "line": 26, + "description": "Add `hotkeysBindings` property as a `concatenatedProperties`.", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "array", + "class": "HotkeysMixin" + }, + { + "file": "lib/style_bindings_mixin.coffee", + "line": 13, + "description": "Add `styleBindings` property as a `concatenatedProperties`.", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "array", + "class": "StyleBindingsMixin" + }, + { + "file": "lib/style_bindings_mixin.coffee", + "line": 20, + "description": "Apply the `style` attribute to the DOM element.", + "itemtype": "property", + "name": "attributeBindings", + "type": "array", + "class": "StyleBindingsMixin" + }, + { + "file": "lib/style_bindings_mixin.coffee", + "line": 27, + "description": "The default unit for numbered value.", + "itemtype": "property", + "name": "unit", + "type": "string", + "class": "StyleBindingsMixin" + }, + { + "file": "lib/style_bindings_mixin.coffee", + "line": 34, + "description": "Build a style property and its value as a string.", + "itemtype": "method", + "name": "buildStyleString", + "params": [ + { + "name": "style", + "description": "property name", + "type": "String" + }, + { + "name": "property", + "description": "name in the current object that should be resolved as the\nvalue of the style property.", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "StyleBindingsMixin" + }, + { + "file": "lib/style_bindings_mixin.coffee", + "line": 48, + "description": "Apply the style bindings during the view `init` phase.\n\nThis method assumes that the attribute `styleBindings` is defined as an array of strings where\neach string is a property name that should be resolved as a style option.", + "itemtype": "method", + "name": "applyBindings", + "access": "private", + "tagname": "", + "class": "StyleBindingsMixin" + } + ], + "warnings": [] +} \ No newline at end of file diff --git a/apidocs/files/index.html b/apidocs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/apidocs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/apidocs/files/lib_hotkeys_bindings_mixin.coffee.html b/apidocs/files/lib_hotkeys_bindings_mixin.coffee.html new file mode 100644 index 0000000..da697c2 --- /dev/null +++ b/apidocs/files/lib_hotkeys_bindings_mixin.coffee.html @@ -0,0 +1,178 @@ + + + + + lib/hotkeys_bindings_mixin.coffee - Ember Utils + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 0.0.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: lib/hotkeys_bindings_mixin.coffee

    + +
    +
    +#(c) 2014 Indexia, Inc.
    +
    +`import {Mixin, debug} from 'ember';`
    +
    +###*
    +# A mixin to enhance an `Ember.View` with hotkey support.
    +# 
    +# To use, inherit this mixin in your view:
    +#
    +# ```javascript
    +# MyView = Em.View.extend(HotkeysMixin, {
    +#   hotkeysBindings: ['ctrl-a']
    +#
    +#   actions: {
    +#       'ctrl-a': function() {
    +#           console.log("Ctrl-a was pressed!");
    +#       }
    +#   }
    +# });
    +# ```
    +#
    +# @class HotkeysMixin
    +# @public
    +###
    +HotkeysMixin = Mixin.create
    +    ###*
    +    # Add `hotkeysBindings` property as a `concatenatedProperties`.
    +    # @property concatenatedProperties
    +    # @type array
    +    ###
    +    concatenatedProperties: ['hotkeysBindings']
    +
    +    keyMap: {
    +        8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 224: "meta",
    +        112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", 120: "f9", 121: "f10", 122: "f11", 123: "f12"
    +    }
    +
    +    keyPressHandler: (e) ->
    +        command = ""
    +
    +        if e.ctrlKey
    +            command += "ctrl+"
    +
    +        if e.altKey
    +            command += "alt+"
    +
    +        if e.shiftKey
    +            command += "shift+"
    +
    +        if e.metaKey
    +            command += "meta+"
    +
    +        if @keyMap[e.which] then command += @keyMap[e.which] else command += String.fromCharCode(e.which).toLowerCase()
    +  
    +        debug "hotkey command: #{command}"
    +        @send command
    +        
    +
    +    keyDown: (e) ->
    +        @keyPressHandler e
    +
    +    keyUp: (e) ->
    +        @keyPressHandler e
    +
    +    keyPress: (e) ->
    +        @keyPressHandler e
    +
    +`export default HotkeysMixin;`
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/apidocs/files/lib_style_bindings_mixin.coffee.html b/apidocs/files/lib_style_bindings_mixin.coffee.html new file mode 100644 index 0000000..c84bf72 --- /dev/null +++ b/apidocs/files/lib_style_bindings_mixin.coffee.html @@ -0,0 +1,191 @@ + + + + + lib/style_bindings_mixin.coffee - Ember Utils + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 0.0.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: lib/style_bindings_mixin.coffee

    + +
    +
    +#(c) 2014 Indexia, Inc.
    +
    +`import {Mixin} from 'ember';`
    +
    +###*
    +# Provides styleBindings property to bind style 
    +# properties based on object properties.
    +#
    +# @class StyleBindingsMixin
    +# @public
    +###
    +StyleBindingsMixin = Mixin.create
    +    ###*
    +    # Add `styleBindings` property as a `concatenatedProperties`.
    +    # @property concatenatedProperties
    +    # @type array
    +    ###
    +    concatenatedProperties: ['styleBindings']
    +
    +    ###*
    +    # Apply the `style` attribute to the DOM element.
    +    # @property attributeBindings
    +    # @type array
    +    ####
    +    attributeBindings: ['style']
    +
    +    ###*
    +    # The default unit for numbered value.
    +    # @property unit
    +    # @type string
    +    ###
    +    unit: 'px'
    +
    +    ###*
    +    # Build a style property and its value as a string.
    +    # @method buildStyleString
    +    # @param {String} style property name
    +    # @param {String} property name in the current object that should be resolved as the
    +    # value of the style property.
    +    # @private
    +    ###
    +    buildStyleString: (styleName, property) ->
    +        value = @get(property)
    +        return if value is undefined
    +        value = value + @get("unit") if Ember.typeOf(value) is "number"
    +        styleName + ":" + value + ";"
    +
    +    ###*
    +    # Apply the style bindings during the view `init` phase.
    +    #
    +    # This method assumes that the attribute `styleBindings` is defined as an array of strings where
    +    # each string is a property name that should be resolved as a style option.
    +    #
    +    # @method applyBindings
    +    # @private
    +    ###
    +    applyBindings: (->
    +        return unless styleBindingsstyleBindings = @styleBindings
    +        lookup = {}
    +        @styleBindings.forEach (binding) ->
    +            propArr = binding.split(":")
    +            property = propArr[0]
    +            style = propArr[1]
    +            lookup[style or property] = property
    +        styles = Em.keys(lookup)
    +        properties = styles.map((style) ->
    +            lookup[style]
    +        )
    +        styleComputed = Em.computed(->
    +            styleTokens = styles.map((style) =>
    +                @buildStyleString style, lookup[style]
    +            )
    +            styleString = styleTokens.join("")
    +            styleString  if styleString.length isnt 0
    +        )
    +        styleComputed.property.apply styleComputed, properties
    +        Em.defineProperty @, "style", styleComputed
    +    ).on 'init'
    +
    +`export default StyleBindingsMixin`
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/apidocs/index.html b/apidocs/index.html new file mode 100644 index 0000000..b6d3f9e --- /dev/null +++ b/apidocs/index.html @@ -0,0 +1,124 @@ + + + + + Ember Utils + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 0.0.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/apidocs/modules/index.html b/apidocs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/apidocs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/bower.json b/bower.json index 23af11c..5aadd43 100644 --- a/bower.json +++ b/bower.json @@ -4,7 +4,7 @@ "description": "A set of utilities for Ember.js", "homepage": "http://www.github.com/indexiatech/ember-utils", "authors": [ - "Asaf Shakarchi " + "Asaf Shakarchi " ], "license": "ASF 2.0", "ignore": [ diff --git a/dist/amd/config.js b/dist/amd/config.js new file mode 100644 index 0000000..817c8bb --- /dev/null +++ b/dist/amd/config.js @@ -0,0 +1,26 @@ +define( + ["ember","exports"], + function(__dependency1__, __exports__) { + "use strict"; + var Namespace = __dependency1__.Namespace; + + var Config; + + Config = Namespace.extend({ + _configs: Em.Object.create(), + getConfig: function(name) { + var config; + config = this._configs.get(name); + return config; + }, + addConfig: function(name, config) { + var defaultConfig, newConfig; + defaultConfig = this._configs.get('default'); + newConfig = Em.Object.create(config); + newConfig = Em.$.extend(true, newConfig, defaultConfig); + return this._configs.set(name, newConfig); + } + }); + + __exports__["default"] = Config; + }); \ No newline at end of file diff --git a/dist/amd/hotkeys_bindings_mixin.js b/dist/amd/hotkeys_bindings_mixin.js new file mode 100644 index 0000000..40a24dc --- /dev/null +++ b/dist/amd/hotkeys_bindings_mixin.js @@ -0,0 +1,94 @@ +define( + ["ember","exports"], + function(__dependency1__, __exports__) { + "use strict"; + var Mixin = __dependency1__.Mixin; + var debug = __dependency1__.debug; + + + /** + * A mixin to enhance an `Ember.View` with hotkey support. + * + * To use, inherit this mixin in your view: + * + * ```javascript + * MyView = Em.View.extend(HotkeysMixin, { + * hotkeysBindings: ['ctrl-a'] + * + * actions: { + * 'ctrl-a': function() { + * console.log("Ctrl-a was pressed!"); + * } + * } + * }); + * ``` + * + * @class HotkeysMixin + */ + var HotkeysMixin; + + HotkeysMixin = Mixin.create({ + + /** + * Add `hotkeysBindings` property as a `concatenatedProperties`. + * @property concatenatedProperties + * @type array + */ + concatenatedProperties: ['hotkeysBindings'], + keyMap: { + 8: "backspace", + 9: "tab", + 13: "return", + 16: "shift", + 17: "ctrl", + 18: "alt", + 224: "meta", + 112: "f1", + 113: "f2", + 114: "f3", + 115: "f4", + 116: "f5", + 117: "f6", + 118: "f7", + 119: "f8", + 120: "f9", + 121: "f10", + 122: "f11", + 123: "f12" + }, + keyPressHandler: function(e) { + var command; + command = ""; + if (e.ctrlKey) { + command += "ctrl+"; + } + if (e.altKey) { + command += "alt+"; + } + if (e.shiftKey) { + command += "shift+"; + } + if (e.metaKey) { + command += "meta+"; + } + if (this.keyMap[e.which]) { + command += this.keyMap[e.which]; + } else { + command += String.fromCharCode(e.which).toLowerCase(); + } + debug("hotkey command: " + command); + return this.send(command); + }, + keyDown: function(e) { + return this.keyPressHandler(e); + }, + keyUp: function(e) { + return this.keyPressHandler(e); + }, + keyPress: function(e) { + return this.keyPressHandler(e); + } + }); + + __exports__["default"] = HotkeysMixin;; + }); \ No newline at end of file diff --git a/dist/amd/main.js b/dist/amd/main.js new file mode 100644 index 0000000..455f181 --- /dev/null +++ b/dist/amd/main.js @@ -0,0 +1,17 @@ +define( + ["./style_bindings_mixin","./with_config_mixin","./hotkeys_bindings_mixin","./config","exports"], + function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) { + "use strict"; + var StyleBindingsMixin = __dependency1__["default"] || __dependency1__; + + var WithConfigMixin = __dependency2__["default"] || __dependency2__; + + var HotkeysBindingsMixin = __dependency3__["default"] || __dependency3__; + + var Config = __dependency4__["default"] || __dependency4__; + + __exports__.StyleBindingsMixin = StyleBindingsMixin; + __exports__.WithConfigMixin = WithConfigMixin; + __exports__.HotkeysBindingsMixin = HotkeysBindingsMixin; + __exports__.Config = Config; + }); \ No newline at end of file diff --git a/dist/amd/style_bindings_mixin.js b/dist/amd/style_bindings_mixin.js new file mode 100644 index 0000000..e1c7bb2 --- /dev/null +++ b/dist/amd/style_bindings_mixin.js @@ -0,0 +1,100 @@ +define( + ["ember","exports"], + function(__dependency1__, __exports__) { + "use strict"; + var Mixin = __dependency1__.Mixin; + + + /** + * Provides styleBindings property to bind style + * properties based on object properties. + * @class StyleBindingsMixin + */ + var StyleBindingsMixin; + + StyleBindingsMixin = Mixin.create({ + + /** + * Add `styleBindings` property as a `concatenatedProperties`. + * @property concatenatedProperties + * @type array + */ + concatenatedProperties: ['styleBindings'], + + /** + * Apply the `style` attribute to the DOM element. + * @property attributeBindings + * @type array + */ + attributeBindings: ['style'], + + /** + * The default unit for numbered value. + */ + unit: 'px', + + /** + * Build a style property and its value as a string. + * @method buildStyleString + * @param {String} style property name + * @param {String} property name in the current object that should be resolved as the + * value of the style property. + * @private + */ + buildStyleString: function(styleName, property) { + var value; + value = this.get(property); + if (value === void 0) { + return; + } + if (Ember.typeOf(value) === "number") { + value = value + this.get("unit"); + } + return styleName + ":" + value + ";"; + }, + + /** + * Apply the style bindings during the view `init` phase. + * + * This method assumes that the attribute `styleBindings` is defined as an array of strings where + * each string is a property name that should be resolved as a style option. + * + * @method applyBindings + * @private + */ + applyBindings: (function() { + var lookup, properties, styleBindingsstyleBindings, styleComputed, styles; + if (!(styleBindingsstyleBindings = this.styleBindings)) { + return; + } + lookup = {}; + this.styleBindings.forEach(function(binding) { + var propArr, property, style; + propArr = binding.split(":"); + property = propArr[0]; + style = propArr[1]; + return lookup[style || property] = property; + }); + styles = Em.keys(lookup); + properties = styles.map(function(style) { + return lookup[style]; + }); + styleComputed = Em.computed(function() { + var styleString, styleTokens; + styleTokens = styles.map((function(_this) { + return function(style) { + return _this.buildStyleString(style, lookup[style]); + }; + })(this)); + styleString = styleTokens.join(""); + if (styleString.length !== 0) { + return styleString; + } + }); + styleComputed.property.apply(styleComputed, properties); + return Em.defineProperty(this, "style", styleComputed); + }).on('init') + }); + + __exports__["default"] = StyleBindingsMixin; + }); \ No newline at end of file diff --git a/dist/amd/with_config_mixin.js b/dist/amd/with_config_mixin.js new file mode 100644 index 0000000..c4d24e7 --- /dev/null +++ b/dist/amd/with_config_mixin.js @@ -0,0 +1,25 @@ +define( + ["ember","exports"], + function(__dependency1__, __exports__) { + "use strict"; + var Mixin = __dependency1__.Mixin; + + var WithConfigMixin; + + WithConfigMixin = Mixin.create({ + configName: (function() { + var config; + config = this.nearestWithProperty('configName'); + if (config) { + return config.get('configName'); + } else { + return 'default'; + } + }).property(), + config: (function() { + return Em.Config.getConfig(this.get('configName')); + }).property('configName') + }); + + __exports__["default"] = WithConfigMixin; + }); \ No newline at end of file diff --git a/dist/cjs/config.js b/dist/cjs/config.js new file mode 100644 index 0000000..0b1eb49 --- /dev/null +++ b/dist/cjs/config.js @@ -0,0 +1,22 @@ +"use strict"; +var Namespace = require("ember").Namespace; + +var Config; + +Config = Namespace.extend({ + _configs: Em.Object.create(), + getConfig: function(name) { + var config; + config = this._configs.get(name); + return config; + }, + addConfig: function(name, config) { + var defaultConfig, newConfig; + defaultConfig = this._configs.get('default'); + newConfig = Em.Object.create(config); + newConfig = Em.$.extend(true, newConfig, defaultConfig); + return this._configs.set(name, newConfig); + } +}); + +exports["default"] = Config; \ No newline at end of file diff --git a/dist/cjs/hotkeys_bindings_mixin.js b/dist/cjs/hotkeys_bindings_mixin.js new file mode 100644 index 0000000..2ee48a7 --- /dev/null +++ b/dist/cjs/hotkeys_bindings_mixin.js @@ -0,0 +1,90 @@ +"use strict"; +var Mixin = require("ember").Mixin; +var debug = require("ember").debug; + + +/** + * A mixin to enhance an `Ember.View` with hotkey support. + * + * To use, inherit this mixin in your view: + * + * ```javascript + * MyView = Em.View.extend(HotkeysMixin, { + * hotkeysBindings: ['ctrl-a'] + * + * actions: { + * 'ctrl-a': function() { + * console.log("Ctrl-a was pressed!"); + * } + * } + * }); + * ``` + * + * @class HotkeysMixin + */ +var HotkeysMixin; + +HotkeysMixin = Mixin.create({ + + /** + * Add `hotkeysBindings` property as a `concatenatedProperties`. + * @property concatenatedProperties + * @type array + */ + concatenatedProperties: ['hotkeysBindings'], + keyMap: { + 8: "backspace", + 9: "tab", + 13: "return", + 16: "shift", + 17: "ctrl", + 18: "alt", + 224: "meta", + 112: "f1", + 113: "f2", + 114: "f3", + 115: "f4", + 116: "f5", + 117: "f6", + 118: "f7", + 119: "f8", + 120: "f9", + 121: "f10", + 122: "f11", + 123: "f12" + }, + keyPressHandler: function(e) { + var command; + command = ""; + if (e.ctrlKey) { + command += "ctrl+"; + } + if (e.altKey) { + command += "alt+"; + } + if (e.shiftKey) { + command += "shift+"; + } + if (e.metaKey) { + command += "meta+"; + } + if (this.keyMap[e.which]) { + command += this.keyMap[e.which]; + } else { + command += String.fromCharCode(e.which).toLowerCase(); + } + debug("hotkey command: " + command); + return this.send(command); + }, + keyDown: function(e) { + return this.keyPressHandler(e); + }, + keyUp: function(e) { + return this.keyPressHandler(e); + }, + keyPress: function(e) { + return this.keyPressHandler(e); + } +}); + +exports["default"] = HotkeysMixin;; \ No newline at end of file diff --git a/dist/cjs/main.js b/dist/cjs/main.js new file mode 100644 index 0000000..92285e9 --- /dev/null +++ b/dist/cjs/main.js @@ -0,0 +1,13 @@ +"use strict"; +var StyleBindingsMixin = require("./style_bindings_mixin")["default"] || require("./style_bindings_mixin"); + +var WithConfigMixin = require("./with_config_mixin")["default"] || require("./with_config_mixin"); + +var HotkeysBindingsMixin = require("./hotkeys_bindings_mixin")["default"] || require("./hotkeys_bindings_mixin"); + +var Config = require("./config")["default"] || require("./config"); + +exports.StyleBindingsMixin = StyleBindingsMixin; +exports.WithConfigMixin = WithConfigMixin; +exports.HotkeysBindingsMixin = HotkeysBindingsMixin; +exports.Config = Config; \ No newline at end of file diff --git a/dist/cjs/style_bindings_mixin.js b/dist/cjs/style_bindings_mixin.js new file mode 100644 index 0000000..e8767b9 --- /dev/null +++ b/dist/cjs/style_bindings_mixin.js @@ -0,0 +1,96 @@ +"use strict"; +var Mixin = require("ember").Mixin; + + +/** + * Provides styleBindings property to bind style + * properties based on object properties. + * @class StyleBindingsMixin + */ +var StyleBindingsMixin; + +StyleBindingsMixin = Mixin.create({ + + /** + * Add `styleBindings` property as a `concatenatedProperties`. + * @property concatenatedProperties + * @type array + */ + concatenatedProperties: ['styleBindings'], + + /** + * Apply the `style` attribute to the DOM element. + * @property attributeBindings + * @type array + */ + attributeBindings: ['style'], + + /** + * The default unit for numbered value. + */ + unit: 'px', + + /** + * Build a style property and its value as a string. + * @method buildStyleString + * @param {String} style property name + * @param {String} property name in the current object that should be resolved as the + * value of the style property. + * @private + */ + buildStyleString: function(styleName, property) { + var value; + value = this.get(property); + if (value === void 0) { + return; + } + if (Ember.typeOf(value) === "number") { + value = value + this.get("unit"); + } + return styleName + ":" + value + ";"; + }, + + /** + * Apply the style bindings during the view `init` phase. + * + * This method assumes that the attribute `styleBindings` is defined as an array of strings where + * each string is a property name that should be resolved as a style option. + * + * @method applyBindings + * @private + */ + applyBindings: (function() { + var lookup, properties, styleBindingsstyleBindings, styleComputed, styles; + if (!(styleBindingsstyleBindings = this.styleBindings)) { + return; + } + lookup = {}; + this.styleBindings.forEach(function(binding) { + var propArr, property, style; + propArr = binding.split(":"); + property = propArr[0]; + style = propArr[1]; + return lookup[style || property] = property; + }); + styles = Em.keys(lookup); + properties = styles.map(function(style) { + return lookup[style]; + }); + styleComputed = Em.computed(function() { + var styleString, styleTokens; + styleTokens = styles.map((function(_this) { + return function(style) { + return _this.buildStyleString(style, lookup[style]); + }; + })(this)); + styleString = styleTokens.join(""); + if (styleString.length !== 0) { + return styleString; + } + }); + styleComputed.property.apply(styleComputed, properties); + return Em.defineProperty(this, "style", styleComputed); + }).on('init') +}); + +exports["default"] = StyleBindingsMixin; \ No newline at end of file diff --git a/dist/cjs/with_config_mixin.js b/dist/cjs/with_config_mixin.js new file mode 100644 index 0000000..764095d --- /dev/null +++ b/dist/cjs/with_config_mixin.js @@ -0,0 +1,21 @@ +"use strict"; +var Mixin = require("ember").Mixin; + +var WithConfigMixin; + +WithConfigMixin = Mixin.create({ + configName: (function() { + var config; + config = this.nearestWithProperty('configName'); + if (config) { + return config.get('configName'); + } else { + return 'default'; + } + }).property(), + config: (function() { + return Em.Config.getConfig(this.get('configName')); + }).property('configName') +}); + +exports["default"] = WithConfigMixin; \ No newline at end of file diff --git a/dist/globals/main.js b/dist/globals/main.js new file mode 100644 index 0000000..1e3c7ee --- /dev/null +++ b/dist/globals/main.js @@ -0,0 +1,250 @@ +!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),(f.Em||(f.Em={})).Eu=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o", + "author": "Asaf Shakarchi ", "license": "ASF 2.0", "repository": { "type": "git", diff --git a/scripts/apidocs.sh b/scripts/apidocs.sh new file mode 100755 index 0000000..076f931 --- /dev/null +++ b/scripts/apidocs.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo "# Executing apidocs script" +yuidoc --syntaxtype coffee -e .coffee \ No newline at end of file diff --git a/scripts/test b/scripts/test index f0aaa9e..7ad8805 100755 --- a/scripts/test +++ b/scripts/test @@ -1,6 +1,6 @@ #!/bin/sh echo "# Executing test script" -script/build +scripts/build node_modules/.bin/bower install node_modules/.bin/testem ci -l chrome diff --git a/testem.json b/testem.json index 84eba6d..28c93c4 100644 --- a/testem.json +++ b/testem.json @@ -7,6 +7,7 @@ "bower_components/ic-styled/main.js", "bower_components/jquery-simulate/index.js", "bower_components/ember-qunit/dist/globals/main.js", + "dist/globals/main.js", "http://localhost:4200/globals/main.js", "test/support/setup.js", "test/**/*.spec.js"