<commit_before>/* jslint node: true */
"use strict";

// ===========================================
//      Equal Temperament 12 semi-tones pool
// ===========================================
var ET12POOL = ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"];

// ===========================================
//              Scale Formulas
// ===========================================

// Formulas for pentatonic scales
exports.MINOR_PENTATONIC = [3, 2, 2, 3, 2];  // minor pentatonic
exports.MAJOR_PENTATONIC = [2, 2, 3, 2, 3];  // major pentatonic

// Formulas for hexatonic scales
exports.MINOR_BLUES          = [3, 2, 1, 1, 3, 2];  // minor blues
exports.MAJOR_BLUES          = [2, 1, 1, 3, 2, 3];  // major blues
exports.PROMETHEUS           = [2, 2, 2, 3, 1, 2];  // prometheus - mystic
exports.ISTRIAN              = [1, 2, 1, 2, 1, 5];  // istrian
exports.WHOLE_TONE           = [2, 2, 2, 2, 2, 2];  // whole tone
exports.AUGMENTED            = [3, 1, 3, 1, 3, 1];  // augmented - symmetrical augmented
exports.TRITONE              = [1, 3, 2, 1, 3, 2];  // tritone
exports.TWO_SEMITONE_TRITONE = [1, 1, 4, 1, 1, 4];  // two semitone tritone

// Major derived formulas
exports.LYDIAN     = [2, 2, 2, 1, 2, 2, 1];  // lydian
exports.IONIAN     = [2, 2, 1, 2, 2, 2, 1];  // ionian - major
exports.MIXOLYDIAN = [2, 2, 1, 2, 2, 1, 2];  // mixolydian
exports.DORIAN     = [2, 1, 2, 2, 2, 1, 2];  // dorian
exports.AEOLIAN    = [2, 1, 2, 2, 1, 2, 2];  // aeolian - minor
exports.PHRYGIAN   = [1, 2, 2, 2, 1, 2, 2];  // phrygian
exports.LOCRIAN    = [1, 2, 2, 1, 2, 2, 2];  // locrian
exports.MAJOR      = [2, 2, 1, 2, 2, 2, 1];  // ionian alias
exports.MINOR      = [2, 1, 2, 2, 1, 2, 2];  // aeolian alias

// Melodic minor derived formulas
exports.MELODIC_MINOR     = [2, 1, 2, 2, 2, 2, 1]; // melodic minor
exports.DORIAN_FLAT9      = [1, 2, 2, 2, 2, 1, 2]; // dorian flat 9
exports.LYDIAN_AUGMENTED  = [2, 2, 2, 2, 1, 2, 1]; // lydian augmented
exports.LYDIAN_FLAT7      = [2, 2, 2, 1, 2, 1, 2]; // lydian flat 7
exports.MIXOLYDIAN_FLAT13 = [2, 2, 1, 2, 1, 2, 2]; // mixolydian flat 13
exports.SEMI_LOCRIAN      = [2, 1, 2, 1, 2, 2, 2]; // semilocrian
exports.SUPER_LOCRIAN     = [1, 2, 1, 2, 2, 2, 2]; // superlocrian

// Harmonic minor derived formulas
exports.HARMONIC_MINOR   = [2, 1, 2, 2, 1, 3, 1]; // harmonic minor
exports.LOCRIAN_SHARP7   = [1, 2, 2, 1, 3, 1, 2]; // locrian sharp 7
exports.IONIAN_AUGMENTED = [2, 2, 1, 3, 1, 2, 1]; // ionian augmented

// ===========================================
//               Chord Formulas
// ===========================================
// http://www.scales-chords.com/showchbykey.php?key=C
// http://music.stackexchange.com/questions/11659/what-determines-a-chords-name/
// https://en.wikipedia.org/wiki/Chord_names_and_symbols_%28jazz_and_pop_music%29#Seventh_chords
// https://en.wikibooks.org/wiki/Music_Theory/Complete_List_of_Chord_Patterns
// http://music.stackexchange.com/questions/3732/what-notes-are-optional-in-jazz-chords
// http://www.smithfowler.org/music/Chord_Formulas.htm

// Ted green's v-system:
// http://www.tedgreene.com/teaching/v_system.asp
// http://tedgreene.com/images/lessons/v_system/14_The_43_Four-Note_Qualities.pdf
// http://www.tedgreene.com/images/lessons/v_system/15_The_Mathematics_of_Four-Note_Chords-and-Beyond.pdf

// Array indexes:
// 0: formula
// 1: root offset for no root chords, distance from the lowest note to the root

var twoNoteChords = {
    // Indeterminate triad (no 3rd):
    "5"                      : [[7], 0],   // Indeterminate triad, power chord, five no 3rd
    "b5 no 3rd"              : [[6], 0],   // Flat five no third
    // No 5th:
    "maj no 5th"             : [[4], 0],   // Major no 5th
    "min no 5th"             : [[3], 0],   // Minor no 5th
    "sus4 no 5th"            : [[5], 0],   // Suspended fourth no 5th
    "sus2 no 5th"            : [[2], 0],   // Suspended second no 5th
    // No root:
    "maj no root"            : [[3], -4],  // Major no root
    "min no root"            : [[4], -3],  // Minor no root
    // No 3rd no 5th
    "maj7 no(3rd, 5th)"      : [[11], 0],  // Major seventh no 3rd no 5th
    "7 no(3rd, 5th)"         : [[10], 0]   // Dominant seventh no 3rd no 5th
};

var threeNoteChords = {
    // Triads:
    "maj"             : [[4, 3], 0],   // Major triad
    "min"             : [[3, 4], 0],   // Minor triad
    "aug"             : [[4, 4], 0],   // Augmented triad
    "dim"             : [[3, 3], 0],   // Diminished triad
    // Sus trichords:
    "sus4"            : [[5, 2], 0],   // Suspended fourth trichord
    "sus2"            : [[2, 5], 0],   // Suspended second trichord
    // 7th no 5th trichords:
    "maj7 no 5th"     : [[4, 7], 0],   // Major seventh no fifth
    "min7 no 5th"     : [[3, 7], 0],   // Minor seventh no fifth
    "7 no 5th"        : [[4, 6], 0],   // Dominant seventh no fifth
    "dim7 no 5th"     : [[3, 6], 0],   // Diminished seventh no fifth
    "minmaj7 no 5th"  : [[3, 8], 0],   // Minor-major seventh no fifth
    // 6th no 5th trichords:
    "maj6 no 5th"     : [[4, 5], 0],   // Major sixth no fifth
    "min6 no 5th"     : [[3, 6], 0],   // Minor sixth no fifth
    // Add no 5th trichords:
    "maj add2 no 5th" : [[4, 10], 0],  // Major added-second no fifth
    "maj add4 no 5th" : [[4, 1], 0],   // Major added-fourth no fifth
    // 7th no root chords:
    "maj7 no root"    : [[3, 4], -4],  // Major seventh no root
    "min7 no root"    : [[4, 3], -3],  // Minor seventh no root
    "7 no root"       : [[3, 3], -4],  // Dominant seventh no root
    "min7b5 no root"  : [[3, 4], -3],  // Half-diminished seventh no root
    "dim7 no root"    : [[3, 3], -3],  // Diminished seventh no root
    "minmaj7 no root" : [[4, 4], -3],  // Minor-major seventh no root
    "maj7#5 no root"  : [[4, 3], -4],  // Major seventh sharp fifth no root
    "7b5 no root"     : [[2, 4], -4],  // Dominant seventh flat fifth no root
    "7#5 no root"     : [[4, 2], -4],  // Dominant seventh sharp fifth no root
    "maj7b5 no root"  : [[2, 5], -4],  // Major seventh flat fifth
    "min7#5 no root"  : [[5, 2], -3]   // Minor seventh sharp fifth
};

var fourNoteChords = {
    // 7th chords:
    "maj7"           : [[4, 3, 4], 0],   // Major seventh
    "min7"           : [[3, 4, 3], 0],   // Minor seventh
    "7"              : [[4, 3, 3], 0],   // Dominant seventh
    "min7b5"         : [[3, 3, 4], 0],   // Half-diminished seventh
    "dim7"           : [[3, 3, 3], 0],   // Diminished seventh
    "minmaj7"        : [[3, 4, 4], 0],   // Minor-major seventh
    "maj7#5"         : [[4, 4, 3], 0],   // Augmented-major seventh
    "7b5"            : [[4, 2, 4], 0],   // Dominant seventh flat five
    "7#5"            : [[4, 4, 2], 0],   // Dominant seventh sharp five
    "maj7b5"         : [[4, 2, 5], 0],   // Major seventh flat fifth
    "min7#5"         : [[3, 5, 2], 0],   // Minor seventh sharp fifth
    // 6th chords:
    "maj6"           : [[4, 3, 2], 0],   // Major sixth
    "min6"           : [[3, 4, 2], 0],   // Minor sixth
    // Add chords:
    "maj add2"       : [[4, 3, 7,], 0],  // Major added-second
    "maj add4"       : [[4, 3, 10], 0],  // Major added-fourth
    // 9th no 5th chords:
    "maj9 no 5th"    : [[4, 7, 3], 0],   // Major ninth no fifth
    "min9 no 5th"    : [[3, 7, 4], 0],   // Minor ninth no fifth
    "9 no 5th"       : [[4, 6, 4], 0],   // Dominant ninth no fifth
    "6/9 no 5th"     : [[4, 5, 5], 0],   // Six Nine no fifth
    // 9th No root chords:
    "maj9 no root"   : [[3, 4, 3], -4],  // Major ninth no root
    "9 sus4 no root" : [[3, 4, 3], -7],  // Dominant ninth suspended fourth no root
    "9 no root"      : [[3, 3, 4], -4]   // Dominant ninth no root
};

var fiveNoteChords = {
    // Ninth chords:
    "min9"         : [[3, 4, 3, 4], 0],  // Minor ninth
    "9"            : [[4, 3, 3, 4], 0],  // Dominant ninth
    "maj9"         : [[4, 3, 4, 3], 0],  // Major ninth
    "6/9"          : [[4, 3, 2, 5], 0],  // Six nine
    // Ninth sus chords:
    "9 sus4"       : [[5, 2, 3, 4], 0]   // Dominant ninth suspended fourth

};

// Node exports:
exports.twoNoteChords   = twoNoteChords;
exports.threeNoteChords = threeNoteChords;
exports.fourNoteChords  = fourNoteChords;
exports.fiveNoteChords  = fiveNoteChords;
exports.ET12POOL        = ET12POOL;<commit_msg>included ET12POOL_VALUES<commit_after>/** @module formulas */
/* jslint node: true */
"use strict";

// ===========================================
//   Equal Temperament 12 Semi-tones Values
// ===========================================
var ET12POOL_VALUES = {
    "C" : 0,
    "D" : 2,
    "E" : 4,
    "F" : 5,
    "G" : 7,
    "A" : 9,
    "B" : 11
};

// ===========================================
//      Equal Temperament 12 semi-tones pool
// ===========================================
var ET12POOL = ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"];

// ===========================================
//              Scale Formulas
// ===========================================

// Formulas for pentatonic scales
exports.MINOR_PENTATONIC = [3, 2, 2, 3, 2];  // minor pentatonic
exports.MAJOR_PENTATONIC = [2, 2, 3, 2, 3];  // major pentatonic

// Formulas for hexatonic scales
exports.MINOR_BLUES          = [3, 2, 1, 1, 3, 2];  // minor blues
exports.MAJOR_BLUES          = [2, 1, 1, 3, 2, 3];  // major blues
exports.PROMETHEUS           = [2, 2, 2, 3, 1, 2];  // prometheus - mystic
exports.ISTRIAN              = [1, 2, 1, 2, 1, 5];  // istrian
exports.WHOLE_TONE           = [2, 2, 2, 2, 2, 2];  // whole tone
exports.AUGMENTED            = [3, 1, 3, 1, 3, 1];  // augmented - symmetrical augmented
exports.TRITONE              = [1, 3, 2, 1, 3, 2];  // tritone
exports.TWO_SEMITONE_TRITONE = [1, 1, 4, 1, 1, 4];  // two semitone tritone

// Major derived formulas
exports.LYDIAN     = [2, 2, 2, 1, 2, 2, 1];  // lydian
exports.IONIAN     = [2, 2, 1, 2, 2, 2, 1];  // ionian - major
exports.MIXOLYDIAN = [2, 2, 1, 2, 2, 1, 2];  // mixolydian
exports.DORIAN     = [2, 1, 2, 2, 2, 1, 2];  // dorian
exports.AEOLIAN    = [2, 1, 2, 2, 1, 2, 2];  // aeolian - minor
exports.PHRYGIAN   = [1, 2, 2, 2, 1, 2, 2];  // phrygian
exports.LOCRIAN    = [1, 2, 2, 1, 2, 2, 2];  // locrian
exports.MAJOR      = [2, 2, 1, 2, 2, 2, 1];  // ionian alias
exports.MINOR      = [2, 1, 2, 2, 1, 2, 2];  // aeolian alias

// Melodic minor derived formulas
exports.MELODIC_MINOR     = [2, 1, 2, 2, 2, 2, 1]; // melodic minor
exports.DORIAN_FLAT9      = [1, 2, 2, 2, 2, 1, 2]; // dorian flat 9
exports.LYDIAN_AUGMENTED  = [2, 2, 2, 2, 1, 2, 1]; // lydian augmented
exports.LYDIAN_FLAT7      = [2, 2, 2, 1, 2, 1, 2]; // lydian flat 7
exports.MIXOLYDIAN_FLAT13 = [2, 2, 1, 2, 1, 2, 2]; // mixolydian flat 13
exports.SEMI_LOCRIAN      = [2, 1, 2, 1, 2, 2, 2]; // semilocrian
exports.SUPER_LOCRIAN     = [1, 2, 1, 2, 2, 2, 2]; // superlocrian

// Harmonic minor derived formulas
exports.HARMONIC_MINOR   = [2, 1, 2, 2, 1, 3, 1]; // harmonic minor
exports.LOCRIAN_SHARP7   = [1, 2, 2, 1, 3, 1, 2]; // locrian sharp 7
exports.IONIAN_AUGMENTED = [2, 2, 1, 3, 1, 2, 1]; // ionian augmented

// ===========================================
//               Chord Formulas
// ===========================================
// http://www.scales-chords.com/showchbykey.php?key=C
// http://music.stackexchange.com/questions/11659/what-determines-a-chords-name/
// https://en.wikipedia.org/wiki/Chord_names_and_symbols_%28jazz_and_pop_music%29#Seventh_chords
// https://en.wikibooks.org/wiki/Music_Theory/Complete_List_of_Chord_Patterns
// http://music.stackexchange.com/questions/3732/what-notes-are-optional-in-jazz-chords
// http://www.smithfowler.org/music/Chord_Formulas.htm

// Ted green's v-system:
// http://www.tedgreene.com/teaching/v_system.asp
// http://tedgreene.com/images/lessons/v_system/14_The_43_Four-Note_Qualities.pdf
// http://www.tedgreene.com/images/lessons/v_system/15_The_Mathematics_of_Four-Note_Chords-and-Beyond.pdf

// Array indexes:
// 0: formula
// 1: root offset for no root chords, distance from the lowest note to the root

var twoNoteChords = {
    // Indeterminate triad (no 3rd):
    "5"                      : [[7], 0],   // Indeterminate triad, power chord, five no 3rd
    "b5 no 3rd"              : [[6], 0],   // Flat five no third
    // No 5th:
    "maj no 5th"             : [[4], 0],   // Major no 5th
    "min no 5th"             : [[3], 0],   // Minor no 5th
    "sus4 no 5th"            : [[5], 0],   // Suspended fourth no 5th
    "sus2 no 5th"            : [[2], 0],   // Suspended second no 5th
    // No root:
    "maj no root"            : [[3], -4],  // Major no root
    "min no root"            : [[4], -3],  // Minor no root
    // No 3rd no 5th
    "maj7 no(3rd, 5th)"      : [[11], 0],  // Major seventh no 3rd no 5th
    "7 no(3rd, 5th)"         : [[10], 0]   // Dominant seventh no 3rd no 5th
};

var threeNoteChords = {
    // Triads:
    "maj"             : [[4, 3], 0],   // Major triad
    "min"             : [[3, 4], 0],   // Minor triad
    "aug"             : [[4, 4], 0],   // Augmented triad
    "dim"             : [[3, 3], 0],   // Diminished triad
    // Sus trichords:
    "sus4"            : [[5, 2], 0],   // Suspended fourth trichord
    "sus2"            : [[2, 5], 0],   // Suspended second trichord
    // 7th no 5th trichords:
    "maj7 no 5th"     : [[4, 7], 0],   // Major seventh no fifth
    "min7 no 5th"     : [[3, 7], 0],   // Minor seventh no fifth
    "7 no 5th"        : [[4, 6], 0],   // Dominant seventh no fifth
    "dim7 no 5th"     : [[3, 6], 0],   // Diminished seventh no fifth
    "minmaj7 no 5th"  : [[3, 8], 0],   // Minor-major seventh no fifth
    // 6th no 5th trichords:
    "maj6 no 5th"     : [[4, 5], 0],   // Major sixth no fifth
    "min6 no 5th"     : [[3, 6], 0],   // Minor sixth no fifth
    // Add no 5th trichords:
    "maj add2 no 5th" : [[4, 10], 0],  // Major added-second no fifth
    "maj add4 no 5th" : [[4, 1], 0],   // Major added-fourth no fifth
    // 7th no root chords:
    "maj7 no root"    : [[3, 4], -4],  // Major seventh no root
    "min7 no root"    : [[4, 3], -3],  // Minor seventh no root
    "7 no root"       : [[3, 3], -4],  // Dominant seventh no root
    "min7b5 no root"  : [[3, 4], -3],  // Half-diminished seventh no root
    "dim7 no root"    : [[3, 3], -3],  // Diminished seventh no root
    "minmaj7 no root" : [[4, 4], -3],  // Minor-major seventh no root
    "maj7#5 no root"  : [[4, 3], -4],  // Major seventh sharp fifth no root
    "7b5 no root"     : [[2, 4], -4],  // Dominant seventh flat fifth no root
    "7#5 no root"     : [[4, 2], -4],  // Dominant seventh sharp fifth no root
    "maj7b5 no root"  : [[2, 5], -4],  // Major seventh flat fifth
    "min7#5 no root"  : [[5, 2], -3]   // Minor seventh sharp fifth
};

var fourNoteChords = {
    // 7th chords:
    "maj7"           : [[4, 3, 4], 0],   // Major seventh
    "min7"           : [[3, 4, 3], 0],   // Minor seventh
    "7"              : [[4, 3, 3], 0],   // Dominant seventh
    "min7b5"         : [[3, 3, 4], 0],   // Half-diminished seventh
    "dim7"           : [[3, 3, 3], 0],   // Diminished seventh
    "minmaj7"        : [[3, 4, 4], 0],   // Minor-major seventh
    "maj7#5"         : [[4, 4, 3], 0],   // Augmented-major seventh
    "7b5"            : [[4, 2, 4], 0],   // Dominant seventh flat five
    "7#5"            : [[4, 4, 2], 0],   // Dominant seventh sharp five
    "maj7b5"         : [[4, 2, 5], 0],   // Major seventh flat fifth
    "min7#5"         : [[3, 5, 2], 0],   // Minor seventh sharp fifth
    // 6th chords:
    "maj6"           : [[4, 3, 2], 0],   // Major sixth
    "min6"           : [[3, 4, 2], 0],   // Minor sixth
    // Add chords:
    "maj add2"       : [[4, 3, 7,], 0],  // Major added-second
    "maj add4"       : [[4, 3, 10], 0],  // Major added-fourth
    // 9th no 5th chords:
    "maj9 no 5th"    : [[4, 7, 3], 0],   // Major ninth no fifth
    "min9 no 5th"    : [[3, 7, 4], 0],   // Minor ninth no fifth
    "9 no 5th"       : [[4, 6, 4], 0],   // Dominant ninth no fifth
    "6/9 no 5th"     : [[4, 5, 5], 0],   // Six Nine no fifth
    // 9th No root chords:
    "maj9 no root"   : [[3, 4, 3], -4],  // Major ninth no root
    "9 sus4 no root" : [[3, 4, 3], -7],  // Dominant ninth suspended fourth no root
    "9 no root"      : [[3, 3, 4], -4]   // Dominant ninth no root
};

var fiveNoteChords = {
    // Ninth chords:
    "min9"         : [[3, 4, 3, 4], 0],  // Minor ninth
    "9"            : [[4, 3, 3, 4], 0],  // Dominant ninth
    "maj9"         : [[4, 3, 4, 3], 0],  // Major ninth
    "6/9"          : [[4, 3, 2, 5], 0],  // Six nine
    // Ninth sus chords:
    "9 sus4"       : [[5, 2, 3, 4], 0]   // Dominant ninth suspended fourth

};

// Node exports:
exports.twoNoteChords   = twoNoteChords;
exports.threeNoteChords = threeNoteChords;
exports.fourNoteChords  = fourNoteChords;
exports.fiveNoteChords  = fiveNoteChords;
exports.ET12POOL        = ET12POOL;
exports.ET12POOL_VALUES = ET12POOL_VALUES;<|endoftext|>


<commit_before>// Import React
import React from "react";

// Import Spectacle Core tags
import {
  Appear,
  BlockQuote,
  Cite,
  CodePane,
  Deck,
  Fill,
  Fit,
  Heading,
  Image,
  Layout,
  Link,
  ListItem,
  List,
  Markdown,
  Quote,
  Slide,
  Spectacle,
  Text
} from "spectacle";

// Import image preloader util
import preloader from "spectacle/lib/utils/preloader";

// Import theme
import createTheme from "spectacle/lib/themes/default";

//Font Awesome
import FontAwesome from "react-fontawesome";

// Require CSS
require("normalize.css");
require("spectacle/lib/themes/default/index.css");

const images = {
  city: require("../assets/raven_animal/raven_duo.jpg"),
  markdown: require("../assets/markdown.png"),
  drawing: require("../assets/epk/raven_adriano_lyra.jpg"),

  birdcage: require("../assets/epk/raven_birdcage_bw.jpg"),

  birdcage2: require("../assets/_epk/birdcage.jpg"),
  lyra: require("../assets/_epk/lyra.jpg"),
  feathers: require("../assets/raven_animal/feathers_2.jpg"),
  cubit: require("../assets/_epk/cubit.jpg"),
  houseofyes: require("../assets/_epk/house_of_yes.jpg"),
  signature: require("../assets/_epk/signature.jpg"),
  silks: require("../assets/_epk/silks.jpg"),
  rig: require("../assets/_epk/rig.jpg"),
  burning: require("../assets/_epk/burning_black.jpg"),
  lc: require("../assets/_epk/lc.jpg"),
};

preloader(images);

const theme = createTheme({
  //Colors
  primary: "#111",
  secondary: "white",
  tertiary: "#333",
  quartenary: "#CECECE"
}, {
  //Fonts
  primary: "Unica One",
  secondary: "Abel",
  tertiary: "Helvetica"
});

export default class Presentation extends React.Component {
  render() {
    return (
  <Deck controls={true} progress={"bar"} transition={["fade"]} transitionDuration={500} theme={theme}>

      <Slide transition={["fade"]} bgImage={images.city.replace("/", "")} bgDarken={0.75}>
        <Heading fit bold textColor="primary">RAVEN</Heading>
      </Slide>

      <Slide transition={["fade"]} bgImage={images.signature.replace("/", "")} bgDarken={0.85}>

        <Quote textColor="secondary">Once upon a midnight dreary...</Quote>

      </Slide>

{/* Slideshow */}
  <Slide transition={["fade"]} bgImage={images.signature.replace("/", "")} bgDarken={0.33} />
  <Slide transition={["fade"]} bgImage={images.silks.replace("/", "")} bgDarken={0.33} />
    <Slide transition={["fade"]} bgImage={images.rig.replace("/", "")} bgDarken={0.67} />
      <Slide transition={["fade"]} bgImage={images.lc.replace("/", "")} bgDarken={0.67} />

{/* Services */}
  <Slide transition={["fade"]} bgImage={images.feathers.replace("/", "")} bgDarken={0.75}>
      <Heading caps textColor="secondary">SERVICES</Heading>
  </Slide>

  <Slide transition={["fade"]} bgImage={images.lyra.replace("/", "")} bgDarken={0.75}>
      <Heading fill caps textColor="secondary">Feature</Heading>
        <Text fill caps italic textColor="secondary">Aerial Duo</Text>
        <Text fill caps italic textColor="secondary">Tandem Duo</Text>
        <Text fill caps italic textColor="secondary">Solo</Text>

      <Heading fill caps textColor="secondary">Ambient</Heading>
        <Text fill caps italic textColor="secondary">Aerial Duo</Text>
        <Text fill caps italic textColor="secondary">Tandem Duo</Text>
        <Text fill caps italic textColor="secondary">Solo</Text>
        <Text fill caps italic textColor="secondary">contortion-based acro</Text>
        <Text fill caps italic textColor="secondary">Dance</Text>
  </Slide>

  <Slide transition={["fade"]} bgImage={images.cubit.replace("/", "")} bgDarken={0.75}>
    <Heading fit caps textColor="secondary">Stage Shows</Heading>
      <Text fill caps italic textColor="secondary">
         {/* <FontAwesome className='white' name='clock-o' size='1x'
            style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />  */}
            15-60 minutes</Text>
    <Heading margin="20px 0 0 0" fit caps textColor="secondary">Collaboration</Heading>
    <Text fill caps italic textColor="secondary">Theater</Text>
    <Text fill caps italic textColor="secondary">Dance</Text>
  </Slide>

  {/* Appaatus */}
    <Slide align="center center" transition={["fade"]} bgImage={images.houseofyes.replace("/", "")} bgDarken={0.67}>
      <Heading margin="0 0 20px 0" caps fit textColor="secondary">apparatus</Heading>
        <Layout fit>
          <Fill>
        <Text textAlign="left" margin="0 0 10px 0" bold italic textColor="secondary">
          <FontAwesome className='white' name='institution' size='1x'
              style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
                Birdcage
              </Text>
          </Fill>
          <Fill>
      <Text textAlign="right" margin="0 0 10px 0"  bold italic textColor="secondary">
              Corde Lisse
              <FontAwesome className='white' name='road' size='1x'
                  style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
              </Text>
          </Fill>
            </Layout>
              <Layout fit>
          <Fill>
              <Text textAlign="left" margin="0 0 10px 0" bold italic textColor="secondary">
            <FontAwesome className='white' name='cube' size='1x'
                style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
                  Cubit
                </Text>
          </Fill>
          <Fill>
            <Text textAlign="right" margin="0 0 10px 0"  bold italic textColor="secondary">
                Hammock
                <FontAwesome className='white' name='leaf' rotate={180} size='1x'
                    style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
              </Text>
          </Fill>
          </Layout>
              <Layout fit>
          <Fill>
                  <Text textAlign="left" margin="0 0 10px 0" bold italic textColor="secondary">
          <FontAwesome className='primary'  name='opera' size='1x'
              style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
              LYRA
            </Text>
          </Fill>
          <Fill>
        <Text textAlign="right" margin="0 0 10px 0" bold italic textColor="secondary">
                NET
                <FontAwesome className='white' name='table' size='1x'
                    style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
              </Text>
          </Fill>
        </Layout>
    <Layout fit>
        <Fill>
      <Text textAlign="left" margin="0 0 10px 0"  bold italic textColor="secondary">
        <FontAwesome className='white' rotate={90} name='random' size='1x'
            style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
            Spansets
            </Text>
        </Fill>
        <Fill>
    <Text textAlign="right"margin="0 0 10px 0" bold italic textColor="secondary">
              Tissu
            <FontAwesome  className='white' name='fire' rotate={180} size='1x'
                  style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
                </Text>
        </Fill>
      </Layout>
        <Heading margin="20px 0 0 0" caps fit textColor="secondary">options</Heading>
      </Slide>

{/* EVENTS */}
<Slide transition={["fade"]} bgColor="primary" textColor="secondary" bgImage={images.birdcage2.replace("/", "")} bgDarken={0.85}>
  <Heading fit caps textColor="secondary" caps>OCCASIONS</Heading>

    <Text textColor="secondary" italic>corporate events</Text>
    <Text textColor="secondary" italic>commercial video</Text>
    <Text textColor="secondary" italic>still shoots</Text>
    <Text textColor="secondary" italic>nightclubs</Text>
    <Text textColor="secondary" italic>concerts</Text>
    <Text textColor="secondary" italic>immersive theatre</Text>
    <Text textColor="secondary" italic>proscenium productions</Text>
    <Text textColor="secondary" italic>variety</Text>

</Slide>

{/* NIGHT CLUBS AND VARIETY - LOGO BADGE  */}
  <Slide transition={["fade"]} bgImage={images.feathers.replace("/", "")} bgDarken={0.50}>
  <Heading fit>Nightclubs & Variety</Heading>
  <Text fit textColor="secondary">The Box: NYC | UK</Text>
  <Text fit textColor="secondary">Blunderland</Text>
  <Text fit textColor="secondary">Diamond Horseshoe</Text>
  <Text fit textColor="secondary">The House of YES</Text>
  <Text fit textColor="secondary">Lightning Society</Text>
  <Text fit textColor="secondary">Little Cinema</Text>
  <Text fit textColor="secondary">El Ministerio De La Parranda</Text>
  <Text fit textColor="secondary">No Holds Barred</Text>
  <Text fit textColor="secondary">Que Bajo?!</Text>
  <Text fit textColor="secondary">The Slipper Room</Text>
</Slide>

  <Slide transition={["fade"]} bgImage={images.feathers.replace("/", "")} bgDarken={0.67}>
  <Heading fit>TV & Commercial</Heading>

    <Text fit textColor="secondary">Casual Films - commercial shoot</Text>
    <Text fit textColor="secondary">Younger (TV Land)</Text>

<Heading fit>Shows</Heading>
<Text fit textColor="secondary">The Chicago Party</Text>
<Text fit textColor="secondary">False Awakening</Text>
</Slide>

{/* Contact Info */}
<Slide align="left center" bgImage={images.burning.replace("/", "")} bgDarken={0.67}>
    <Link href="http://www.instagram.com/ravenkindness" _blank >
  <Text textAlign="right" italic textFont="secondary" textColor="white">
    <FontAwesome className='white' name='instagram' size='1x'
        style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }}
      />
       ravenkindness
  </Text>
</Link>
  <Link href="http://www.kindnessofravens.com" _blank>
  <Text textAlign="right" italic textFont="secondary" textColor="white">
    <FontAwesome className='white' name='globe' size='1x'
        style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }}
      />
       kindnessofravens.com
  </Text>
</Link>
<Link href="mailto:ravenkindness@gmail.com" _blank>
  <Text textAlign="right" italic textFont="secondary" textColor="white">  <FontAwesome
    className='white'
    name='envelope'
    size='1x'
    style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }}
  />ravenkindness@gmail.com</Text>
</Link>
</Slide>
      </Deck>
    );
  }
}
<commit_msg>first draft<commit_after>// Import React
import React from "react";

// Import Spectacle Core tags
import {
  Appear,
  BlockQuote,
  Cite,
  CodePane,
  Deck,
  Fill,
  Fit,
  Heading,
  Image,
  Layout,
  Link,
  ListItem,
  List,
  Markdown,
  Quote,
  Slide,
  Spectacle,
  Text
} from "spectacle";

// Import image preloader util
import preloader from "spectacle/lib/utils/preloader";

// Import theme
import createTheme from "spectacle/lib/themes/default";

//Font Awesome
import FontAwesome from "react-fontawesome";

// Require CSS
require("normalize.css");
require("spectacle/lib/themes/default/index.css");

const images = {
  city: require("../assets/raven_animal/raven_duo.jpg"),
  markdown: require("../assets/markdown.png"),
  drawing: require("../assets/epk/raven_adriano_lyra.jpg"),

  birdcage: require("../assets/epk/raven_birdcage_bw.jpg"),

  birdcage2: require("../assets/_epk/birdcage.jpg"),
  lyra: require("../assets/_epk/lyra.jpg"),
  feathers: require("../assets/raven_animal/feathers_2.jpg"),
  cubit: require("../assets/_epk/cubit.jpg"),
  houseofyes: require("../assets/_epk/house_of_yes.jpg"),
  signature: require("../assets/_epk/signature.jpg"),
  silks: require("../assets/_epk/silks.jpg"),
  rig: require("../assets/_epk/rig.jpg"),
  burning: require("../assets/_epk/burning_black.jpg"),
  lc: require("../assets/_epk/lc.jpg"),
};

preloader(images);

const theme = createTheme({
  //Colors
  primary: "#111",
  secondary: "white",
  tertiary: "#333",
  quartenary: "#CECECE"
}, {
  //Fonts
  primary: "Unica One",
  secondary: "Abel",
  tertiary: "Helvetica"
});

export default class Presentation extends React.Component {
  render() {
    return (
  <Deck controls={true} progress={"bar"} transition={["fade"]} transitionDuration={500} theme={theme}>

      <Slide transition={["fade"]} bgImage={images.city.replace("/", "")} bgDarken={0.75}>
        <Heading fit bold textColor="primary">RAVEN</Heading>
      </Slide>

      <Slide transition={["fade"]} bgImage={images.signature.replace("/", "")} bgDarken={0.85}>

        <Quote textColor="secondary">Once upon a midnight dreary...</Quote>

      </Slide>

{/* Slideshow */}
  <Slide transition={["fade"]} bgImage={images.signature.replace("/", "")} bgDarken={0.33} />
  <Slide transition={["fade"]} bgImage={images.silks.replace("/", "")} bgDarken={0.33} />
    <Slide transition={["fade"]} bgImage={images.rig.replace("/", "")} bgDarken={0.67} />
      <Slide transition={["fade"]} bgImage={images.lc.replace("/", "")} bgDarken={0.67} />

{/* Services */}
  <Slide transition={["fade"]} bgImage={images.feathers.replace("/", "")} bgDarken={0.75}>
      <Heading caps textColor="secondary">SERVICES</Heading>
  </Slide>

  <Slide transition={["fade"]} bgImage={images.lyra.replace("/", "")} bgDarken={0.75}>
      <Heading fill caps textColor="secondary">Feature</Heading>
        <Text fill caps italic textColor="secondary">Aerial Duo</Text>
        <Text fill caps italic textColor="secondary">Tandem Duo</Text>
        <Text fill caps italic textColor="secondary">Solo</Text>

      <Heading fill caps textColor="secondary">Ambient</Heading>
        <Text fill caps italic textColor="secondary">Aerial Duo</Text>
        <Text fill caps italic textColor="secondary">Tandem Duo</Text>
        <Text fill caps italic textColor="secondary">Solo</Text>
        <Text fill caps italic textColor="secondary">contortion-based acro</Text>
        <Text fill caps italic textColor="secondary">Dance</Text>
  </Slide>

  <Slide transition={["fade"]} bgImage={images.cubit.replace("/", "")} bgDarken={0.75}>
    <Heading fit caps textColor="secondary">Stage Shows</Heading>
      <Text fill caps italic textColor="secondary">
         {/* <FontAwesome className='white' name='clock-o' size='1x'
            style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />  */}
            15-60 minutes</Text>

    <Heading fit caps margin="20px 0 0 0" textColor="secondary">Original Productions</Heading>
    <Text fill caps italic textColor="secondary">The Chicago Party</Text>
    <Text fill caps italic textColor="secondary">False Awakening</Text>
  </Slide>

  {/* Appaatus */}
    <Slide align="center center" transition={["fade"]} bgImage={images.houseofyes.replace("/", "")} bgDarken={0.67}>
      <Heading margin="0 0 20px 0" caps fit textColor="secondary">apparatus</Heading>
        <Layout fit>
          <Fill>
        <Text textAlign="left" margin="0 0 10px 0" bold italic textColor="secondary">
          <FontAwesome className='white' name='institution' size='1x'
              style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
                Birdcage
              </Text>
          </Fill>
          <Fill>
      <Text textAlign="right" margin="0 0 10px 0"  bold italic textColor="secondary">
              Corde Lisse
              <FontAwesome className='white' name='road' size='1x'
                  style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
              </Text>
          </Fill>
            </Layout>
              <Layout fit>
          <Fill>
              <Text textAlign="left" margin="0 0 10px 0" bold italic textColor="secondary">
            <FontAwesome className='white' name='cube' size='1x'
                style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
                  Cubit
                </Text>
          </Fill>
          <Fill>
            <Text textAlign="right" margin="0 0 10px 0"  bold italic textColor="secondary">
                Hammock
                <FontAwesome className='white' name='leaf' rotate={180} size='1x'
                    style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
              </Text>
          </Fill>
          </Layout>
              <Layout fit>
          <Fill>
                  <Text textAlign="left" margin="0 0 10px 0" bold italic textColor="secondary">
          <FontAwesome className='primary'  name='opera' size='1x'
              style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
              LYRA
            </Text>
          </Fill>
          <Fill>
        <Text textAlign="right" margin="0 0 10px 0" bold italic textColor="secondary">
                NET
                <FontAwesome className='white' name='table' size='1x'
                    style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
              </Text>
          </Fill>
        </Layout>
    <Layout fit>
        <Fill>
      <Text textAlign="left" margin="0 0 10px 0"  bold italic textColor="secondary">
        <FontAwesome className='white' rotate={90} name='random' size='1x'
            style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
            Spansets
            </Text>
        </Fill>
        <Fill>
    <Text textAlign="right"margin="0 0 10px 0" bold italic textColor="secondary">
              Tissu
            <FontAwesome  className='white' name='fire' rotate={180} size='1x'
                  style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} />
                </Text>
        </Fill>
      </Layout>
        <Heading margin="20px 0 0 0" caps fit textColor="secondary">options</Heading>
      </Slide>

{/* EVENTS */}
<Slide transition={["fade"]} bgColor="primary" textColor="secondary" bgImage={images.birdcage2.replace("/", "")} bgDarken={0.85}>
  <Heading fit caps textColor="secondary" caps>OCCASIONS</Heading>

    <Text textColor="secondary" italic>corporate events</Text>
    <Text textColor="secondary" italic>commercial video</Text>
    <Text textColor="secondary" italic>still shoots</Text>
    <Text textColor="secondary" italic>nightclubs</Text>
    <Text textColor="secondary" italic>concerts</Text>
    <Text textColor="secondary" italic>immersive theatre</Text>
    <Text textColor="secondary" italic>proscenium productions</Text>
    <Text textColor="secondary" italic>variety</Text>
    <Text textColor="secondary" italic>TV & Commercial</Text>

</Slide>

{/* NIGHT CLUBS AND VARIETY - LOGO BADGE  */}
  <Slide transition={["fade"]} bgImage={images.feathers.replace("/", "")} bgDarken={0.50}>
  <Heading fit>Nightclubs & Variety</Heading>
  <Text fit textColor="secondary">The Box: NYC | UK</Text>
  <Text fit textColor="secondary">Blunderland</Text>
  <Text fit textColor="secondary">Diamond Horseshoe</Text>
  <Text fit textColor="secondary">The House of YES</Text>
  <Text fit textColor="secondary">Lightning Society</Text>
  <Text fit textColor="secondary">Little Cinema</Text>
  <Text fit textColor="secondary">El Ministerio De La Parranda</Text>
  <Text fit textColor="secondary">No Holds Barred</Text>
  <Text fit textColor="secondary">Que Bajo?!</Text>
  <Text fit textColor="secondary">The Slipper Room</Text>
</Slide>

{/* Contact Info */}
<Slide align="left center" bgImage={images.burning.replace("/", "")} bgDarken={0.67}>
    <Link href="http://www.instagram.com/ravenkindness" _blank >
  <Text textAlign="right" italic textFont="secondary" textColor="white">
    <FontAwesome className='white' name='instagram' size='1x'
        style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }}
      />
       ravenkindness
  </Text>
</Link>
  <Link href="http://www.kindnessofravens.com" _blank>
  <Text textAlign="right" italic textFont="secondary" textColor="white">
    <FontAwesome className='white' name='globe' size='1x'
        style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }}
      />
       kindnessofravens.com
  </Text>
</Link>
<Link href="mailto:ravenkindness@gmail.com" _blank>
  <Text textAlign="right" italic textFont="secondary" textColor="white">  <FontAwesome
    className='white'
    name='envelope'
    size='1x'
    style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }}
  />ravenkindness@gmail.com</Text>
</Link>
</Slide>
      </Deck>
    );
  }
}
<|endoftext|>


<commit_before>// Import React
import React from "react";

// Import Spectacle Core tags
import {
  Appear,
  BlockQuote,
  Cite,
  CodePane,
  Deck,
  Fill,
  Heading,
  Image,
  Layout,
  Link,
  ListItem,
  List,
  Markdown,
  Quote,
  Slide,
  Spectacle,
  Text
} from "spectacle";

// Import image preloader util
import preloader from "spectacle/lib/utils/preloader";

// Import theme
import createTheme from "../themes/ga";

// Import custom component
import Interactive from "../assets/interactive";

import Codepen from "react-codepen";

// Require CSS
require("normalize.css");
require("../themes/ga/index.css");

const images = {
  city: require("../assets/city.jpg"),
  kat: require("../assets/kat.png"),
  logo: require("../assets/formidable-logo.svg"),
  markdown: require("../assets/markdown.png")
};

preloader(images);

const theme = createTheme({
  primary: "#ff0021"
});

export default class Presentation extends React.Component {
  render() {
    return (
      <Spectacle theme={theme}>
        <Deck transition={["zoom", "slide"]} transitionDuration={500}>
          <Slide transition={["zoom"]} bgColor="primary">
            <Heading size={1} fit caps lineHeight={1}>
              Intro to ReactJS
            </Heading>
            <Heading size={1} fit caps>
              A JavaScript library for User Interfaces
            </Heading>
            <Heading size={2} textSize="1.5em" margin="20px 0px 0px">Hit Your Right Arrow To Begin!</Heading>
          </Slide>
          <Slide transition={["slide"]} bgColor="black" notes="You can even put notes on your slide. How awesome is that?">
            <Codepen user="bhague1281" hash="NxOdgv" />
            <Heading size={2} caps fit textColor="primary">
              Wait what?
            </Heading>
            <Heading size={3} caps textColor="tertiary">
              That's Right. Codepen in your presentations.
            </Heading>
          </Slide>
          <Slide transition={["zoom", "fade"]} bgColor="primary" notes="

talk about that

and that

">
            <CodePane
              lang="jsx"
              source={require("raw!../assets/deck.example")}
              margin="20px auto"
            />
          </Slide>
          <Slide transition={["slide"]} bgImage={images.city.replace("/", "")} bgDarken={0.75}>
            <Appear fid="1">
              <Heading size={1} caps fit>
                Full Width
              </Heading>
            </Appear>
            <Appear fid="2">
              <Heading size={1} caps fit textColor="tertiary">
                Adjustable Darkness
              </Heading>
            </Appear>
            <Appear fid="3">
              <Heading size={1} caps fit textColor="primary">
                Background Imagery
              </Heading>
            </Appear>
          </Slide>
          <Slide transition={["zoom", "fade"]} bgColor="primary">
            <Heading caps fit>Flexible Layouts</Heading>
            <Layout>
              <Fill>
                <Heading size={4} caps textColor="secondary" bgColor="white" margin={10}>
                  Left
                </Heading>
              </Fill>
              <Fill>
                <Heading size={4} caps textColor="secondary" bgColor="white" margin={10}>
                  Right
                </Heading>
              </Fill>
            </Layout>
          </Slide>
          <Slide transition={["slide"]} bgColor="black">

              <Quote>Wonderfully formatted quotes</Quote>
              Ken Wheeler

          </Slide>
          <Slide transition={["spin", "zoom"]} bgColor="tertiary">
            <Heading caps fit size={1} textColor="primary">
              Inline Markdown
            </Heading>
            <Markdown>
              {`
![Markdown Logo](${images.markdown.replace("/", "")})

You can write inline images, [Markdown Links](http://commonmark.org), paragraph text and most other markdown syntax
* Lists too!
* With ~~strikethrough~~ and _italic_
* And lets not forget **bold**
              `}
            </Markdown>
          </Slide>
          <Slide transition={["slide", "spin"]} bgColor="primary">
            <Heading caps fit size={1} textColor="tertiary">
              Smooth
            </Heading>
            <Heading caps fit size={1} textColor="secondary">
              Combinable Transitions
            </Heading>
          </Slide>
          <Slide transition={["fade"]} bgColor="secondary" textColor="primary">
            <List>
              <Appear><ListItem>Inline style based theme system</ListItem></Appear>
              <Appear><ListItem>Autofit text</ListItem></Appear>
              <Appear><ListItem>Flexbox layout system</ListItem></Appear>
              <Appear><ListItem>React-Router navigation</ListItem></Appear>
              <Appear><ListItem>PDF export</ListItem></Appear>
              <Appear><ListItem>And...</ListItem></Appear>
            </List>
          </Slide>
          <Slide transition={["slide"]} bgColor="primary">
            <Heading size={1} caps fit textColor="tertiary">
              Your presentations are interactive
            </Heading>
            <Interactive/>
          </Slide>
          <Slide transition={["spin", "slide"]} bgColor="tertiary">
            <Heading size={1} caps fit lineHeight={1.5} textColor="primary">
              Made with love in Seattle by
            </Heading>
            <Link href="http://www.formidablelabs.com"><Image width="100%" src={images.logo}/></Link>
          </Slide>
        </Deck>
      </Spectacle>
    );
  }
}
<commit_msg>changed title<commit_after>// Import React
import React from "react";

// Import Spectacle Core tags
import {
  Appear,
  BlockQuote,
  Cite,
  CodePane,
  Deck,
  Fill,
  Heading,
  Image,
  Layout,
  Link,
  ListItem,
  List,
  Markdown,
  Quote,
  Slide,
  Spectacle,
  Text
} from "spectacle";

// Import image preloader util
import preloader from "spectacle/lib/utils/preloader";

// Import theme
import createTheme from "../themes/ga";

// Import custom component
import Interactive from "../assets/interactive";

import Codepen from "react-codepen";

// Require CSS
require("normalize.css");
require("../themes/ga/index.css");

const images = {
  city: require("../assets/city.jpg"),
  kat: require("../assets/kat.png"),
  logo: require("../assets/formidable-logo.svg"),
  markdown: require("../assets/markdown.png")
};

preloader(images);

const theme = createTheme({
  primary: "#ff0021"
});

export default class Presentation extends React.Component {
  render() {
    return (
      <Spectacle theme={theme}>
        <Deck transition={["zoom", "slide"]} transitionDuration={500}>
          <Slide transition={["zoom"]} bgColor="primary">
            <Heading size={1} fit caps lineHeight={1}>
              ES2015
            </Heading>
            <Appear fid="1">
              <Heading size={1} fit caps>
                Use cases at General Assembly
              </Heading>
            </Appear>
          </Slide>
          <Slide transition={["slide"]} bgColor="black" notes="You can even put notes on your slide. How awesome is that?">
            <Codepen user="bhague1281" hash="NxOdgv" />
            <Heading size={2} caps fit textColor="primary">
              Wait what?
            </Heading>
            <Heading size={3} caps textColor="tertiary">
              That's Right. Codepen in your presentations.
            </Heading>
          </Slide>
          <Slide transition={["zoom", "fade"]} bgColor="primary" notes="

talk about that

and that

">
            <CodePane
              lang="jsx"
              source={require("raw!../assets/deck.example")}
              margin="20px auto"
            />
          </Slide>
          <Slide transition={["slide"]} bgImage={images.city.replace("/", "")} bgDarken={0.75}>
            <Appear fid="1">
              <Heading size={1} caps fit>
                Full Width
              </Heading>
            </Appear>
            <Appear fid="2">
              <Heading size={1} caps fit textColor="tertiary">
                Adjustable Darkness
              </Heading>
            </Appear>
            <Appear fid="3">
              <Heading size={1} caps fit textColor="primary">
                Background Imagery
              </Heading>
            </Appear>
          </Slide>
          <Slide transition={["zoom", "fade"]} bgColor="primary">
            <Heading caps fit>Flexible Layouts</Heading>
            <Layout>
              <Fill>
                <Heading size={4} caps textColor="secondary" bgColor="white" margin={10}>
                  Left
                </Heading>
              </Fill>
              <Fill>
                <Heading size={4} caps textColor="secondary" bgColor="white" margin={10}>
                  Right
                </Heading>
              </Fill>
            </Layout>
          </Slide>
          <Slide transition={["slide"]} bgColor="black">

              <Quote>Wonderfully formatted quotes</Quote>
              Ken Wheeler

          </Slide>
          <Slide transition={["spin", "zoom"]} bgColor="tertiary">
            <Heading caps fit size={1} textColor="primary">
              Inline Markdown
            </Heading>
            <Markdown>
              {`
![Markdown Logo](${images.markdown.replace("/", "")})

You can write inline images, [Markdown Links](http://commonmark.org), paragraph text and most other markdown syntax
* Lists too!
* With ~~strikethrough~~ and _italic_
* And lets not forget **bold**
              `}
            </Markdown>
          </Slide>
          <Slide transition={["slide", "spin"]} bgColor="primary">
            <Heading caps fit size={1} textColor="tertiary">
              Smooth
            </Heading>
            <Heading caps fit size={1} textColor="secondary">
              Combinable Transitions
            </Heading>
          </Slide>
          <Slide transition={["fade"]} bgColor="secondary" textColor="primary">
            <List>
              <Appear><ListItem>Inline style based theme system</ListItem></Appear>
              <Appear><ListItem>Autofit text</ListItem></Appear>
              <Appear><ListItem>Flexbox layout system</ListItem></Appear>
              <Appear><ListItem>React-Router navigation</ListItem></Appear>
              <Appear><ListItem>PDF export</ListItem></Appear>
              <Appear><ListItem>And...</ListItem></Appear>
            </List>
          </Slide>
          <Slide transition={["slide"]} bgColor="primary">
            <Heading size={1} caps fit textColor="tertiary">
              Your presentations are interactive
            </Heading>
            <Interactive/>
          </Slide>
          <Slide transition={["spin", "slide"]} bgColor="tertiary">
            <Heading size={1} caps fit lineHeight={1.5} textColor="primary">
              Made with love in Seattle by
            </Heading>
            <Link href="http://www.formidablelabs.com"><Image width="100%" src={images.logo}/></Link>
          </Slide>
        </Deck>
      </Spectacle>
    );
  }
}
<|endoftext|>


<commit_before>/* An immutable Fraction datatype */

/**
* Constructor: Take integer or string parameters
* Example: Fraction(1,2), Fraction(-3), Fraction('3/2')
*/
var Fraction = (function(){
    function assert(val, msg) { if(!val) throw msg }
    function gcd(a, b) { return b ? gcd(b, a % b) : a } // this definition is informal
    function normalize(frac) {
        if(frac.numerator===0) return;
        if(frac.denominator===1) return;
        if(frac.denominator!==-1) {
            var divisor = gcd(frac.numerator, frac.denominator);
            frac.numerator /= divisor;
            frac.denominator /= divisor;
        }
        // put the negative sign (if any) in numerator
        if (frac.denominator<0) {
            frac.numerator = -frac.numerator;
            frac.denominator = -frac.denominator;
        }
    }
    return function(numerator, denominator) {
        assert(denominator!==0, 'Invalid fraction: ' + numerator + '/0');
        assert(arguments.length!==0, 'Invalid fraction: no parameters');
        if(typeof numerator == 'string' && denominator===undefined) {
            var vals = numerator.split('/');
            assert(vals.length<=2, 'Invalid fraction: ' + numerator);
            numerator = +vals[0];
            denominator = (vals.length==2) ? +vals[1] : 1;
        }
        this.numerator = +numerator;
        this.denominator = denominator===undefined ? 1 : +denominator;
        // NaN check
        assert(isNaN(this.numerator)||isNaN(this.denominator), 'Invalid fraction parameters: ' + arguments);
        normalize(this);
    };
})();
Fraction.prototype = {
    toString: function() {
        if(this.numerator===0) return '0';
        if(this.denominator===1) return this.numerator.toString();
        return this.numerator + '/' + this.denominator;
    },
    toNumber: function() {
        if(this.numerator===0) return 0;
        if(this.denominator===1) return this.numerator;
        return this.numerator/this.denominator;
    },
    clone: function() {
        return new Fraction(this.numerator, this.denominator);
    },
    times: function(n) {
        return new Fraction(this.numerator*n, this.denominator);
    },
    add: function(that) {
        if(typeof that == 'number')
            return new Fraction(this.numerator + that*this.denominator);
        if(this.numerator===0) return that;
        if(that.numerator===0) return this;
        var n = this.numerator*that.denominator + that.numerator*this.denominator;
        var d = this.denominator * that.denominator;
        return new Fraction(n,d);
    },
    subtract: function(that) {
        if(typeof that == 'number')
            return new Fraction(this.numerator - that*this.denominator);
        if(this.numerator===0) return that.times(-1);
        if(that.numerator===0) return this;
        var n = this.numerator*that.denominator - that.numerator*this.denominator;
        var d = this.denominator * that.denominator;
        return new Fraction(n,d);
    },
    mul: function(that) {
        if(typeof that == 'number') return this.times(that);
        if(this.numerator===0 || that.numerator===0) return Fraction.ZERO;
        if(this.numerator===1 && this.denominator===1) return that;
        if(that.numerator===1 && that.denominator===1) return this;
        var n = this.numerator * that.numerator;
        var d = this.denominator * that.denominator;
        return new Fraction(n,d);
    },
    lt: function(that) {
        if(typeof that == 'number')
            return this.numerator < that*this.denominator;
        else
            return (this.numerator*that.denominator < that.numerator*this.denominator);
    },
    le: function(that) {
        if(typeof that == 'number')
            return this.numerator <= that*this.denominator;
        else
            return (this.numerator*that.denominator <= that.numerator*this.denominator);
    },
    eq: function(that) {
      if(typeof that == 'number')
            return this.numerator === that*this.denominator;
        else
            return (this.numerator===that.numerator && this.numerator===that.numerator);
    },
    gt: function(that) {
        return !this.le(that);
    },
    ge: function(that) {
        return !this.lt(that);
    },
    isZero: function() {
        return this.numerator === 0;
    }
};
Fraction.ZERO = new Fraction(0);
Fraction.ONE = new Fraction(1);
module.exports = Fraction;
<commit_msg>fix bug<commit_after>/* An immutable Fraction datatype */

/**
* Constructor: Take integer or string parameters
* Example: Fraction(1,2), Fraction(-3), Fraction('3/2')
*/
var Fraction = (function(){
    function assert(val, msg) { if(!val) throw msg }
    function gcd(a, b) { return b ? gcd(b, a % b) : a } // this definition is informal
    function normalize(frac) {
        if(frac.numerator===0) return;
        if(frac.denominator===1) return;
        if(frac.denominator!==-1) {
            var divisor = gcd(frac.numerator, frac.denominator);
            frac.numerator /= divisor;
            frac.denominator /= divisor;
        }
        // put the negative sign (if any) in numerator
        if (frac.denominator<0) {
            frac.numerator = -frac.numerator;
            frac.denominator = -frac.denominator;
        }
    }
    return function(numerator, denominator) {
        assert(denominator!==0, 'Invalid fraction: ' + numerator + '/0');
        assert(arguments.length!==0, 'Invalid fraction: no parameters');
        if(typeof numerator == 'string' && denominator===undefined) {
            var vals = numerator.split('/');
            assert(vals.length<=2, 'Invalid fraction: ' + numerator);
            numerator = +vals[0];
            denominator = (vals.length==2) ? +vals[1] : 1;
        }
        this.numerator = +numerator;
        this.denominator = denominator===undefined ? 1 : +denominator;
        // NaN check
        assert(!isNaN(this.numerator) && !isNaN(this.denominator),
            'Invalid fraction parameters: Fraction(' + Array.prototype.join.call(arguments) + ')');
        normalize(this);
    };
})();
Fraction.prototype = {
    toString: function() {
        if(this.numerator===0) return '0';
        if(this.denominator===1) return this.numerator.toString();
        return this.numerator + '/' + this.denominator;
    },
    toNumber: function() {
        if(this.numerator===0) return 0;
        if(this.denominator===1) return this.numerator;
        return this.numerator/this.denominator;
    },
    clone: function() {
        return new Fraction(this.numerator, this.denominator);
    },
    times: function(n) {
        return new Fraction(this.numerator*n, this.denominator);
    },
    add: function(that) {
        if(typeof that == 'number')
            return new Fraction(this.numerator + that*this.denominator);
        if(this.numerator===0) return that;
        if(that.numerator===0) return this;
        var n = this.numerator*that.denominator + that.numerator*this.denominator;
        var d = this.denominator * that.denominator;
        return new Fraction(n,d);
    },
    subtract: function(that) {
        if(typeof that == 'number')
            return new Fraction(this.numerator - that*this.denominator);
        if(this.numerator===0) return that.times(-1);
        if(that.numerator===0) return this;
        var n = this.numerator*that.denominator - that.numerator*this.denominator;
        var d = this.denominator * that.denominator;
        return new Fraction(n,d);
    },
    mul: function(that) {
        if(typeof that == 'number') return this.times(that);
        if(this.numerator===0 || that.numerator===0) return Fraction.ZERO;
        if(this.numerator===1 && this.denominator===1) return that;
        if(that.numerator===1 && that.denominator===1) return this;
        var n = this.numerator * that.numerator;
        var d = this.denominator * that.denominator;
        return new Fraction(n,d);
    },
    lt: function(that) {
        if(typeof that == 'number')
            return this.numerator < that*this.denominator;
        else
            return (this.numerator*that.denominator < that.numerator*this.denominator);
    },
    le: function(that) {
        if(typeof that == 'number')
            return this.numerator <= that*this.denominator;
        else
            return (this.numerator*that.denominator <= that.numerator*this.denominator);
    },
    eq: function(that) {
      if(typeof that == 'number')
            return this.numerator === that*this.denominator;
        else
            return (this.numerator===that.numerator && this.numerator===that.numerator);
    },
    gt: function(that) {
        return !this.le(that);
    },
    ge: function(that) {
        return !this.lt(that);
    },
    isZero: function() {
        return this.numerator === 0;
    }
};
Fraction.ZERO = new Fraction(0);
Fraction.ONE = new Fraction(1);
module.exports = Fraction;
<|endoftext|>


<commit_before>var margin = {top: 20, right: 30, bottom: 30, left: 40},
    width = window.innerWidth - margin.left - margin.right,
    height = window.innerHeight - margin.top - margin.bottom - 100;

var chart = d3.select('svg#chart')
    .attr('width', width + margin.left + margin.right),
    //.attr('height', height + margin.top + margin.bottom)
    svg = chart.append('g')
    .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');

var data,
    root,
    prevFolder = [],
    description = d3.select('p#description');

var editing = false,
    sourceNode = null,
    specialAction = null,
    connectingLine = null;

d3.select('button#back')
    .on('click', gotoPreviousFolder);
d3.select('button#toggleEdit')
    .on('click', toggleEdit);
d3.select(document)
    .on('keydown', handleKeyDown)
    .on('keyup', handleKeyUp)
    .on('mousemove', moveConnectingLine);

d3.json('test/d3.franklin', function (error, _data) {
  data = _data;
  root = '/';
  createDagre(data[root]);
});

function createDagre(root) {
  var g = new dagreD3.Digraph(),
      nodes = flatten(root);

  // Nodes
  nodes.forEach(function (d) {
    g.addNode(d.name, { label: d.name, description: d.description, entry_point: d.entry_point });
  });
  // Edges
  nodes.forEach(function (d) {
    d.next.forEach(function (n) {
      if (!g.hasNode(n)) {
        g.addNode(n, { label: n, description: '' });
      }
      g.addEdge(null, d.name, n);
    });
  });

  var renderer = new dagreD3.Renderer();
  var oldDrawNodes = renderer.drawNodes();
  renderer.drawNodes(function (graph, svg) {
    var svgNodes = oldDrawNodes(graph, svg);
    svgNodes.select('rect')
        .attr('style', function (u) {
          if (g.node(u).entry_point) return 'fill: #ffd0cd';
        })
        .attr('id', function (u) { return 'franklin-' + cleanHtmlId(g.node(u).label); })
        .on('click', function (u) { handleClick(g.node(u).label); })
        .on('mouseover', function (u) { updateDescription(g.node(u).description); });
    return svgNodes;
  });
  var layout = dagreD3.layout()
                      .rankDir('LR');
  renderer.transition(function (selection) { return selection.transition().duration(500); });
  layout = renderer.layout(layout).run(g, svg);

  var ypos = [];
  layout.eachNode(function (u, value) { ypos.push(value.y); });
  chart.attr('height', d3.max(ypos) + 100);
}

function flatten(obj) {
  var nodes = [], i = 0;
  d3.keys(obj).forEach(function (key) {
    var value = obj[key];
    value.name = key;
    value.id = ++i;
    nodes.push(value);
  });
  return nodes;
};

function handleClick(name) {
  if (d3.event.defaultPrevented) return;
  if (!editing && data[root + name]) {
    prevFolder.push(root);
    root += name;
    createDagre(data[root]);
  } else if (editing) {
    editGraph(name);
  }
}

function editGraph(name) {
  if (sourceNode && sourceNode != name) {
    if (specialAction == 'removeLink') {
      var n = data[root][sourceNode];
      n.next = n.next.filter(function(f) { return f != name; });
    } else {
      data[root][sourceNode].next.push(name);
    }
    cleanup();
    createDagre(data[root]);
  } else if (specialAction == 'deleteNode') {
    delete data[root][name];
    cleanup();
    createDagre(data[root]);
  } else {
    sourceNode = name;
    var selected = d3.select('#franklin-' + cleanHtmlId(sourceNode))
        .style('stroke', '#e22121');
    createConnectLine(selected.node().parentNode);
  }
}

function updateDescription(des) {
  description.html(des);
}

function cleanHtmlId(id) {
  // Replace "/" or "." with "-".
  return id.replace(/\/|\./g, '-');
}

function gotoPreviousFolder(e) {
  var folder = prevFolder.pop();
  if (folder) {
    root = folder;
    createDagre(data[root]);
  }
}

function toggleEdit(e) {
  editing = !editing;
  d3.select('button#toggleEdit').html(editing ? 'Explore' : 'Edit');
  cleanup();
}

function createConnectLine(selected) {
  connectingLine = d3.select(selected).append('line')
      .attr({ x1: 0, y1: 0,
              stroke: 'black', 'stroke-width': 2
            });
}

function cleanup() {
  if (connectingLine) { connectingLine.remove(); }
  if (sourceNode) {
    d3.select('#franklin-' + cleanHtmlId(sourceNode))
        .style('stroke', null);
  }
  connectingLine = null;
  sourceNode = null;
}

function moveConnectingLine() {
  if (connectingLine) {
    var xy = d3.mouse(connectingLine.node()),
        padding = 5;
    connectingLine.attr({ x2: xy[0] - padding, y2: xy[1] - padding });
  }
}

function handleKeyDown() {
  if (specialAction) return;
  var e = d3.event.keyCode;
  if (e == 68) { specialAction = 'deleteNode'; } // 'd'
  else if (e == 82) { specialAction = 'removeLink'; } // 'r'
  else if (e == 81) { cleanup(); } // 'q'
}

function handleKeyUp() {
  var e = d3.event.keyCode;
  if (e == 68 && specialAction == 'deleteNode') { specialAction = null; } // 'd'
  else if (e == 82 && specialAction == 'removeLink')  { specialAction = null; } // 'r'
}

<commit_msg>Refactored the magic key code numbers.<commit_after>var margin = {top: 20, right: 30, bottom: 30, left: 40},
    width = window.innerWidth - margin.left - margin.right,
    height = window.innerHeight - margin.top - margin.bottom - 100;

var chart = d3.select('svg#chart')
    .attr('width', width + margin.left + margin.right),
    //.attr('height', height + margin.top + margin.bottom)
    svg = chart.append('g')
    .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');

var data,
    root,
    prevFolder = [],
    description = d3.select('p#description');

var editing = false,
    sourceNode = null,
    specialAction = null,
    connectingLine = null;

var KEYS = { d: 68, r: 82, q: 81, p: 80 };

d3.select('button#back')
    .on('click', gotoPreviousFolder);
d3.select('button#toggleEdit')
    .on('click', toggleEdit);
d3.select(document)
    .on('keydown', handleKeyDown)
    .on('keyup', handleKeyUp)
    .on('mousemove', moveConnectingLine);

d3.json('test/d3.franklin', function (error, _data) {
  data = _data;
  root = '/';
  createDagre(data[root]);
});

function createDagre(root) {
  var g = new dagreD3.Digraph(),
      nodes = flatten(root);

  // Nodes
  nodes.forEach(function (d) {
    g.addNode(d.name, { label: d.name, description: d.description, entry_point: d.entry_point });
  });
  // Edges
  nodes.forEach(function (d) {
    d.next.forEach(function (n) {
      if (!g.hasNode(n)) {
        g.addNode(n, { label: n, description: '' });
      }
      g.addEdge(null, d.name, n);
    });
  });

  var renderer = new dagreD3.Renderer();
  var oldDrawNodes = renderer.drawNodes();
  renderer.drawNodes(function (graph, svg) {
    var svgNodes = oldDrawNodes(graph, svg);
    svgNodes.select('rect')
        .attr('style', function (u) {
          if (g.node(u).entry_point) return 'fill: #ffd0cd';
        })
        .attr('id', function (u) { return 'franklin-' + cleanHtmlId(g.node(u).label); })
        .on('click', function (u) { handleClick(g.node(u).label); })
        .on('mouseover', function (u) { updateDescription(g.node(u).description); });
    return svgNodes;
  });
  var layout = dagreD3.layout()
                      .rankDir('LR');
  renderer.transition(function (selection) { return selection.transition().duration(500); });
  layout = renderer.layout(layout).run(g, svg);

  var ypos = [];
  layout.eachNode(function (u, value) { ypos.push(value.y); });
  chart.attr('height', d3.max(ypos) + 100);
}

function flatten(obj) {
  var nodes = [], i = 0;
  d3.keys(obj).forEach(function (key) {
    var value = obj[key];
    value.name = key;
    value.id = ++i;
    nodes.push(value);
  });
  return nodes;
};

function handleClick(name) {
  if (d3.event.defaultPrevented) return;
  if (!editing && data[root + name]) {
    prevFolder.push(root);
    root += name;
    createDagre(data[root]);
  } else if (editing) {
    editGraph(name);
  }
}

function editGraph(name) {
  if (sourceNode && sourceNode != name) {
    if (specialAction == 'removeLink') {
      var n = data[root][sourceNode];
      n.next = n.next.filter(function(f) { return f != name; });
    } else {
      data[root][sourceNode].next.push(name);
    }
    cleanup();
    createDagre(data[root]);
  } else if (specialAction == 'deleteNode') {
    delete data[root][name];
    cleanup();
    createDagre(data[root]);
  } else {
    sourceNode = name;
    var selected = d3.select('#franklin-' + cleanHtmlId(sourceNode))
        .style('stroke', '#e22121');
    createConnectLine(selected.node().parentNode);
  }
}

function updateDescription(des) {
  description.html(des);
}

function cleanHtmlId(id) {
  // Replace "/" or "." with "-".
  return id.replace(/\/|\./g, '-');
}

function gotoPreviousFolder(e) {
  var folder = prevFolder.pop();
  if (folder) {
    root = folder;
    createDagre(data[root]);
  }
}

function toggleEdit(e) {
  editing = !editing;
  d3.select('button#toggleEdit').html(editing ? 'Explore' : 'Edit');
  cleanup();
}

function createConnectLine(selected) {
  connectingLine = d3.select(selected).append('line')
      .attr({ x1: 0, y1: 0,
              stroke: 'black', 'stroke-width': 2
            });
}

function cleanup() {
  if (connectingLine) { connectingLine.remove(); }
  if (sourceNode) {
    d3.select('#franklin-' + cleanHtmlId(sourceNode))
        .style('stroke', null);
  }
  connectingLine = null;
  sourceNode = null;
}

function moveConnectingLine() {
  if (connectingLine) {
    var xy = d3.mouse(connectingLine.node()),
        padding = 5;
    connectingLine.attr({ x2: xy[0] - padding, y2: xy[1] - padding });
  }
}

function handleKeyDown() {
  if (specialAction) return;
  var e = d3.event.keyCode;
  if (e == KEYS.d) { specialAction = 'deleteNode'; }
  else if (e == KEYS.r) { specialAction = 'removeLink'; }
  else if (e == KEYS.q) { cleanup(); }
}

function handleKeyUp() {
  var e = d3.event.keyCode;
  if (e == KEYS.d && specialAction == 'deleteNode') { specialAction = null; }
  else if (e == KEYS.r && specialAction == 'removeLink')  { specialAction = null; }
}

<|endoftext|>


<commit_before>import StringManipulator from '../stringManipulation';

import exceptions from '../exceptions';

import constants from '../constants';

import DateTime from '../generated-data/dateTime';

const alasql = require('alasql');

const stringManipulator = new StringManipulator();

const dateTime = new DateTime();

function getFormattedCurrentDateTime() {
  return stringManipulator.stringConcat('"', dateTime.getCurrentDateTime(), '"');
}

export default function sqlCommands() {
  this.linkDatabaseToIndexedDB = function linkDatabaseToIndexedDB() {
    const databaseRequestStr = "CREATE INDEXEDDB DATABASE IF NOT EXISTS lectureNote; " +
                               "ATTACH INDEXEDDB DATABASE lectureNote; " +
                               "USE lectureNote;";
    alasql.promise([databaseRequestStr])
      .then().catch(sqlError => sqlError);
  };

  this.getFullTableData = function getFullTableData(tableName) {
    // ensure working in browsers that support Promise
    if (typeof Promise === 'function') {
      return new Promise((resolve, reject) => {
        alasql.promise([stringManipulator.stringConcat('SELECT * FROM ', tableName)])
          .then(data => resolve(data))
          .catch(sqlError => sqlError);
      });
    } else {
      throw new exceptions.PromiseFunctionNotDefined();
    }
  };

  this.createTable = function createTable(sqlStatement) {
    alasql.promise([stringManipulator.stringConcat('CREATE TABLE IF NOT EXISTS ', sqlStatement)])
      .then().catch(sqlError => sqlError);
  };

  this.insertContent = function insertContent(tableName, ...content) {
    if (typeof Promise === 'function') {
      return new Promise((resolve, reject) => {
        // concatenate all the values to insert together
        const valuesToInsertIntoTable = content.join(', ');
        alasql.promise([stringManipulator.stringConcat('INSERT INTO ', tableName,
                                                       ' VALUES (', valuesToInsertIntoTable, ')')])
        .then(() => true)
        .catch(sqlError => sqlError);
      });
    } else {
      throw new exceptions.PromiseFunctionNotDefined();
    }
  };

  this.partialSearchFileName = function partialSearchFileName(searchString) {
    if (typeof Promise === 'function') {
      return new Promise((resolve, reject) => {
        alasql.promise([stringManipulator.stringConcat('SELECT * FROM ', constants.ENTITIES_FILE_MANAGER,
                                                       ' WHERE ', constants.HEADER_FILE_MANAGER_FILE_NAME,
                                                       ' LIKE "%', searchString, '%"')])
        .then(data => resolve(data))
        .catch(sqlError => sqlError);
      });
    } else {
      throw new exceptions.PromiseFunctionNotDefined();
    }
  };
  this.getMaxFileId = function getMaxFileId() {
    if (typeof Promise === 'function') {
      return new Promise((resolve, reject) => {
        alasql.promise([stringManipulator.stringConcat('SELECT MAX(', constants.HEADER_FILE_MANAGER_FILE_ID,
                                                       ') FROM ', constants.ENTITIES_FILE_MANAGER)])
        .then((data) => {
          const maxFileId = getDataOutOfAlasql(data);
          if (typeof maxFileId === 'number') {
            resolve(maxFileId);
          } else {
            resolve(-1);
          }
        }).catch(sqlError => sqlError);
      });
    } else {
      throw new exceptions.PromiseFunctionNotDefined();
    }
  };
  };

  this.deleteTable = function deleteTable(tableName) {
    alasql(stringManipulator.stringConcat('DROP TABLE ', tableName), callback());
  };

  this.cleanTable = function cleanTable(tableName) {
    alasql(stringManipulator.stringConcat('DELETE * FROM ', tableName), callback());
  };
}
<commit_msg>Add getMaxFolderId implementation into sqlCommands.js<commit_after>import StringManipulator from '../stringManipulation';

import exceptions from '../exceptions';

import constants from '../constants';

import DateTime from '../generated-data/dateTime';

const alasql = require('alasql');

const stringManipulator = new StringManipulator();

const dateTime = new DateTime();

function getFormattedCurrentDateTime() {
  return stringManipulator.stringConcat('"', dateTime.getCurrentDateTime(), '"');
}

export default function sqlCommands() {
  this.linkDatabaseToIndexedDB = function linkDatabaseToIndexedDB() {
    const databaseRequestStr = "CREATE INDEXEDDB DATABASE IF NOT EXISTS lectureNote; " +
                               "ATTACH INDEXEDDB DATABASE lectureNote; " +
                               "USE lectureNote;";
    alasql.promise([databaseRequestStr])
      .then().catch(sqlError => sqlError);
  };

  this.getFullTableData = function getFullTableData(tableName) {
    // ensure working in browsers that support Promise
    if (typeof Promise === 'function') {
      return new Promise((resolve, reject) => {
        alasql.promise([stringManipulator.stringConcat('SELECT * FROM ', tableName)])
          .then(data => resolve(data))
          .catch(sqlError => sqlError);
      });
    } else {
      throw new exceptions.PromiseFunctionNotDefined();
    }
  };

  this.createTable = function createTable(sqlStatement) {
    alasql.promise([stringManipulator.stringConcat('CREATE TABLE IF NOT EXISTS ', sqlStatement)])
      .then().catch(sqlError => sqlError);
  };

  this.insertContent = function insertContent(tableName, ...content) {
    if (typeof Promise === 'function') {
      return new Promise((resolve, reject) => {
        // concatenate all the values to insert together
        const valuesToInsertIntoTable = content.join(', ');
        alasql.promise([stringManipulator.stringConcat('INSERT INTO ', tableName,
                                                       ' VALUES (', valuesToInsertIntoTable, ')')])
        .then(() => true)
        .catch(sqlError => sqlError);
      });
    } else {
      throw new exceptions.PromiseFunctionNotDefined();
    }
  };

  this.partialSearchFileName = function partialSearchFileName(searchString) {
    if (typeof Promise === 'function') {
      return new Promise((resolve, reject) => {
        alasql.promise([stringManipulator.stringConcat('SELECT * FROM ', constants.ENTITIES_FILE_MANAGER,
                                                       ' WHERE ', constants.HEADER_FILE_MANAGER_FILE_NAME,
                                                       ' LIKE "%', searchString, '%"')])
        .then(data => resolve(data))
        .catch(sqlError => sqlError);
      });
    } else {
      throw new exceptions.PromiseFunctionNotDefined();
    }
  };
  this.getMaxFileId = function getMaxFileId() {
    if (typeof Promise === 'function') {
      return new Promise((resolve, reject) => {
        alasql.promise([stringManipulator.stringConcat('SELECT MAX(', constants.HEADER_FILE_MANAGER_FILE_ID,
                                                       ') FROM ', constants.ENTITIES_FILE_MANAGER)])
        .then((data) => {
          const maxFileId = getDataOutOfAlasql(data);
          if (typeof maxFileId === 'number') {
            resolve(maxFileId);
          } else {
            resolve(-1);
          }
        }).catch(sqlError => sqlError);
      });
    } else {
      throw new exceptions.PromiseFunctionNotDefined();
    }
  };
  this.getMaxFolderId = function getMaxFolderId() {
    if (typeof Promise === 'function') {
      return new Promise((resolve, reject) => {
        alasql.promise([stringManipulator.stringConcat('SELECT MAX(', constants.HEADER_FOLDER_FOLDER_ID,
                                                       ') FROM ', constants.ENTITIES_FOLDER)])
        .then((data) => {
          const maxFolderId = getDataOutOfAlasql(data);
          if (typeof maxFolderId === 'number') {
            resolve(maxFolderId);
          } else {
            resolve(0);
          }
        }).catch(sqlError => sqlError);
      });
    } else {
      throw new exceptions.PromiseFunctionNotDefined();
    }
  };
  };

  this.deleteTable = function deleteTable(tableName) {
    alasql(stringManipulator.stringConcat('DROP TABLE ', tableName), callback());
  };

  this.cleanTable = function cleanTable(tableName) {
    alasql(stringManipulator.stringConcat('DELETE * FROM ', tableName), callback());
  };
}
<|endoftext|>