diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..73b323c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + "version": "0.2.0", + "configurations": [ + + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceRoot}" + }, + { + "type": "chrome", + "request": "attach", + "name": "Attach to Chrome", + "port": 9222, + "webRoot": "${workspaceRoot}" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..310b8ea --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +// Place your settings in this file to overwrite default and user settings. +{ + "editor.tabSize": 2 +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..f6d8b41 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,13 @@ +{ + "version": "0.1.0", + + "command": "explorer", + + "windows": { + "command": "explorer.exe" + }, + + "showOutput": "never", + + "args": ["${file}"] +} \ No newline at end of file diff --git a/admin.html b/admin.html new file mode 100644 index 0000000..467cac7 --- /dev/null +++ b/admin.html @@ -0,0 +1,302 @@ + + + + + Bad Ass Customer Interviews...Live! | Customer Development Labs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Welcome to...

+
+

Interviewing your Customers

+

...the Right Way

+
+

By Customer Development Labs

+
+
+
+ +
+
+

Live Stream

+ +
+
+

Questions

+
+
+
    +
    + +
    +
    +
    +
    +
    +

    Looking for a partner for you...

    + +
    +
    + +
    + +
    +
    +
    +

    Excercises

    +
    + +
    +
    +
    + + + +
    + +

    Who's here?

    +
    +
    +
    + Stats +
    +
    + Map +
    +
    +
    +
    +
    +
    + + + +
    + +

    Notes and Takeaways

    +
    +
    +
    +

    Your Private Notepad

    +

    Take any notes you like here. They won't be shared with your partner

    + +
    +
    +

    Live Interview Takeaway:

    +

    Interview Practice Takeaway:

    +

    Overall Takeaway(s):

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

    Meet your Partner

    +
    +
    +
    +

    Where do you live?

    +

    What's your company name?

    +

    Do you have a company website?

    +

    Who are your target customers?

    +

    What problem will you solve for them?

    +

    What do you hope to get out of this workshop?

    +

    Do you have a LinkedIn or Twitter profile?

    +
    +
    +

    Your partner lives in:

    +

    Your partner's company is:

    +

    The URL is:

    +

    Your partner's is serving:

    +

    Helping them:

    +

    Your partner is here to:

    +

    More about them is here:

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

    Interview Questions

    + This notepad is shared with your Workshop Partner. +
    +
    +
    +

    Interview Responses

    + This notepad is shared with your Workshop Partner. +
    +
    +
    +
    +

    Where do you live?

    +
    +
    +
    + +
    +
    + + +
    +
    +

    Chat

    +

    Use the tabs below to switch between chatting with your partner and everyone.

    +
    +
    +
    + + +
    + + + + diff --git a/alex.html b/alex.html new file mode 100644 index 0000000..2fdd9b8 --- /dev/null +++ b/alex.html @@ -0,0 +1,839 @@ + + + + + Webshops: Better Online Learning | Customer Development Labs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    Value Proposition Workshop from Strategizer
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Questions: Ask and up vote.

    +
    +
    +
      +
      + +
      +
      +
      +
      +
      +
      + +
      +
      +
      +
      + +
      + + + +
      +
      + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Please, introduce yourself......and meet your partner, !
      +
      + Where do you live? + +
      +
      +
      lives in:
      +
      +
      +
      + What year are you? + +
      +
      +
      's year:
      +
      +
      +
      + Do you have a Twitter, Instagram or Facebook page? + +
      +
      +
      Check out 's profile at:
      +
      +
      +
      + What's your major? + +
      +
      +
      's major is:
      +
      +
      +
      + What do you do for fun? + +
      +
      +
      For fun :
      +
      +
      + Ask more questions in your private chat window. +
      +
      + +
      +
      + + + + +
      +
      +
      + +
      +
      +
      + +
      +
      + + + + +
      +
      +
      + +
      +
      +
      + +
      +
      + + + + +
      +
      +
      + +
      +
      +
      + +
      +
      + + + + +
      +
      +
      + +
      +
      +
      + +
      +
      + + + + +
      +
      +
      + +
      +
      +
      + +
      +
      + + + + +
      +
      +
      + +
      +
      +
      + +
      +
      + + + + +
      +
      +
      + +
      +
      +
      + +
      +
      + + + + +
      +
      + Share your Skype username with in the chat room. Then interview each other! +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Ask these questions:Listen for:
      +
      + What's the biggest challenge you're facing as a founder? +
      +
      +
      + Anything to dig into. +
      +
      +
      + When was the last time you tried to solve that problem? +
      +
      +
      + Have they tried to solve it in the last 3 months (B2C) or last 12 months (B2B)?

      + If not, start over asking about a different challenge. +
      +
      +
      + Can you tell me about the last time that problem happened? +
      +
      +
      + Opportunities to clarify - this is your chance to ask "dumb" questions.

      + Phrases and jargon you can turn into marketing copy.

      +
      +
      +
      + Why is it a problem for you? +
      +
      +
      + The real problem they're trying to solve.

      + Emotions you can evoke in your marketing copy.

      +
      +
      +
      + Are you looking for alternative solutions? If yes, why? +
      +
      +
      + No? They're not early adopters yet. Start again.

      + Yes? This is how to differentiate your solution from the competition.

      +
      +
      +
      + +
      +
      + + + + +
      + + Click here:to Generate your Interview Script +
      + +
      +
      + + + + +
      + +
      +
      +
      +

      Interview Script Creator

      +
      +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Your Interview Script (repeat 2-3 times):Listen for:
      +
      + What's the biggest challenge you're facing as a CUSTOMER ROLE? +
      +
      +
      + Anything to dig into. +
      +
      +
      + When was the last time you tried to solve that problem? +
      +
      +
      + Have they tried to solve it in the last 3 months (B2C) or last 12 months (B2B)?

      + If not, start over asking about a different challenge. +
      +
      +
      + Can you tell me about the last time that problem happened? +
      +
      +
      + Opportunities to clarify - this is your chance to ask "dumb" questions.

      + Phrases and jargon you can turn into marketing copy.

      +
      +
      +
      + Why is it a problem for you? +
      +
      +
      + The real problem they're trying to solve.

      + Emotions you can evoke in your marketing copy.

      +
      +
      +
      + Are you looking for alternative solutions? If yes, why? +
      +
      +
      + No? They're not early adopters yet. Start again.

      + Yes? This is how to differentiate your solution from the competition.

      +
      +
      +
      + No mention of the problem you hoped? +
      +
      +
      + What's the biggest challenge you're facing as a CUSTOMER ROLE with respect to PROBLEM CONTEXT? +
      +
      +
      + Note: Pay extra close attention to how recently they've looked for a solution. +
      +
      +
      + Bonus Questions +
      +
      +
      + How did you find out about the solution you're trying now? +
      +
      +
      + Your marketing channels. +
      +
      +
      + I'm actually exploring a solution to the      [Insert their Problem]       problem. Can I contact you if we find a viable solution? +
      +
      +
      + Contact information, in case you end up solving their problem. +
      +
      +
      + Do you know 1 or 2 other people who are struggling with      [Insert their Problem]       problem I could talk to? +
      +
      +
      + More customer interviews. +
      +
      +
      + How much money are you spending to try and solve this problem now? +
      +
      +
      + A potential anchor price. +
      +
      +
      + How often do you encounter this problem? +
      +
      +
      + How often they might use your solution. +
      +
      +
      + +
      +
      + + + + +
      +
      +
      +
      +

      Bonus #1

      +
      +
      +
      +

      + $50 Customer Interview Email Course
      + FREE +

      +
      + You'll learn... +
        +
      • Which customers to ask for interviews
      • +
      • A cold email script that works to get interviews
      • +
      • How to analyze your interview answers
      • +
      +

      Plus: Get free Customer Discovery Ninja coupon codes.

      +
      + +
      +
      +
      +

      Bonus #2

      +
      +
      +
      +

      FOCUS Framework Pre-Order

      + +
      + +
      +
      + Step by step instructions on:

      + What to test
      + When to test
      + How to test
      + + +
      +
      +
      Use coupon code "FounderInstitute" by March 13th for:
      +
        +
      • 25% off
      • +
      • Early access to chapters
      • +
      + Check out the FOCUS Framework. +
      + +
      + +
      +
      +
      + +
      +
      + + + + +
      +
      + +
      +
      +

      How likely would you be to recommend this workshop to a friend?

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

      What's one thing we can improve next time?

      +
      +
      + +
      +
      + +
      +
      +

      What was your favorite part of the workshop?

      +
      +
      + +
      + +
      + +
      +
      +
      +
      +
      +
      +
      + +
      + +
      + + + + + diff --git a/alex.js b/alex.js new file mode 100644 index 0000000..c1e4aac --- /dev/null +++ b/alex.js @@ -0,0 +1,1055 @@ +var firebaseRoot = "https://cdlwebshops.firebaseio.com"; + +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); + +var loggedInUserId; +var questionPad, responsePad; + +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +var publicChat; + +var firstName = null; +var studentNum = null; +var studentCampus = null; +var lastSoloPriority = 0; +var lastQuestionAnswered; + +function init() { + firstName = getParameterByName('firstName'); + + $('.carousel').carousel({ + interval: 5000 + }); + + if (firstName == null) { + initModal(); + return; + } + + publicChat = new FirechatUI(publicChatRef, document.getElementById("public-firechat-wrapper")); + publicChat.maxLengthMessage = 1024; + + publicChat.on('room-enter', function() { + stylizeChatRooms(); + }); + + logInToChat(publicChatRef, publicChat, PUBLIC_CHAT_ROOM_ID, true); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + $("#newPartner").hide(); + $("#newPartner").click(function () { + leavePartnership(); + }); + + $('.meetYourPartnerMe').on("input", function() { + updateMyInfo($(this)); + }); + + initEnrollForm(); + keepTabsOnTabs(); + setupInterviewScriptGenerator(); + setupFeedbackForm(); + setupQuizzes(); + + setupiFrames(); + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function() { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function() { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#enrollForm").submit(function(event) { + event.preventDefault(); + + enrolledRef.child(loggedInUserId).set({email: $('#enrollEmail').val()}); + $('#enrollSuccessAlert').show(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: true}); + exercisesRef.child("active").update({exercise: exerciseName}); + }); + + $(".showTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: true}); + }); + + $(".hideTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: false}); + }); + + $(".soloTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each( function(index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({exercise: tabName.replace("Tab", '')}); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function(exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each( function(index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.id).once('value', function(snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function(snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "That's not your name", + validators: { + notEmpty: { + message: 'We need your name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We can do names between 2 and 20 characters' + } + } + }, + studentNum: { + message: "That's not your student number", + validators: { + notEmpty: { + message: 'We need your student number' + }, + stringLength: { + min: 6, + max: 12, + message: 'We need a number between 6 and 12 digits' + } + } + }, + studentCampus: { + validators: { + notEmpty: { + message: 'Please select your campus.' + } + } + } + } + }); + + $( "#welcomeForm" ).submit(function(event) { + firstName = $("#attendeeName").val(); + studentNum = $("#studentNum").val(); + studentCampus = $("#studentCampus").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function() { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function logInToChat(chatRef, chatUI, roomId, getPartner) { + var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { + if (user) { + loggedInUserId = user.id; + + user.firstName = firstName; + chatUI.setUser(user.id, firstName); + + if (roomId != null) { + enterRoomAfterUserSessionCreated(chatUI, roomId); + } + + if (getPartner) { + searchForPartner(user); + } + + authUserName = firstName; + fbid = user.id; + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestion; + + allQuestionsSnapshot.forEach(function(snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
    • "); + var divmediabody = $("
      "); + var divmedia = $("
      "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = "" + answerText + " " + hideText + ""; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 1; + var votesElement = "" + voteLink + ": "+ voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
      "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
      " + userNameElement + "
      " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestion = questionElement; + divmediabody2.addClass('bg-danger'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-success'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-info'); + } + else { + divmediabody2.addClass('bg-warning'); + } + + questionList.prepend(questionElement); + } + }); + + questionList.prepend(activeQuestion); + }); + + } else { + simpleLogin.login('anonymous', { + rememberMe: true + }); + } + }); +} + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


      You'll see what your partner types, as she/he does.


      Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


      (Delete this too :)" : ""); + + //questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
       
      Note: your partner will be able to see your text as you type it.
       
      Try editing this text!
       
       
      2. Secretly pick a company below to pitch:
       

      • AirBnB
      • Pampers (diapers)
      • Twitter
      • Facebook
      • Subway (sandwiches)
      • Instagram
      • Disney
      • SnapChat
      • Angry Birds (Rovio)
      • RedBull
       
      3. Fill out the pitch template for the company you're pitching:
       
      - Problem:
       
       
       
      - Solution:
       
       
       
      - Market:
       
       
       
      - Business Model:
       
       
       
      -------------------------------------------------------
       
      4. Guess which company your partner is pitching:
       
       
       
      5. Which elements of your partner's pitch could be improved? 
       
       
      " : ""); + //responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
       
      Note: your partner will be able to see your text as you type it.
       
      Try editing this text!
       
       
      2. Secretly pick a company below to pitch:
       
      • AirBnB
      • Pampers (diapers)
      • Twitter
      • Facebook
      • Subway (sandwiches)
      • Instagram
      • Disney
      • SnapChat
      • Angry Birds (Rovio)
      • RedBull
       
      3. Fill out the pitch template for the company you're pitching:
       
      - Problem:
       
       
       
      - Solution:
       
       
       
      - Market:
       
       
       
      - Business Model:
       
       
       
      -------------------------------------------------------
       
      4. Guess which company your partner is pitching:
       
       
       
      5. Which elements of your partner's pitch could be improved? 
       
       
      " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(user.id, ""); + + attendeesRef.child(user.id).update(user); + + leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function(partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + $("#partnerName").html("Your partner isn't available. Let's find another for you!"); + + return; + } + else if (part.room != null) { + console.log("Entering our partner chat room: " + part.room); + publicChat._chat.enterRoom(part.room); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.id).update(user); + } + }); + + soloRef.off('child_changed'); + + // intro partners + $("#partnerName").html("Say hi to your workshop partner, !"); + $('.partnerName').text(user.partnerName); + $("#newPartner").show(); + + getMeetYourPartnerUpdates(user); +} + +function lookingForPartnerUI() { + $("#partnerName").html("Looking for a partner for you..."); + $("#newPartner").hide(); +} + +function joinSoloList(user) { + soloRef.child(user.id).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.id; + user.responsesPad = "r-" + user.id; + + // store my pad addresses + attendeesRef.child(user.id).update(user); + + loadFirepads(user, true); + + soloRef.on('child_changed', function(soloSnap) { + var solo = soloSnap.val(); + + if (solo.id != user.id) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + soloRef.child(user.id).remove(function(error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function(roomId) { + console.log('Created our partnership chat room'); + partnershipsRef.child(solo.partnership).set({"room": roomId}); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + }); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function(solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function(soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.id == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.id).transaction(function(currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.id.localeCompare(solo.id) < 0) { + partnership = user.id + solo.id; + } + else { + partnership = solo.id + user.id; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.id; + user.responsesPad = "r-" + solo.id; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function(){confirmPartnershipAccepted(user)}, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function(partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.id, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function(error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.id).transaction(function(currentData) { + + // Always return null because we want off this list + return null; + + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.id).once('value', function(attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.id).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + console.log("My user id is: " + user.id); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership() { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function(attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + searchForSolos(user); + } + else { + console.log("This user is requesting to leave partnership."); + lookingForPartnerUI(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function(error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(true); + } + }); + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function(attendeeSnap) { + var user = attendeeSnap.val(); + + leavePrivateChatRooms(); + clearPartnerFromUser(user); + unloadFirepads(); + + attendeesRef.child(user.id).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +$(document).ready( function() { + init(); +}); + +function hideQuestion(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function(question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + question.votes = question.votes * -1; + question.isActive = 0; + return question; + }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + if (lastQuestionAnswered) { + questionsRef.child(lastQuestionAnswered).update({ isActive: false}); + } + + lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false}); + + lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function(confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function(currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null){ + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: 1 }); + + $("#question-txt").val(''); + +} diff --git a/alex_original.html b/alex_original.html new file mode 100644 index 0000000..2fdd9b8 --- /dev/null +++ b/alex_original.html @@ -0,0 +1,839 @@ + + + + + Webshops: Better Online Learning | Customer Development Labs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      Value Proposition Workshop from Strategizer
      +
      + +
      +
      +
      +
      +
      +
      + +
      +
      + +
      +
      +
      +

      Questions: Ask and up vote.

      +
      +
      +
        +
        + +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        + +
        + + + +
        +
        + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Please, introduce yourself......and meet your partner, !
        +
        + Where do you live? + +
        +
        +
        lives in:
        +
        +
        +
        + What year are you? + +
        +
        +
        's year:
        +
        +
        +
        + Do you have a Twitter, Instagram or Facebook page? + +
        +
        +
        Check out 's profile at:
        +
        +
        +
        + What's your major? + +
        +
        +
        's major is:
        +
        +
        +
        + What do you do for fun? + +
        +
        +
        For fun :
        +
        +
        + Ask more questions in your private chat window. +
        +
        + +
        +
        + + + + +
        +
        +
        + +
        +
        +
        + +
        +
        + + + + +
        +
        +
        + +
        +
        +
        + +
        +
        + + + + +
        +
        +
        + +
        +
        +
        + +
        +
        + + + + +
        +
        +
        + +
        +
        +
        + +
        +
        + + + + +
        +
        +
        + +
        +
        +
        + +
        +
        + + + + +
        +
        +
        + +
        +
        +
        + +
        +
        + + + + +
        +
        +
        + +
        +
        +
        + +
        +
        + + + + +
        +
        + Share your Skype username with in the chat room. Then interview each other! +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Ask these questions:Listen for:
        +
        + What's the biggest challenge you're facing as a founder? +
        +
        +
        + Anything to dig into. +
        +
        +
        + When was the last time you tried to solve that problem? +
        +
        +
        + Have they tried to solve it in the last 3 months (B2C) or last 12 months (B2B)?

        + If not, start over asking about a different challenge. +
        +
        +
        + Can you tell me about the last time that problem happened? +
        +
        +
        + Opportunities to clarify - this is your chance to ask "dumb" questions.

        + Phrases and jargon you can turn into marketing copy.

        +
        +
        +
        + Why is it a problem for you? +
        +
        +
        + The real problem they're trying to solve.

        + Emotions you can evoke in your marketing copy.

        +
        +
        +
        + Are you looking for alternative solutions? If yes, why? +
        +
        +
        + No? They're not early adopters yet. Start again.

        + Yes? This is how to differentiate your solution from the competition.

        +
        +
        +
        + +
        +
        + + + + +
        + + Click here:to Generate your Interview Script +
        + +
        +
        + + + + +
        + +
        +
        +
        +

        Interview Script Creator

        +
        +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Your Interview Script (repeat 2-3 times):Listen for:
        +
        + What's the biggest challenge you're facing as a CUSTOMER ROLE? +
        +
        +
        + Anything to dig into. +
        +
        +
        + When was the last time you tried to solve that problem? +
        +
        +
        + Have they tried to solve it in the last 3 months (B2C) or last 12 months (B2B)?

        + If not, start over asking about a different challenge. +
        +
        +
        + Can you tell me about the last time that problem happened? +
        +
        +
        + Opportunities to clarify - this is your chance to ask "dumb" questions.

        + Phrases and jargon you can turn into marketing copy.

        +
        +
        +
        + Why is it a problem for you? +
        +
        +
        + The real problem they're trying to solve.

        + Emotions you can evoke in your marketing copy.

        +
        +
        +
        + Are you looking for alternative solutions? If yes, why? +
        +
        +
        + No? They're not early adopters yet. Start again.

        + Yes? This is how to differentiate your solution from the competition.

        +
        +
        +
        + No mention of the problem you hoped? +
        +
        +
        + What's the biggest challenge you're facing as a CUSTOMER ROLE with respect to PROBLEM CONTEXT? +
        +
        +
        + Note: Pay extra close attention to how recently they've looked for a solution. +
        +
        +
        + Bonus Questions +
        +
        +
        + How did you find out about the solution you're trying now? +
        +
        +
        + Your marketing channels. +
        +
        +
        + I'm actually exploring a solution to the      [Insert their Problem]       problem. Can I contact you if we find a viable solution? +
        +
        +
        + Contact information, in case you end up solving their problem. +
        +
        +
        + Do you know 1 or 2 other people who are struggling with      [Insert their Problem]       problem I could talk to? +
        +
        +
        + More customer interviews. +
        +
        +
        + How much money are you spending to try and solve this problem now? +
        +
        +
        + A potential anchor price. +
        +
        +
        + How often do you encounter this problem? +
        +
        +
        + How often they might use your solution. +
        +
        +
        + +
        +
        + + + + +
        +
        +
        +
        +

        Bonus #1

        +
        +
        +
        +

        + $50 Customer Interview Email Course
        + FREE +

        +
        + You'll learn... +
          +
        • Which customers to ask for interviews
        • +
        • A cold email script that works to get interviews
        • +
        • How to analyze your interview answers
        • +
        +

        Plus: Get free Customer Discovery Ninja coupon codes.

        +
        + +
        +
        +
        +

        Bonus #2

        +
        +
        +
        +

        FOCUS Framework Pre-Order

        + +
        + +
        +
        + Step by step instructions on:

        + What to test
        + When to test
        + How to test
        + + +
        +
        +
        Use coupon code "FounderInstitute" by March 13th for:
        +
          +
        • 25% off
        • +
        • Early access to chapters
        • +
        + Check out the FOCUS Framework. +
        + +
        + +
        +
        +
        + +
        +
        + + + + +
        +
        + +
        +
        +

        How likely would you be to recommend this workshop to a friend?

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

        What's one thing we can improve next time?

        +
        +
        + +
        +
        + +
        +
        +

        What was your favorite part of the workshop?

        +
        +
        + +
        + +
        + +
        +
        +
        +
        +
        +
        +
        + +
        + +
        + + + + + diff --git a/beback.html b/beback.html new file mode 100644 index 0000000..1a15ae6 --- /dev/null +++ b/beback.html @@ -0,0 +1,137 @@ + + + + + + + + + + + + + +
        +

        The next session starts in...

        +
        +
        + +
        Days
        +
        +
        + +
        Hours
        +
        +
        + +
        Minutes
        +
        +
        + +
        Seconds
        +
        +
        +
        + + + + \ No newline at end of file diff --git a/bootbox.min.js b/bootbox.min.js new file mode 100644 index 0000000..0dc0cbd --- /dev/null +++ b/bootbox.min.js @@ -0,0 +1,6 @@ +/** + * bootbox.js v4.4.0 + * + * http://bootboxjs.com/license.txt + */ +!function(a,b){"use strict";"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.bootbox=b(a.jQuery)}(this,function a(b,c){"use strict";function d(a){var b=q[o.locale];return b?b[a]:q.en[a]}function e(a,c,d){a.stopPropagation(),a.preventDefault();var e=b.isFunction(d)&&d.call(c,a)===!1;e||c.modal("hide")}function f(a){var b,c=0;for(b in a)c++;return c}function g(a,c){var d=0;b.each(a,function(a,b){c(a,b,d++)})}function h(a){var c,d;if("object"!=typeof a)throw new Error("Please supply an object of options");if(!a.message)throw new Error("Please specify a message");return a=b.extend({},o,a),a.buttons||(a.buttons={}),c=a.buttons,d=f(c),g(c,function(a,e,f){if(b.isFunction(e)&&(e=c[a]={callback:e}),"object"!==b.type(e))throw new Error("button with key "+a+" must be an object");e.label||(e.label=a),e.className||(e.className=2>=d&&f===d-1?"btn-primary":"btn-default")}),a}function i(a,b){var c=a.length,d={};if(1>c||c>2)throw new Error("Invalid argument length");return 2===c||"string"==typeof a[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}function j(a,c,d){return b.extend(!0,{},a,i(c,d))}function k(a,b,c,d){var e={className:"bootbox-"+a,buttons:l.apply(null,b)};return m(j(e,d,c),b)}function l(){for(var a={},b=0,c=arguments.length;c>b;b++){var e=arguments[b],f=e.toLowerCase(),g=e.toUpperCase();a[f]={label:d(g)}}return a}function m(a,b){var d={};return g(b,function(a,b){d[b]=!0}),g(a.buttons,function(a){if(d[a]===c)throw new Error("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}var n={dialog:"",header:"",footer:"",closeButton:"",form:"
        ",inputs:{text:"",textarea:"",email:"",select:"",checkbox:"
        ",date:"",time:"",number:"",password:""}},o={locale:"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},p={};p.alert=function(){var a;if(a=k("alert",["ok"],["message","callback"],arguments),a.callback&&!b.isFunction(a.callback))throw new Error("alert requires callback property to be a function when provided");return a.buttons.ok.callback=a.onEscape=function(){return b.isFunction(a.callback)?a.callback.call(this):!0},p.dialog(a)},p.confirm=function(){var a;if(a=k("confirm",["cancel","confirm"],["message","callback"],arguments),a.buttons.cancel.callback=a.onEscape=function(){return a.callback.call(this,!1)},a.buttons.confirm.callback=function(){return a.callback.call(this,!0)},!b.isFunction(a.callback))throw new Error("confirm requires a callback");return p.dialog(a)},p.prompt=function(){var a,d,e,f,h,i,k;if(f=b(n.form),d={className:"bootbox-prompt",buttons:l("cancel","confirm"),value:"",inputType:"text"},a=m(j(d,arguments,["title","callback"]),["cancel","confirm"]),i=a.show===c?!0:a.show,a.message=f,a.buttons.cancel.callback=a.onEscape=function(){return a.callback.call(this,null)},a.buttons.confirm.callback=function(){var c;switch(a.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":c=h.val();break;case"checkbox":var d=h.find("input:checked");c=[],g(d,function(a,d){c.push(b(d).val())})}return a.callback.call(this,c)},a.show=!1,!a.title)throw new Error("prompt requires a title");if(!b.isFunction(a.callback))throw new Error("prompt requires a callback");if(!n.inputs[a.inputType])throw new Error("invalid prompt type");switch(h=b(n.inputs[a.inputType]),a.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":h.val(a.value);break;case"select":var o={};if(k=a.inputOptions||[],!b.isArray(k))throw new Error("Please pass an array of input options");if(!k.length)throw new Error("prompt with select requires options");g(k,function(a,d){var e=h;if(d.value===c||d.text===c)throw new Error("given options in wrong format");d.group&&(o[d.group]||(o[d.group]=b("").attr("label",d.group)),e=o[d.group]),e.append("")}),g(o,function(a,b){h.append(b)}),h.val(a.value);break;case"checkbox":var q=b.isArray(a.value)?a.value:[a.value];if(k=a.inputOptions||[],!k.length)throw new Error("prompt with checkbox requires options");if(!k[0].value||!k[0].text)throw new Error("given options in wrong format");h=b("
        "),g(k,function(c,d){var e=b(n.inputs[a.inputType]);e.find("input").attr("value",d.value),e.find("label").append(d.text),g(q,function(a,b){b===d.value&&e.find("input").prop("checked",!0)}),h.append(e)})}return a.placeholder&&h.attr("placeholder",a.placeholder),a.pattern&&h.attr("pattern",a.pattern),a.maxlength&&h.attr("maxlength",a.maxlength),f.append(h),f.on("submit",function(a){a.preventDefault(),a.stopPropagation(),e.find(".btn-primary").click()}),e=p.dialog(a),e.off("shown.bs.modal"),e.on("shown.bs.modal",function(){h.focus()}),i===!0&&e.modal("show"),e},p.dialog=function(a){a=h(a);var d=b(n.dialog),f=d.find(".modal-dialog"),i=d.find(".modal-body"),j=a.buttons,k="",l={onEscape:a.onEscape};if(b.fn.modal===c)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(g(j,function(a,b){k+="",l[a]=b.callback}),i.find(".bootbox-body").html(a.message),a.animate===!0&&d.addClass("fade"),a.className&&d.addClass(a.className),"large"===a.size?f.addClass("modal-lg"):"small"===a.size&&f.addClass("modal-sm"),a.title&&i.before(n.header),a.closeButton){var m=b(n.closeButton);a.title?d.find(".modal-header").prepend(m):m.css("margin-top","-10px").prependTo(i)}return a.title&&d.find(".modal-title").html(a.title),k.length&&(i.after(n.footer),d.find(".modal-footer").html(k)),d.on("hidden.bs.modal",function(a){a.target===this&&d.remove()}),d.on("shown.bs.modal",function(){d.find(".btn-primary:first").focus()}),"static"!==a.backdrop&&d.on("click.dismiss.bs.modal",function(a){d.children(".modal-backdrop").length&&(a.currentTarget=d.children(".modal-backdrop").get(0)),a.target===a.currentTarget&&d.trigger("escape.close.bb")}),d.on("escape.close.bb",function(a){l.onEscape&&e(a,d,l.onEscape)}),d.on("click",".modal-footer button",function(a){var c=b(this).data("bb-handler");e(a,d,l[c])}),d.on("click",".bootbox-close-button",function(a){e(a,d,l.onEscape)}),d.on("keyup",function(a){27===a.which&&d.trigger("escape.close.bb")}),b(a.container).append(d),d.modal({backdrop:a.backdrop?"static":!1,keyboard:!1,show:!1}),a.show&&d.modal("show"),d},p.setDefaults=function(){var a={};2===arguments.length?a[arguments[0]]=arguments[1]:a=arguments[0],b.extend(o,a)},p.hideAll=function(){return b(".bootbox").modal("hide"),p};var q={bg_BG:{OK:"Ок",CANCEL:"Отказ",CONFIRM:"Потвърждавам"},br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},cs:{OK:"OK",CANCEL:"Zrušit",CONFIRM:"Potvrdit"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},el:{OK:"Εντάξει",CANCEL:"Ακύρωση",CONFIRM:"Επιβεβαίωση"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},et:{OK:"OK",CANCEL:"Katkesta",CONFIRM:"OK"},fa:{OK:"قبول",CANCEL:"لغو",CONFIRM:"تایید"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},he:{OK:"אישור",CANCEL:"ביטול",CONFIRM:"אישור"},hu:{OK:"OK",CANCEL:"Mégsem",CONFIRM:"Megerősít"},hr:{OK:"OK",CANCEL:"Odustani",CONFIRM:"Potvrdi"},id:{OK:"OK",CANCEL:"Batal",CONFIRM:"OK"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},ja:{OK:"OK",CANCEL:"キャンセル",CONFIRM:"確認"},lt:{OK:"Gerai",CANCEL:"Atšaukti",CONFIRM:"Patvirtinti"},lv:{OK:"Labi",CANCEL:"Atcelt",CONFIRM:"Apstiprināt"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},no:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},pt:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Confirmar"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},sq:{OK:"OK",CANCEL:"Anulo",CONFIRM:"Prano"},sv:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},th:{OK:"ตกลง",CANCEL:"ยกเลิก",CONFIRM:"ยืนยัน"},tr:{OK:"Tamam",CANCEL:"İptal",CONFIRM:"Onayla"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}};return p.addLocale=function(a,c){return b.each(["OK","CANCEL","CONFIRM"],function(a,b){if(!c[b])throw new Error("Please supply a translation for '"+b+"'")}),q[a]={OK:c.OK,CANCEL:c.CANCEL,CONFIRM:c.CONFIRM},p},p.removeLocale=function(a){return delete q[a],p},p.setLocale=function(a){return p.setDefaults("locale",a)},p.init=function(c){return a(c||b)},p}); \ No newline at end of file diff --git a/bootstrap.min.css b/bootstrap.min.css deleted file mode 100644 index 69aa8b6..0000000 --- a/bootstrap.min.css +++ /dev/null @@ -1,7 +0,0 @@ -@import url("http://fonts.googleapis.com/css?family=Lato:400,700,400italic");/*! - * Bootswatch v3.2.0 - * Homepage: http://bootswatch.com - * Copyright 2012-2014 Thomas Park - * Licensed under MIT - * Based on Bootstrap -*//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}@media print{*{text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff !important}.navbar{display:none}.table td,.table th{background-color:#fff !important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:1.42857143;color:#2c3e50;background-color:#ffffff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#18bc9c;text-decoration:none}a:hover,a:focus{color:#18bc9c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;width:100% \9;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#ffffff;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;width:100% \9;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:21px;margin-bottom:21px;border:0;border-top:1px solid #ecf0f1}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#b4bcc2}h1,.h1,h2,.h2,h3,.h3{margin-top:21px;margin-bottom:10.5px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10.5px;margin-bottom:10.5px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:39px}h2,.h2{font-size:32px}h3,.h3{font-size:26px}h4,.h4{font-size:19px}h5,.h5{font-size:15px}h6,.h6{font-size:13px}p{margin:0 0 10.5px}.lead{margin-bottom:21px;font-size:17px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:22.5px}}small,.small{font-size:86%}cite{font-style:normal}mark,.mark{background-color:#f39c12;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#b4bcc2}.text-primary{color:#2c3e50}a.text-primary:hover{color:#1a242f}.text-success{color:#ffffff}a.text-success:hover{color:#e6e6e6}.text-info{color:#ffffff}a.text-info:hover{color:#e6e6e6}.text-warning{color:#ffffff}a.text-warning:hover{color:#e6e6e6}.text-danger{color:#ffffff}a.text-danger:hover{color:#e6e6e6}.bg-primary{color:#fff;background-color:#2c3e50}a.bg-primary:hover{background-color:#1a242f}.bg-success{background-color:#18bc9c}a.bg-success:hover{background-color:#128f76}.bg-info{background-color:#3498db}a.bg-info:hover{background-color:#217dbb}.bg-warning{background-color:#f39c12}a.bg-warning:hover{background-color:#c87f0a}.bg-danger{background-color:#e74c3c}a.bg-danger:hover{background-color:#d62c1a}.page-header{padding-bottom:9.5px;margin:42px 0 21px;border-bottom:1px solid transparent}ul,ol{margin-top:0;margin-bottom:10.5px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:21px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #b4bcc2}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10.5px 21px;margin:0 0 21px;font-size:18.75px;border-left:5px solid #ecf0f1}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#b4bcc2}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #ecf0f1;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:21px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#ffffff;background-color:#333333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;box-shadow:none}pre{display:block;padding:10px;margin:0 0 10.5px;font-size:14px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#7b8a8b;background-color:#ecf0f1;border:1px solid #cccccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0%}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0%}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0%}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0%}}table{background-color:transparent}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:21px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ecf0f1}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ecf0f1}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ecf0f1}.table .table{background-color:#ffffff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ecf0f1}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ecf0f1}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#ecf0f1}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#ecf0f1}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#dde4e6}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#18bc9c}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#15a589}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#3498db}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#258cd1}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#f39c12}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#e08e0b}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#e74c3c}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#e43725}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15.75px;overflow-y:hidden;overflow-x:auto;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ecf0f1;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:21px;font-size:22.5px;line-height:inherit;color:#2c3e50;border:0;border-bottom:1px solid transparent}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:11px;font-size:15px;line-height:1.42857143;color:#2c3e50}.form-control{display:block;width:100%;height:43px;padding:10px 15px;font-size:15px;line-height:1.42857143;color:#2c3e50;background-color:#ffffff;background-image:none;border:1px solid #dce4ec;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#2c3e50;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(44,62,80,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(44,62,80,0.6)}.form-control::-moz-placeholder{color:#acb6c0;opacity:1}.form-control:-ms-input-placeholder{color:#acb6c0}.form-control::-webkit-input-placeholder{color:#acb6c0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#ecf0f1;opacity:1}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}input[type="date"],input[type="time"],input[type="datetime-local"],input[type="month"]{line-height:43px;line-height:1.42857143 \0}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm{line-height:33px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg{line-height:64px}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;min-height:21px;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:11px;padding-bottom:11px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm,.form-horizontal .form-group-sm .form-control{height:33px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}select.input-sm{height:33px;line-height:33px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg,.form-horizontal .form-group-lg .form-control{height:64px;padding:18px 27px;font-size:19px;line-height:1.33;border-radius:6px}select.input-lg{height:64px;line-height:64px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:53.75px}.form-control-feedback{position:absolute;top:26px;right:0;z-index:2;display:block;width:43px;height:43px;line-height:43px;text-align:center}.input-lg+.form-control-feedback{width:64px;height:64px;line-height:64px}.input-sm+.form-control-feedback{width:33px;height:33px;line-height:33px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#ffffff}.has-success .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-success .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#18bc9c}.has-success .form-control-feedback{color:#ffffff}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#ffffff}.has-warning .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-warning .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#f39c12}.has-warning .form-control-feedback{color:#ffffff}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#ffffff}.has-error .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-error .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#e74c3c}.has-error .form-control-feedback{color:#ffffff}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#597ea2}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:11px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:32px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:11px}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:24.94px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:7px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:10px 15px;font-size:15px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#ffffff;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#ffffff;background-color:#95a5a6;border-color:#95a5a6}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#ffffff;background-color:#798d8f;border-color:#74898a}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#95a5a6;border-color:#95a5a6}.btn-default .badge{color:#95a5a6;background-color:#ffffff}.btn-primary{color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#ffffff;background-color:#1a242f;border-color:#161f29}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#2c3e50;border-color:#2c3e50}.btn-primary .badge{color:#2c3e50;background-color:#ffffff}.btn-success{color:#ffffff;background-color:#18bc9c;border-color:#18bc9c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#ffffff;background-color:#128f76;border-color:#11866f}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#18bc9c;border-color:#18bc9c}.btn-success .badge{color:#18bc9c;background-color:#ffffff}.btn-info{color:#ffffff;background-color:#3498db;border-color:#3498db}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#ffffff;background-color:#217dbb;border-color:#2077b2}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#3498db;border-color:#3498db}.btn-info .badge{color:#3498db;background-color:#ffffff}.btn-warning{color:#ffffff;background-color:#f39c12;border-color:#f39c12}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#ffffff;background-color:#c87f0a;border-color:#be780a}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f39c12;border-color:#f39c12}.btn-warning .badge{color:#f39c12;background-color:#ffffff}.btn-danger{color:#ffffff;background-color:#e74c3c;border-color:#e74c3c}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#ffffff;background-color:#d62c1a;border-color:#cd2a19}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#e74c3c;border-color:#e74c3c}.btn-danger .badge{color:#e74c3c;background-color:#ffffff}.btn-link{color:#18bc9c;font-weight:normal;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#18bc9c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#b4bcc2;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:18px 27px;font-size:19px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:13px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:15px;text-align:left;background-color:#ffffff;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#7b8a8b;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#ffffff;background-color:#2c3e50}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#ffffff;text-decoration:none;outline:0;background-color:#2c3e50}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#b4bcc2}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:13px;line-height:1.42857143;color:#b4bcc2;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:4px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{position:absolute;z-index:-1;opacity:0;filter:alpha(opacity=0)}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:64px;padding:18px 27px;font-size:19px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:64px;line-height:64px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:33px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:33px;line-height:33px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:10px 15px;font-size:15px;font-weight:normal;line-height:1;color:#2c3e50;text-align:center;background-color:#ecf0f1;border:1px solid #dce4ec;border-radius:4px}.input-group-addon.input-sm{padding:6px 9px;font-size:13px;border-radius:3px}.input-group-addon.input-lg{padding:18px 27px;font-size:19px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#ecf0f1}.nav>li.disabled>a{color:#b4bcc2}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#b4bcc2;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#ecf0f1;border-color:#18bc9c}.nav .nav-divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ecf0f1}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#ecf0f1 #ecf0f1 #ecf0f1}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#2c3e50;background-color:#ffffff;border:1px solid #ecf0f1;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ecf0f1}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ecf0f1;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#ffffff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#ffffff;background-color:#2c3e50}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ecf0f1}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ecf0f1;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#ffffff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:60px;margin-bottom:21px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:19.5px 15px;font-size:19px;line-height:21px;height:60px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:13px;margin-bottom:13px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:9.75px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:21px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:21px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:19.5px;padding-bottom:19.5px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:8.5px;margin-bottom:8.5px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8.5px;margin-bottom:8.5px}.navbar-btn.btn-sm{margin-top:13.5px;margin-bottom:13.5px}.navbar-btn.btn-xs{margin-top:19px;margin-bottom:19px}.navbar-text{margin-top:19.5px;margin-bottom:19.5px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#2c3e50;border-color:transparent}.navbar-default .navbar-brand{color:#ffffff}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-text{color:#777777}.navbar-default .navbar-nav>li>a{color:#ffffff}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#ffffff;background-color:#1a242f}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#1a242f}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#1a242f}.navbar-default .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:transparent}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#1a242f;color:#ffffff}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#1a242f}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-default .navbar-link{color:#ffffff}.navbar-default .navbar-link:hover{color:#18bc9c}.navbar-default .btn-link{color:#ffffff}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#18bc9c}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#cccccc}.navbar-inverse{background-color:#18bc9c;border-color:transparent}.navbar-inverse .navbar-brand{color:#ffffff}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-text{color:#ffffff}.navbar-inverse .navbar-nav>li>a{color:#ffffff}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#ffffff;background-color:#15a589}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#128f76}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#128f76}.navbar-inverse .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#149c82}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#15a589;color:#ffffff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#15a589}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-inverse .navbar-link{color:#ffffff}.navbar-inverse .navbar-link:hover{color:#2c3e50}.navbar-inverse .btn-link{color:#ffffff}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#2c3e50}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#cccccc}.breadcrumb{padding:8px 15px;margin-bottom:21px;list-style:none;background-color:#ecf0f1;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#cccccc}.breadcrumb>.active{color:#95a5a6}.pagination{display:inline-block;padding-left:0;margin:21px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:10px 15px;line-height:1.42857143;text-decoration:none;color:#ffffff;background-color:#18bc9c;border:1px solid transparent;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#ffffff;background-color:#0f7864;border-color:transparent}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#ffffff;background-color:#0f7864;border-color:transparent;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#ecf0f1;background-color:#3be6c4;border-color:transparent;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:18px 27px;font-size:19px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:6px 9px;font-size:13px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:21px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#18bc9c;border:1px solid transparent;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#0f7864}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#ffffff;background-color:#18bc9c;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#ffffff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#95a5a6}.label-default[href]:hover,.label-default[href]:focus{background-color:#798d8f}.label-primary{background-color:#2c3e50}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#1a242f}.label-success{background-color:#18bc9c}.label-success[href]:hover,.label-success[href]:focus{background-color:#128f76}.label-info{background-color:#3498db}.label-info[href]:hover,.label-info[href]:focus{background-color:#217dbb}.label-warning{background-color:#f39c12}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#c87f0a}.label-danger{background-color:#e74c3c}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#d62c1a}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:13px;font-weight:bold;color:#ffffff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#2c3e50;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#ffffff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#2c3e50;background-color:#ffffff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;color:inherit;background-color:#ecf0f1}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:23px;font-weight:200}.jumbotron>hr{border-top-color:#cfd9db}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:67.5px}}.thumbnail{display:block;padding:4px;margin-bottom:21px;line-height:1.42857143;background-color:#ffffff;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#18bc9c}.thumbnail .caption{padding:9px;color:#2c3e50}.alert{padding:15px;margin-bottom:21px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#18bc9c;border-color:#18bc9c;color:#ffffff}.alert-success hr{border-top-color:#15a589}.alert-success .alert-link{color:#e6e6e6}.alert-info{background-color:#3498db;border-color:#3498db;color:#ffffff}.alert-info hr{border-top-color:#258cd1}.alert-info .alert-link{color:#e6e6e6}.alert-warning{background-color:#f39c12;border-color:#f39c12;color:#ffffff}.alert-warning hr{border-top-color:#e08e0b}.alert-warning .alert-link{color:#e6e6e6}.alert-danger{background-color:#e74c3c;border-color:#e74c3c;color:#ffffff}.alert-danger hr{border-top-color:#e43725}.alert-danger .alert-link{color:#e6e6e6}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:21px;margin-bottom:21px;background-color:#ecf0f1;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0%;height:100%;font-size:13px;line-height:21px;color:#ffffff;text-align:center;background-color:#2c3e50;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar[aria-valuenow="1"],.progress-bar[aria-valuenow="2"]{min-width:30px}.progress-bar[aria-valuenow="0"]{color:#b4bcc2;min-width:30px;background-color:transparent;background-image:none;box-shadow:none}.progress-bar-success{background-color:#18bc9c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-info{background-color:#3498db}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-warning{background-color:#f39c12}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-danger{background-color:#e74c3c}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#ffffff;border:1px solid #ecf0f1}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555555}a.list-group-item .list-group-item-heading{color:#333333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;color:#555555;background-color:#ecf0f1}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{background-color:#ecf0f1;color:#b4bcc2}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#b4bcc2}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#8aa4be}.list-group-item-success{color:#ffffff;background-color:#18bc9c}a.list-group-item-success{color:#ffffff}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#ffffff;background-color:#15a589}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-info{color:#ffffff;background-color:#3498db}a.list-group-item-info{color:#ffffff}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#ffffff;background-color:#258cd1}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-warning{color:#ffffff;background-color:#f39c12}a.list-group-item-warning{color:#ffffff}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#ffffff;background-color:#e08e0b}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-danger{color:#ffffff;background-color:#e74c3c}a.list-group-item-danger{color:#ffffff}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#ffffff;background-color:#e43725}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:21px;background-color:#ffffff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:17px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#ecf0f1;border-top:1px solid #ecf0f1;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ecf0f1}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:21px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ecf0f1}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ecf0f1}.panel-default{border-color:#ecf0f1}.panel-default>.panel-heading{color:#2c3e50;background-color:#ecf0f1;border-color:#ecf0f1}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ecf0f1}.panel-default>.panel-heading .badge{color:#ecf0f1;background-color:#2c3e50}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ecf0f1}.panel-primary{border-color:#2c3e50}.panel-primary>.panel-heading{color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#2c3e50}.panel-primary>.panel-heading .badge{color:#2c3e50;background-color:#ffffff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#2c3e50}.panel-success{border-color:#18bc9c}.panel-success>.panel-heading{color:#ffffff;background-color:#18bc9c;border-color:#18bc9c}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#18bc9c}.panel-success>.panel-heading .badge{color:#18bc9c;background-color:#ffffff}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#18bc9c}.panel-info{border-color:#3498db}.panel-info>.panel-heading{color:#ffffff;background-color:#3498db;border-color:#3498db}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#3498db}.panel-info>.panel-heading .badge{color:#3498db;background-color:#ffffff}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#3498db}.panel-warning{border-color:#f39c12}.panel-warning>.panel-heading{color:#ffffff;background-color:#f39c12;border-color:#f39c12}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#f39c12}.panel-warning>.panel-heading .badge{color:#f39c12;background-color:#ffffff}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#f39c12}.panel-danger{border-color:#e74c3c}.panel-danger>.panel-heading{color:#ffffff;background-color:#e74c3c;border-color:#e74c3c}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#e74c3c}.panel-danger>.panel-heading .badge{color:#e74c3c;background-color:#ffffff}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#e74c3c}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#ecf0f1;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:22.5px;font-weight:bold;line-height:1;color:#000000;text-shadow:none;opacity:0.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate3d(0, -25%, 0);transform:translate3d(0, -25%, 0);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#ffffff;border:1px solid #999999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:0.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.42857143px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{padding:20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;visibility:visible;font-size:13px;line-height:1.4;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:0.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:rgba(0,0,0,0.9);border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:rgba(0,0,0,0.9)}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:rgba(0,0,0,0.9)}.tooltip.top-right .tooltip-arrow{bottom:0;right:5px;border-width:5px 5px 0;border-top-color:rgba(0,0,0,0.9)}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:rgba(0,0,0,0.9)}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:rgba(0,0,0,0.9)}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:rgba(0,0,0,0.9)}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:rgba(0,0,0,0.9)}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:rgba(0,0,0,0.9)}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;text-align:left;background-color:#ffffff;background-clip:padding-box;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);white-space:normal}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:15px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999999;border-right-color:rgba(0,0,0,0.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#ffffff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999999;border-left-color:rgba(0,0,0,0.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:0.5;filter:alpha(opacity=50);font-size:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-control.left{background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:linear-gradient(to right, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #ffffff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#ffffff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important;visibility:hidden !important}.affix{position:fixed;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}}.navbar{border-width:0}.navbar-default .badge{background-color:#fff;color:#2c3e50}.navbar-inverse .badge{background-color:#fff;color:#18bc9c}.navbar-brand{padding:18.5px 15px 20.5px}.btn:active{-webkit-box-shadow:none;box-shadow:none}.btn-group.open .dropdown-toggle{-webkit-box-shadow:none;box-shadow:none}.text-primary,.text-primary:hover{color:#2c3e50}.text-success,.text-success:hover{color:#18bc9c}.text-danger,.text-danger:hover{color:#e74c3c}.text-warning,.text-warning:hover{color:#f39c12}.text-info,.text-info:hover{color:#3498db}table a:not(.btn),.table a:not(.btn){text-decoration:underline}table .success,.table .success,table .warning,.table .warning,table .danger,.table .danger,table .info,.table .info{color:#fff}table .success a,.table .success a,table .warning a,.table .warning a,table .danger a,.table .danger a,table .info a,.table .info a{color:#fff}table>thead>tr>th,.table>thead>tr>th,table>tbody>tr>th,.table>tbody>tr>th,table>tfoot>tr>th,.table>tfoot>tr>th,table>thead>tr>td,.table>thead>tr>td,table>tbody>tr>td,.table>tbody>tr>td,table>tfoot>tr>td,.table>tfoot>tr>td{border:none}table-bordered>thead>tr>th,.table-bordered>thead>tr>th,table-bordered>tbody>tr>th,.table-bordered>tbody>tr>th,table-bordered>tfoot>tr>th,.table-bordered>tfoot>tr>th,table-bordered>thead>tr>td,.table-bordered>thead>tr>td,table-bordered>tbody>tr>td,.table-bordered>tbody>tr>td,table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ecf0f1}.form-control,input{border-width:2px;-webkit-box-shadow:none;box-shadow:none}.form-control:focus,input:focus{-webkit-box-shadow:none;box-shadow:none}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning .form-control-feedback{color:#f39c12}.has-warning .form-control,.has-warning .form-control:focus{border:2px solid #f39c12}.has-warning .input-group-addon{border-color:#f39c12}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error .form-control-feedback{color:#e74c3c}.has-error .form-control,.has-error .form-control:focus{border:2px solid #e74c3c}.has-error .input-group-addon{border-color:#e74c3c}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success .form-control-feedback{color:#18bc9c}.has-success .form-control,.has-success .form-control:focus{border:2px solid #18bc9c}.has-success .input-group-addon{border-color:#18bc9c}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{border-color:transparent}.pager a,.pager a:hover{color:#fff}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{background-color:#3be6c4}.close{color:#fff;text-decoration:none;opacity:0.4}.close:hover,.close:focus{color:#fff;opacity:1}.alert .alert-link{color:#fff;text-decoration:underline}.progress{height:10px;-webkit-box-shadow:none;box-shadow:none}.progress .progress-bar{font-size:10px;line-height:10px}.well{-webkit-box-shadow:none;box-shadow:none}.panel-default .close{color:#2c3e50}.modal .close{color:#2c3e50}.popover{color:#2c3e50} \ No newline at end of file diff --git a/calendarCreator.html b/calendarCreator.html new file mode 100644 index 0000000..b22e50f --- /dev/null +++ b/calendarCreator.html @@ -0,0 +1,162 @@ + + + + + + + + + + + + + +
        + + + \ No newline at end of file diff --git a/cdl.html b/cdl.html new file mode 100644 index 0000000..6d60a6a --- /dev/null +++ b/cdl.html @@ -0,0 +1,2125 @@ + + + + + How to Find Product-Market Fit | Justin Wilcox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        +
        How to Find Product-Market Fit with Justin Wilcox
        +
        + +
        + +
        +
        +
        +
        + +
        + +
        + +
        +
        + +
        +
        +

        Questions: Ask and up vote.

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

          Welcome to How to Find Product-Market Fit!

          You can take notes during the workshop here. +

          +   +

          5 Phases of Product-Market Fit

          +
            +
          1. F
          2. +
          3. O
          4. +
          5. C
          6. +
          7. U
          8. +
          9. S
          10. +
          +

          +

          Takeaways

          +

          +

          - Declaring Victory: What's your Victory?

          +

          +   +

          - Product-Market Fit Assessment:

          +
            +
          • Phase are you in:
          • +
          • Riskiest Assumption:
          • +
          • Next step:
          • +
          +

          +   + +

          Where are your Early Adopters:

          +

          +
          +
          +
          +
          + +
          +
          + + + + +
          +
          +
          + +
          +
          +
          + +
          + + +
          +
          + + + + + + + + + + + +
          +
          + +
          + +
          + +
          +
          + + + + +
          + +
          +
          + + +
          +
          +
          +
          +
          +
          +
          + + +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          + +
          + +
          +
          Defining Product-Market Fit
          +
          + Ready to define Product-Market Fit? +
          +
          + +
          +
          Declaring Victory Worksheet
          +
          + This worksheet will walk you through defining Product-Market Fit. +
          +
          + +
          +
          Today's Date
          +
            +
          • +
          +
          + Start by writing in today's date in the field on the right.

          +
          +
          + + + + + +
          +
          What's your Product?
          +
          +

          Write in the product or service that you would like to build.

          + +
          +
            +
          • +
          +
          + +
          +
          Who's your Customer?
          +
          + Write in the customers or people whom you would like to serve.

          +
          +
            +
          • +
          +
          + +
          +
          Fold on the Dotted Line
          +
          + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
          +
            +
          +
          + +
          +
          Your Promise
          +
          + Now that your worksheet is folded, you've revealed a new contract with yourself: +
            +
          1. Even if you never get to build your product and
          2. +
          3. Even if you are not able to help the people you want to help...
          4. +
          +
          You are still going to achieve victory.
          +
          +
            +
          +
          + + + +
          +
          Enter your Victory
          +
          +

          Write in your measurable Victory metric.

          + +
          +
            +
          • +
          • +
          +
          + +
          +
          Find your FOCUS
          +
          + Want Feedback?

          + Type "Yes" if you'd like me to review your Victory.

          + + Bonus: you'll also be helping others learn. +
          +
            + +
          +
          + +
          +
          What Emotions are you Seeking?
          +
          + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

          + +
          +
            +
          • +
          +
          + +
          +
          Make it Official
          +
          +

          Congratulations! You have your victory.

          + + + +
          +
            +
          • +
          +
          + +
          +
          What are your Co-Founders' Victories?
          +
          + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

          + +
          +
          + + + +
          +
          Find your FOCUS
          +
          +

          Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

          Write your Victory Declaration in your Notes tab!
          + +
          +
          + +
          + +
          + +
          +
          + + + + +
          +
          +
          + +
          +
          + + +
          Your customer segment
          +
          Your customer's problem (in their words)
          + +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          + +
          1. +
          2. +
          3. +
          4. +
          5. +
          +
          +
          1. +
          2. +
          3. +
          4. +
          5. +
          +
          +
          +
          +
          +
          +
          + +
          +
          + + + + +
          +
          +
          + +
          +

          Product-Market Fit Assessment

          This exercise will tell you: +
            +
          1. What phase of Product-Market Fit you're in
          2. +
          3. Your startup's "Riskiest Assumption"
          4. +
          5. Your next step to test that assumption
          6. +
          +

          Just answer these questions...

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

          Have you launched your product?

          +
          +
          +
            +
          • No30
          • +

            +
          • Yes2
          • +

            +
          +
          +
          +
          +
          +
          +

          Are customers paying for it?

          +
          +
          +
            +
          • No23
          • +

            +
          • Yes3
          • +

            +
          +
          +
          +
          +
          +
          +

          Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

          +
          +
          +
            +
          • No5
          • +

            +
          • Yes4
          • +

            +
          • Not sure20
          • +

            +
          +
          +
          +
          +
          +
          + Congrats! You're on the path to Product-Market + Fit. +
          +
          +
          + Keep doing what you're doing! +
          +
          +
          +
          +
          +
          +

          Why aren't you on track to acheive Product-Market Fit?

          +
          +
          +
            +
          • Not enough customers6
          • +

            +
          • Customer Lifetime Value is too low16
          • +

            +
          +
          Not sure? Go with your gut. Eventually you'll test both.
          +
          +
          +
          +
          +
          +

          Why don't you have enough customers?

          +
          +
          +
            +
          • Having trouble finding them7
          • +

            +
          • Conversion rate it too low10
          • +

            +
          • Customer segment is too small14
          • +

            +
          • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
          • +

            +
          +
          Not sure? Starting at the top, pick the first answer you think could be the reason.
          +
          +
          +
          +
          +
          +

          Where are you looking for customers?

          +
          +
          +
            +
          • Places I think my customers are.8
          • +

            +
          • Places customers have told me they are.9
          • +

            +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
          +
          +
          +
          Product-Market Fit Phase: Finding Early Adopters for + your product.
          +
          Your Your Next Step: Interview customers to validate + where they look for solutions.
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

          Use this information to make your interviews easier and faster + to get.
          +
          +

          Found in FOCUS Workbook 1...

          + +
          +
          +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
          +
          +
          +
          Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
          +
          Your Next Step: Test alternative channels to determine + potential customer segment size.
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

          You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
          +
          +

          Found in FOCUS Workbook 2...

          + +
          +
          +
          +
          +
          +
          +
          +
          +

          What emotions are you evoking in your Call to Action?

          +
          +
          +
            +
          • I'm not evoking emotions in my Call to Action11
          • +

            +
          • Emotions I think my customers are experiencing12
          • +

            +
          • Emotions my customers have told me they are experiencing13
          • +

            +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
          +
          +
          +
          Product-Market Fit Phase: Finding Early Adopters for + your product.
          +
          Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

          Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
          +
          +

          Found in FOCUS Workbook 1...

          + +
          +
          +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: You understand + your customer's emotional desires. +
          +
          +
          +
          Product-Market Fit Phase: .
          +
          Your Next Step: Interview your customers to understand + their emotional desires. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

          Use this information to make your interviews easier and faster + to get.
          +
          +

          Found in FOCUS Workbook 1...

          + +
          +
          +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
          +
          +
          +
          Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
          +
          Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This exercise will help you identify + the emotions your customers' emotions. + +

          By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
          +
          +

          Found in FOCUS Workbook 2...

          + +
          +
          +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
          +
          +
          +
          Product-Market Fit Phase: Scaling to Product-Market + Fit. +
          +
          Your Next Step: Identify, size and test related customer + segments. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

          By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
          +
          +

          Found in FOCUS Workbook 5...

          + +
          +
          +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
          +
          +
          +
          Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
          +
          Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
          +
          +

          Found in FOCUS Workbook 4...

          + +
          +
          +
          +
          +
          +
          +
          +
          +

          Why is your Customer Lifetime Value too low?

          +
          +
          +
            +
          • Customer churn is too high (i.e. they cancel your service too soon)17
          • +

            +
          • Price is too low18
          • +

            +
          • Cost of customer acquisition is too high19
          • +

            +
          +
          Not sure? Starting at the top, pick the first answer you think could be the reason.
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
          +
          +
          +
          Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
          +
          Your Next Step: Test ways to increase the value your + solution is providing to customers. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
          +
          +

          Found in FOCUS Workbook 4...

          + +
          +
          +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
          +
          +
          +
          Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
          +
          Your Next Step: Optimize your price via price testing. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
          +
          +

          Found in FOCUS Workbook 3...

          + +
          +
          +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
          +
          +
          +
          Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
          +
          Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
          +
          +

          Found in FOCUS Workbook 2...

          + +
          +
          +
          +
          +
          +
          +
          +
          +

          Have you defined a metric that represents when you have acheived Product-Market Fit?

          +
          +
          +
            +
          • No21
          • +

            +
          • Yes22
          • +

            +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
          +
          +
          +
          Product-Market Fit Phase: Finding Early Adopters for + your product.
          +
          Your Next Step: Define Product-Market Fit for you + and your team. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

          This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
          +
          +

          Found in FOCUS Workbook 1...

          + +
          +
          +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
          +
          +
          +
          Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
          +
          Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
          +
          +

          Found in FOCUS Workbook 3...

          + +
          +
          +
          +
          +
          +
          +
          +
          +

          Are customers using the product?

          +
          +
          +
            +
          • No41
          • +

            +
          • Yes24
          • +

            +
          +
          +
          +
          +
          +
          +

          Why aren't your customers paying to use your product?

          +
          +
          +
            +
          • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
          • +

            +
          • Going to monetize after reaching critical mass26
          • +

            +
          • Pursuing a freemium model and haven't built paid features yet25
          • +

            +
          • Tried charging but no one would pay10
          • +

            +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
          +
          +
          +
          Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
          +
          Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
          +
          +

          Found in FOCUS Workbook 3...

          + +
          +
          +
          +
          +
          +
          +
          +
          +

          Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

          +
          +
          +
            +
          • No28
          • +

            +
          • Yes38
          • +

            +
          • Not sure20
          • +

            +
          +
          +
          +
          + +
          +
          +
          +

          Why aren't enough customers using for you to achieve Product-Market Fit?

          +
          +
          +
            +
          • Having trouble finding them7
          • +

            +
          • Conversion rate it too low10
          • +

            +
          • Customer segment is too small14
          • +

            +
          • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
          • +

            +
          +
          Not sure? Starting at the top, pick the first answer you think could be the reason.
          +
          +
          +
          +
          +
          +

          Have you defined a metric that represents when you have acheived Product-Market Fit?

          +
          +
          +
            +
          • No21
          • +

            +
          • Yes22
          • +

            +
          +
          +
          +
          +
          +
          +

          Have you generated any pre-sales or signed Letters of Intent?

          +
          +
          +
            +
          • No35
          • +

            +
          • Yes31
          • +

            +
          +
          +
          +
          +
          +
          +

          Are enough customers pre-paying for it that, if you solve their problems, you'll achieve Product-Market Fit?

          +
          +
          +
            +
          • No5
          • +

            +
          • Yes32
          • +

            +
          • Not sure20
          • +

            +
          +
          +
          +
          +
          +
          +

          Why haven't you launched the product yet?

          +
          +
          +
            +
          • No development team33
          • +

            +
          • Solution is still under development33
          • +

            +
          • Testing the solution privately before making it available publicly34
          • +

            +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: You can solve + your customers' problems. +
          +
          +
          +
          Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
          +
          Your Next Step: Test a manual solution. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
          +
          +

          Found in FOCUS Workbook 4...

          + +
          +
          +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
          +
          +
          +
          Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
          +
          Your Next Step: Test an automated solution. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
          +
          +

          Found in FOCUS Workbook 5...

          + +
          +
          +
          +
          +
          +
          +
          +
          +

          Have you identified a problem at least 60% of your customers are actively trying to solve?

          +
          +
          +
            +
          • No40
          • +

            +
          • Yes36
          • +

            +
          +
          +
          +
          +
          +
          +

          If you solve the problem, will you achieve Product-Market Fit?

          +
          +
          +
            +
          • No5
          • +

            +
          • Yes37
          • +

            +
          • Not sure39
          • +

            +
          +
          +
          +
          +
          +
          +

          Why aren't you collecting pre-orders or Letters of Intent?

          +
          +
          +
            +
          • Can't finding customers to pre-sell7
          • +

            +
          • Don't know how38
          • +

            +
          • Tried but no one bought10
          • +

            +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
          +
          +
          +
          Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
          +
          Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
          +
          +

          Found in FOCUS Workbook 3...

          + +
          +
          +
          +
          +
          +
          +
          +
          +

          Have you defined a metric that represents when you have acheived Product-Market Fit?

          +
          +
          +
            +
          • No21
          • +

            +
          • Yes9
          • +

            +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
          +
          +
          +
          Product-Market Fit Phase: Finding Early Adopters for + your product.
          +
          Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

          Use this information to make your interviews easier and faster + to get.
          +
          +

          Found in FOCUS Workbook 1...

          + +
          +
          +
          +
          +
          +
          +
          +
          +

          Why aren't customers using your product?

          +
          +
          +
            +
          • I'm not sure how/where to find customers to tell about it8
          • +

            +
          • I've told them about it, but they don't really use it11
          • +

            +
          • Customers use it a little, but then they stop42
          • +

            +
          +
          +
          +
          +
          +
          + Your Riskiest Assumption: Your product solves + your customers' problems. +
          +
          +
          +
          Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
          +
          Your Next Step: Test ways to increase the value your + solution is providing to customers. +
          +
          + This will help... +
          + +
          +

          Recommended FOCUS Exercise...

          + +
          +
          Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
          +
          +

          Found in FOCUS Workbook 4...

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

          Bonus #1

          +
          +
          +
          +

          + FREE Customer Interview Email Course
          +

          +
          + You'll learn... +
            +
          • Which customers to ask for interviews
          • +
          • A cold email script that works to get interviews
          • +
          • How to analyze your interview answers
          • +
          + +
          + +
          +
          +
          +

          Bonus #2

          +
          +
          +
          +

          FOCUS Framework

          +

          $20 Off Coupon

          + +
          + +
          +
          +

          Use coupon: CDLFIT
          (next 24 hours)

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

          How likely would you be to recommend this workshop to a friend?

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

          What's one thing we can improve next time?

          +
          +
          + +
          +
          + +
          +
          +

          What was your favorite part of the workshop?

          +
          +
          + +
          + +
          + +
          +
          +
          +
          +
          +
          +
          + + +
          + +
          + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cdl.js b/cdl.js new file mode 100644 index 0000000..08ee254 --- /dev/null +++ b/cdl.js @@ -0,0 +1,1605 @@ +//var app = angular.module('app', ['firebase']); +var firebaseRoot = "https://cdlwebshops.firebaseio.com/cdl"; + +var rootRef = new Firebase(firebaseRoot); +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var emailsRef = new Firebase(firebaseRoot + "/emails"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); +var notesRef = new Firebase(firebaseRoot + "/notes"); +var exerciseValuesRef = new Firebase(firebaseRoot + "/exerciseValues"); + +var declaringVictoryRef = exerciseValuesRef.child("declaringVictory"); +var pmfAssessmentRef = exerciseValuesRef.child("pmfAssessment"); + +var loggedInUserId; +var questionPad, responsePad; +var myPMFAssessmentRef; + +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +const GET_PARTNER = false; + +var publicChat; + +var firstName = null; +var emailAddress = null; + +var lastSoloPriority = 0; +var lastQuestionAnswered; + +var app = angular.module('app', [ + 'ui.grid', + 'ui.grid.resizeColumns', + 'ui.grid.autoResize', + 'ui.grid.moveColumns', + 'ui.grid.saveState', + 'ngSanitize', + 'ui.bootstrap', + 'firebase']). + directive('contenteditable', ['$sce', function ($sce) { + return { + restrict: 'A', // only activate on element attribute + require: '?ngModel', // get a hold of NgModelController + link: function (scope, element, attrs, ngModel) { + if (!ngModel) return; // do nothing if no ng-model + + // Specify how UI should be updated + ngModel.$render = function () { + element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); + }; + + // Listen for change events to enable binding + element.on('blur keyup change', function () { + scope.$evalAsync(read); + }); + read(); // initialize + + // Write data to the model + function read() { + var html = element.html(); + // When we clear the content editable the browser leaves a
          behind + // If strip-br attribute is provided then we strip this out + if (attrs.stripBr && html == '
          ') { + html = ''; + } + ngModel.$setViewValue(html); + } + } + }; + }]); + +app.controller('MainCtrl', ['$scope', '$firebaseArray', '$firebaseAuth', '$firebaseObject', 'uiGridConstants', function ($scope, $firebaseArray, $firebaseAuth, $firebaseObject, uiGridConstants) { + var vm = this; + + var VictoryDeclarationFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + date: 'Write here', + step1: 'Write here', + step2: 'Write here', + number: '#', + things: 'things here', + emotion: 'Write here', + signature: 'Sign here', + optIn: 'Want Feedback?' + } + }); + + vm.gridOptions = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Number', + field: 'number' + }, + { + displayName: 'Things', + field: 'things' + }, + { + displayName: 'Emotion', + field: 'emotion', + }, + { + displayName: 'Product', + field: 'step1', + }, + { + displayName: 'Customer', + field: 'step2', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm.gridApi = gridApi; + } + }; + + if (isSimpleMode()) { + vm.properties = $firebaseArray(declaringVictoryRef); + vm.properties.$loaded().then(function () { + vm.gridOptions.data = vm.properties; + }); + + vm.giveFeedback = function (exercise) { + var victoryRef = declaringVictoryRef.child(exercise.$id); + + if (vm.feedbackObj) { + vm.feedbackObj.$destroy(); + } + + vm.feedbackObj = VictoryDeclarationFactory(victoryRef); + vm.feedbackObj.$bindTo($scope, "declaringVictoryFeedback"); + }; + } + + // $scope.giveFeedback = function(exercise) { + // console.log(exercise); + // // $state.transitionTo('club', { clubId: club.id }); + // }; + + // vm.getTableHeight = function () { + // var rowHeight = 33; + // var headerHeight = 33; + // var height = vm.gridOptions.data.length * rowHeight + headerHeight; + // if (height > window.innerHeight) { + // height = window.innerHeight - 250; + // } + // return { + // height: height + "px" + // }; + // }; + + + if (!initParameters()) { + initModal(); + return; + } + + var auth = $firebaseAuth(rootRef); + var dataFromAuth = auth.$getAuth(); + + if (!dataFromAuth) { + auth.$authAnonymously(); + } + + auth.$onAuth(function (authData) { + postAuthConfig(authData, publicChat, PUBLIC_CHAT_ROOM_ID, GET_PARTNER); + + // var VictoryDeclarationGridFactory = $firebaseArray.$extend({ + // // each time an update arrives from the server, apply the change locally + // columnDefs: [ + // { field: 'date', displayName: 'Id' }, + // { field: 'step1', displayName: 'Club Id', visible: false }, + // { field: 'step2', displayName: 'Club Name' }, + // { name: 'select', displayName: 'Select', cellTemplate: ' ' } + // ] + // }); + + var victoryRef = declaringVictoryRef.child(authData.uid); + var victorySyncObj = VictoryDeclarationFactory(victoryRef); + + victorySyncObj.$bindTo($scope, "declaringVictory"); + + // $scope.victoryDeclarations = { + // data: '$firebaseArray(declaringVictoryRef)', + // columnDefs: [ + // {field: 'date', displayName: 'Id'}, + // {field: 'step1', displayName: 'Club Id', visible: false}, + // {field: 'step2', displayName: 'Club Name'}, + // {name: 'select', displayName: 'Select', cellTemplate: ' '} + // ] + // }; + + // $scope.victoryDeclarations = { + // columnDefs: [ + // {field: 'date', displayName: 'Id'}, + // {field: 'step1', displayName: 'Club Id', visible: false}, + // {field: 'step2', displayName: 'Club Name'}, + // {name: 'select', displayName: 'Select', cellTemplate: ' '} + // ] + // }; + + // var vm = this; + + + // vm.gridOptions = { + // columnDefs: [ + // { + // displayName: 'PROS Number', + // field: 'date' + // }, + // { + // displayName: 'MLS Status', + // field: 'step1' + // }, + // { + // displayName: 'Deal Status', + // field: 'step2', + // enableColumnMenu: false, + // enableSorting: false + // } + // ], + // //enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + // flatEntityAccess: true, + // //rowHeight: '33', + // enableGridMenu: true, + // enableFiltering: true, + // onRegisterApi: function (gridApi) { + // vm.gridApi = gridApi; + // } + // }; + + + // //var dataRef = new Firebase('https://itjustwerks.firebaseio.com/data/properties'); // jshint ignore:line + // vm.properties = $firebaseArray(declaringVictoryRef); + // vm.properties.$loaded().then(function() { + // vm.gridOptions.data = vm.properties; + // }); + + + + // $scope.victoryDeclarations = { + // columnDefs: [ + // { field: 'date', displayName: 'Id' }, + // { field: 'step1', displayName: 'Club Id', visible: false }, + // { field: 'step2', displayName: 'Club Name' }, + // { name: 'select', displayName: 'Select', cellTemplate: ' ' } + // ] + // }; + + // var hope = $firebaseArray(declaringVictoryRef); + + // hope.$loaded().then(function () { + // $scope.victoryDeclarations.data = hope; + // }); + + // hope.columnDefs = [ + // {field: 'date', displayName: 'Id'}, + // {field: 'step1', displayName: 'Club Id', visible: false}, + // {field: 'step2', displayName: 'Club Name'}, + // {name: 'select', displayName: 'Select', cellTemplate: ' '} + // ]; + + //$scope.victoryDeclarations = hope; + }); +}]); + +function connectExercisesToFirebase(userId) { + myPMFAssessmentRef = pmfAssessmentRef.child(userId); + + if (isSimpleMode()) { + $('#refreshPMFChartsButton').show(); + + refreshPMFCharts(); + } +} + +function refreshPMFCharts() { + pmfAssessmentRef.once("value", function (data) { + populateChart(data.val()); + }); +} + +function populateChart(model, chartContainer, title) { + var countMap = {}; + var pathMap = {} + + for (value in model) { + var node = model[value]; + + if (countMap[node.currentPhase]) { + countMap[node.currentPhase].data += 1; + } + else { + countMap[node.currentPhase] = { + name: node.currentPhase, + data: 1 + }; + } + + if (pathMap[node.assessmentPath]) { + pathMap[node.assessmentPath].data += 1; + } + else { + pathMap[node.assessmentPath] = { + name: node.assessmentPath, + data: 1 + }; + } + } + + var phases = []; + var phaseCounts = []; + + for (key in Object.keys(countMap)) { + phases.push(countMap[Object.keys(countMap)[key]].name); + phaseCounts.push(countMap[Object.keys(countMap)[key]].data); + } + + var paths = []; + var pathCounts = []; + + for (key in Object.keys(pathMap)) { + paths.push(pathMap[Object.keys(pathMap)[key]].name); + pathCounts.push(pathMap[Object.keys(pathMap)[key]].data); + } + + $('#pmfPhaseChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Current Phase' }, + xAxis: { + categories: phases + }, + series: [{ + data: phaseCounts + }] + }); + + $('#pmfPathChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Popular Paths' }, + xAxis: { + categories: paths + }, + series: [{ + data: pathCounts + }] + }); +} + +function initParameters() { + firstName = getParameterByName('firstName'); + + return firstName != null; +} + +function getAttendees() { + emailsRef.once('value', function (emailsSnap) { + console.log(emailsSnap.numChildren()); + }); +} + +function getEnrollees() { + enrolledRef.once('value', function (enrolledSnap) { + enrolledSnap.forEach(function (snapshot) { + console.log(snapshot.val().email); + }); + }); +} + +function escapeRegExp(str) { + return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); +} + +function replaceAll(str, find, replace) { + if (str && find && replace) { + return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); + } +} + +function getFeedback() { + feedbackRef.once('value', function (feedbackSnap) { + feedbackSnap.forEach(function (snapshot) { + var feedback = snapshot.val(); + console.log(feedback.nps + ",'" + replaceAll(feedback.favorite, "\r\n", " ") + "','" + replaceAll(feedback.improve, "\r\n", " ") + "'"); + }); + }); +} + +function initUI() { + $('.carousel').carousel({ + interval: 5000 + }); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + $("#newPartner").hide(); + $("#newPartner").click(function () { + leavePartnership(); + }); + + $('.meetYourPartnerMe').on("input", function () { + updateMyInfo($(this)); + }); + + keepTabsOnTabs(); + initEnrollForm(); + setupFeedbackForm(); + //setupInterviewScriptGenerator(); + //setupQuizzes(); + + setupiFrames(); + + if (isWebViewerMode()) { + // load video stream + var youTubeIFrame = $('.youtube-iframe'); + youTubeIFrame.attr("src", youTubeIFrame.attr("data-youtube-src")); + } + else { + // get ride of video holder + $('.left-column .top-row').hide(); + $('.left-column .bottom-row').addClass("full-height").removeClass("bottom-row"); + } + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } +} + +function setupTextEditors() { + + tinymce.init({ + selector: '.text-editor', + menubar: false, + plugins: 'autoresize autosave', + autosave_interval: "2s", + setup: function (ed) { + ed.on('init', function () { + this.getDoc().body.style.fontSize = '16px'; + this.getDoc().body.style.fontName = 'Lato'; + // ed.target.editorCommands.execCommand("fontSize", false, "2"); + // ed.target.editorCommands.execCommand("fontName", false, "Lato"); + }); + } + }); +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function () { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function () { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#enrollForm").submit(function (event) { + event.preventDefault(); + + enrolledRef.child(loggedInUserId).set({ email: $('#enrollEmail').val() }); + $('#enrollSuccessAlert').show(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function isWebViewerMode() { + return !isSimpleMode() && document.URL.indexOf("vip.html") == -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + exercisesRef.child("active").update({ exercise: exerciseName }); + }); + + $(".showTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + }); + + $(".hideTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: false }); + }); + + $(".soloTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each(function (index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({ exercise: tabName.replace("Tab", '') }); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function (exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each(function (index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.uid).once('value', function (snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function (snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "That's not your name", + validators: { + notEmpty: { + message: 'We need your name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We can do names between 2 and 20 characters' + } + } + }, + attendeeEmail: { + message: "Hmm, something doesn't look right.", + validators: { + notEmpty: { + message: 'Please enter your email address' + }, + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#welcomeForm").submit(function (event) { + firstName = $("#attendeeName").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function () { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function postAuthConfig(authData, chatUI, roomId, getPartner) { + console.log("Authenticated successfully with payload: ", authData); + + var user = authData; + + loggedInUserId = user.uid; + user.firstName = firstName; + //chatUI.setUser(user.uid, firstName); + //enterRoomAfterUserSessionCreated(chatUI, roomId); + + connectExercisesToFirebase(loggedInUserId); + + emailsRef.child(loggedInUserId).set({ name: firstName }); + + setupTextEditors(); + + if (getPartner) { + searchForPartner(user); + } + + authUserName = firstName; + fbid = user.uid; + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestion; + + allQuestionsSnapshot.forEach(function (snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
        • "); + var divmediabody = $("
          "); + var divmedia = $("
          "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = + "Top | " + + "Middle | " + + "" + answerText + " | " + + "" + hideText + ""; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 0; + var votesElement = "" + voteLink + ": " + voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
          "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
          " + userNameElement + "
          " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestion = questionElement; + divmediabody2.addClass('bg-warning'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-info'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-primary'); + } + else { + divmediabody2.addClass('this-class-does-not-exist'); + } + + questionList.prepend(questionElement); + } + }); + + questionList.prepend(activeQuestion); + }); +} + +function logInToChat(ref, chatUI, roomId, getPartner) { + var dataFromAuth = ref.getAuth(); + + if (dataFromAuth) { + postAuthConfig(dataFromAuth, chatUI, roomId, getPartner); + return; + } + + ref.authAnonymously(function (error, authData) { + if (error) { + console.log("Login Failed!", error); + return; + } + + postAuthConfig(authData, chatUI, roomId, getPartner); + + }); +} + +// var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { +// if (user) { +// loggedInUserId = user.uid; +// +// user.firstName = firstName; +// chatUI.setUser(user.uid, firstName); +// +// if (roomId != null) { +// setTimeout(function() { +// console.log("About to enter room. User: " + JSON.stringify(user) + ". Room: " + roomId); +// chatUI._chat.enterRoom(roomId); +// }, 500); +// } +// +// if (getPartner) { +// searchForPartner(user); +// } +// +// authUserName = firstName; +// fbid = user.uid; +// +// // simple should see all of the questions, everyone else should only see the unhidden ones +// var startAtNum = isSimpleMode() ? -1000000 : 1; +// +// // Add a callback that is triggered for each chat question. +// questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { +// questionList.empty(); +// +// var activeQuestion; +// +// allQuestionsSnapshot.forEach(function(snapshot) { +// +// //GET DATA +// var questionId = snapshot.key(); +// var data = snapshot.val(); +// var fbid_d = data.fbid; +// var username_d = data.name; +// var question_d = data.text; +// var date_d = data.currentdate; +// var votes_d = data.votes; +// +// divdir = ""; +// +// //CREATE ELEMENTS question & SANITIZE TEXT +// var questionElement = $("
        • "); +// var divmediabody = $("
          "); +// var divmedia = $("
          "); +// +// var voteLink; +// var userAskedQuestion = fbid_d == fbid; +// +// if (isSimpleMode()) { +// var answerText = data.isActive ? "Unanswer" : "Answer"; +// var hideText = data.votes <= 0 ? "Show" : "Hide"; +// +// voteLink = "" + answerText + " " + hideText + ""; +// } +// else if (userAskedQuestion) { +// // This user submitted the question +// voteLink = "Delete"; +// } +// else { +// var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; +// voteLink = "" + voteText + ""; +// } +// +// var voteCount = data.votes ? data.votes : 1; +// var votesElement = "" + voteLink + ": "+ voteCount + ""; +// var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; +// var dateElement = " " + date_d + ""; +// +// var divmediabody2 = $("
          "); +// questionElement.append(divmediabody); +// divmediabody.append(divmedia); +// //divmedia.append(a); +// //divmedia.append(votesElement); +// divmedia.append(divmediabody2); +// +// var usernamediv = $(""); +// divmediabody2.html(question_d); +// +// divmediabody2.append(usernamediv); +// usernamediv.html("
          " + userNameElement + "
          " + votesElement); +// +// //ADD question +// if (data.isActive) { +// activeQuestion = questionElement; +// divmediabody2.addClass('bg-danger'); +// } +// else { +// if (userAskedQuestion) { +// divmediabody2.addClass('bg-success'); +// // divmediabody2.css('background', "#476982"); +// // usernamediv.css('color', "#CCC") +// } +// else if (data.votes > 0) { +// // divmediabody2.css('background', "#73B3D7"); +// divmediabody2.addClass('bg-info'); +// } +// else { +// divmediabody2.addClass('bg-warning'); +// } +// +// questionList.prepend(questionElement); +// } +// }); +// +// questionList.prepend(activeQuestion); +// }); +// +// } else { +// simpleLogin.login('anonymous', { +// rememberMe: true +// }); +// } +// }); +// } + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


          You'll see what your partner types, as she/he does.


          Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


          (Delete this too :)" : ""); + + questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
           
          Note: your partner will be able to see your text as you type it.
           
          Try editing this text!
           
           
          2. Secretly pick a company below to pitch:
           

          • AirBnB
          • Pampers (diapers)
          • Twitter
          • Facebook
          • Subway (sandwiches)
          • Instagram
          • Disney
          • SnapChat
          • Angry Birds (Rovio)
          • RedBull
           
          3. Fill out the pitch template for the company you're pitching:
           
          - Problem:
           
           
           
          - Solution:
           
           
           
          - Market:
           
           
           
          - Business Model:
           
           
           
          -------------------------------------------------------
           
          4. Guess which company your partner is pitching:
           
           
           
          5. Which elements of your partner's pitch could be improved? 
           
           
          " : ""); + responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
           
          Note: your partner will be able to see your text as you type it.
           
          Try editing this text!
           
           
          2. Secretly pick a company below to pitch:
           
          • AirBnB
          • Pampers (diapers)
          • Twitter
          • Facebook
          • Subway (sandwiches)
          • Instagram
          • Disney
          • SnapChat
          • Angry Birds (Rovio)
          • RedBull
           
          3. Fill out the pitch template for the company you're pitching:
           
          - Problem:
           
           
           
          - Solution:
           
           
           
          - Market:
           
           
           
          - Business Model:
           
           
           
          -------------------------------------------------------
           
          4. Guess which company your partner is pitching:
           
           
           
          5. Which elements of your partner's pitch could be improved? 
           
           
          " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(useruser.uid, ""); + + attendeesRef.child(user.uid).update(user); + + leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + $("#partnerName").html("Your partner isn't available. Let's find another for you!"); + + return; + } + else if (part.room != null) { + console.log("Entering our partner chat room: " + part.room); + publicChat._chat.enterRoom(part.room); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.uid).update(user); + } + }); + + soloRef.off('child_changed'); + + // intro partners + $("#partnerName").html("Say hi to your workshop partner, !"); + $('.partnerName').text(user.partnerName); + $("#newPartner").show(); + + getMeetYourPartnerUpdates(user); +} + +function lookingForPartnerUI() { + $("#partnerName").html("Looking for a partner for you..."); + $("#newPartner").hide(); +} + +function joinSoloList(user) { + soloRef.child(user.uid).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.uid; + user.responsesPad = "r-" + user.uid; + + // store my pad addresses + attendeesRef.child(user.uid).update(user); + + //loadFirepads(user, true); + + soloRef.on('child_changed', function (soloSnap) { + var solo = soloSnap.val(); + + if (solo.id != user.uid) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + soloRef.child(user.uid).remove(function (error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function (roomId) { + console.log('Created our partnership chat room'); + partnershipsRef.child(solo.partnership).set({ "room": roomId }); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + }); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function (solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function (soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.id == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.id).transaction(function (currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.uid.localeCompare(solo.id) < 0) { + partnership = user.uid + solo.id; + } + else { + partnership = solo.id + user.uid; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.id; + user.responsesPad = "r-" + solo.id; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function () { confirmPartnershipAccepted(user) }, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.uid, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function (error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + //loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.uid).transaction(function (currentData) { + + // Always return null because we want off this list + return null; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.uid).once('value', function (attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.uid).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + console.log("My user id is: " + user.uid); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership() { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + searchForSolos(user); + } + else { + console.log("This user is requesting to leave partnership."); + lookingForPartnerUI(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function (error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(true); + } + }); + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + leavePrivateChatRooms(); + clearPartnerFromUser(user); + unloadFirepads(); + + attendeesRef.child(user.uid).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +const DEFAULT_QUESTION_VOTES = 0; +const MIDDLE_OF_LIST_VOTES = 50; +const TOP_OF_LIST_VOTES = 100; + +$(document).ready(function () { + initUI(); +}); + +function toggleQuestionVisibility(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function (question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (question.votes == 0) { + question.votes = 1; + } + else { + question.votes = question.votes * -1; + question.isActive = 0; + } + + return question; + }); +} + +function moveQuestionToMiddle(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: MIDDLE_OF_LIST_VOTES }); +} + +function moveQuestionToTop(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: TOP_OF_LIST_VOTES }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + if (lastQuestionAnswered) { + questionsRef.child(lastQuestionAnswered).update({ isActive: false }); + } + + lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false }); + + lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function (confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function (currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null) { + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: DEFAULT_QUESTION_VOTES }); + + $("#question-txt").val(''); + +} diff --git a/comingSoon/css/font-awesome.min.css b/comingSoon/css/font-awesome.min.css new file mode 100644 index 0000000..24fcc04 --- /dev/null +++ b/comingSoon/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.3.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.3.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.3.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.3.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.3.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transform:translate(0, 0)}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-genderless:before,.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"} \ No newline at end of file diff --git a/comingSoon/css/ie.css b/comingSoon/css/ie.css new file mode 100644 index 0000000..e160cf9 --- /dev/null +++ b/comingSoon/css/ie.css @@ -0,0 +1,84 @@ +.contact a.mail:hover { + text-decoration: underline; +} + + +.contact .icons li a:hover { + border-bottom: 5px solid transparent; +} + +/* HERO */ +h1 { font-size: 120px; line-height: 120px; } +.sub-title { font-size: 20px; line-height: 20px; margin-top: 20px; } +/* TITLE & CONTACT */ +.title { top: 15%;} +.contact { bottom: 8%; } +.contact .icons { margin-bottom: 12px; } +/* SIZES */ +.sphere img{ + -webkit-transform: scale(1); + -moz-transform: scale(1); + transform: scale(1); +} +.depth-5 img, .depth-4 img, .depth-3 img, .depth-2 img, .depth-1 img { + -webkit-transform: scale(0.8); + -moz-transform: scale(0.8); + transform: scale(0.8); +} +/* POSITIONING */ +.depth-5 { + right: -25%; + top: 3%; +} + +.depth-4 { + left: -3%; + top: 15%; + } + +.depth-3.flake1 { + display: none; +} + +.depth-3.flake2 { + right: 25%; + bottom: 25%; +} + +.depth-3.flake3 { + left: 20%; + bottom: 20%; +} + +.depth-3.flake4 { + display: block; + position: absolute; + left: 10%; + bottom: 40%; +} + +.depth-2.flake1 { + display: none; +} + +.depth-2.flake2 { + display: none; +} + +.depth-1.flake1 { + display: none; +} + +.depth-1.flake2 { + display: block; + left: 15%; + top: 25%; +} + +.depth-1.flake3 { + display: none; +} + +.depth-1.flake4 { + display: none; +} \ No newline at end of file diff --git a/comingSoon/css/loader.css b/comingSoon/css/loader.css new file mode 100644 index 0000000..6cb652b --- /dev/null +++ b/comingSoon/css/loader.css @@ -0,0 +1,66 @@ +/* =Loader +-------------------------------------------------------------- */ + +.preloader { + display: block; + position: fixed; + width: 100%; + height: 100%; + z-index: 9999; + background: white; + text-align: center; +} +.loading { + overflow: hidden; + position: absolute; + top: 50%; + margin-top: -12px; + left: 50%; + margin-left: -50px; + width: 100px; + height: 24px; +} + +.progress { + display: block; + position: absolute; + bottom: 0; + overflow: hidden; + width: 100px; + height: 1px; + left: -102px; + background-color: #00d9ec; + -webkit-animation: loader-anim 1s 0s infinite cubic-bezier(0.785, 0.135, 0.15, 0.86); + -moz-animation: loader-anim 1s 0s infinite cubic-bezier(0.785, 0.135, 0.15, 0.86); + animation: loader-anim 1s 0s infinite cubic-bezier(0.785, 0.135, 0.15, 0.86) +} + +@-webkit-keyframes loader-anim { + 0% { + left: -102px + } + + 100% { + left: 102px + } +} + +@-moz-keyframes loader-anim { + 0% { + left: -102px + } + + 100% { + left: 102px + } +} + +@keyframes loader-anim { + 0% { + left: -102px + } + + 100% { + left: 102px + } +} \ No newline at end of file diff --git a/comingSoon/css/normalize.css b/comingSoon/css/normalize.css new file mode 100644 index 0000000..ae8bc83 --- /dev/null +++ b/comingSoon/css/normalize.css @@ -0,0 +1,425 @@ +/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} \ No newline at end of file diff --git a/comingSoon/css/style.css b/comingSoon/css/style.css new file mode 100644 index 0000000..95fc231 --- /dev/null +++ b/comingSoon/css/style.css @@ -0,0 +1,1038 @@ +/* +Imminent - Coming Soon Template by Themewagon +Version: 1.0 +Author: ThemeWagon +Author URI: http://www.themewagon.com +*/ + + +/* =Common Styles +-------------------------------------------------------------- */ + +*, +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +html { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} + +img { + vertical-align: middle; + max-width: 100%; + height: auto; +} + +body { + background: #fff; + color: #666666; + font-family: 'Roboto', sans-serif; + -webkit-font-smoothing: antialiased; + -webkit-text-size-adjust: 100%; +} + +section { overflow: hidden; } +::selection { background: #161a1b; color: #fff; } +::-moz-selection { background: #161a1b; color: #fff; } + + +/* =Typography +-------------------------------------------------------------- */ +a { + text-decoration: none; +} + +h1, h2 { margin: 0; } + +h1 { + font-size: 80px; + font-weight: 800; + line-height: 80px; + letter-spacing: -0.08em; + color: #161a1b; +} + +h2 { + font-size: 18px; + font-weight: 800; + line-height: 1em; + letter-spacing: 0.2em; + text-transform: uppercase; + color: #161a1b; +} + +#countdown div span { + display:block; + font-size: 50px; + line-height: 50px; + letter-spacing: initial; + font-weight: 100; + text-transform: uppercase; +} + +#countdown div { + display:inline-block; + margin: 0 34px; +} + +.sub-title { + font-size: 18px; + margin-top: 5px; + margin-bottom: 0px; +} + + +/* =Content Styles +-------------------------------------------------------------- */ + +.wrapper { + text-align: center; + position: absolute; + overflow: hidden; + display: table-cell; + height: 100%; + width: 100%; + left: 0; + top: 0; +} + +.scene, +.layer { + display: block; + height: 100%; + width: 100%; + padding: 0; + margin: 0; +} + +.scene { + position: relative; + overflow: hidden; +} + +.layer { position: absolute; } + +.layer div { + -webkit-transform: translate3d(0,0,0); + -moz-transform: translate3d(0,0,0); + transform: translate3d(0,0,0); + -webkit-transform-style: preserve-3d; + -moz-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + backface-visibility: hidden; +} + + +/* Background */ +.background { + background: url(../images/background.jpg) no-repeat 50% 100%; + bottom: -20px; + background-size: cover; + position: absolute; + width: 110%; + left: -5%; + top: -5%; +} + + +.sphere img{ + -webkit-transform: scale(0.7); + -moz-transform: scale(0.7); + -ms-transform: scale(0.7,0.7); + transform: scale(0.7); +} + +/* Text */ +.title { + display: block; + text-align: center; + width: 100%; + position: absolute; + z-index: 2; + top: 10%; +} + +.line { + display: block; + margin: 0 auto; + width: 60px; + height: 1px; + background: #00d9ec; + margin-top: 10px; +} + +.contact { + display: block; + width: 100%; + position: absolute; + z-index: 2; + text-align: center; + bottom: 5%; +} + +.contact .icons { + margin: 0; + padding: 0; + margin-bottom: 18px; + text-align: center; + list-style: none; + list-style-type: none; +} + +.contact .icons li { + display: inline-block; + margin-right: 10px; +} + +.contact .icons li:last-of-type { margin-right: 0px; } + +.contact .icons li a { + display: block; + width: 25px; + height: 25px; + opacity: .5; + -webkit-transition: opacity 0.3s; + -moz-transition: opacity 0.3s; + transition: opacity 0.3s; + color: black; + font-size: 24px; +} + + +.contact .icons li a:hover { + opacity: 1; + -webkit-transition: opacity 0.3s; + -moz-transition: opacity 0.3s; + transition: opacity 0.3s; +} + +.contact a.mail { + text-decoration: none; + color: #161a1b; + padding-bottom: 8px; + font-size: 15px; +} + +.contact a.mail::after { + position: absolute; + top: 100%; + left: 50%; + width: 125px; + margin-left: -60px; + margin-top: 10px; + height: 1px; + background: #666666; + content: ''; + opacity: 0; + -webkit-transition: opacity 0.3s, -webkit-transform 0.3s; + -moz-transition: opacity 0.3s, -moz-transform 0.3s; + transition: opacity 0.3s, transform 0.3s; + -webkit-transform: translateY(10px); + -moz-transform: translateY(10px); + transform: translateY(10px); +} + +.contact a.mail:hover::after, .contact a.mail:focus::after { + opacity: 1; + -webkit-transform: translateY(0px); + -moz-transform: translateY(0px); + transform: translateY(0px); +} + +/* Flakes Sizing */ +.depth-5 img, .depth-4 img, .depth-3 img, .depth-2 img, .depth-1 img { + -webkit-transform: scale(0.6); + -moz-transform: scale(0.6); + -ms-transform: scale(0.6,0.6); + transform: scale(0.6); +} + +/* Flakes Positioning */ +.depth-5 { + position: absolute; + right: -100%; + top: -24%; +} + +.depth-4 { + position: absolute; + left: -10%; + top: 37%; + } + +.depth-3.flake1 { + display: none; +} + +.depth-3.flake2 { + position: absolute; + right: 16%; + bottom: 20%; +} + +.depth-3.flake3 { + position: absolute; + left: 10%; + bottom: 16%; +} + +.depth-3.flake4 { + display: none; +} + +.depth-2.flake1 { + display: none; +} + +.depth-2.flake2 { + display: none; +} + +.depth-1.flake1 { + display: none; +} + +.depth-1.flake2 { + position: absolute; + right: 40%; + top: 50%; +} + +.depth-1.flake3 { + display: none; +} + +.depth-1.flake4 { + position: absolute; + right: 0; + top: 0; +} + + +/* =Responsive Styles +-------------------------------------------------------------- */ + +@media (max-width: 320px) { + /* HERO */ + h1 { font-size: 40px; line-height: 40px; } + #countdown div span {font-size: 24px; line-height: 34px;} + .sub-title { font-size: ; line-height: ; margin-top: 10px; } + /* TITLE & CONTACT */ + .title { top: 15%;} + .contact .icons { margin-bottom: 0px; } + /* SIZES */ + .sphere img{ + -webkit-transform: scale(0.6); + -moz-transform: scale(0.6); + -ms-transform: scale(0.6,0.6); + transform: scale(0.6); + } + /* POSITIONING */ + .depth-5 { + position: absolute; + right: -50%; + top: -50%; + } + + .depth-4 { + left: -4%; + top: 20%; + } + + .depth-3.flake1 { + display: none; + } + + .depth-3.flake2 { + position: absolute; + right: 16%; + bottom: 20%; + } + + .depth-3.flake3 { + position: absolute; + left: 10%; + bottom: 16%; + } + + .depth-3.flake4 { + display: none; + } + + .depth-2.flake1 { + display: none; + } + + .depth-2.flake2 { + display: none; + } + + .depth-1.flake1 { + display: none; + } + + .depth-1.flake2 { + position: absolute; + right: 40%; + top: 40%; + } + + .depth-1.flake3 { + display: none; + } + + .depth-1.flake4 { + position: absolute; + right: 0; + top: 0; + } +} + + +/* Landscape Phone */ +@media all and (min-width: 400px) { + /* HERO */ + h1 { font-size: 40px; line-height: 40px; } + #countdown div span {font-size: 24px; line-height: 34px;} + .sub-title { font-size: ; line-height: ; margin-top: 10px; } + /* TITLE & CONTACT */ + .title { top: 15%;} + .contact .icons { margin-bottom: 0px; } + /* SIZES */ + .sphere img{ + -webkit-transform: scale(0.6); + -moz-transform: scale(0.6); + -ms-transform: scale(0.6,0.6); + transform: scale(0.6); + } + /* POSITIONING */ + .depth-5 { + position: absolute; + right: -50%; + top: -50%; + } + + .depth-4 { + left: -4%; + top: 20%; + } + + .depth-3.flake1 { + display: none; + } + + .depth-3.flake2 { + position: absolute; + right: 16%; + bottom: 20%; + } + + .depth-3.flake3 { + position: absolute; + left: 10%; + bottom: 16%; + } + + .depth-3.flake4 { + display: none; + } + + .depth-2.flake1 { + display: none; + } + + .depth-2.flake2 { + display: none; + } + + .depth-1.flake1 { + display: none; + } + + .depth-1.flake2 { + position: absolute; + right: 40%; + top: 40%; + } + + .depth-1.flake3 { + display: none; + } + + .depth-1.flake4 { + position: absolute; + right: 0; + top: 0; + } +} + +/* Tablet Portrait */ +@media all and (min-width: 700px) { + /* HERO */ + h1 { font-size: 90px; line-height: 90px; } + .sub-title { font-size: 20px; line-height: 20px; margin-top: 10px; } + /* TITLE & CONTACT */ + .title { top: 18%;} + .line { margin-top: 20px; } + .contact { bottom: 10%; } + .contact .icons { margin-bottom: 12px; } + /* SIZES */ + .sphere img{ + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1,1); + transform: scale(1); + } + .depth-5 img, .depth-4 img, .depth-3 img, .depth-2 img, .depth-1 img { + -webkit-transform: scale(0.8); + -moz-transform: scale(0.8); + -ms-transform: scale(0.8,0.8); + transform: scale(0.8); + } + /* POSITIONING */ + .depth-5 { + right: -25%; + top: 3%; + } + + .depth-4 { + left: -3%; + top: 15%; + } + + .depth-3.flake1 { + display: none; + } + + .depth-3.flake2 { + right: 25%; + bottom: 25%; + } + + .depth-3.flake3 { + left: 20%; + bottom: 20%; + } + + .depth-3.flake4 { + display: block; + position: absolute; + left: 10%; + bottom: 40%; + } + + .depth-2.flake1 { + display: none; + } + + .depth-2.flake2 { + display: none; + } + + .depth-1.flake1 { + display: none; + } + + .depth-1.flake2 { + display: block; + left: 15%; + top: 25%; + } + + .depth-1.flake3 { + display: none; + } + + .depth-1.flake4 { + display: none; + } + +} + +@media all and (min-width: 900px) { + /* HERO */ + h1 { font-size: 120px; line-height: 120px; } + + #countdown div span {font-size: 34px; line-height: 34px;} + + .sub-title { font-size: 20px; line-height: 20px; margin-top: 20px; } + /* TITLE & CONTACT */ + .title { top: 15%;} + .contact { bottom: 8%; } + .contact .icons { margin-bottom: 12px; } + /* SIZES */ + .sphere img{ + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1,1); + transform: scale(1); + } + .depth-5 img, .depth-4 img, .depth-3 img, .depth-2 img, .depth-1 img { + -webkit-transform: scale(0.8); + -moz-transform: scale(0.8); + -ms-transform: scale(0.8,0.8); + transform: scale(0.8); + } + /* POSITIONING */ + .depth-5 { + right: -25%; + top: 3%; + } + + .depth-4 { + left: -3%; + top: 15%; + } + + .depth-3.flake1 { + display: none; + } + + .depth-3.flake2 { + right: 25%; + bottom: 25%; + } + + .depth-3.flake3 { + left: 20%; + bottom: 20%; + } + + .depth-3.flake4 { + display: block; + position: absolute; + left: 10%; + bottom: 40%; + } + + .depth-2.flake1 { + display: none; + } + + .depth-2.flake2 { + display: none; + } + + .depth-1.flake1 { + display: none; + } + + .depth-1.flake2 { + display: block; + left: 15%; + top: 25%; + } + + .depth-1.flake3 { + display: none; + } + + .depth-1.flake4 { + display: none; + } +} + +@media all and (min-width: 1200px) { + /* HERO */ + h1 { font-size: 150px; line-height: 150px; } + #countdown div span {font-size: 44px; line-height: 44px;} + .sub-title { font-size: 25px; line-height: 25px; margin-top: 20px; } + /* SIZES */ + .sphere img{ + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1,1); + transform: scale(1); + } + .depth-5 img, .depth-4 img, .depth-3 img, .depth-2 img, .depth-1 img { + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1,1); + transform: scale(1); + } + /* POSITIONING */ + .depth-5 { + right: -10%; + top: -10%; + -webkit-animation: wave 9s 0.1s infinite linear; + -moz-animation: wave 9s 0.1s infinite linear; + animation: wave 9s 0.1s infinite linear; + } + + .depth-4 { + left: -3%; + top: 15%; + -webkit-animation: wave 7s 0.1s infinite linear; + -moz-animation: wave 7s 0.1s infinite linear; + animation: wave 7s 0.1s infinite linear; + } + + + .depth-3 { + -webkit-animation: wave 6s 0.1s infinite linear; + -moz-animation: wave 6s 0.1s infinite linear; + animation: wave 6s 0.1s infinite linear; + } + + .depth-3.flake1 { + display: block; + position: absolute; + left: 20%; + top: 40%; + } + + .depth-3.flake2 { + right: 25%; + bottom: 25%; + } + + .depth-3.flake3 { + left: 20%; + bottom: 20%; + } + + .depth-3.flake4 { + display: block; + position: absolute; + left: 10%; + bottom: 40%; + } + + .depth-2 { + -webkit-animation: wave 5s 0.1s infinite linear; + -moz-animation: wave 5s 0.1s infinite linear; + animation: wave 5s 0.1s infinite linear; + } + + .depth-2.flake1 { + display: block; + position: absolute; + right: 40%; + top: 40%; + } + + .depth-2.flake2 { + display: none; + } + + .depth-1 { + -webkit-animation: wave 4s 0.1s infinite linear; + -moz-animation: wave 4s 0.1s infinite linear; + animation: wave 4s 0.1s infinite linear; + } + + .depth-1.flake1 { + display: block; + position: absolute; + left: 30%; + bottom: 20%; + } + + .depth-1.flake2 { + display: block; + left: 15%; + top: 25%; + } + + .depth-1.flake3 { + display: none; + } + + .depth-1.flake4 { + display: none; + } +} + +@media all and (min-width: 1400px) { + /* HERO */ + h1 { font-size: 160px; line-height: 160px; } + .sub-title { font-size: 25px; line-height: 25px; margin-top: 20px; } + /* POSITIONING */ + .depth-5 { + right: -10%; + top: -5%; + } + + .depth-4 { + left: -3%; + top: 15%; + } + + .depth-3.flake1 { + display: block; + position: absolute; + left: 20%; + top: 40%; + } + + .depth-3.flake2 { + right: 25%; + bottom: 25%; + } + + .depth-3.flake3 { + left: 40%; + bottom: 20%; + } + + .depth-3.flake4 { + display: block; + position: absolute; + left: 10%; + bottom: 40%; + } + + .depth-2.flake1 { + display: block; + position: absolute; + right: 40%; + top: 40%; + } + + .depth-2.flake2 { + display: none; + } + + .depth-1.flake1 { + display: block; + position: absolute; + left: 30%; + bottom: 30%; + } + + .depth-1.flake2 { + display: block; + left: 15%; + top: 25%; + } + + .depth-1.flake3 { + display: block; + position: absolute; + bottom: 20%; + right: 40%; + } + + .depth-1.flake4 { + display: block; + right: 40%; + top: 25%; + } +} + +@media all and (min-width: 1600px) { + /* HERO */ + h1 { font-size: 180px; line-height: 180px; } + #countdown div span {font-size: 54px; line-height: 54px;} + .sub-title { font-size: 25px; line-height: 25px; margin-top: 25px; } +} + + +@media all and (min-width: 1920px) { + /* HERO */ + h1 { font-size: 200px; line-height: 200px; } + .sub-title { font-size: 30px; line-height: 30px; margin-top: 30px; } + /* POSITIONING */ + .depth-5 { + right: -10%; + top: 5%; + } + + .depth-4 { + left: 3%; + top: 15%; + } + + .depth-3.flake1 { + display: block; + position: absolute; + left: 20%; + top: 40%; + } + + .depth-3.flake2 { + right: 25%; + bottom: 25%; + } + + .depth-3.flake3 { + left: 40%; + bottom: 20%; + } + + .depth-3.flake4 { + display: block; + position: absolute; + left: 10%; + bottom: 40%; + } + + .depth-2.flake1 { + display: block; + position: absolute; + right: 40%; + top: 40%; + } + + .depth-2.flake2 { + display: none; + } + + .depth-1.flake1 { + display: block; + position: absolute; + left: 30%; + bottom: 30%; + } + + .depth-1.flake2 { + display: block; + left: 20%; + top: 30%; + } + + .depth-1.flake3 { + display: block; + position: absolute; + bottom: 30%; + right: 40%; + } + + .depth-1.flake4 { + display: block; + right: 40%; + top: 25%; + } +} + +/* =Animation +-------------------------------------------------------------- */ + +@-webkit-keyframes wave { + 0% { + -webkit-transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + -moz-transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + } + + 100% { + -webkit-transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + -moz-transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + } +} + +@-moz-keyframes wave { + 0% { + -webkit-transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + -moz-transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + } + + 100% { + -webkit-transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + -moz-transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + } +} + +@-ms-keyframes wave { + 0% { + -webkit-transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + -moz-transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + } + + 100% { + -webkit-transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + -moz-transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + } +} + +@keyframes wave { + 0% { + -webkit-transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + -moz-transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + transform: rotateZ(0deg) translate3d(0,10%,0) rotateZ(0deg); + } + + 100% { + -webkit-transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + -moz-transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + transform: rotateZ(360deg) translate3d(0,10%,0) rotateZ(-360deg); + } +} + + +/* =404 +-------------------------------------------------------------- */ + +.snap { + display: block; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: url(../images/404-background.jpg) no-repeat center; + background-size: cover; + text-align: center; +} + +.snap .line { margin-bottom: 70px; } + +.button { + display: inline-block; + margin-top: 80px; + text-decoration: none; + font-size: 9px; + font-weight: 700; + line-height: 1em; + letter-spacing: 0.2em; + text-transform: uppercase; + color: #161a1b; + background: transparent; + border: 1px solid rgb(23,26,28); + border: 1px solid rgba(23,26,28,.3); + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 4px; + padding: 15px 25px; + -webkit-transition: all 0.3s; + -moz-transition: all 0.3s; + transition: all 0.3s; +} + +.button:hover { + background: rgb(23,26,28); + color: #fff; + border: 1px solid rgb(23,26,28); + -webkit-transition: all 0.3s; + -moz-transition: all 0.3s; + transition: all 0.3s; +} + + +@media all and (min-width: 700px) { + .button { + font-size: 12px; + border-radius: 10px; + padding: 25px 45px; + } +} diff --git a/comingSoon/fonts/FontAwesome.otf b/comingSoon/fonts/FontAwesome.otf new file mode 100644 index 0000000..f7936cc Binary files /dev/null and b/comingSoon/fonts/FontAwesome.otf differ diff --git a/comingSoon/fonts/fontawesome-webfont.eot b/comingSoon/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..33b2bb8 Binary files /dev/null and b/comingSoon/fonts/fontawesome-webfont.eot differ diff --git a/comingSoon/fonts/fontawesome-webfont.svg b/comingSoon/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000..1ee89d4 --- /dev/null +++ b/comingSoon/fonts/fontawesome-webfont.svg @@ -0,0 +1,565 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/comingSoon/fonts/fontawesome-webfont.ttf b/comingSoon/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..ed9372f Binary files /dev/null and b/comingSoon/fonts/fontawesome-webfont.ttf differ diff --git a/comingSoon/fonts/fontawesome-webfont.woff b/comingSoon/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..8b280b9 Binary files /dev/null and b/comingSoon/fonts/fontawesome-webfont.woff differ diff --git a/comingSoon/fonts/fontawesome-webfont.woff2 b/comingSoon/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000..3311d58 Binary files /dev/null and b/comingSoon/fonts/fontawesome-webfont.woff2 differ diff --git a/comingSoon/images/background.jpg b/comingSoon/images/background.jpg new file mode 100644 index 0000000..29125ea Binary files /dev/null and b/comingSoon/images/background.jpg differ diff --git a/comingSoon/images/clouds/cloud-01.png b/comingSoon/images/clouds/cloud-01.png new file mode 100644 index 0000000..9690b15 Binary files /dev/null and b/comingSoon/images/clouds/cloud-01.png differ diff --git a/comingSoon/images/clouds/cloud-02.png b/comingSoon/images/clouds/cloud-02.png new file mode 100644 index 0000000..d167b24 Binary files /dev/null and b/comingSoon/images/clouds/cloud-02.png differ diff --git a/comingSoon/images/flakes/depth1/flakes1.png b/comingSoon/images/flakes/depth1/flakes1.png new file mode 100644 index 0000000..5f8a46c Binary files /dev/null and b/comingSoon/images/flakes/depth1/flakes1.png differ diff --git a/comingSoon/images/flakes/depth1/flakes2.png b/comingSoon/images/flakes/depth1/flakes2.png new file mode 100644 index 0000000..fa65fdb Binary files /dev/null and b/comingSoon/images/flakes/depth1/flakes2.png differ diff --git a/comingSoon/images/flakes/depth1/flakes3.png b/comingSoon/images/flakes/depth1/flakes3.png new file mode 100644 index 0000000..e7cfef8 Binary files /dev/null and b/comingSoon/images/flakes/depth1/flakes3.png differ diff --git a/comingSoon/images/flakes/depth1/flakes4.png b/comingSoon/images/flakes/depth1/flakes4.png new file mode 100644 index 0000000..21c3ca8 Binary files /dev/null and b/comingSoon/images/flakes/depth1/flakes4.png differ diff --git a/comingSoon/images/flakes/depth2/flakes1.png b/comingSoon/images/flakes/depth2/flakes1.png new file mode 100644 index 0000000..9690b15 Binary files /dev/null and b/comingSoon/images/flakes/depth2/flakes1.png differ diff --git a/comingSoon/images/flakes/depth2/flakes2.png b/comingSoon/images/flakes/depth2/flakes2.png new file mode 100644 index 0000000..aa33962 Binary files /dev/null and b/comingSoon/images/flakes/depth2/flakes2.png differ diff --git a/comingSoon/images/flakes/depth3/flakes1.png b/comingSoon/images/flakes/depth3/flakes1.png new file mode 100644 index 0000000..3de3db8 Binary files /dev/null and b/comingSoon/images/flakes/depth3/flakes1.png differ diff --git a/comingSoon/images/flakes/depth3/flakes2.png b/comingSoon/images/flakes/depth3/flakes2.png new file mode 100644 index 0000000..72f2e54 Binary files /dev/null and b/comingSoon/images/flakes/depth3/flakes2.png differ diff --git a/comingSoon/images/flakes/depth3/flakes3.png b/comingSoon/images/flakes/depth3/flakes3.png new file mode 100644 index 0000000..72b1304 Binary files /dev/null and b/comingSoon/images/flakes/depth3/flakes3.png differ diff --git a/comingSoon/images/flakes/depth3/flakes4.png b/comingSoon/images/flakes/depth3/flakes4.png new file mode 100644 index 0000000..ddb4c8a Binary files /dev/null and b/comingSoon/images/flakes/depth3/flakes4.png differ diff --git a/comingSoon/images/flakes/depth4/flakes.png b/comingSoon/images/flakes/depth4/flakes.png new file mode 100644 index 0000000..d167b24 Binary files /dev/null and b/comingSoon/images/flakes/depth4/flakes.png differ diff --git a/comingSoon/images/flakes/depth5/flakes.png b/comingSoon/images/flakes/depth5/flakes.png new file mode 100644 index 0000000..9690b15 Binary files /dev/null and b/comingSoon/images/flakes/depth5/flakes.png differ diff --git a/comingSoon/images/sphere.png b/comingSoon/images/sphere.png new file mode 100644 index 0000000..add6dfe Binary files /dev/null and b/comingSoon/images/sphere.png differ diff --git a/comingSoon/index.html b/comingSoon/index.html new file mode 100644 index 0000000..247e570 --- /dev/null +++ b/comingSoon/index.html @@ -0,0 +1,160 @@ + + + + + + + + + + Starting Soon... + + + + + + + + + + + + + + + + + + + + + + + + +
          +
          +

          + Loading... +

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

            + Teaching Customer Interviews +

            +

            + starts in +

            + +
            +
          • + + + +
          • +
            +

            + Feb. 1st at 10 am Pacific Time +

            + +

            + Feb. 1st at 10 am Pacific Time +

            +
            +
          • + + +
          • +
            + flake +
            + +
            + flake +
            + +
            + flake +
            + +
            + flake +
            +
          • + +
          • +
            + flake +
            + +
            + flake +
            +
          • + +
          • +
            + flake +
            + +
            + flake +
            + +
            + flake +
            + +
            + flake +
            +
          • + +
          • +
            + flake +
            +
          • + +
          • +
            + flake +
            +
          • + +
          +
          + + + + + + + + + \ No newline at end of file diff --git a/comingSoon/js/jquery.countdown.min.js b/comingSoon/js/jquery.countdown.min.js new file mode 100644 index 0000000..61d163f --- /dev/null +++ b/comingSoon/js/jquery.countdown.min.js @@ -0,0 +1 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.Countdown=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);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=365.25*86400){dateData.years=Math.floor(diff/(365.25*86400));diff-=dateData.years*365.25*86400}if(diff>=86400){dateData.days=Math.floor(diff/86400);diff-=dateData.days*86400}if(diff>=3600){dateData.hours=Math.floor(diff/3600);diff-=dateData.hours*3600}if(diff>=60){dateData.min=Math.floor(diff/60);diff-=dateData.min*60}dateData.sec=Math.round(diff);dateData.millisec=diff%1*1e3;return dateData}.bind(this);this.leadingZeros=function(num,length){length=length||2;num=String(num);if(num.length>length){return num}return(Array(length+1).join("0")+num).substr(-length)};this.update=function(newDate){if(typeof newDate!=="object"){newDate=new Date(newDate)}this.options.date=newDate;this.render();return this}.bind(this);this.stop=function(){if(this.interval){clearInterval(this.interval);this.interval=false}return this}.bind(this);this.render=function(){this.options.render(this.getDiffDate());return this}.bind(this);this.start=function(){if(this.interval){return}this.render();if(this.options.refresh){this.interval=setInterval(this.render,this.options.refresh)}return this}.bind(this);this.updateOffset=function(offset){this.options.offset=offset;return this}.bind(this);this.start()};module.exports=Countdown},{}],2:[function(require,module,exports){var Countdown=require("./countdown.js");var NAME="countdown";var DATA_ATTR="date";jQuery.fn.countdown=function(options){return $.each(this,function(i,el){var $el=$(el);if(!$el.data(NAME)){if($el.data(DATA_ATTR)){options.date=$el.data(DATA_ATTR)}$el.data(NAME,new Countdown(el,options))}})};module.exports=Countdown},{"./countdown.js":1}]},{},[2])(2)}); \ No newline at end of file diff --git a/comingSoon/js/jquery.js b/comingSoon/js/jquery.js new file mode 100644 index 0000000..a202c66 --- /dev/null +++ b/comingSoon/js/jquery.js @@ -0,0 +1,9789 @@ +/*! + * jQuery JavaScript Library v1.10.2 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2013-07-03T13:48Z + */ +(function( window, undefined ) { + +// Can't do this because several apps including ASP.NET trace +// the stack via arguments.caller.callee and Firefox dies if +// you try to trace through "use strict" call chains. (#13335) +// Support: Firefox 18+ +//"use strict"; +var + // The deferred used on DOM ready + readyList, + + // A central reference to the root jQuery(document) + rootjQuery, + + // Support: IE<10 + // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` + core_strundefined = typeof undefined, + + // Use the correct document accordingly with window argument (sandbox) + location = window.location, + document = window.document, + docElem = document.documentElement, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // [[Class]] -> type pairs + class2type = {}, + + // List of deleted data cache ids, so we can reuse them + core_deletedIds = [], + + core_version = "1.10.2", + + // Save a reference to some core methods + core_concat = core_deletedIds.concat, + core_push = core_deletedIds.push, + core_slice = core_deletedIds.slice, + core_indexOf = core_deletedIds.indexOf, + core_toString = class2type.toString, + core_hasOwn = class2type.hasOwnProperty, + core_trim = core_version.trim, + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Used for matching numbers + core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, + + // Used for splitting on whitespace + core_rnotwhite = /\S+/g, + + // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, + rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }, + + // The ready event handler + completed = function( event ) { + + // readyState === "complete" is good enough for us to call the dom ready in oldIE + if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { + detach(); + jQuery.ready(); + } + }, + // Clean-up method for dom ready events + detach = function() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", completed, false ); + window.removeEventListener( "load", completed, false ); + + } else { + document.detachEvent( "onreadystatechange", completed ); + window.detachEvent( "onload", completed ); + } + }; + +jQuery.fn = jQuery.prototype = { + // The current version of jQuery being used + jquery: core_version, + + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + + // scripts is true for back-compat + jQuery.merge( this, jQuery.parseHTML( + match[1], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return core_slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; + }, + + slice: function() { + return this.pushStack( core_slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: core_push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var src, copyIsArray, copy, name, options, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), + + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger("ready").off("ready"); + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + isWindow: function( obj ) { + /* jshint eqeqeq: false */ + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + return !isNaN( parseFloat(obj) ) && isFinite( obj ); + }, + + type: function( obj ) { + if ( obj == null ) { + return String( obj ); + } + return typeof obj === "object" || typeof obj === "function" ? + class2type[ core_toString.call(obj) ] || "object" : + typeof obj; + }, + + isPlainObject: function( obj ) { + var key; + + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !core_hasOwn.call(obj, "constructor") && + !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Support: IE<9 + // Handle iteration over inherited properties before own properties. + if ( jQuery.support.ownLast ) { + for ( key in obj ) { + return core_hasOwn.call( obj, key ); + } + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + for ( key in obj ) {} + + return key === undefined || core_hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw new Error( msg ); + }, + + // data: string of html + // context (optional): If specified, the fragment will be created in this context, defaults to document + // keepScripts (optional): If true, will include scripts passed in the html string + parseHTML: function( data, context, keepScripts ) { + if ( !data || typeof data !== "string" ) { + return null; + } + if ( typeof context === "boolean" ) { + keepScripts = context; + context = false; + } + context = context || document; + + var parsed = rsingleTag.exec( data ), + scripts = !keepScripts && []; + + // Single tag + if ( parsed ) { + return [ context.createElement( parsed[1] ) ]; + } + + parsed = jQuery.buildFragment( [ data ], context, scripts ); + if ( scripts ) { + jQuery( scripts ).remove(); + } + return jQuery.merge( [], parsed.childNodes ); + }, + + parseJSON: function( data ) { + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + if ( data === null ) { + return data; + } + + if ( typeof data === "string" ) { + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + if ( data ) { + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return ( new Function( "return " + data ) )(); + } + } + } + + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + var xml, tmp; + if ( !data || typeof data !== "string" ) { + return null; + } + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && jQuery.trim( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + // args is for internal usage only + each: function( obj, callback, args ) { + var value, + i = 0, + length = obj.length, + isArray = isArraylike( obj ); + + if ( args ) { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } + } + + return obj; + }, + + // Use native String.trim function wherever possible + trim: core_trim && !core_trim.call("\uFEFF\xA0") ? + function( text ) { + return text == null ? + "" : + core_trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArraylike( Object(arr) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + core_push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( core_indexOf ) { + return core_indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var l = second.length, + i = first.length, + j = 0; + + if ( typeof l === "number" ) { + for ( ; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var retVal, + ret = [], + i = 0, + length = elems.length; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, + i = 0, + length = elems.length, + isArray = isArraylike( elems ), + ret = []; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return core_concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var args, proxy, tmp; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = core_slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + // Multifunctional method to get and set values of a collection + // The value/s can optionally be executed if it's a function + access: function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + length = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < length; i++ ) { + fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[0], key ) : emptyGet; + }, + + now: function() { + return ( new Date() ).getTime(); + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations. + // Note: this method belongs to the css module but it's needed here for the support module. + // If support gets modularized, this method should be moved back to the css module. + swap: function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; + } +}); + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // we once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed, false ); + + // If IE event model is used + } else { + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", completed ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", completed ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch(e) {} + + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } + + // detach all dom ready events + detach(); + + // and execute any waiting functions + jQuery.ready(); + } + })(); + } + } + } + return readyList.promise( obj ); +}; + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +function isArraylike( obj ) { + var length = obj.length, + type = jQuery.type( obj ); + + if ( jQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.nodeType === 1 && length ) { + return true; + } + + return type === "array" || type !== "function" && + ( length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj ); +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); +/*! + * Sizzle CSS Selector Engine v1.10.2 + * http://sizzlejs.com/ + * + * Copyright 2013 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2013-07-03 + */ +(function( window, undefined ) { + +var i, + support, + cachedruns, + Expr, + getText, + isXML, + compile, + outermostContext, + sortInput, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + -(new Date()), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + hasDuplicate = false, + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + return 0; + }, + + // General-purpose constants + strundefined = typeof undefined, + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf if we can't use a native one + indexOf = arr.indexOf || function( elem ) { + var i = 0, + len = this.length; + for ( ; i < len; i++ ) { + if ( this[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", + + // Prefer arguments quoted, + // then not containing pseudos/brackets, + // then attribute selectors/non-parenthetical expressions, + // then anything else + // These preferences are here to reduce the number of selectors + // needing tokenize in the PSEUDO preFilter + pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rsibling = new RegExp( whitespace + "*[+~]" ), + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + // BMP codepoint + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var match, elem, m, nodeType, + // QSA vars + i, groups, old, nid, newContext, newSelector; + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + + context = context || document; + results = results || []; + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { + return []; + } + + if ( documentIsHTML && !seed ) { + + // Shortcuts + if ( (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // QSA path + if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + nid = old = expando; + newContext = context; + newSelector = nodeType === 9 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + toSelector( groups[i] ); + } + newContext = rsibling.test( selector ) && context.parentNode || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key += " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = attrs.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Detect xml + * @param {Element|Object} elem An element or a document + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var doc = node ? node.ownerDocument || node : preferredDoc, + parent = doc.defaultView; + + // If no document and documentElement is available, return + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Set our document + document = doc; + docElem = doc.documentElement; + + // Support tests + documentIsHTML = !isXML( doc ); + + // Support: IE>8 + // If iframe document is assigned to "document" variable and if iframe has been reloaded, + // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 + // IE6-8 do not support the defaultView property so parent will be undefined + if ( parent && parent.attachEvent && parent !== parent.top ) { + parent.attachEvent( "onbeforeunload", function() { + setDocument(); + }); + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( doc.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Check if getElementsByClassName can be trusted + support.getElementsByClassName = assert(function( div ) { + div.innerHTML = "
          "; + + // Support: Safari<4 + // Catch class over-caching + div.firstChild.className = "i"; + // Support: Opera<10 + // Catch gEBCN failure to find non-leading classes + return div.getElementsByClassName("i").length === 2; + }); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !doc.getElementsByName || !doc.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && documentIsHTML ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var elem, + tmp = [], + i = 0, + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + div.innerHTML = ""; + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + + // Support: Opera 10-12/IE8 + // ^= $= *= and empty values + // Should not select anything + // Support: Windows 8 Native Apps + // The type attribute is restricted during .innerHTML assignment + var input = doc.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "t", "" ); + + if ( div.querySelectorAll("[t^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + + // Element contains another + // Purposefully does not implement inclusive descendent + // As in, an element does not contain itself + contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = docElem.compareDocumentPosition ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); + + if ( compare ) { + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === doc || contains(preferredDoc, a) ) { + return -1; + } + if ( b === doc || contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } + + // Not directly comparable, sort on existence of method + return a.compareDocumentPosition ? -1 : 1; + } : + function( a, b ) { + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Parentless nodes are either documents or disconnected + } else if ( !aup || !bup ) { + return a === doc ? -1 : + b === doc ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return doc; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, document, null, [elem] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val === undefined ? + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null : + val; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + for ( ; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (see #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[5] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] && match[4] !== undefined ) { + match[2] = match[4]; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, outerCache, node, diff, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + // Seek `elem` from a previously-cached index + outerCache = parent[ expando ] || (parent[ expando ] = {}); + cache = outerCache[ type ] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + // Use previously-cached element index if available + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { + diff = cache[1]; + + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) + } else { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { + // Cache the index of each encountered element + if ( useCache ) { + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), + // not comment, processing instructions, or others + // Thanks to Diego Perini for the nodeName shortcut + // Greater than "@" means alpha characters (specifically not starting with "#" or "?") + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +function tokenize( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( tokens = [] ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var data, cache, outerCache, + dirkey = dirruns + " " + doneName; + + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { + if ( (data = cache[1]) === true || data === cachedruns ) { + return data === true; + } + } else { + cache = outerCache[ dir ] = [ dirkey ]; + cache[1] = matcher( elem, context, xml ) || cachedruns; + if ( cache[1] === true ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + // A counter to specify which element is currently being matched + var matcherCachedRuns = 0, + bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, expandContext ) { + var elem, j, matcher, + setMatched = [], + matchedCount = 0, + i = "0", + unmatched = seed && [], + outermost = expandContext != null, + contextBackup = outermostContext, + // We must always have either seed elements or context + elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); + + if ( outermost ) { + outermostContext = context !== document && context; + cachedruns = matcherCachedRuns; + } + + // Add elements passing elementMatchers directly to results + // Keep `i` a string if there are no elements so `matchedCount` will be "00" below + for ( ; (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + cachedruns = ++matcherCachedRuns; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !group ) { + group = tokenize( selector ); + } + i = group.length; + while ( i-- ) { + cached = matcherFromTokens( group[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + } + return cached; +}; + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function select( selector, context, results, seed ) { + var i, tokens, token, type, find, + match = tokenize( selector ); + + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + } + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && context.parentNode || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + } + + // Compile and execute a filtering function + // Provide `match` to avoid retokenization if we modified the selector above + compile( selector, match )( + seed, + context, + !documentIsHTML, + results, + rsibling.test( selector ) + ); + return results; +} + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome<14 +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = ""; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = ""; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + elem[ name ] === true ? name.toLowerCase() : null; + } + }); +} + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.pseudos; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})( window ); +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + }); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // First callback to fire (used internally by add and fireWith) + firingStart, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], + // Fire callbacks + fire = function( data ) { + memory = options.memory && data; + fired = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + firing = true; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add + break; + } + } + firing = false; + if ( list ) { + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); + } + } else if ( memory ) { + list = []; + } else { + self.disable(); + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + jQuery.each( arguments, function( _, arg ) { + var index; + while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; + } + if ( index <= firingIndex ) { + firingIndex--; + } + } + } + }); + } + return this; + }, + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); + }, + // Remove all callbacks from the list + empty: function() { + list = []; + firingLength = 0; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( list && ( !fired || stack ) ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( firing ) { + stack.push( args ); + } else { + fire( args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; +jQuery.extend({ + + Deferred: function( func ) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred(function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var action = tuple[ 0 ], + fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ](function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); + } + }); + }); + fns = null; + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[0] ] = function() { + deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = core_slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; + if( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +}); +jQuery.support = (function( support ) { + + var all, a, input, select, fragment, opt, eventName, isSupported, i, + div = document.createElement("div"); + + // Setup + div.setAttribute( "className", "t" ); + div.innerHTML = "
          a"; + + // Finish early in limited (non-browser) environments + all = div.getElementsByTagName("*") || []; + a = div.getElementsByTagName("a")[ 0 ]; + if ( !a || !a.style || !all.length ) { + return support; + } + + // First batch of tests + select = document.createElement("select"); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName("input")[ 0 ]; + + a.style.cssText = "top:1px;float:left;opacity:.5"; + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + support.getSetAttribute = div.className !== "t"; + + // IE strips leading whitespace when .innerHTML is used + support.leadingWhitespace = div.firstChild.nodeType === 3; + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + support.tbody = !div.getElementsByTagName("tbody").length; + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + support.htmlSerialize = !!div.getElementsByTagName("link").length; + + // Get the style information from getAttribute + // (IE uses .cssText instead) + support.style = /top/.test( a.getAttribute("style") ); + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + support.hrefNormalized = a.getAttribute("href") === "/a"; + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + support.opacity = /^0.5/.test( a.style.opacity ); + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + support.cssFloat = !!a.style.cssFloat; + + // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) + support.checkOn = !!input.value; + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + support.optSelected = opt.selected; + + // Tests for enctype support on a form (#6743) + support.enctype = !!document.createElement("form").enctype; + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>"; + + // Will be defined later + support.inlineBlockNeedsLayout = false; + support.shrinkWrapBlocks = false; + support.pixelPosition = false; + support.deleteExpando = true; + support.noCloneEvent = true; + support.reliableMarginRight = true; + support.boxSizingReliable = true; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Support: IE<9 + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + // Check if we can trust getAttribute("value") + input = document.createElement("input"); + input.setAttribute( "value", "" ); + support.input = input.getAttribute( "value" ) === ""; + + // Check if an input maintains its value after becoming a radio + input.value = "t"; + input.setAttribute( "type", "radio" ); + support.radioValue = input.value === "t"; + + // #11217 - WebKit loses check when the name is after the checked attribute + input.setAttribute( "checked", "t" ); + input.setAttribute( "name", "t" ); + + fragment = document.createDocumentFragment(); + fragment.appendChild( input ); + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<9 + // Opera does not clone events (and typeof div.attachEvent === undefined). + // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() + if ( div.attachEvent ) { + div.attachEvent( "onclick", function() { + support.noCloneEvent = false; + }); + + div.cloneNode( true ).click(); + } + + // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) + for ( i in { submit: true, change: true, focusin: true }) { + div.setAttribute( eventName = "on" + i, "t" ); + + support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; + } + + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + // Support: IE<9 + // Iteration over object's inherited properties before its own. + for ( i in jQuery( support ) ) { + break; + } + support.ownLast = i !== "0"; + + // Run tests that need a body at doc ready + jQuery(function() { + var container, marginDiv, tds, + divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + container = document.createElement("div"); + container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; + + body.appendChild( container ).appendChild( div ); + + // Support: IE8 + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + div.innerHTML = "
          t
          "; + tds = div.getElementsByTagName("td"); + tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Support: IE8 + // Check if empty table cells still have offsetWidth/Height + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + // Check box-sizing and margin behavior. + div.innerHTML = ""; + div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; + + // Workaround failing boxSizing test due to offsetWidth returning wrong value + // with some non-1 values of body zoom, ticket #13543 + jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { + support.boxSizing = div.offsetWidth === 4; + }); + + // Use window.getComputedStyle because jsdom on node.js will break without it. + if ( window.getComputedStyle ) { + support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; + support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. (#3333) + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + marginDiv = div.appendChild( document.createElement("div") ); + marginDiv.style.cssText = div.style.cssText = divReset; + marginDiv.style.marginRight = marginDiv.style.width = "0"; + div.style.width = "1px"; + + support.reliableMarginRight = + !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); + } + + if ( typeof div.style.zoom !== core_strundefined ) { + // Support: IE<8 + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + div.innerHTML = ""; + div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); + + // Support: IE6 + // Check if elements with layout shrink-wrap their children + div.style.display = "block"; + div.innerHTML = "
          "; + div.firstChild.style.width = "5px"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); + + if ( support.inlineBlockNeedsLayout ) { + // Prevent IE 6 from affecting layout for positioned elements #11048 + // Prevent IE from shrinking the body in IE 7 mode #12869 + // Support: IE<8 + body.style.zoom = 1; + } + } + + body.removeChild( container ); + + // Null elements to avoid leaks in IE + container = div = tds = marginDiv = null; + }); + + // Null elements to avoid leaks in IE + all = select = fragment = opt = a = input = null; + + return support; +})({}); + +var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, + rmultiDash = /([A-Z])/g; + +function internalData( elem, name, data, pvt /* Internal Use Only */ ){ + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var ret, thisCache, + internalKey = jQuery.expando, + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + // Avoid exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( typeof name === "string" ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; +} + +function internalRemoveData( elem, name, pvt ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split(" "); + } + } + } else { + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = name.concat( jQuery.map( name, jQuery.camelCase ) ); + } + + i = name.length; + while ( i-- ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + /* jshint eqeqeq: false */ + } else if ( jQuery.support.deleteExpando || cache != cache.window ) { + /* jshint eqeqeq: true */ + delete cache[ id ]; + + // When all else fails, null + } else { + cache[ id ] = null; + } +} + +jQuery.extend({ + cache: {}, + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "applet": true, + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data ) { + return internalData( elem, name, data ); + }, + + removeData: function( elem, name ) { + return internalRemoveData( elem, name ); + }, + + // For internal use only. + _data: function( elem, name, data ) { + return internalData( elem, name, data, true ); + }, + + _removeData: function( elem, name ) { + return internalRemoveData( elem, name, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + // Do not set data on non-element because it will not be cleared (#8335). + if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { + return false; + } + + var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; + + // nodes accept data unless otherwise specified; rejection can be conditional + return !noData || noData !== true && elem.getAttribute("classid") === noData; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var attrs, name, + data = null, + i = 0, + elem = this[0]; + + // Special expections of .data basically thwart jQuery.access, + // so implement the relevant behavior ourselves + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + attrs = elem.attributes; + for ( ; i < attrs.length; i++ ) { + name = attrs[i].name; + + if ( name.indexOf("data-") === 0 ) { + name = jQuery.camelCase( name.slice(5) ); + + dataAttr( elem, name, data[ name ] ); + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + return arguments.length > 1 ? + + // Sets one value + this.each(function() { + jQuery.data( this, key, value ); + }) : + + // Gets one value + // Try to fetch any internally stored data first + elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} +jQuery.extend({ + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray(data) ) { + queue = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + jQuery._removeData( elem, type + "queue" ); + jQuery._removeData( elem, key ); + }) + }); + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while( i-- ) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +}); +var nodeHook, boolHook, + rclass = /[\t\r\n\f]/g, + rreturn = /\r/g, + rfocusable = /^(?:input|select|textarea|button|object)$/i, + rclickable = /^(?:a|area)$/i, + ruseDefault = /^(?:checked|selected)$/i, + getSetAttribute = jQuery.support.getSetAttribute, + getSetInput = jQuery.support.input; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classes, elem, cur, clazz, j, + i = 0, + len = this.length, + proceed = typeof value === "string" && value; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call( this, j, this.className ) ); + }); + } + + if ( proceed ) { + // The disjunction here is for better compressibility (see removeClass) + classes = ( value || "" ).match( core_rnotwhite ) || []; + + for ( ; i < len; i++ ) { + elem = this[ i ]; + cur = elem.nodeType === 1 && ( elem.className ? + ( " " + elem.className + " " ).replace( rclass, " " ) : + " " + ); + + if ( cur ) { + j = 0; + while ( (clazz = classes[j++]) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + elem.className = jQuery.trim( cur ); + + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, clazz, j, + i = 0, + len = this.length, + proceed = arguments.length === 0 || typeof value === "string" && value; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call( this, j, this.className ) ); + }); + } + if ( proceed ) { + classes = ( value || "" ).match( core_rnotwhite ) || []; + + for ( ; i < len; i++ ) { + elem = this[ i ]; + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( elem.className ? + ( " " + elem.className + " " ).replace( rclass, " " ) : + "" + ); + + if ( cur ) { + j = 0; + while ( (clazz = classes[j++]) ) { + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + elem.className = value ? jQuery.trim( cur ) : ""; + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value; + + if ( typeof stateVal === "boolean" && type === "string" ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + classNames = value.match( core_rnotwhite ) || []; + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( type === core_strundefined || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // If the element has a class name or if we're passed "false", + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var ret, hooks, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // Use proper attribute retrieval(#6932, #12072) + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + elem.text; + } + }, + select: { + get: function( elem ) { + var value, option, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one" || index < 0, + values = one ? null : [], + max = one ? index + 1 : options.length, + i = index < 0 ? + max : + one ? index : 0; + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // oldIE doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + // Don't return options that are disabled or in a disabled optgroup + ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && + ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { + optionSet = true; + } + } + + // force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attr: function( elem, name, value ) { + var hooks, ret, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === core_strundefined ) { + return jQuery.prop( elem, name, value ); + } + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + + } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, value + "" ); + return value; + } + + } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var name, propName, + i = 0, + attrNames = value && value.match( core_rnotwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( (name = attrNames[i++]) ) { + propName = jQuery.propFix[ name ] || name; + + // Boolean attributes get special treatment (#10870) + if ( jQuery.expr.match.bool.test( name ) ) { + // Set corresponding property to false + if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { + elem[ propName ] = false; + // Support: IE<9 + // Also clear defaultChecked/defaultSelected (if appropriate) + } else { + elem[ jQuery.camelCase( "default-" + name ) ] = + elem[ propName ] = false; + } + + // See #9699 for explanation of this approach (setting first, then removal) + } else { + jQuery.attr( elem, name, "" ); + } + + elem.removeAttribute( getSetAttribute ? name : propName ); + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to default in case type is set after value during creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? + ret : + ( elem[ name ] = value ); + + } else { + return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? + ret : + elem[ name ]; + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + return tabindex ? + parseInt( tabindex, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + -1; + } + } + } +}); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { + // IE<8 needs the *property* name + elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); + + // Use defaultChecked and defaultSelected for oldIE + } else { + elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; + } + + return name; + } +}; +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { + var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; + + jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? + function( elem, name, isXML ) { + var fn = jQuery.expr.attrHandle[ name ], + ret = isXML ? + undefined : + /* jshint eqeqeq: false */ + (jQuery.expr.attrHandle[ name ] = undefined) != + getter( elem, name, isXML ) ? + + name.toLowerCase() : + null; + jQuery.expr.attrHandle[ name ] = fn; + return ret; + } : + function( elem, name, isXML ) { + return isXML ? + undefined : + elem[ jQuery.camelCase( "default-" + name ) ] ? + name.toLowerCase() : + null; + }; +}); + +// fix oldIE attroperties +if ( !getSetInput || !getSetAttribute ) { + jQuery.attrHooks.value = { + set: function( elem, value, name ) { + if ( jQuery.nodeName( elem, "input" ) ) { + // Does not return so that setAttribute is also used + elem.defaultValue = value; + } else { + // Use nodeHook if defined (#1954); otherwise setAttribute is fine + return nodeHook && nodeHook.set( elem, value, name ); + } + } + }; +} + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = { + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + elem.setAttributeNode( + (ret = elem.ownerDocument.createAttribute( name )) + ); + } + + ret.value = value += ""; + + // Break association with cloned elements by also using setAttribute (#9646) + return name === "value" || value === elem.getAttribute( name ) ? + value : + undefined; + } + }; + jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = + // Some attributes are constructed with empty-string values when not defined + function( elem, name, isXML ) { + var ret; + return isXML ? + undefined : + (ret = elem.getAttributeNode( name )) && ret.value !== "" ? + ret.value : + null; + }; + jQuery.valHooks.button = { + get: function( elem, name ) { + var ret = elem.getAttributeNode( name ); + return ret && ret.specified ? + ret.value : + undefined; + }, + set: nodeHook.set + }; + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + set: function( elem, value, name ) { + nodeHook.set( elem, value === "" ? false : value, name ); + } + }; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }; + }); +} + + +// Some attributes require a special call on IE +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !jQuery.support.hrefNormalized ) { + // href/src property should get the full normalized URL (#10299/#12915) + jQuery.each([ "href", "src" ], function( i, name ) { + jQuery.propHooks[ name ] = { + get: function( elem ) { + return elem.getAttribute( name, 4 ); + } + }; + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Note: IE uppercases css property names, but if we were to .toLowerCase() + // .cssText, that would destroy case senstitivity in URL's, like in "background" + return elem.style.cssText || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = value + "" ); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }; +} + +jQuery.each([ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +}); + +// IE6/7 call enctype encoding +if ( !jQuery.support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + +// Radios and checkboxes getter/setter +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }; + if ( !jQuery.support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + // Support: Webkit + // "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + }; + } +}); +var rformElems = /^(?:input|select|textarea)$/i, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + var tmp, events, t, handleObjIn, + special, eventHandle, handleObj, + handlers, type, namespaces, origType, + elemData = jQuery._data( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !(events = elemData.events) ) { + events = elemData.events = {}; + } + if ( !(eventHandle = elemData.handle) ) { + eventHandle = elemData.handle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( core_rnotwhite ) || [""]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !(handlers = events[ type ]) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + var j, handleObj, tmp, + origCount, t, events, + special, handlers, type, + namespaces, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( core_rnotwhite ) || [""]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery._removeData( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + var handle, ontype, cur, + bubbleType, special, tmp, i, + eventPath = [ elem || document ], + type = core_hasOwn.call( event, "type" ) ? event.type : event, + namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf(":") < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join("."); + event.namespace_re = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === (elem.ownerDocument || document) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { + event.preventDefault(); + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && + jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + try { + elem[ type ](); + } catch ( e ) { + // IE<9 dies on focus/blur to hidden element (#1486,#12518) + // only reproducible on winXP IE8 native, not IE9 in IE8 mode + } + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, ret, handleObj, matched, j, + handlerQueue = [], + args = core_slice.call( arguments ), + handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( (event.result = ret) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var sel, handleObj, matches, i, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + + /* jshint eqeqeq: false */ + for ( ; cur != this; cur = cur.parentNode || this ) { + /* jshint eqeqeq: true */ + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, handlers: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + } + + return handlerQueue; + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: IE<9 + // Fix target property (#1925) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Support: Chrome 23+, Safari? + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Support: IE<9 + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) + event.metaKey = !!event.metaKey; + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var body, eventDoc, doc, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + special: { + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + try { + this.focus(); + return false; + } catch ( e ) { + // Support: IE<9 + // If we error on focus to hidden element (#1486, #12518), + // let .trigger() run the handlers + } + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return jQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Even when returnValue equals to undefined Firefox will still show alert + if ( event.result !== undefined ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 + // detachEvent needed property on element, by name of that event, to properly expose it to GC + if ( typeof elem[ name ] === core_strundefined ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + if ( !e ) { + return; + } + + // If preventDefault exists, run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // Support: IE + // Otherwise set the returnValue property of the original event to false + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + if ( !e ) { + return; + } + // If stopPropagation exists, run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + + // Support: IE + // Set the cancelBubble property of the original event to true + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !jQuery._data( form, "submitBubbles" ) ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submit_bubble = true; + }); + jQuery._data( form, "submitBubbles", true ); + } + }); + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( event._submit_bubble ) { + delete event._submit_bubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + } + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !jQuery.support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + } + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event, true ); + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + jQuery._data( elem, "changeBubbles", true ); + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0, + handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var type, origFn; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + var elem = this[0]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +}); +var isSimple = /^.[^:#\[\.,]*$/, + rparentsprev = /^(?:parents|prev(?:Until|All))/, + rneedsContext = jQuery.expr.match.needsContext, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var i, + ret = [], + self = this, + len = self.length; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }) ); + } + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + + has: function( target ) { + var i, + targets = jQuery( target, this ), + len = targets.length; + + return this.filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector || [], true) ); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector || [], false) ); + }, + + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + ret = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { + // Always skip document fragments + if ( cur.nodeType < 11 && (pos ? + pos.index(cur) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector(cur, selectors)) ) { + + cur = ret.push( cur ); + break; + } + } + } + + return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( jQuery.unique(all) ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); + } +}); + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + if ( this.length > 1 ) { + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + ret = jQuery.unique( ret ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + } + + return this.pushStack( ret ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + })); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + }); + + } + + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + }); + + } + + if ( typeof qualifier === "string" ) { + if ( isSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + qualifier = jQuery.filter( qualifier, elements ); + } + + return jQuery.grep( elements, function( elem ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; + }); +} +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rtagName = /<([\w:]+)/, + rtbody = /\s*$/g, + + // We have to close these tags to support XHTML (#13200) + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
          ", "
          " ], + area: [ 1, "", "" ], + param: [ 1, "", "" ], + thead: [ 1, "", "
          " ], + tr: [ 2, "", "
          " ], + col: [ 2, "", "
          " ], + td: [ 3, "", "
          " ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
          ", "
          " ] + }, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement("div") ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +jQuery.fn.extend({ + text: function( value ) { + return jQuery.access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); + }, null, value, arguments.length ); + }, + + append: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + }); + }, + + before: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + }); + }, + + after: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + }); + }, + + // keepData is for internal use only--do not document + remove: function( selector, keepData ) { + var elem, + elems = selector ? jQuery.filter( selector, this ) : this, + i = 0; + + for ( ; (elem = elems[i]) != null; i++ ) { + + if ( !keepData && elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem ) ); + } + + if ( elem.parentNode ) { + if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { + setGlobalEval( getAll( elem, "script" ) ); + } + elem.parentNode.removeChild( elem ); + } + } + + return this; + }, + + empty: function() { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + + // If this is a select, ensure that it displays empty (#12336) + // Support: IE<9 + if ( elem.options && jQuery.nodeName( elem, "select" ) ) { + elem.options.length = 0; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function () { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + }); + }, + + html: function( value ) { + return jQuery.access( this, function( value ) { + var elem = this[0] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlinejQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { + + value = value.replace( rxhtmlTag, "<$1>" ); + + try { + for (; i < l; i++ ) { + // Remove element nodes and prevent memory leaks + elem = this[i] || {}; + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch(e) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var + // Snapshot the DOM in case .domManip sweeps something relevant into its fragment + args = jQuery.map( this, function( elem ) { + return [ elem.nextSibling, elem.parentNode ]; + }), + i = 0; + + // Make the changes, replacing each context element with the new content + this.domManip( arguments, function( elem ) { + var next = args[ i++ ], + parent = args[ i++ ]; + + if ( parent ) { + // Don't use the snapshot next if it has moved (#13810) + if ( next && next.parentNode !== parent ) { + next = this.nextSibling; + } + jQuery( this ).remove(); + parent.insertBefore( elem, next ); + } + // Allow new content to include elements from the context set + }, true ); + + // Force removal if there was no new content (e.g., from empty arguments) + return i ? this : this.remove(); + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, callback, allowIntersection ) { + + // Flatten any nested arrays + args = core_concat.apply( [], args ); + + var first, node, hasScripts, + scripts, doc, fragment, + i = 0, + l = this.length, + set = this, + iNoClone = l - 1, + value = args[0], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { + return this.each(function( index ) { + var self = set.eq( index ); + if ( isFunction ) { + args[0] = value.call( this, index, self.html() ); + } + self.domManip( args, callback, allowIntersection ); + }); + } + + if ( l ) { + fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + if ( first ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( this[i], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { + + if ( node.src ) { + // Hope ajax is available... + jQuery._evalUrl( node.src ); + } else { + jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); + } + } + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + } + } + + return this; + } +}); + +// Support: IE<8 +// Manipulating tables requires a tbody +function manipulationTarget( elem, content ) { + return jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? + + elem.getElementsByTagName("tbody")[0] || + elem.appendChild( elem.ownerDocument.createElement("tbody") ) : + elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + if ( match ) { + elem.type = match[1]; + } else { + elem.removeAttribute("type"); + } + return elem; +} + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; (elem = elems[i]) != null; i++ ) { + jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); + } +} + +function cloneCopyEvent( src, dest ) { + + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = jQuery._data( src ), + curData = jQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = jQuery.extend( {}, curData.data ); + } +} + +function fixCloneNodeIssues( src, dest ) { + var nodeName, e, data; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + nodeName = dest.nodeName.toLowerCase(); + + // IE6-8 copies events bound via attachEvent when using cloneNode. + if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { + data = jQuery._data( dest ); + + for ( e in data.events ) { + jQuery.removeEvent( dest, e, data.handle ); + } + + // Event data gets referenced instead of copied if the expando gets copied too + dest.removeAttribute( jQuery.expando ); + } + + // IE blanks contents when cloning scripts, and tries to evaluate newly-set text + if ( nodeName === "script" && dest.text !== src.text ) { + disableScript( dest ).text = src.text; + restoreScript( dest ); + + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + } else if ( nodeName === "object" ) { + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.defaultSelected = dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone(true); + jQuery( insert[i] )[ original ]( elems ); + + // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() + core_push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +}); + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : + undefined; + + if ( !found ) { + for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { + if ( !tag || jQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + jQuery.merge( found, getAll( elem, tag ) ); + } + } + } + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], found ) : + found; +} + +// Used in buildFragment, fixes the defaultChecked property +function fixDefaultChecked( elem ) { + if ( manipulation_rcheckableType.test( elem.type ) ) { + elem.defaultChecked = elem.checked; + } +} + +jQuery.extend({ + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var destElements, node, clone, i, srcElements, + inPage = jQuery.contains( elem.ownerDocument, elem ); + + if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && + (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + // Fix all IE cloning issues + for ( i = 0; (node = srcElements[i]) != null; ++i ) { + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[i] ) { + fixCloneNodeIssues( node, destElements[i] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0; (node = srcElements[i]) != null; i++ ) { + cloneCopyEvent( node, destElements[i] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + destElements = srcElements = node = null; + + // Return the cloned set + return clone; + }, + + buildFragment: function( elems, context, scripts, selection ) { + var j, elem, contains, + tmp, tag, tbody, wrap, + l = elems.length, + + // Ensure a safe fragment + safe = createSafeFragment( context ), + + nodes = [], + i = 0; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || safe.appendChild( context.createElement("div") ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + + tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; + + // Descend through wrappers to the right content + j = wrap[0]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Manually add leading whitespace removed by IE + if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { + nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); + } + + // Remove IE's autoinserted from table fragments + if ( !jQuery.support.tbody ) { + + // String was a , *may* have spurious + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare or + wrap[1] === "
          " && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { + elem.removeChild( tbody ); + } + } + } + + jQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !jQuery.support.appendChecked ) { + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( (elem = nodes[ i++ ]) ) { + + // #4087 - If origin and destination elements are the same, and this is + // that element, do not do anything + if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( (elem = tmp[ j++ ]) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + tmp = null; + + return safe; + }, + + cleanData: function( elems, /* internal */ acceptData ) { + var elem, type, id, data, + i = 0, + internalKey = jQuery.expando, + cache = jQuery.cache, + deleteExpando = jQuery.support.deleteExpando, + special = jQuery.event.special; + + for ( ; (elem = elems[i]) != null; i++ ) { + + if ( acceptData || jQuery.acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( deleteExpando ) { + delete elem[ internalKey ]; + + } else if ( typeof elem.removeAttribute !== core_strundefined ) { + elem.removeAttribute( internalKey ); + + } else { + elem[ internalKey ] = null; + } + + core_deletedIds.push( id ); + } + } + } + } + }, + + _evalUrl: function( url ) { + return jQuery.ajax({ + url: url, + type: "GET", + dataType: "script", + async: false, + global: false, + "throws": true + }); + } +}); +jQuery.fn.extend({ + wrapAll: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapAll( html.call(this, i) ); + }); + } + + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); + + if ( this[0].parentNode ) { + wrap.insertBefore( this[0] ); + } + + wrap.map(function() { + var elem = this; + + while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { + elem = elem.firstChild; + } + + return elem; + }).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapInner( html.call(this, i) ); + }); + } + + return this.each(function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + }); + }, + + wrap: function( html ) { + var isFunction = jQuery.isFunction( html ); + + return this.each(function(i) { + jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); + }); + }, + + unwrap: function() { + return this.parent().each(function() { + if ( !jQuery.nodeName( this, "body" ) ) { + jQuery( this ).replaceWith( this.childNodes ); + } + }).end(); + } +}); +var iframe, getStyles, curCSS, + ralpha = /alpha\([^)]*\)/i, + ropacity = /opacity\s*=\s*([^)]*)/, + rposition = /^(top|right|bottom|left)$/, + // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" + // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rmargin = /^margin/, + rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), + rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), + rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), + elemdisplay = { BODY: "block" }, + + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: 0, + fontWeight: 400 + }, + + cssExpand = [ "Top", "Right", "Bottom", "Left" ], + cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; + +// return a css property mapped to a potentially vendor prefixed property +function vendorPropName( style, name ) { + + // shortcut for names that are not vendor prefixed + if ( name in style ) { + return name; + } + + // check for vendor prefixed names + var capName = name.charAt(0).toUpperCase() + name.slice(1), + origName = name, + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in style ) { + return name; + } + } + + return origName; +} + +function isHidden( elem, el ) { + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); +} + +function showHide( elements, show ) { + var display, elem, hidden, + values = [], + index = 0, + length = elements.length; + + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + values[ index ] = jQuery._data( elem, "olddisplay" ); + display = elem.style.display; + if ( show ) { + // Reset the inline display of this element to learn if it is + // being hidden by cascaded rules or not + if ( !values[ index ] && display === "none" ) { + elem.style.display = ""; + } + + // Set elements which have been overridden with display: none + // in a stylesheet to whatever the default browser style is + // for such an element + if ( elem.style.display === "" && isHidden( elem ) ) { + values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); + } + } else { + + if ( !values[ index ] ) { + hidden = isHidden( elem ); + + if ( display && display !== "none" || !hidden ) { + jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); + } + } + } + } + + // Set the display of most of the elements in a second loop + // to avoid the constant reflow + for ( index = 0; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + if ( !show || elem.style.display === "none" || elem.style.display === "" ) { + elem.style.display = show ? values[ index ] || "" : "none"; + } + } + + return elements; +} + +jQuery.fn.extend({ + css: function( name, value ) { + return jQuery.access( this, function( elem, name, value ) { + var len, styles, + map = {}, + i = 0; + + if ( jQuery.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + }, + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each(function() { + if ( isHidden( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + }); + } +}); + +jQuery.extend({ + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "columnCount": true, + "fillOpacity": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + // normalize float css property + "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = jQuery.camelCase( name ), + style = elem.style; + + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // convert relative number strings (+= or -=) to relative numbers. #7345 + if ( type === "string" && (ret = rrelNum.exec( value )) ) { + value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); + // Fixes bug #9237 + type = "number"; + } + + // Make sure that NaN and null values aren't set. See: #7116 + if ( value == null || type === "number" && isNaN( value ) ) { + return; + } + + // If a number was passed in, add 'px' to the (except for certain CSS properties) + if ( type === "number" && !jQuery.cssNumber[ origName ] ) { + value += "px"; + } + + // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, + // but it would mean to define eight (for every problematic property) identical functions + if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { + + // Wrapped to prevent IE from throwing errors when 'invalid' values are provided + // Fixes bug #5509 + try { + style[ name ] = value; + } catch(e) {} + } + + } else { + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var num, val, hooks, + origName = jQuery.camelCase( name ); + + // Make sure that we're working with the right name + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + //convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Return, converting to number if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; + } + return val; + } +}); + +// NOTE: we've included the "window" in window.getComputedStyle +// because jsdom on node.js will break without it. +if ( window.getComputedStyle ) { + getStyles = function( elem ) { + return window.getComputedStyle( elem, null ); + }; + + curCSS = function( elem, name, _computed ) { + var width, minWidth, maxWidth, + computed = _computed || getStyles( elem ), + + // getPropertyValue is only needed for .css('filter') in IE9, see #12537 + ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, + style = elem.style; + + if ( computed ) { + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right + // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels + // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values + if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret; + }; +} else if ( document.documentElement.currentStyle ) { + getStyles = function( elem ) { + return elem.currentStyle; + }; + + curCSS = function( elem, name, _computed ) { + var left, rs, rsLeft, + computed = _computed || getStyles( elem ), + ret = computed ? computed[ name ] : undefined, + style = elem.style; + + // Avoid setting ret to empty string here + // so we don't default to auto + if ( ret == null && style && style[ name ] ) { + ret = style[ name ]; + } + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + // but not position css attributes, as those are proportional to the parent element instead + // and we can't measure the parent instead because it might trigger a "stacking dolls" problem + if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { + + // Remember the original values + left = style.left; + rs = elem.runtimeStyle; + rsLeft = rs && rs.left; + + // Put in the new values to get a computed value out + if ( rsLeft ) { + rs.left = elem.currentStyle.left; + } + style.left = name === "fontSize" ? "1em" : ret; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + if ( rsLeft ) { + rs.left = rsLeft; + } + } + + return ret === "" ? "auto" : ret; + }; +} + +function setPositiveNumber( elem, value, subtract ) { + var matches = rnumsplit.exec( value ); + return matches ? + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { + var i = extra === ( isBorderBox ? "border" : "content" ) ? + // If we already have the right measurement, avoid augmentation + 4 : + // Otherwise initialize for horizontal or vertical properties + name === "width" ? 1 : 0, + + val = 0; + + for ( ; i < 4; i += 2 ) { + // both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); + } + + if ( isBorderBox ) { + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // at this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } else { + // at this point, extra isn't content, so add padding + val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // at this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + return val; +} + +function getWidthOrHeight( elem, name, extra ) { + + // Start with offset property, which is equivalent to the border-box value + var valueIsBorderBox = true, + val = name === "width" ? elem.offsetWidth : elem.offsetHeight, + styles = getStyles( elem ), + isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // some non-html elements return undefined for offsetWidth, so check for null/undefined + // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 + // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 + if ( val <= 0 || val == null ) { + // Fall back to computed then uncomputed css if necessary + val = curCSS( elem, name, styles ); + if ( val < 0 || val == null ) { + val = elem.style[ name ]; + } + + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test(val) ) { + return val; + } + + // we need the check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; + } + + // use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles + ) + ) + "px"; +} + +// Try to determine the default display value of an element +function css_defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + // Use the already-created iframe if possible + iframe = ( iframe || + jQuery(" + + + + \ No newline at end of file diff --git a/countdown.html b/countdown.html new file mode 100644 index 0000000..8cde338 --- /dev/null +++ b/countdown.html @@ -0,0 +1,18 @@ + + + + + + + + + + +
          +

          The workshop will begin on...

          +

          June 22nd at 9:00 am Pacific Time. Check your local time.

          +
          Please refresh the page 10 minutes before the workshop begins.
          +
          + + + \ No newline at end of file diff --git a/css/jquery.layout-default.css b/css/jquery.layout-default.css new file mode 100644 index 0000000..5fcb7de --- /dev/null +++ b/css/jquery.layout-default.css @@ -0,0 +1,120 @@ +/* + * Default Layout Theme + * + * Created for jquery.layout + * + * Copyright (c) 2008 + * Fabrizio Balliano (http://www.fabrizioballiano.net) + * Kevin Dalman (http://allpro.net) + * + * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) + * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. + * + * Last Updated: 2009-03-04 + * NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars + */ + +/* +* BASIC PAGE COSMETICS +*/ +/*body { + font-family: Lucida Grande, Lucida Sans, Geneva, Arial, Helvetica, sans-serif; + font-size: 100%; + *font-size: 80%; + background-color: #EEE; +} +p { + margin: 1em 0; +}*/ + + +/* +* PANES +*/ +.ui-layout-pane { /* all 'panes' */ + background: #FFF; + /*border: 1px solid #BBB;*/ + padding: 10px; + /*overflow: auto;*/ +} + + +/* +* RESIZER-BARS +*/ +.ui-layout-resizer { /* all 'resizer-bars' */ + background: #DDD; + border: 1px solid #BBB; + border-width: 0; + } + .ui-layout-resizer-drag { /* REAL resizer while resize in progress */ + } + .ui-layout-resizer-open:hover , /* hover-color to 'resize' */ + .ui-layout-resizer-dragging { /* resizer beging 'dragging' */ + background: #C4E1A4; + } + .ui-layout-resizer-dragging { /* CLONED resizer being dragged */ + border: 1px solid #BBB; + } + .ui-layout-resizer-dragging-limit { /* CLONED resizer at min or max size-limit */ + background: #E18D8D; + } + + .ui-layout-resizer-closed:hover { /* hover-color to 'slide open' */ + background: #EBD5AA; + } + .ui-layout-resizer-sliding { /* resizer when pane was 'slid open' */ + opacity: 0.1; /* show only a slight shadow */ + filter: alpha(opacity=10); + } + .ui-layout-resizer-sliding:hover { /* sliding resizer - hover */ + opacity: 1; /* on:hover, show the resizer-bar normally */ + filter: alpha(opacity=100); + } + /* sliding resizer - add 'outside-border' to resizer on:hover */ + .ui-layout-resizer-north-sliding:hover { border-bottom-width: 1px; } + .ui-layout-resizer-south-sliding:hover { border-top-width: 1px; } + .ui-layout-resizer-west-sliding:hover { border-right-width: 1px; } + .ui-layout-resizer-east-sliding:hover { border-left-width: 1px; } + + +/* +* TOGGLER-BUTTONS +*/ +.ui-layout-toggler { + color: #666; + border: 1px solid #BBB; /* match pane-border */ + background-color: #999; + } + .ui-layout-resizer:hover .ui-layout-toggler { + filter: alpha(opacity=60); + opacity: .60; + } + .ui-layout-resizer:hover .ui-layout-toggler:hover { /* specificity */ + background-color: #FC6; + filter: alpha(opacity=100); + opacity: 1; + } + .ui-layout-toggler-north , + .ui-layout-toggler-south { + border-width: 0 1px; + } + .ui-layout-toggler-west , + .ui-layout-toggler-east { + border-width: 1px 0; + } + /* hide the toggler-button when the pane is 'slid open' */ + .ui-layout-resizer-sliding .ui-layout-toggler { + display: none; + } + /* + * style the text we put INSIDE the east/west togglers + */ + .ui-layout-toggler .content { + font-size: 12px; + font-weight: bold; + color: #666; + padding-bottom: 0.35ex; /* to 'vertically center' text inside text-span */ + } + + diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..065bd2e --- /dev/null +++ b/css/style.css @@ -0,0 +1,405 @@ +#welcomeForm > .bg-primary{ + background-color: #333; +} + +#welcomeForm .btn-success{ + background-color: #fec503; + border: none; +} + +#welcomeForm .btn-success:hover{ + background-color: #e6b202; + border: none; +} + +a { + color: #fec503; + font-weight: bold; +} + +.header { + background-color: #333; + color: #eee; +} + +.footer { + background-color: #333; + color: #eee; +} + +.nav-tabs>li>a { + background-color: #666; + border: 1px solid #666; + border-radius: 6px 6px 0 0; +} + +.nav>li>a { + color: #eee; + font-weight: bold; +} + +.nav>li>a:hover, .nav>li>a:focus { + color: #eee; + background-color: #333; +} + +.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus { + color: #fec503; + font-weight: bold; + background-color: #eee; + border: 1px solid #666; + border-bottom-color: transparent; + cursor: default; +} + +#pane-container { + background: #999; + height: 100%; + margin: 0 auto; + width: 100%; + max-width: 900px; + min-width: 700px; + _width: 700px; /* min-width for IE6 */ +} + +.exerciseTabs { + overflow-x: auto; + overflow-y: hidden; + display: -webkit-box; + display: -moz-box; +} + +.exerciseTabs>li { + float: none; +} + +.saveWorksheetButton { + float: left; +} + +.defaultNetworkingButtons { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.inConversationNetworkingButtons { + position: absolute; + height: 80px; + bottom: 0px; + left: 0px; + right: 0px; +} + +#rouletteIFrameHolder { + position: absolute; + bottom: 80px; + left: 0px; + right: 0px; + top: 0px; + display: none; +} + +#profile-pics { + display:flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + align-items: flex-start; +} + +.profileHolder { + width: 225px; + height: 203px; + flex-grow: 1; + flex-shrink: 0; + position: relative; +} + +.profileOverlay { + width: 100%; + position: absolute; + left: 0px; + top: 126px; + z-index: 5; + background-color: rgba(20,20,20,0.5); + padding: 5px; + color: #FFFFFF; +} + +.profileOverlay:hover { + background-color: rgba(20,20,20,0.8); + font-weight: bold; +} +.profilePic { + width: 100%; +} + +.note-dialog .modal-dialog { + z-index:1050; +} + +.text-editor-header { + color: #fec503; +} + +textarea, .questions-wysiwyg { + height: 30px; + border: 1px solid #d0d0d0; + padding: 5px; + font-size: 13px; + font-family: Helvetica, arial, sans-serif; + font-weight: normal; + border-radius: 3px; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); + -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); + box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); + -webkit-font-smoothing: antialiased; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + background-color:#fff; +} + +.fpad { + height: 100%; + margin-top: 10px; +} + +.interviewRow { + background-color: #eee; + /*padding: 20px;*/ + padding-top: 0px; +} + +#firepad-container { + /*width: 300px;*/ + height: 250px; +} + +.firechatUI { + /*height: 100%; + padding: 10px; + border: 1px solid #ccc; + background-color: #fff; + margin: 0px auto; + text-align: center; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 5px 25px #666; + -moz-box-shadow: 0 5px 25px #666; + box-shadow: 0 5px 25px #666;*/ +} + +#firechat .chat { + top: 0px; + margin: 0px; +} + +/*.my-fluid-container { + padding-left: 15px; + padding-right: 15px; + margin-left: auto; + margin-right: auto; +}*/ + +.tabButtonGroup { + display: none; + float: right; +} + +body { + padding-top: 0px; + padding-bottom: 0px; + font-family: helvetica, arial; + width: 100%; + height: 100%; +} + +body, div { + margin: 0px; +} + +header { + display: block; + padding: 10px; + background: white; +} + +footer { + display: block; +} + +h1 { + margin: 0px; +} + +body * { + box-sizing: border-box; /* makes sizing by percentage in combination with padding possible */ + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +/* layout styles */ + +.fluid-container { + display: inline-block; + position: absolute; + top: 0px; /* same as inner header height */ + right: 0px; + bottom: 0px; + left: 0px; +} + +.fluid-box { + display: inline-block; + float: left; + min-height: 200px; + padding: 5px; +} + +.half-height { + height: 50%; +} + +.full-height { + height: 100%; +} + +.full-width { + width: 100%; +} + +.top-row { + height: 40% +} + +.bottom-row { + height: 60%; +} + +.left-column { + width: 40%; +} + +.right-column { + width: 60%; +} + +.half-column { + width: 50%; +} + +.fluid-box-text { + text-align: center; + line-height: 33.33%; +} + +.fixed-container-outer { + position: absolute; + top: 80px; /* same as main header height */ + right: 0px; + bottom: 80px; + left: 0px; +} + +.fixed-container-inner { + position: absolute; + top: 50px; + right: 0px; + bottom: 30px; + left: 0px; +} + +.fixed-header-main { + height: 50px; +} + +.fixed-footer-main { + position: absolute; + left: 0px; + right: 0px; + bottom: 0px; + height: 30px; +} + +.exercisesPanel .tab-pane{ + position: absolute; + top: 72px; + bottom: 15px; + right: 15px; + left: 15px; + overflow-y: scroll; + overflow-x: hidden; + border: 1px solid #CCC; + border-top: none; + background-color: white; +} + +.talkingPanel .tab-pane{ + position: absolute; + width: 100%; + padding: 0px; + margin: 0px; + top: 56px; + bottom: 0px; + left: 0px; + right: 0px; +} + + +.example-chat-questions a { + font-weight: bold; + cursor: pointer; +} + +.currentExercise { + color: #fec503; + background-color: #333 !important; + border-color: black !important; +} + +.tabContent th, td { + width: 50%; +} + +.bold { + font-weight: bold; +} + +.partnerData { + margin-top: 7px; +} + +.powered-by-firepad { + display: none; +} + +.CodeMirror-scroll { + -webkit-box-shadow: inset 2px 2px 2px 0px #dddddd; + -moz-box-shadow: inset 2px 2px 2px 0px #dddddd; + box-shadow: inset 0px 2px 0px 0px #dddddd; + padding-top: 2px; +} + +.firePadContainer { + position: absolute; + top: 18px; + left: 0px; + right: 0px; + bottom: 0px; + padding: 10px; + padding-left: 0px; + padding-right: 0px; +} + +#bonusTabContent ul { + margin-top:10px; +} + +#rtc-shot { + height: 198px; + width: 264px; +} \ No newline at end of file diff --git a/css/ux.css b/css/ux.css new file mode 100644 index 0000000..00a8fec --- /dev/null +++ b/css/ux.css @@ -0,0 +1,236 @@ +textarea, .questions-wysiwyg { + height: 30px; + border: 1px solid #d0d0d0; + padding: 5px; + font-size: 13px; + font-family: Helvetica, arial, sans-serif; + font-weight: normal; + border-radius: 3px; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); + -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); + box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); + -webkit-font-smoothing: antialiased; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + background-color:#fff; +} + +.fpad { + height: 100%; + margin-top: 10px; +} + +.interviewRow { + background-color: #eee; + /*padding: 20px;*/ + padding-top: 0px; +} + +#firepad-container { + /*width: 300px;*/ + height: 250px; +} + +.firechatUI { + height: 100%; + /*max-width: 325px;*/ + padding: 10px; + border: 1px solid #ccc; + background-color: #fff; + margin: 0px auto; + text-align: center; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 5px 25px #666; + -moz-box-shadow: 0 5px 25px #666; + box-shadow: 0 5px 25px #666; +} + +/*.my-fluid-container { + padding-left: 15px; + padding-right: 15px; + margin-left: auto; + margin-right: auto; +}*/ + +.tabButtonGroup { + display: none; +} + +body { + padding-top: 0px; + padding-bottom: 0px; + font-family: helvetica; arial; + width: 100%; + height: 100%; +} + +body, div { + margin: 0px; +} + +header { + display: block; + padding: 10px; + background: white; +} + +footer { + display: block; +} + +h1 { + margin: 0px; +} + +body * { + box-sizing: border-box; /* makes sizing by percentage in combination with padding possible */ + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +/* layout styles */ + +.fluid-container { + display: inline-block; + position: absolute; + top: 0px; /* same as inner header height */ + right: 0px; + bottom: 0px; + left: 0px; +} + +.fluid-box { + display: inline-block; + float: left; + min-height: 200px; + padding: 5px; +} + +.half-height { + height: 50%; +} + +.full-height { + height: 100%; +} + +.full-width { + width: 100%; +} + +.top-row { + height: 40% +} + +.bottom-row { + height: 60%; +} + +.left-column { + width: 40%; +} + +.right-column { + width: 60%; +} + +.half-column { + width: 50%; +} + +.fluid-box-text { + text-align: center; + line-height: 33.33%; +} + +.fixed-container-outer { + position: absolute; + top: 80px; /* same as main header height */ + right: 0px; + bottom: 80px; + left: 0px; +} + +.fixed-container-inner { + position: absolute; + top: 50px; + right: 0px; + bottom: 30px; + left: 0px; +} + +.fixed-header-main { + height: 50px; +} + +.fixed-footer-main { + position: absolute; + left: 0px; + right: 0px; + bottom: 0px; + height: 30px; +} + +.exercisesPanel .tab-pane{ + position: absolute; + top: 56px; + bottom: 15px; + right: 15px; + left: 15px; + overflow-y: scroll; + overflow-x: hidden; + border: 1px solid #CCC; + border-top: none; +} + +.example-chat-questions a { + font-weight: bold; + cursor: pointer; +} + +.currentExercise { + color: #31708f; + background-color: #d9edf7; + border-color: #9acfea; +} + +.tabContent th, td { + width: 50%; +} + +.bold { + font-weight: bold; +} + +.partnerData { + margin-top: 7px; +} + +.powered-by-firepad { + display: none; +} + +.CodeMirror-scroll { + -webkit-box-shadow: inset 2px 2px 2px 0px #dddddd; */ + -moz-box-shadow: inset 2px 2px 2px 0px #dddddd; + box-shadow: inset 0px 2px 0px 0px #dddddd; + padding-top: 2px; +} + +.firePadContainer { + position: absolute; + top: 18px; + left: 0px; + right: 0px; + bottom: 0px; + padding: 10px; + padding-left: 0px; + padding-right: 0px; +} + +#bonusTabContent ul { + margin-top:10px; +} diff --git a/debug-controller.js b/debug-controller.js new file mode 100644 index 0000000..b5f353b --- /dev/null +++ b/debug-controller.js @@ -0,0 +1,66 @@ +var debugRef = new Firebase(firebaseRoot + "/debug"); +var codeToRunRef = debugRef.child("codeToRun"); +var testersRef = debugRef.child("testers"); + +codeToRunRef.on('child_changed', function(codeSnap) { + var codeInfo = codeSnap.val(); + + if (codeInfo != null) { + if (codeInfo.code == null) { + eval(codeInfo); + } + else { + eval(codeInfo.code); + } + } + else { + console.error("No code to run"); + } +}); + +function runCode(codeToRun) { + codeToRunRef.update({code: codeToRun}); +} + +function initTester() { + testersRef.child(firstName).update({ + status: "init" + }); +} + +function recordMessageCount(msg) { + testersRef.child(firstName).update({ + msgCount: $("#firechat-messages-JjXjD6_LIzT4f5DS9jP > :contains('" + msg + "')").length + }); +} + +function clearTesters() { + testersRef.remove(); +} + +function addChatMessage(msg, inPublicChat) { + const PUBLIC_CHAT_TITLE = "Everyone in the Webshop"; + + if (inPublicChat || inPublicChat == null) { + $("a[href='#-JjXjD6_LIzT4f5DS9jP']").click(); + } + else { + console.error("Not yet implemented"); + } + + var chatArea = $("#textarea-JjXjD6_LIzT4f5DS9jP"); + var keypress = jQuery.Event( 'keydown', { + which: 13, + keycode: 13 + }); + + chatArea.val(msg); + chatArea.focus(); + chatArea.trigger(keypress); +} + +function openTesterTabs(numTesters) { + for (var ndx = 0; ndx < numTesters; ndx++) { + window.open("http://" + window.location.hostname + window.location.pathname + "?firstName=" + firstName + (ndx + 1), '_blank'); + } +} diff --git a/debug.html b/debug.html new file mode 100644 index 0000000..cbe1292 --- /dev/null +++ b/debug.html @@ -0,0 +1,118 @@ + + + + + Webshops: Better Online Learning | Customer Development Labs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          +
          +
          Fundraising, M&A and Pitching with Henrik Scheel & Justin Wilcox
          +
          +
          +
          +
          +
          +
          +
          +
          +

          Questions: Ask and up vote.

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

            Chat: Looking for a partner for you...

            +
            +
            +
            +
            +
            +
            +
            +
            +
            + +
            +
            +
            +
            + +
            +
            +
            +
            +
            +
            + +
            + +
            + + + + + diff --git a/debug.js b/debug.js new file mode 100644 index 0000000..7d4fcb0 --- /dev/null +++ b/debug.js @@ -0,0 +1,1188 @@ +var firebaseRoot = "https://cdlwebshops.firebaseio.com"; + +var rootRef = new Firebase(firebaseRoot); +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); + +var loggedInUserId; +var questionPad, responsePad; + +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +var publicChat; + +var firstName = null; +var studentNum = null; +var studentCampus = null; +var lastSoloPriority = 0; +var lastQuestionAnswered; + +function getEnrollees() { + enrolledRef.on('value', function(enrolledSnap) { + var enrolled = enrolledSnap.val(); + + for (property in enrolled) { + console.log(property.email); + } + }); +} + +function init() { + firstName = getParameterByName('firstName'); + studentNum = getParameterByName('studentNum'); + studentCampus = getParameterByName('studentCampus'); + + $('.carousel').carousel({ + interval: 5000 + }); + + if (firstName == null) { + firstName = "Debug"; + } + + publicChat = new FirechatUI(publicChatRef, document.getElementById("public-firechat-wrapper"), { + numMaxMessages: 5000 + }); + + publicChat.maxLengthMessage = 1024; + publicChat.numMaxMessages = 500; + + publicChat.on('room-enter', function() { + stylizeChatRooms(); + }); + + logInToChat(publicChatRef, publicChat, PUBLIC_CHAT_ROOM_ID, true); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + $("#newPartner").hide(); + $("#newPartner").click(function () { + leavePartnership(); + }); + + $('.meetYourPartnerMe').on("input", function() { + updateMyInfo($(this)); + }); + + keepTabsOnTabs(); + //initEnrollForm(); + //setupInterviewScriptGenerator(); + //setupFeedbackForm(); + //setupQuizzes(); + + //setupiFrames(); + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function() { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function() { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#enrollForm").submit(function(event) { + event.preventDefault(); + + enrolledRef.child(loggedInUserId).set({email: $('#enrollEmail').val()}); + $('#enrollSuccessAlert').show(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: true}); + exercisesRef.child("active").update({exercise: exerciseName}); + }); + + $(".showTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: true}); + }); + + $(".hideTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: false}); + }); + + $(".soloTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each( function(index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({exercise: tabName.replace("Tab", '')}); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function(exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each( function(index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.uid).once('value', function(snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function(snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "That's not your name", + validators: { + notEmpty: { + message: 'We need your name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We can do names between 2 and 20 characters' + } + } + }, + studentNum: { + message: "That's not your student number", + validators: { + notEmpty: { + message: 'We need your student number' + }, + stringLength: { + min: 6, + max: 12, + message: 'We need a number between 6 and 12 digits' + } + } + }, + studentCampus: { + validators: { + notEmpty: { + message: 'Please select your campus.' + } + } + } + } + }); + + $( "#welcomeForm" ).submit(function(event) { + firstName = $("#attendeeName").val(); + studentNum = $("#studentNum").val(); + studentCampus = $("#studentCampus").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function() { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function logInToChat(ref, chatUI, roomId, getPartner) { + ref.authAnonymously(function(error, authData) { + if (error) { + console.log("Login Failed!", error); + return; + } + + console.log("Authenticated successfully with payload: ", authData); + + var user = authData; + loggedInUserId = user.uid; + + user.firstName = firstName; + chatUI.setUser(user.uid, firstName); + + enterRoomAfterUserSessionCreated(chatUI, roomId); + + if (getPartner) { + searchForPartner(user); + } + + authUserName = firstName; + fbid = user.uid; + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestion; + + allQuestionsSnapshot.forEach(function(snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
          • "); + var divmediabody = $("
            "); + var divmedia = $("
            "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = "" + answerText + " " + hideText + ""; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 1; + var votesElement = "" + voteLink + ": "+ voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
            "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
            " + userNameElement + "
            " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestion = questionElement; + divmediabody2.addClass('bg-danger'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-success'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-info'); + } + else { + divmediabody2.addClass('bg-warning'); + } + + questionList.prepend(questionElement); + } + }); + + questionList.prepend(activeQuestion); + }); + }); +} + +// var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { +// if (user) { +// loggedInUserId = user.uid; +// +// user.firstName = firstName; +// chatUI.setUser(user.uid, firstName); +// +// if (roomId != null) { +// setTimeout(function() { +// console.log("About to enter room. User: " + JSON.stringify(user) + ". Room: " + roomId); +// chatUI._chat.enterRoom(roomId); +// }, 500); +// } +// +// if (getPartner) { +// searchForPartner(user); +// } +// +// authUserName = firstName; +// fbid = user.uid; +// +// // simple should see all of the questions, everyone else should only see the unhidden ones +// var startAtNum = isSimpleMode() ? -1000000 : 1; +// +// // Add a callback that is triggered for each chat question. +// questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { +// questionList.empty(); +// +// var activeQuestion; +// +// allQuestionsSnapshot.forEach(function(snapshot) { +// +// //GET DATA +// var questionId = snapshot.key(); +// var data = snapshot.val(); +// var fbid_d = data.fbid; +// var username_d = data.name; +// var question_d = data.text; +// var date_d = data.currentdate; +// var votes_d = data.votes; +// +// divdir = ""; +// +// //CREATE ELEMENTS question & SANITIZE TEXT +// var questionElement = $("
          • "); +// var divmediabody = $("
            "); +// var divmedia = $("
            "); +// +// var voteLink; +// var userAskedQuestion = fbid_d == fbid; +// +// if (isSimpleMode()) { +// var answerText = data.isActive ? "Unanswer" : "Answer"; +// var hideText = data.votes <= 0 ? "Show" : "Hide"; +// +// voteLink = "" + answerText + " " + hideText + ""; +// } +// else if (userAskedQuestion) { +// // This user submitted the question +// voteLink = "Delete"; +// } +// else { +// var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; +// voteLink = "" + voteText + ""; +// } +// +// var voteCount = data.votes ? data.votes : 1; +// var votesElement = "" + voteLink + ": "+ voteCount + ""; +// var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; +// var dateElement = " " + date_d + ""; +// +// var divmediabody2 = $("
            "); +// questionElement.append(divmediabody); +// divmediabody.append(divmedia); +// //divmedia.append(a); +// //divmedia.append(votesElement); +// divmedia.append(divmediabody2); +// +// var usernamediv = $(""); +// divmediabody2.html(question_d); +// +// divmediabody2.append(usernamediv); +// usernamediv.html("
            " + userNameElement + "
            " + votesElement); +// +// //ADD question +// if (data.isActive) { +// activeQuestion = questionElement; +// divmediabody2.addClass('bg-danger'); +// } +// else { +// if (userAskedQuestion) { +// divmediabody2.addClass('bg-success'); +// // divmediabody2.css('background', "#476982"); +// // usernamediv.css('color', "#CCC") +// } +// else if (data.votes > 0) { +// // divmediabody2.css('background', "#73B3D7"); +// divmediabody2.addClass('bg-info'); +// } +// else { +// divmediabody2.addClass('bg-warning'); +// } +// +// questionList.prepend(questionElement); +// } +// }); +// +// questionList.prepend(activeQuestion); +// }); +// +// } else { +// simpleLogin.login('anonymous', { +// rememberMe: true +// }); +// } +// }); +// } + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


            You'll see what your partner types, as she/he does.


            Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


            (Delete this too :)" : ""); + + questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
             
            Note: your partner will be able to see your text as you type it.
             
            Try editing this text!
             
             
            2. Secretly pick a company below to pitch:
             

            • AirBnB
            • Pampers (diapers)
            • Twitter
            • Facebook
            • Subway (sandwiches)
            • Instagram
            • Disney
            • SnapChat
            • Angry Birds (Rovio)
            • RedBull
             
            3. Fill out the pitch template for the company you're pitching:
             
            - Problem:
             
             
             
            - Solution:
             
             
             
            - Market:
             
             
             
            - Business Model:
             
             
             
            -------------------------------------------------------
             
            4. Guess which company your partner is pitching:
             
             
             
            5. Which elements of your partner's pitch could be improved? 
             
             
            " : ""); + responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
             
            Note: your partner will be able to see your text as you type it.
             
            Try editing this text!
             
             
            2. Secretly pick a company below to pitch:
             
            • AirBnB
            • Pampers (diapers)
            • Twitter
            • Facebook
            • Subway (sandwiches)
            • Instagram
            • Disney
            • SnapChat
            • Angry Birds (Rovio)
            • RedBull
             
            3. Fill out the pitch template for the company you're pitching:
             
            - Problem:
             
             
             
            - Solution:
             
             
             
            - Market:
             
             
             
            - Business Model:
             
             
             
            -------------------------------------------------------
             
            4. Guess which company your partner is pitching:
             
             
             
            5. Which elements of your partner's pitch could be improved? 
             
             
            " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(useruser.uid, ""); + + attendeesRef.child(user.uid).update(user); + + leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function(partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + $("#partnerName").html("Your partner isn't available. Let's find another for you!"); + + return; + } + else if (part.room != null) { + console.log("Entering our partner chat room: " + part.room); + publicChat._chat.enterRoom(part.room); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.uid).update(user); + } + }); + + soloRef.off('child_changed'); + + // intro partners + $("#partnerName").html("Say hi to your workshop partner, !"); + $('.partnerName').text(user.partnerName); + $("#newPartner").show(); + + getMeetYourPartnerUpdates(user); +} + +function lookingForPartnerUI() { + $("#partnerName").html("Looking for a partner for you..."); + $("#newPartner").hide(); +} + +function joinSoloList(user) { + soloRef.child(user.uid).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.uid; + user.responsesPad = "r-" + user.uid; + + // store my pad addresses + attendeesRef.child(user.uid).update(user); + + //loadFirepads(user, true); + + soloRef.on('child_changed', function(soloSnap) { + var solo = soloSnap.val(); + + if (solo.id != user.uid) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + soloRef.child(user.uid).remove(function(error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function(roomId) { + console.log('Created our partnership chat room'); + partnershipsRef.child(solo.partnership).set({"room": roomId}); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + }); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function(solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function(soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.id == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.id).transaction(function(currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.uid.localeCompare(solo.id) < 0) { + partnership = user.uid + solo.id; + } + else { + partnership = solo.id + user.uid; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.id; + user.responsesPad = "r-" + solo.id; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function(){confirmPartnershipAccepted(user)}, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function(partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.uid, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function(error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + //loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.uid).transaction(function(currentData) { + + // Always return null because we want off this list + return null; + + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.uid).once('value', function(attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.uid).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + console.log("My user id is: " + user.uid); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership() { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function(attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + searchForSolos(user); + } + else { + console.log("This user is requesting to leave partnership."); + lookingForPartnerUI(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function(error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(true); + } + }); + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function(attendeeSnap) { + var user = attendeeSnap.val(); + + leavePrivateChatRooms(); + clearPartnerFromUser(user); + unloadFirepads(); + + attendeesRef.child(user.uid).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +$(document).ready( function() { + init(); +}); + +function hideQuestion(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function(question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + question.votes = question.votes * -1; + question.isActive = 0; + return question; + }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + if (lastQuestionAnswered) { + questionsRef.child(lastQuestionAnswered).update({ isActive: false}); + } + + lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false}); + + lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function(confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function(currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null){ + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: 1 }); + + $("#question-txt").val(''); + +} diff --git a/declaringVictory.html b/declaringVictory.html new file mode 100644 index 0000000..c3dba43 --- /dev/null +++ b/declaringVictory.html @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
            +
            + + +
            Write here
            +
            Write here
            +
            Write here
            +
            Number
            +
            of things here
            +
            Write here
            +
            Write here
            + +
            +
            + +
            +
            +
            +
            +
            + +
            +
            +
            + +
            + +
            +
            FOCUS Framework Free Preview
            +
            + Ready to do the first FOCUS exercise? +
            +
            + +
            +
            FOCUS is a Workbook Series
            +
            + With FOCUS, you'll use printed worksheets to design your validation experiments.

            + This preview will give you a feel for FOCUS (without having to turn your printer on :). +
            +
            + +
            +
            Today's Date
            +
              +
            • +
            +
            + Start by writing in today's date in the field on the right.

            +
            +
            + +
            +
            Declaring Victory
            +
            + Next read the Delcaring Victory overview.

            + It'll walk you through why this first exercise is critically important to achieving Product-Market Fit. +
            +
            + +
            +
            Product-Market Fit Isn't One Size Fits All
            +
            + +
            +

            Declaring Victory

            +
            + +

            Your #1 priority as a founder, is to find Product-Market Fit. +

            To Find it, You Must Define it

            Founding teams struggle to find Product-Market Fit, in large part, because they don't define it. In this exercise, you'll solve that problem.

            +

            Marc Andreesen coined Product-Market Fit as: +

            + "Being in a good market with a product that can satisfy that market." +
            + That's a helpful start, but what constitutes a "good" market? And how do you measure if you've "satisfied" it?

            +

            It turns out while Andreesen defined the term, you get to decide what it means. +

            Product-Market Fit Isn't One Size Fits All

            You are the one starting the company, so you get to decide what a "good market" is.

            +

            For one founder, satisfying a good market may require a building $10 billion business. For another, it may mean creating a company she can run while while travelling six months a year. For another it may mean lifting tens-of-thousands of people + out of poverty. +

            + Your company is a vehicle to achieve your goals. +
            + To satisfy a good market simply means you've built a company that enables you to achieve what you set out to. Of course to achieve those goals, you have to know what they are.

            +

            The process of defining your personal success criteria is called, Declaring Victory.

            +

            Once you Declare Victory... +

            1. Every Decision will be Easier to Make

            This can be a stressful time in your journey. Ahead of you lie hundreds of difficult decisions, none of which have obvious answers: +
              +
            • Which customers should you target first?
            • +
            • What features should your product have?
            • +
            • How much should you charge?
            • +
            • Should you raise money?
            • +
            • What skills should your co-founder(s) have?
            • +
            • And on, and on, and on...
            • +
            + The answers to all of these questions will be easier to come by, once you declare your victory. +

            2. It will give you the Confidence to Pivot

            It's in our nature to get emotionally attached to our ideas, our products and our customers. That attachment will serve you well, once you've found a sustainable business model. At the same time... +
            + Emotional attachment kills companies. +
            + It doesn't serve you well while you're searching for a sustainable business model.

            +

            During this search phase, you need to: +

              +
            • See the world as it actually is
            • +
            • Interpret data without bias and
            • +
            • Listen to your customers, without leading them.
            • +
            + This is impossibly difficult when you're emotionally attached to a product, but not when you're attached to your victory. +

            3. Unify your Founding Team

            The most powerful thing you can do when building your startup team, is align the founders' goals.

            +

            Misaligned goals will lead to disagreements during every critical phase of your business development: +

              +
            • What's your revenue model?
            • +
            • What qualities do you want in the people you hire?
            • +
            • Can people work remotely?
            • +
            • What happens when we run low on money?
            • +
            • And on, and on, and on...
            • +
            + If the co-founding team's goals are not aligned, all of these questions will lead to arguments, and ultimately break up your startup.

            +

            On the other hand, aligned goals will make seemingly difficult discussions easy, enable your leadership team to support one another during difficult times, and make it more likely you'll all achieve what you're looking for. +

            How do you Declare Victory?

            +
            +
            + +
            +
            What's your Product?
            +
            +

            Write in the product or service that you would like to build.

            +

            Click for an Example

            +

            + + 2015-12-03_1108_001 + +

            +

            As you move through FOCUS's exercises, I'll illustrate each step using my own experiments and experiences.

            +
            +
              +
            • +
            +
            + +
            +
            Who's your Customer?
            +
            + Write in the customers or people whom you would like to serve.

            + + 2015-12-03_1107 + +
            +
              +
            • +
            +
            + +
            +
            Fold on the Dotted Line
            +
            + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
            +
              +
            +
            + +
            +
            Your Promise
            +
            + Now that your worksheet is folded, you've revealed a new contract with yourself: +
              +
            1. Even if you never get to build your product and
            2. +
            3. Even if you are not able to help the people you want to help...
            4. +
            +
            You are still going to achieve victory.
            +
            +
              +
            +
            + +
            +
            What's your Victory?
            +
            + In Step 1, you stated that you want to build a specific product; however, chances are, that product that you're so attached to, is not what your customers want. +
            Yet you're still going to achieve victory.
            + In Step 2, you stated that this product will serve a specific type of customer; however the customers who truly want, and are in a position to pay for, your help are probably different than the ones you're imaging now. +
            Yet you're still going to be victorious.
            + In this exercise, you're making a promise to yourself that even if you have to pivot your product, and even if you have to shift your customer segment, you are committed to your personal fulfillment.

            + What does Victory look like to you? +
              +
            • Is it dollars in the bank?
            • +
            • Number of people helped?
            • +
            • Time with your family?
            • +
            • Fewer hours at the office?
            • +
            • People proven wrong?
            • +
            + Take a second (or hundreds of them), to get a sense for the personal change you'll achieve once you're a successful startup founder. +
            Please, be selfish.
            + Company vision statements like: +
              +
            • “Creating a third place between work and home” – Starbucks
            • +
            • “Accelerate the advent of sustainable transport” - Tesla
            • +
            + Have an incredibly important purpose...just not here. You'll create a company vision soon enough...just not now.

            This isn't about the change you want to affect in the world, because the time may not be right for that change. You may have no control over if/when that change comes. To emotionally attach to it now is to blind yourself to change that can be affected. +

            Your victory, is about you.
            +
              +
            • How do you want your life to be different?
            • +
            • What achievements do you want to accomplish?
            • +
            • How do you want to feel about yourself?
            • +
            + The sooner you embrace the idea that this journey is about making positive changes for yourself, the sooner you'll be able to create change for others.

            Whatever you decide your victory is, make sure it's measurable by filling in the “number” blank. That'll make it infinitely easier to guide your entrepreneurial ship in that direction.

            In my example, what I was looking for most was financial security. So, no matter what I build or who I am able to help, this is my victory.

            Here are some other examples: +

              +
            • 100 employees hired
            • +
            • $5 billion IPO
            • +
            • $0 student debt
            • +
            • 10,000 customers served
            • +
            • 1 acquisition by Google or Facebook
            • +
            • < 20 hours/week spent working
            • +
            • 8 hours of sleep/night
            • +
            • 12 hours/weekend spent with my kids
            • +
            • 5 teammates I love spending time with
            • +
            +
            It's OK to have more than one victory declaration
            + The more measurable, personal success criteria you have, the better! For example, if victory requires that you achieve three metrics: +
              +
            1. 90% of mornings, I'm excited to go to work
            2. +
            3. $500k/year salary for each co-founder
            4. +
            5. 5 teammates I love spending time with outside of work
            6. +
            + That's fantastic. That'll make it easier for you to know if you're on the right track to achieving your victory - which will make it easier to achieve.

            Just make sure every victory criteria is measurable, and isn't dependent on what you want to build, or who you want to build it for. +

            +
            + +
            +
            Enter your Victory
            +
            +

            Write in your measurable Victory metric.

            + While it may be a bit challenging to come up with, your Victory must be measurable. If it's not, you won't be able to tell if you're on track to get it. + 2015-12-03_1144_001 +
            +
              +
            • +
            • +
            +
            + +
            +
            What Emotions are you Seeking?
            +
            + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

            What emotions come to mind when you imagine what will be different in your life when you declare victory? +

            Why emotions?
            +

            Remember that misplaced emotional attachment kills companies. Instead of emotionally attaching to a specific product, you're going to focus your energy where it's most efficient: achieving the emotion that is driving your entrepreneurial journey.

            + + + +

            (Wanna know a secret? The reason your starting a company isn't to achieve your victory. You're starting a company to achieve the emotion you think the victory will give you.)

            +
            +
              +
            • +
            +
            + +
            +
            Make it Official
            +
            +

            Congratulations! You have your victory.

            Now you know exactly what Andreesen meant when he said, "Being in a good market with a product that can satisfy that market."

            + You will have found Product-Market Fit, when you satisfy a "good market" that enables you to achieve your victory!

            + Sign your name and post this paper in a very visible place (e.g. your desk, your night stand, your bathroom mirror, your car, etc.).

            +

            (Posting it will be easier when you're using an actual FOCUS worksheet :)

            This paper will remind you of your true aim - even if you have to kill your idea, even if you have to pivot your customer segment, you will still be moving towards your victory by focusing on your personal outcomes.

            + + + +
            +
              +
            • +
            +
            + +
            +
            What are your Co-Founders' Victories?
            +
            + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

            It can be awkward to sit down with your co-founder(s) to understand why they want to start a company - what "victory" looks like for them. At the same time, it's the most important conversation you will have with them. +

            Misaligned goals is the #1 reason founding teams break up.
            + This exercise makes this crucial conversation with your co-founders easy. Simply have each co-founder fill out the worksheet individually (Steps 1 - 6) and then... +

            Merge your Victories

            + + + + On the back side of the worksheet is a place for your team to merge your declarations into a single, unifying victory.

            By merging your goals into a team-wide victory declaration, you can ensure everyone is on the same page and have a common reference point you all turn to when making decisions.

            If you're not able to align your goals, better to discover that now than later. So often one founder wants to change the world, while another simply wants personal financial freedom - both are great, but not in the same founding team.

            The sooner you find out what you and your co-founder(s) want, the more quickly you can get it...either together, or apart. +

            +
            + +
            +
            Let's Recap
            +
            + I told you at the beginning of this exercise that to find Product-Market Fit, you needed to define it, and to define it, you'd need to declare your victory.

            I said declaring your victory would: +

              +
            1. Make decisions easier
            2. +
            3. Give you the confidence to pivot and
            4. +
            5. Unify your founding team
            6. +
            +
            +
            + +
            +
            Let's Recap
            +
            +

            Declaring Victory - your personal victory - makes decisions easier by reminding you what's most important about this journey.

            Declaring Victory gives you the confidence to pivot because focusing on your personal goal allows you to respond effectively to real-world data - even when that data is different than what you wanted it to be.

            Finally, Declaring Victory facilitates the critical "Why are we all doing this?" conversation between you and your co-founders. The results of this conversation will strengthen your team to withstand the emotional roller coaster that is starting a company.

            +
            +
            + +
            +
            Find your FOCUS
            +
            +

            Congratulations, you've taken the most important step of your startup journey, you've Declared Victory and in doing so, defined your Product-Market Fit. +

            Now it's time, to go get it!
            + If you want help achieving your Victory, get your copy of FOCUS today! +
            +
            + +
            + + + + + + diff --git a/demo.html b/demo.html new file mode 100644 index 0000000..ae42bbe --- /dev/null +++ b/demo.html @@ -0,0 +1,2543 @@ + + + + + FOCUS Con: Mastering Customer Interviews + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            +
            +
            FOCUS Con: Mastering Customer Interviews by Justin Wilcox, Founder Institute and Startup Weekend
            +
            + +
            + +
            +
            +
            +
            + +
            + +
            + +
            +
            + +
            +
            +

            Questions: Ask Below

            +

            To Chat: Join us on Slack

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

              Welcome to the Workshop!

              You can take notes during the workshop here. +

              +   +

              5 Phases of Product-Market Fit

              +
                +
              1. F
              2. +
              3. O
              4. +
              5. C
              6. +
              7. U
              8. +
              9. S
              10. +
              +

              +

              Takeaways

              +

              + + +

              Where are your Early Adopters:

              +

              +
              +
              +
              +
              + +
              +
              + + + + +
              +
              +
              + +
              +
              +
              + + +
              +
              + + + + +
              +
              +
              +
              +
              +
              + +
              +
              + + + + +
              +
              +
              +
              +
              +
              Want to grow your network?
              + + + + +
              +
              +
              + +
              +
              +
              +
              + +
              +
              + + + + +
              +
              +
              + +
              +
              +
              + +
              + +
              +
              + + + + + + + + + + + +
              +
              + +
              + +
              + +
              +
              + + + + +
              + +
              +
              + + +
              +
              +
              +
              +
              +
              +
              + + +
              +
              + +
              +
              +
              +
              +
              + +
              +
              +
              + +
              + +
              +
              Defining Product-Market Fit
              +
              + Ready to define Product-Market Fit? +
              +
              + +
              +
              Declaring Victory Worksheet
              +
              + This worksheet will walk you through defining Product-Market Fit. +
              +
              + +
              +
              Today's Date
              +
                +
              • +
              +
              + Start by writing in today's date in the field on the right.

              +
              +
              + + + + + +
              +
              What's your Product?
              +
              +

              Write in the product or service that you would like to build.

              + +
              +
                +
              • +
              +
              + +
              +
              Who's your Customer?
              +
              + Write in the customers or people whom you would like to serve.

              +
              +
                +
              • +
              +
              + +
              +
              Fold on the Dotted Line
              +
              + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
              +
                +
              +
              + +
              +
              Your Promise
              +
              + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                +
              1. Even if you never get to build your product and
              2. +
              3. Even if you are not able to help the people you want to help...
              4. +
              +
              You are still going to achieve victory.
              +
              +
                +
              +
              + + + +
              +
              Enter your Victory
              +
              +

              Write in your measurable Victory metric.

              + +
              +
                +
              • +
              • +
              +
              + +
              +
              Find your FOCUS
              +
              + Want Feedback?

              + Type "Yes" if you'd like me to review your Victory.

              + + Bonus: you'll also be helping others learn. +
              +
                + +
              +
              + +
              +
              What Emotions are you Seeking?
              +
              + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

              + +
              +
                +
              • +
              +
              + +
              +
              Make it Official
              +
              +

              Congratulations! You have your victory.

              + + + +
              +
                +
              • +
              +
              + +
              +
              What are your Co-Founders' Victories?
              +
              + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

              + +
              +
              + + + +
              +
              Find your FOCUS
              +
              +

              Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

              Write your Victory Declaration in your Notes tab!
              + +
              +
              + +
              + +
              + +
              +
              + + + + +
              +
              + +
              +
              +
              + +
              +
              + + +
              +
              + +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              + +
              1. +
              2. +
              3. +
              4. +
              5. +
              +
              +
              1. +
              2. +
              3. +
              4. +
              5. +
              +
              + +
              + +
              +
              +
              +
              +
              + +
              +
              +
              + + + + + +
              N
              +
              N
              +
              N
              +
              Y
              +
              N
              +
              N
              +
              Y
              +
              Y
              +
              N
              +
              Y
              +
              Y
              +
              Y
              + + + + + +
              + +
              +
              +
              + +
              +
              + + + + +
              +
              +
              + +
              +
              + + +
              +
              +
              +
              +
              + +
              +
              +
              +
              +
              + +
              +
              +
              +
              +
              + +
              +
              +
              + + + + + + + + + + + + + + +
              + +
              +
              +
              + +
              +
              + + + + +
              +
              + +
              +
              +
              + +
              +
              + + +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              +
              + +
              +
              + + + + +
              +
              +
              + +
              +
              + + +
              + +
              + 1. +
              2. +
              3. +
              4. +
              5. +
              +
              + +
              + 1. +
              2. +
              3. +
              4. +
              5. +
              +
              + +
              + 1. +
              2. +
              3. +
              4. +
              5. +
              +
              + +
              #
              +
              of things
              + +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              +
              + +
              +
              + + + + +
              +
              +
              + +
              +

              Product-Market Fit Assessment

              This exercise will tell you: +
                +
              1. What phase of Product-Market Fit you're in
              2. +
              3. Your startup's "Riskiest Assumption"
              4. +
              5. Your next step to test that assumption
              6. +
              +

              Just answer these questions...

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

              Have you launched your product?

              +
              +
              +
                +
              • No30
              • +

                +
              • Yes2
              • +

                +
              +
              +
              +
              +
              +
              +

              Are customers paying for it?

              +
              +
              +
                +
              • No23
              • +

                +
              • Yes3
              • +

                +
              +
              +
              +
              +
              +
              +

              Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve + Product-Market Fit?

              +
              +
              +
                +
              • No5
              • +

                +
              • Yes4
              • +

                +
              • Not sure20
              • +

                +
              +
              +
              +
              +
              +
              + Congrats! You're on the path to Product-Market + Fit. +
              +
              +
              + Keep doing what you're doing! +
              +
              +
              +
              +
              +
              +

              Why aren't you on track to acheive Product-Market Fit?

              +
              +
              +
                +
              • Not enough customers6
              • +

                +
              • Customer Lifetime Value is too low16
              • +

                +
              +
              Not sure? Go with your gut. Eventually you'll test both.
              +
              +
              +
              +
              +
              +

              Why don't you have enough customers?

              +
              +
              +
                +
              • Having trouble finding them7
              • +

                +
              • Conversion rate it too low10
              • +

                +
              • Customer segment is too small14
              • +

                +
              • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
              • +

                +
              +
              Not sure? Starting at the top, pick the first answer you think could be the reason.
              +
              +
              +
              +
              +
              +

              Where are you looking for customers?

              +
              +
              +
                +
              • Places I think my customers are.8
              • +

                +
              • Places customers have told me they are.9
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
              +
              +
              +
              Product-Market Fit Phase: Finding Early Adopters for + your product.
              +
              Your Your Next Step: Interview customers to validate + where they look for solutions.
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

              Use this information to make your interviews easier and faster + to get.
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
              +
              Your Next Step: Test alternative channels to determine + potential customer segment size.
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

              You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
              +
              +

              Found in FOCUS Workbook 2...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              What emotions are you evoking in your Call to Action?

              +
              +
              +
                +
              • I'm not evoking emotions in my Call to Action11
              • +

                +
              • Emotions I think my customers are experiencing12
              • +

                +
              • Emotions my customers have told me they are experiencing13
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
              +
              +
              +
              Product-Market Fit Phase: Finding Early Adopters for + your product.
              +
              Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

              Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You understand + your customer's emotional desires. +
              +
              +
              +
              Product-Market Fit Phase: .
              +
              Your Next Step: Interview your customers to understand + their emotional desires. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

              Use this information to make your interviews easier and faster + to get.
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
              +
              +
              +
              Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
              +
              Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will help you identify + the emotions your customers' emotions. + +

              By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
              +
              +

              Found in FOCUS Workbook 2...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Scaling to Product-Market + Fit. +
              +
              Your Next Step: Identify, size and test related customer + segments. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

              By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
              +
              +

              Found in FOCUS Workbook 5...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
              +
              +
              +
              Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
              +
              Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
              +
              +

              Found in FOCUS Workbook 4...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Why is your Customer Lifetime Value too low?

              +
              +
              +
                +
              • Customer churn is too high (i.e. they cancel your service too soon)17
              • +

                +
              • Price is too low18
              • +

                +
              • Cost of customer acquisition is too high19
              • +

                +
              +
              Not sure? Starting at the top, pick the first answer you think could be the reason.
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
              +
              +
              +
              Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
              +
              Your Next Step: Test ways to increase the value your + solution is providing to customers. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
              +
              +

              Found in FOCUS Workbook 4...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
              +
              Your Next Step: Optimize your price via price testing. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
              +
              +

              Found in FOCUS Workbook 3...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
              +
              Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
              +
              +

              Found in FOCUS Workbook 2...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Have you defined a metric that represents when you have acheived Product-Market Fit?

              +
              +
              +
                +
              • No21
              • +

                +
              • Yes22
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
              +
              +
              +
              Product-Market Fit Phase: Finding Early Adopters for + your product.
              +
              Your Next Step: Define Product-Market Fit for you + and your team. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

              This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
              +
              Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
              +
              +

              Found in FOCUS Workbook 3...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Are customers using the product?

              +
              +
              +
                +
              • No41
              • +

                +
              • Yes24
              • +

                +
              +
              +
              +
              +
              +
              +

              Why aren't your customers paying to use your product?

              +
              +
              +
                +
              • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
              • +

                +
              • Going to monetize after reaching critical mass26
              • +

                +
              • Pursuing a freemium model and haven't built paid features yet25
              • +

                +
              • Tried charging but no one would pay10
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
              +
              Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
              +
              +

              Found in FOCUS Workbook 3...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market + Fit? +

              +
              +
              +
                +
              • No28
              • +

                +
              • Yes38
              • +

                +
              • Not sure20
              • +

                +
              +
              +
              +
              + +
              +
              +
              +

              Why aren't enough customers using for you to achieve Product-Market Fit?

              +
              +
              +
                +
              • Having trouble finding them7
              • +

                +
              • Conversion rate it too low10
              • +

                +
              • Customer segment is too small14
              • +

                +
              • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
              • +

                +
              +
              Not sure? Starting at the top, pick the first answer you think could be the reason.
              +
              +
              +
              +
              +
              +

              Have you defined a metric that represents when you have acheived Product-Market Fit?

              +
              +
              +
                +
              • No21
              • +

                +
              • Yes22
              • +

                +
              +
              +
              +
              +
              +
              +

              Have you generated any pre-sales or signed Letters of Intent?

              +
              +
              +
                +
              • No35
              • +

                +
              • Yes31
              • +

                +
              +
              +
              +
              +
              +
              +

              Are enough customers pre-paying for it that, if you solve their problems, you'll achieve + Product-Market Fit?

              +
              +
              +
                +
              • No5
              • +

                +
              • Yes32
              • +

                +
              • Not sure20
              • +

                +
              +
              +
              +
              +
              +
              +

              Why haven't you launched the product yet?

              +
              +
              +
                +
              • No development team33
              • +

                +
              • Solution is still under development33
              • +

                +
              • Testing the solution privately before making it available publicly34
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You can solve + your customers' problems. +
              +
              +
              +
              Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
              +
              Your Next Step: Test a manual solution. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
              +
              +

              Found in FOCUS Workbook 4...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
              +
              +
              +
              Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
              +
              Your Next Step: Test an automated solution. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
              +
              +

              Found in FOCUS Workbook 5...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Have you identified a problem at least 60% of your customers are actively trying to solve?

              +
              +
              +
                +
              • No40
              • +

                +
              • Yes36
              • +

                +
              +
              +
              +
              +
              +
              +

              If you solve the problem, will you achieve Product-Market Fit?

              +
              +
              +
                +
              • No5
              • +

                +
              • Yes37
              • +

                +
              • Not sure39
              • +

                +
              +
              +
              +
              +
              +
              +

              Why aren't you collecting pre-orders or Letters of Intent?

              +
              +
              +
                +
              • Can't finding customers to pre-sell7
              • +

                +
              • Don't know how38
              • +

                +
              • Tried but no one bought10
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
              +
              Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
              +
              +

              Found in FOCUS Workbook 3...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Have you defined a metric that represents when you have acheived Product-Market Fit?

              +
              +
              +
                +
              • No21
              • +

                +
              • Yes9
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
              +
              +
              +
              Product-Market Fit Phase: Finding Early Adopters for + your product.
              +
              Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

              Use this information to make your interviews easier and faster + to get.
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Why aren't customers using your product?

              +
              +
              +
                +
              • I'm not sure how/where to find customers to tell about it8
              • +

                +
              • I've told them about it, but they don't really use it11
              • +

                +
              • Customers use it a little, but then they stop42
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your product solves + your customers' problems. +
              +
              +
              +
              Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
              +
              Your Next Step: Test ways to increase the value your + solution is providing to customers. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
              +
              +

              Found in FOCUS Workbook 4...

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

              Upgrade to Silver

              +
              +
              +
              +

              Electronic FOCUS Framework

              +

              Plus:

              +

              Lifetime access to FOCUS Con recordings

              +

              Small-group Mentoring

              + +
              + +
              +
              +

              Normally $299.
              Upgrade: Only $99

              + Upgrade +
              +
              +
              +
              + +
              +
              +

              Upgrade to Gold

              +
              +
              +
              +

              Video or Printed FOCUS Framework +

              +

              Plus:

              +

              Lifetime access to FOCUS Con recordings

              +

              Small-group Mentoring

              + +
              + +
              +
              +

              Normally $499.
              Upgrade: Only $299

              + Upgrade +
              +
              +
              +
              + +
              +
              + +
              +
              + + + + +
              + + +
              + +
              +
              + + + + +
              + + +
              +
              +
              + + + + +
              + + +
              +
              +
              + + + + +
              + +
              + +
              +
              + + + + +
              +
              + +
              +
              +

              How likely would you be to recommend this workshop to a friend?

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

              What's one thing we can improve next time?

              +
              +
              + +
              +
              + +
              +
              +

              What was your favorite part of the workshop?

              +
              +
              + +
              + +
              + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo.js b/demo.js new file mode 100644 index 0000000..955f1eb --- /dev/null +++ b/demo.js @@ -0,0 +1,2144 @@ +//var app = angular.module('app', ['firebase']); +var firebaseRoot = "https://cdlwebshops.firebaseio.com/demo"; + +var rootRef = new Firebase(firebaseRoot); +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var profilesRef = new Firebase(firebaseRoot + "/profiles"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var emailsRef = new Firebase(firebaseRoot + "/emails"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); +var notesRef = new Firebase(firebaseRoot + "/notes"); +var exerciseValuesRef = new Firebase(firebaseRoot + "/exerciseValues"); +var youTubeStreamsUrlRef = new Firebase(firebaseRoot + "/youTubeStreams"); +var hangoutUrlsRef = new Firebase(firebaseRoot + "/hangouts"); + +var declaringVictoryRef = exerciseValuesRef.child("declaringVictory"); +var earlyAdoptersRef = exerciseValuesRef.child("earlyAdopters"); +var offerDesignRef = exerciseValuesRef.child("offerDesign"); +var pmfAssessmentRef = exerciseValuesRef.child("pmfAssessment"); +var interviewTemplateRef = exerciseValuesRef.child("interviewTemplate"); + +var loggedInUserId; +var globalUser; +var questionPad, responsePad; +var myPMFAssessmentRef; +var thisUsersProfileRef; + +const PROFILE_PIC_URL = 'https://s3-us-west-2.amazonaws.com/focus-con-avatars/'; +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +const RTC_URL = 'https://focus-rtc.herokuapp.com/'; +const GET_PARTNER = false; + +var publicChat; + +var firstName = null; +var emailAddress = null; +var cameraWorks = false; + +var lastSoloPriority = 0; +var lastQuestionAnswered; + +var app = angular.module('app', [ + 'ui.grid', + 'ui.grid.resizeColumns', + 'ui.grid.autoResize', + 'ui.grid.moveColumns', + 'ui.grid.saveState', + 'ngSanitize', + 'ui.bootstrap', + 'firebase']). + directive('contenteditable', ['$sce', function ($sce) { + return { + restrict: 'A', // only activate on element attribute + require: '?ngModel', // get a hold of NgModelController + link: function (scope, element, attrs, ngModel) { + if (!ngModel) return; // do nothing if no ng-model + + // Specify how UI should be updated + ngModel.$render = function () { + element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); + }; + + // Listen for change events to enable binding + element.on('blur keyup change', function () { + scope.$evalAsync(read); + }); + read(); // initialize + + // Write data to the model + function read() { + var html = element.html(); + // When we clear the content editable the browser leaves a
              behind + // If strip-br attribute is provided then we strip this out + if (attrs.stripBr && html == '
              ') { + html = ''; + } + ngModel.$setViewValue(html); + } + } + }; + }]); + +app.controller('MainCtrl', ['$scope', '$firebaseArray', '$firebaseAuth', '$firebaseObject', 'uiGridConstants', function ($scope, $firebaseArray, $firebaseAuth, $firebaseObject, uiGridConstants) { + var vm = this; + var vm2 = this; + var vm3 = this; + var vm4 = this; + + var VictoryDeclarationFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + date: 'Write here', + step1: 'Write here', + step2: 'Write here', + number: '#', + things: 'things here', + emotion: 'Write here', + signature: 'Sign here', + optIn: 'Want Feedback?' + } + }); + + vm.gridOptions = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Number', + field: 'number' + }, + { + displayName: 'Things', + field: 'things' + }, + { + displayName: 'Emotion', + field: 'emotion', + }, + { + displayName: 'Product', + field: 'step1', + }, + { + displayName: 'Customer', + field: 'step2', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm.gridApi = gridApi; + } + }; + + var EarlyAdoptersFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + segment: 'Your customer segment', + problem: "Your customer's problem (in their words)", + behaviors: '1.
              2.
              3.
              4.
              5.
              ', + externalBehaviors: '1.
              2.
              3.
              4.
              5.
              ', + optIn: 'Want Feedback?' + } + }); + + vm2.earlyAdoptersFeedbackGrid = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Behaviors', + field: 'behaviors' + }, + { + displayName: 'Ext. Behaviors', + field: 'externalBehaviors' + }, + { + displayName: 'Segment', + field: 'segment', + }, + { + displayName: 'Problem', + field: 'problem', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm2.gridApi = gridApi; + } + }; + + var OfferDesignFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + channel1: 'Write here', + pcm1: "Write here" + } + }); + + vm3.offerDesignFeedbackGrid = { + columnDefs: [ + { + displayName: 'PCM1', + field: 'pcm1' + }, + { + displayName: 'PCM2', + field: 'pcm2' + }, + { + displayName: 'PCM3', + field: 'pcm3' + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm3.gridApi = gridApi; + } + }; + + var InterviewTemplateFactory = $firebaseObject.$extend({ + $$defaults: { + problem: "What's the hardest part about being a ___________?", + lastTime: "Can you tell me about the last time that happened?", + why: "In your words, why is that hard for you?", + solutions: "When was the last time you tried to solve the problem?", + deficiencies: "What's not ideal about your current solution?", + channels: "How did you find out about your current solution?" + } + }); + + if (isSimpleMode()) { + vm.properties = $firebaseArray(declaringVictoryRef); + vm.properties.$loaded().then(function () { + vm.gridOptions.data = vm.properties; + }); + + vm2.earlyAdopterProperties = $firebaseArray(earlyAdoptersRef); + vm2.earlyAdopterProperties.$loaded().then(function () { + vm2.earlyAdoptersFeedbackGrid.data = vm2.earlyAdopterProperties; + }); + + vm3.offerDesignProperties = $firebaseArray(offerDesignRef); + vm3.offerDesignProperties.$loaded().then(function () { + vm3.offerDesignFeedbackGrid.data = vm3.offerDesignProperties; + }); + + vm.giveFeedback = function (exercise) { + var victoryRef = declaringVictoryRef.child(exercise.$id); + + if (vm.feedbackObj) { + vm.feedbackObj.$destroy(); + } + + vm.feedbackObj = VictoryDeclarationFactory(victoryRef); + vm.feedbackObj.$bindTo($scope, "declaringVictoryFeedback"); + }; + + vm2.giveEarlyAdopterFeedback = function (exercise) { + var eaRef = earlyAdoptersRef.child(exercise.$id); + + if (vm2.feedbackObj) { + vm2.feedbackObj.$destroy(); + } + + vm2.feedbackObj = EarlyAdoptersFactory(eaRef); + vm2.feedbackObj.$bindTo($scope, "earlyAdoptersFeedback"); + }; + + vm3.giveOfferDesignFeedback = function (exercise) { + var odRef = offerDesignRef.child(exercise.$id); + + if (vm3.feedbackObj) { + vm3.feedbackObj.$destroy(); + } + + vm3.feedbackObj = OfferDesignFactory(odRef); + vm3.feedbackObj.$bindTo($scope, "offerDesignFeedback"); + }; + } + + // $scope.giveFeedback = function(exercise) { + // console.log(exercise); + // // $state.transitionTo('club', { clubId: club.id }); + // }; + + // vm.getTableHeight = function () { + // var rowHeight = 33; + // var headerHeight = 33; + // var height = vm.gridOptions.data.length * rowHeight + headerHeight; + // if (height > window.innerHeight) { + // height = window.innerHeight - 250; + // } + // return { + // height: height + "px" + // }; + // }; + + + if (!initParameters()) { + initModal(); + return; + } + + var auth = $firebaseAuth(rootRef); + var dataFromAuth = auth.$getAuth(); + + if (!dataFromAuth) { + auth.$authAnonymously(); + } + + auth.$onAuth(function (authData) { + if (authData == null) { + console.warn("authData is null. Returning and waiting for another auth w/ data."); + return; + } + + postAuthConfig(authData, publicChat, PUBLIC_CHAT_ROOM_ID, GET_PARTNER); + + var uid = authData.uid; + var victoryRef = declaringVictoryRef.child(uid); + var victorySyncObj = VictoryDeclarationFactory(victoryRef); + victorySyncObj.$bindTo($scope, "declaringVictory"); + + var eaRef = earlyAdoptersRef.child(uid); + var eaSyncObj = EarlyAdoptersFactory(eaRef); + eaSyncObj.$bindTo($scope, "earlyAdopters"); + + var odRef = offerDesignRef.child(uid); + var odSyncObj = OfferDesignFactory(odRef); + odSyncObj.$bindTo($scope, "offerDesign"); + + var itRef = interviewTemplateRef.child(uid); + var itSyncObj = InterviewTemplateFactory(itRef); + itSyncObj.$bindTo($scope, "interviewTemplate"); + }); +}]); + +function connectExercisesToFirebase(userId) { + myPMFAssessmentRef = pmfAssessmentRef.child(userId); + + if (isSimpleMode()) { + $('#refreshPMFChartsButton').show(); + + refreshPMFCharts(); + } +} + +function refreshPMFCharts() { + pmfAssessmentRef.once("value", function (data) { + populateChart(data.val()); + }); +} + +function populateChart(model, chartContainer, title) { + var countMap = {}; + var pathMap = {} + + for (value in model) { + var node = model[value]; + + if (countMap[node.currentPhase]) { + countMap[node.currentPhase].data += 1; + } + else { + countMap[node.currentPhase] = { + name: node.currentPhase, + data: 1 + }; + } + + if (pathMap[node.assessmentPath]) { + pathMap[node.assessmentPath].data += 1; + } + else { + pathMap[node.assessmentPath] = { + name: node.assessmentPath, + data: 1 + }; + } + } + + var phases = []; + var phaseCounts = []; + + for (key in Object.keys(countMap)) { + phases.push(countMap[Object.keys(countMap)[key]].name); + phaseCounts.push(countMap[Object.keys(countMap)[key]].data); + } + + var paths = []; + var pathCounts = []; + + for (key in Object.keys(pathMap)) { + paths.push(pathMap[Object.keys(pathMap)[key]].name); + pathCounts.push(pathMap[Object.keys(pathMap)[key]].data); + } + + $('#pmfPhaseChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Current Phase' }, + xAxis: { + categories: phases + }, + series: [{ + data: phaseCounts + }] + }); + + $('#pmfPathChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Popular Paths' }, + xAxis: { + categories: paths + }, + series: [{ + data: pathCounts + }] + }); +} + +function initParameters() { + firstName = getParameterByName('firstName'); + attendeeEmail = getParameterByName('attendeeEmail'); + attendeeLocation = getParameterByName('attendeeLocation'); + attendeeUrl = getParameterByName('attendeeUrl'); + photoId = getParameterByName('photoId'); + + return (firstName != null || attendeeEmail != null || attendeeLocation != null || attendeeUrl != null || photoId != null); +} + +function getAttendees() { + emailsRef.once('value', function (emailsSnap) { + console.log(emailsSnap.numChildren()); + }); +} + +function getEnrollees() { + enrolledRef.once('value', function (enrolledSnap) { + enrolledSnap.forEach(function (snapshot) { + console.log(snapshot.val().email); + }); + }); +} + +function escapeRegExp(str) { + return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); +} + +function replaceAll(str, find, replace) { + if (str && find && replace) { + return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); + } +} + +function getFeedback() { + feedbackRef.once('value', function (feedbackSnap) { + feedbackSnap.forEach(function (snapshot) { + var feedback = snapshot.val(); + console.log(feedback.nps + ",'" + replaceAll(feedback.favorite, "\r\n", " ") + "','" + replaceAll(feedback.improve, "\r\n", " ") + "'"); + }); + }); +} + +function initUI() { + $('.carousel').carousel({ + interval: 5000 + }); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + profilePics = $('#profile-pics'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + // $("#newPartner").hide(); + // $("#newPartner").click(function () { + // leavePartnership(); + // }); + + $("#stopNetworkingBtn").click(function () { + leavePartnership(); + }); + + $("#startNetworkingBtn").click(function () { + searchForPartner(); + }); + + $("#cancelNetworkingBtn").click(function () { + cancelSearchForPartnership(); + }); + + showNewRTCConversationButton(); + + $('.meetYourPartnerMe').on("input", function () { + updateMyInfo($(this)); + }); + + keepTabsOnTabs(); + initEnrollForm(); + setupFeedbackForm(); + //setupInterviewScriptGenerator(); + //setupQuizzes(); + + setupiFrames(); + + if (isWebViewerMode()) { + // load video stream + youTubeStreamsUrlRef.on('value', function (snapshot) { + var youTubeIFrame = $('.youtube-iframe'); + youTubeIFrame.attr("src", snapshot.val().url); + }); + } + else { + // get rid of video holder + $('.left-column .top-row').hide(); + $('.left-column .bottom-row').addClass("full-height").removeClass("bottom-row"); + } + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } + + setupSaveToGoogleButtons(); +} + +function setupSaveToGoogleButtons() { + $(".saveToGoogleButton").click(function (obj) { + $('#worksheetSavedModalSaving').show(); + $('#worksheetSavedModalSaved').hide(); + $('#worksheetSavedModalSavingBody').show(); + $('#worksheetSavedModalSavedBody').hide(); + $('#worksheetSavedModalErrorBody').hide(); + $('#savedWorksheetUrl').attr("href", ""); + + $('#worksheetSavedModalOKButton').hide(); + + $('#worksheetSavedModal').modal({ + keyboard: true, + backdrop: 'static' + }); + + var exerciseName = getExerciseName(this); + var userId = loggedInUserId; + var templateId = $(this).attr('data-template-id'); + + $.ajax({ + url: "https://script.google.com/macros/s/AKfycbwVlyn5ntlr1HRXap69I66sdG7TYCiPQKHxNkPSzTajHvbZZVY/exec?userId=" + userId + "&worksheetName=" + exerciseName + "&templateId=" + templateId, + method: "GET", + jsonp: "callback", + dataType: "jsonp", + success: function (response) { + $('#worksheetSavedModalSaving').hide(); + $('#worksheetSavedModalSaved').show(); + $('#worksheetSavedModalSavingBody').hide(); + $('#worksheetSavedModalSavedBody').show(); + $('#savedWorksheetUrl').attr("href", response); + + $('#worksheetSavedModalOKButton').show(); + }, + error: function (xhr, status, error) { + $('#worksheetSavedModalSavingBody').hide(); + $('#worksheetSavedModalErrorBody').show(); + + $('#worksheetSavedModalOKButton').show(); + } + }); + }); +} + +function setupTextEditors() { + + tinymce.init({ + selector: '.text-editor', + menubar: false, + plugins: 'autoresize autosave', + autosave_interval: "2s", + setup: function (ed) { + ed.on('init', function () { + this.getDoc().body.style.fontSize = '16px'; + this.getDoc().body.style.fontName = 'Lato'; + // ed.target.editorCommands.execCommand("fontSize", false, "2"); + // ed.target.editorCommands.execCommand("fontName", false, "Lato"); + }); + } + }); +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function () { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function () { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $('#enrollForm').ajaxChimp({ + url: 'http://CustomerDevLabs.us6.list-manage.com/subscribe/post?u=7de22f15c9e97df7b49df664f&id=583a7a794d', + callback: function (resp) { + $('#enrollSuccessAlert').html(resp.msg); + $('#enrollSuccessAlert').show(); + enrolledRef.child(loggedInUserId).set({ email: $('#enrollEmail').val() }); + } + }); + + $("#enrollForm").submit(function (event) { + event.preventDefault(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function isWebViewerMode() { + return !isSimpleMode() && document.URL.indexOf("vip.html") == -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + exercisesRef.child("active").update({ exercise: exerciseName }); + }); + + $(".showTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + }); + + $(".hideTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: false }); + }); + + $(".soloTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each(function (index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({ exercise: tabName.replace("Tab", '') }); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function (exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each(function (index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.uid).once('value', function (snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function (snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + excluded: [':disabled'], + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "Hmm, something doesn't look right with your first name.", + validators: { + notEmpty: { + message: 'Enter your first name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We support names between 2 and 20 characters' + } + } + }, + attendeeEmail: { + message: "Hmm, something doesn't look right with your email address.", + validators: { + notEmpty: { + message: 'Please enter your email address' + }, + emailAddress: { + message: "Your email address isn't valid" + } + } + }, + attendeeLocation: { + message: "Hmm, something doesn't look right with your location.", + validators: { + notEmpty: { + message: "Please enter your location" + } + } + }, + attendeeUrl: { + message: "Hmm, something doesn't look right with your Internet address.", + validators: { + notEmpty: { + message: "Please enter a web page" + }, + regexp: { + regexp: /^((https?|ftp):\/\/){0,1}(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, + message: 'Please enter a web page' + } + } + }, + photoId: { + message: "Hmm, something doesn't look right with your picture.", + validators: { + notEmpty: { + message: "Pleas take a picture" + } + } + } + } + }); + + $("#welcomeForm").submit(function (event) { + console.log("submit hit"); + firstName = $("#attendeeName").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); + + /*var element = document.querySelector('#rtc-camera'); + var options = { + insertMode: 'append' + }; + + window.component = createOpentokHardwareSetupComponent(element, options, function(error) { + console.log('ot called back'); + if (error) { + console.error('Error: ', error); + element.innerHTML = 'Error getting devices: ' + error.message; + return; + } + // Add a button to call component.destroy() to close the component. + });*/ + + if (OT.checkSystemRequirements() == 0) { + console.log("your camera isn't working (checkSystemRequirements)"); + displayNoWebRtcErrorMessage(); + return; + } + + // OT.getDevices(function (error, devices) { + // videoInputDevices = devices.filter(function (element) { + // return element.kind == "videoInput"; + // }); + + // console.log(videoInputDevices.length); + // if (videoInputDevices.length == 0) { + // console.log("your camera isn't working (no cameras attached to the system)"); + // displayNoWebRtcErrorMessage(); + // return; + // } + + // var publisherOptions = { insertMode: 'append', mirror: false, style: { buttonDisplayMode: 'off' }, resolution: '320x240' }; + // var publisher = OT.initPublisher('rtc-camera', publisherOptions, function (error) { + // if (error) { + // console.log("your camera isn't working (initPublisher callback)"); + // displayNoWebRtcErrorMessage(); + // } else { + // console.log("your camera is working (initPublisher callback)"); + // cameraWorks = true; + // } + // }); + + // publisher.on('accessAllowed', function (event) { + // console.log('granted access to camera'); + // }); + + // publisher.on('accessDenied', function (event) { + // console.log('denied access to camera'); + // }); + + // $("#rtc-shoot").click(function () { + // console.log("shoot clicked"); + // $("#rtc-shoot").hide(); + // $("#rtc-uploading").show(); + + // var imgData = publisher.getImgData(); + // var imgBinary = convertImgFromBase64ToBinary(imgData); + // publisher.destroy(); + + // $('#rtc-shot').attr("src", "data:image/png;base64," + imgData); + // $('#rtc-shot').show(); + + // var albumBucketName = 'focus-con-avatars'; + // var bucketRegion = 'us-west-2'; + // var IdentityPoolId = 'us-west-2:f5420202-fbee-4491-a43e-cec00477d656'; + + // AWS.config.update({ + // region: bucketRegion, + // credentials: new AWS.CognitoIdentityCredentials({ + // IdentityPoolId: IdentityPoolId + // }) + // }); + + // var s3 = new AWS.S3({ + // apiVersion: '2006-03-01', + // params: { Bucket: albumBucketName } + // }); + + // var photoId = guid(); + // s3.upload({ + // Key: photoId, + // Body: imgBinary, + // ACL: 'public-read' + // }, function (err, data) { + // if (err) { + // console.error('There was an error uploading your photo: ', err.message); + // } else { + // console.log('Successfully uploaded photo (' + photoId + ').'); + // $('#photoId').val(photoId); + // $('#welcomeForm').data('bootstrapValidator').updateStatus('photoId', 'VALID'); + + // $("#rtc-uploading").hide(); + // $("#rtc-submit").show(); + // $("#rtc-retake").show(); + // } + // }); + // }); + + // $("#rtc-retake").click(function () { + // $('#rtc-shot').hide(); + + // publisher = OT.initPublisher('rtc-camera', publisherOptions, function (error) { + // if (error) { + // console.log("your camera isn't working (initPublisher callback)"); + // displayNoWebRtcErrorMessage(); + // } else { + // console.log("your camera is working (initPublisher callback)"); + // cameraWorks = true; + // } + // }); + + // $('#photoId').val(''); + // $('#welcomeForm').data('bootstrapValidator').updateStatus('photoId', 'NOT_VALIDATED'); + + // $("#rtc-shoot").show(); + // $("#rtc-retake").hide(); + // $("#rtc-submit").hide(); + // }); + // }); +} + +function displayNoWebRtcErrorMessage() { + $("#rtc-shoot").hide(); + $("#rtc-camera").hide(); + + $('#camera-problem-error').show(); + cameraWorks = false; +} + +function convertImgFromBase64ToBinary(imgData) { + // http://stackoverflow.com/a/14988118 + var binaryImg = atob(imgData); + var length = binaryImg.length; + var ab = new ArrayBuffer(length); + var ua = new Uint8Array(ab); + for (var i = 0; i < length; i++) { + ua[i] = binaryImg.charCodeAt(i); + } + + return ua; +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function () { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function loadUserSnap() { + (function () { + var s = document.createElement("script"); + s.type = "text/javascript"; + s.async = true; + s.src = '//api.usersnap.com/load/' + + '5b8cbdbf-b9d1-487d-bf09-bac5e6e7d46f.js'; + var x = document.getElementsByTagName('script')[0]; + x.parentNode.insertBefore(s, x); + })(); +} + +function postAuthConfig(authData, chatUI, roomId, getPartner) { + console.log("Authenticated successfully with payload: ", authData); + + loadUserSnap(); + + var user = authData; + + // At some point we should remove one of thesee redundant variables + loggedInUserId = user.uid; + fbid = user.uid; + + user.firstName = firstName; + authUserName = firstName; + + //chatUI.setUser(user.uid, firstName); + //enterRoomAfterUserSessionCreated(chatUI, roomId); + + // if (thisUsersProfileRef != null) { + // console.log("Re-authorizing this user. Remove previous profile."); + // thisUsersProfileRef.remove(); + // } + //thisUsersProfileRef = profilesRef.child(loggedInUserId).update({ + + profilesRef.child(loggedInUserId).update({ + name: firstName, + email: attendeeEmail, + location: attendeeLocation, + url: attendeeUrl, + photoId: photoId, + updated: new Date().getTime() + }); + + // Add user to attendees + attendeesRef.child(user.uid).update(user); + + connectExercisesToFirebase(loggedInUserId); + + emailsRef.child(loggedInUserId).set({ name: firstName }); + + setupTextEditors(); + + if (getPartner) { + searchForPartner(user); + } + + configWhoIsHere(); + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestions = []; + + allQuestionsSnapshot.forEach(function (snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
            • "); + var divmediabody = $("
              "); + var divmedia = $("
              "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = + "Top | " + + "Middle | " + + "" + answerText + " | " + + "" + hideText + " | " + + "Archive"; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 0; + var votesElement = "" + voteLink + ": " + voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
              "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
              " + userNameElement + "
              " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestions.push(questionElement); + divmediabody2.addClass('bg-warning'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-info'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-primary'); + } + else if (data.votes <= -10000) { + divmediabody2.css('background', "#808080"); + } + else { + divmediabody2.addClass('this-class-does-not-exist'); + } + + questionList.prepend(questionElement); + } + }); + + if (activeQuestions && activeQuestions.length) { + for (var ndx = 0; ndx < activeQuestions.length; ndx++) { + questionList.prepend(activeQuestions[ndx]); + } + } + }); +} + +function configWhoIsHere() { + profilesRef.orderByChild('updated').on('value', function (allProfilesSnapshot) { + profilePics.empty(); + + $('#attendeeCount').html(allProfilesSnapshot.numChildren()); + + allProfilesSnapshot.forEach(function (snapshot) { + var data = snapshot.val(); + var profileDiv = $("
              "); + + var url = data.url; + + if (!url.startsWith("http")) { + url = "http://" + url; + } + + var linkToUrl = $(""); + + var overlayDiv = $("
              "); + overlayDiv.html(data.name + "
              " + data.location); + + var img = $(""); + + linkToUrl.append(overlayDiv); + linkToUrl.append(img); + + profileDiv.append(linkToUrl); + + profilePics.prepend(profileDiv); + }); + }); +} + +// function logInToChat(ref, chatUI, roomId, getPartner) { +// var dataFromAuth = ref.getAuth(); + +// if (dataFromAuth) { +// postAuthConfig(dataFromAuth, chatUI, roomId, getPartner); +// return; +// } + +// ref.authAnonymously(function (error, authData) { +// if (error) { +// console.log("Login Failed!", error); +// return; +// } + +// postAuthConfig(authData, chatUI, roomId, getPartner); + +// }); +// } + +// var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { +// if (user) { +// loggedInUserId = user.uid; +// +// user.firstName = firstName; +// chatUI.setUser(user.uid, firstName); +// +// if (roomId != null) { +// setTimeout(function() { +// console.log("About to enter room. User: " + JSON.stringify(user) + ". Room: " + roomId); +// chatUI._chat.enterRoom(roomId); +// }, 500); +// } +// +// if (getPartner) { +// searchForPartner(user); +// } +// +// authUserName = firstName; +// fbid = user.uid; +// +// // simple should see all of the questions, everyone else should only see the unhidden ones +// var startAtNum = isSimpleMode() ? -1000000 : 1; +// +// // Add a callback that is triggered for each chat question. +// questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { +// questionList.empty(); +// +// var activeQuestion; +// +// allQuestionsSnapshot.forEach(function(snapshot) { +// +// //GET DATA +// var questionId = snapshot.key(); +// var data = snapshot.val(); +// var fbid_d = data.fbid; +// var username_d = data.name; +// var question_d = data.text; +// var date_d = data.currentdate; +// var votes_d = data.votes; +// +// divdir = ""; +// +// //CREATE ELEMENTS question & SANITIZE TEXT +// var questionElement = $("
            • "); +// var divmediabody = $("
              "); +// var divmedia = $("
              "); +// +// var voteLink; +// var userAskedQuestion = fbid_d == fbid; +// +// if (isSimpleMode()) { +// var answerText = data.isActive ? "Unanswer" : "Answer"; +// var hideText = data.votes <= 0 ? "Show" : "Hide"; +// +// voteLink = "" + answerText + " " + hideText + ""; +// } +// else if (userAskedQuestion) { +// // This user submitted the question +// voteLink = "Delete"; +// } +// else { +// var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; +// voteLink = "" + voteText + ""; +// } +// +// var voteCount = data.votes ? data.votes : 1; +// var votesElement = "" + voteLink + ": "+ voteCount + ""; +// var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; +// var dateElement = " " + date_d + ""; +// +// var divmediabody2 = $("
              "); +// questionElement.append(divmediabody); +// divmediabody.append(divmedia); +// //divmedia.append(a); +// //divmedia.append(votesElement); +// divmedia.append(divmediabody2); +// +// var usernamediv = $(""); +// divmediabody2.html(question_d); +// +// divmediabody2.append(usernamediv); +// usernamediv.html("
              " + userNameElement + "
              " + votesElement); +// +// //ADD question +// if (data.isActive) { +// activeQuestion = questionElement; +// divmediabody2.addClass('bg-danger'); +// } +// else { +// if (userAskedQuestion) { +// divmediabody2.addClass('bg-success'); +// // divmediabody2.css('background', "#476982"); +// // usernamediv.css('color', "#CCC") +// } +// else if (data.votes > 0) { +// // divmediabody2.css('background', "#73B3D7"); +// divmediabody2.addClass('bg-info'); +// } +// else { +// divmediabody2.addClass('bg-warning'); +// } +// +// questionList.prepend(questionElement); +// } +// }); +// +// questionList.prepend(activeQuestion); +// }); +// +// } else { +// simpleLogin.login('anonymous', { +// rememberMe: true +// }); +// } +// }); +// } + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


              You'll see what your partner types, as she/he does.


              Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


              (Delete this too :)" : ""); + + questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
               
              Note: your partner will be able to see your text as you type it.
               
              Try editing this text!
               
               
              2. Secretly pick a company below to pitch:
               

              • AirBnB
              • Pampers (diapers)
              • Twitter
              • Facebook
              • Subway (sandwiches)
              • Instagram
              • Disney
              • SnapChat
              • Angry Birds (Rovio)
              • RedBull
               
              3. Fill out the pitch template for the company you're pitching:
               
              - Problem:
               
               
               
              - Solution:
               
               
               
              - Market:
               
               
               
              - Business Model:
               
               
               
              -------------------------------------------------------
               
              4. Guess which company your partner is pitching:
               
               
               
              5. Which elements of your partner's pitch could be improved? 
               
               
              " : ""); + responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
               
              Note: your partner will be able to see your text as you type it.
               
              Try editing this text!
               
               
              2. Secretly pick a company below to pitch:
               
              • AirBnB
              • Pampers (diapers)
              • Twitter
              • Facebook
              • Subway (sandwiches)
              • Instagram
              • Disney
              • SnapChat
              • Angry Birds (Rovio)
              • RedBull
               
              3. Fill out the pitch template for the company you're pitching:
               
              - Problem:
               
               
               
              - Solution:
               
               
               
              - Market:
               
               
               
              - Business Model:
               
               
               
              -------------------------------------------------------
               
              4. Guess which company your partner is pitching:
               
               
               
              5. Which elements of your partner's pitch could be improved? 
               
               
              " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(user.uid, ""); + + attendeesRef.child(user.uid).update(user); + + //leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + setRouletteText("Your partner isn't available. Let's find another for you!"); + + showNewRTCConversationButton(); + + return; + } + else if (part.hangoutUrl != null) { + leaveRTCRoom(); + setRouletteText("We couldn't connect you directly to your partner, so we created a Google Hangout for you two!"); + + showNetworkingHangoutButton(part.hangoutUrl); + } + else if (part.room != null) { + console.log("Update for partnership room: " + part.room); + + if (part.routedFailed /*&& part.room.startsWith(loggedInUserId)*/) { + // This code should only be executed by one of the partners to prevent them both from picking different hangout urls + // console.log("Routed connection failed. Attempting hangout connection."); + + // getHangoutUrl(part); + leavePartnership(true); + } + else if (part.p2pFailed) { + console.log("P2P connection failed. Attempted routed connection."); + joinRTCRoom(part.room, false); + } + else { + console.log("Entering our partner chat room: " + part.room); + //publicChat._chat.enterRoom(part.room); + + joinRTCRoom(part.room, true); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.uid).update(user); + } + } + }); + + soloRef.off('child_changed'); + + // intro partners + setRouletteText("Introducing you to " + user.partnerName + "..."); + + showStopRTCConversationButton(); + + //getMeetYourPartnerUpdates(user); +} + +function getHangoutUrl(partnership) { +} + +function setRouletteText(html) { + if (html == null) { + $("#default-networking-text").show(); + $("#dynamic-networking-text").hide(); + return; + } + + $("#default-networking-text").hide(); + $("#dynamic-networking-text").html(html); + $("#dynamic-networking-text").show(); +} + +function joinRTCRoom(room, isP2P) { + $("#rouletteIFrame").attr('src', RTC_URL + room + (isP2P ? "p2p" : "")); + + $("#rouletteIFrameHolder").show(); + $("#rouletteControls").addClass("inConversationNetworkingButtons"); + $("#rouletteControls").removeClass("defaultNetworkingButtons"); +} + +function leaveRTCRoom() { + $("#rouletteIFrame").attr('src', ""); + + $("#rouletteIFrameHolder").hide(); + $("#rouletteControls").removeClass("inConversationNetworkingButtons"); + $("#rouletteControls").addClass("defaultNetworkingButtons"); +} + +function showStopRTCConversationButton() { + $("#stopNetworkingBtn").show(); + $("#startNetworkingBtn").hide(); + $("#cancelNetworkingBtn").hide(); + $("#networkingHangoutBtn").hide(); +} + +function showNewRTCConversationButton() { + $("#stopNetworkingBtn").hide(); + $("#startNetworkingBtn").show(); + $("#cancelNetworkingBtn").hide(); + $("#networkingHangoutBtn").hide(); +} + +function showCancelNewRTCConversationButton() { + $("#stopNetworkingBtn").hide(); + $("#startNetworkingBtn").hide(); + $("#cancelNetworkingBtn").show(); + $("#networkingHangoutBtn").hide(); +} + +function showNetworkingHangoutButton(hangoutUrl) { + $("#networkingHangoutBtn").click(function () { + window.open(hangoutUrl, '_blank'); + }); + + $("#stopNetworkingBtn").show(); + $("#startNetworkingBtn").hide(); + $("#cancelNetworkingBtn").hide(); + $("#networkingHangoutBtn").show(); +} + +function lookingForPartnerUI() { + setRouletteText("Looking for someone to introduce you to..."); + + showCancelNewRTCConversationButton(); +} + +function cancelSearchForPartnership() { + leaveSoloList(loggedInUserId); + showNewRTCConversationButton(); + setRouletteText(); +} + +function leaveSoloList(userId) { + soloRef.child(userId).remove(function (error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); +} + +function joinSoloList(user) { + soloRef.child(user.uid).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.uid; + user.responsesPad = "r-" + user.uid; + + // store my pad addresses + attendeesRef.child(user.uid).update(user); + + //loadFirepads(user, true); + + soloRef.on('child_changed', function (soloSnap) { + var solo = soloSnap.val(); + + if (solo.uid != user.uid) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + leaveSoloList(user.uid); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + // Text chat version + // publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function (roomId) { + // console.log('Created our partnership chat room'); + // partnershipsRef.child(solo.partnership).set({ "room": roomId }); + + // user.partnerChatRoom = roomId; + // joinPartnership(user, solo.partnership); + // }); + + // Video chat version + var roomId = solo.partnership; + partnershipsRef.child(solo.partnership).set({ "room": roomId }); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function (solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function (soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.uid == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.uid).transaction(function (currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.uid.localeCompare(solo.uid) < 0) { + partnership = user.uid + solo.uid; + } + else { + partnership = solo.uid + user.uid; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.uid; + user.responsesPad = "r-" + solo.uid; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function () { confirmPartnershipAccepted(user) }, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.uid, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function (error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + //loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.uid).transaction(function (currentData) { + + // Always return null because we want off this list + return null; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.uid).once('value', function (attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.uid).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + //loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + if (user == null) { + if (fbid == null) { + console.log("Don't know my user id. Can't search for partner."); + return; + } + + attendeesRef.child(fbid).once('value', function (attendeeSnap) { + var attendee = attendeeSnap.val(); + + searchForPartner(attendee); + }); + return; + } + + console.log("My user id is: " + user.uid); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership(failedConnection) { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + forgetPartnership(true); + } + else { + console.log("This user is requesting to leave partnership."); + showNewRTCConversationButton(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function (error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(false); + } + }); + + if (failedConnection) { + setRouletteText("We had trouble connecting you with that partner. Let's try again!"); + } + else { + setRouletteText(); + } + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + //leavePrivateChatRooms(); + leaveRTCRoom(); + clearPartnerFromUser(user); + //unloadFirepads(); + + attendeesRef.child(user.uid).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +const DEFAULT_QUESTION_VOTES = 1; +const MIDDLE_OF_LIST_VOTES = 50; +const TOP_OF_LIST_VOTES = 100; +const ARCHIVE_VOTES = -10000; + +$(document).ready(function () { + initUI(); +}); + +function toggleQuestionVisibility(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function (question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (question.votes == 0) { + question.votes = 1; + } + else { + question.votes = question.votes * -1; + question.isActive = 0; + } + + return question; + }); +} + +function moveQuestionToMiddle(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: MIDDLE_OF_LIST_VOTES }); +} + +function moveQuestionToArchive(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: ARCHIVE_VOTES }); +} + +function moveQuestionToTop(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: TOP_OF_LIST_VOTES }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + // if (lastQuestionAnswered) { + // questionsRef.child(lastQuestionAnswered).update({ isActive: false }); + // } + + // lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false }); + + // lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function (confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function (currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null) { + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: DEFAULT_QUESTION_VOTES }); + + $("#question-txt").val(''); +} + +function guid() { + function s4() { + return Math.floor((1 + Math.random()) * 0x10000) + .toString(16) + .substring(1); + } + return s4() + s4() + '-' + s4() + '-' + s4() + '-' + + s4() + '-' + s4() + s4() + s4(); +} diff --git a/digitalWorksheets/adoptionBehaviorCurve.html b/digitalWorksheets/adoptionBehaviorCurve.html new file mode 100644 index 0000000..c5dbbf0 --- /dev/null +++ b/digitalWorksheets/adoptionBehaviorCurve.html @@ -0,0 +1,39 @@ + + + + + + + + + + + +
              +
              + + +
              Write here
              +
              Write here
              + +
              +
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              + +
              Write here
              +
              Write here
              +
              +
              + + + + diff --git a/digitalWorksheets/assessment.html b/digitalWorksheets/assessment.html new file mode 100644 index 0000000..c26fb80 --- /dev/null +++ b/digitalWorksheets/assessment.html @@ -0,0 +1,1298 @@ + + + + + + + + + + + + + + + + + + + + + + +
              + +
              + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              +
              +
              +

              Have you launched your product?

              +
              +
              +
                +
              • No30
              • +

                +
              • Yes2
              • +

                +
              +
              +
              +
              +
              +
              +

              Are customers paying for it?

              +
              +
              +
                +
              • No23
              • +

                +
              • Yes3
              • +

                +
              +
              +
              +
              +
              +
              +

              Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

              +
              +
              +
                +
              • No5
              • +

                +
              • Yes4
              • +

                +
              • Not sure20
              • +

                +
              +
              +
              +
              +
              +
              + Congrats! You're on the path to Product-Market Fit. +
              +
              +
              + Keep doing what you're doing! +
              +
              +
              +
              +
              +
              +

              Why aren't you on track to acheive Product-Market Fit?

              +
              +
              +
                +
              • Not enough customers6
              • +

                +
              • Customer Lifetime Value is too low16
              • +

                +
              +
              Not sure? Go with your gut. Eventually you'll test both.
              +
              +
              +
              +
              +
              +

              Why don't you have enough customers?

              +
              +
              +
                +
              • Having trouble finding them7
              • +

                +
              • Conversion rate it too low10
              • +

                +
              • Customer segment is too small14
              • +

                +
              • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
              • +

                +
              +
              Not sure? Starting at the top, pick the first answer you think could be the reason.
              +
              +
              +
              +
              +
              +

              Where are you looking for customers?

              +
              +
              +
                +
              • Places I think my customers are.8
              • +

                +
              • Places customers have told me they are.9
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption is: You know where your customers look for solutions to their problems. +
              +
              +
              +
              Product-Market Fit Phase: Finding Early Adopters for your product.
              +
              Your Next Step: Interview customers to validate where they look for solutions.
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Understand who your Early Adopters are, and where to find them, by contrasting their behavior with your Early Majority, Late Majority, etc.

              Use this information to make your interviews + easier and faster to get.
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your marketing channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Offer Testing - You can Reach your Early Adopters.
              +
              Your Next Step: Test alternative channels to determine potential customer segment size.
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This spreadsheet will show you if your segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, data. + +

              You'll also be able to estimate the size of your marketing channels, conversion rates, and price points to determine the best approach for you to achieve Product-Market Fit. +
              +
              +

              Found in FOCUS Workbook 2...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              What emotions are you evoking in your Call to Action?

              +
              +
              +
                +
              • I'm not evoking emotions in my Call to Action11
              • +

                +
              • Emotions I think my customers are experiencing12
              • +

                +
              • Emotions my customers have told me they are experiencing13
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You understand what your customers are trying to accomplish in their roles. +
              +
              +
              +
              Product-Market Fit Phase: .
              +
              Your Next Step: Interview your customers to understand what problems they are actively trying to solve. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will help you brainstorm specific groups of customers you can serve by focusing on their problems. + +

              Everything is easier when you center your attention on your customer's problems: asking for interviews, marketing, sales, product development, etc. Take this step now, and you'll move much faster through the rest of your journey. +
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You understand your customer's emotional desires. +
              +
              +
              +
              Product-Market Fit Phase: .
              +
              Your Next Step: Interview your customers to understand their emotional desires. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Understand who your Early Adopters are, and where to find them, by contrasting their behavior with your Early Majority, Late Majority, etc.

              Use this information to make your interviews + easier and faster to get.
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your marketing copy reasonates emotionally with your customers. +
              +
              +
              +
              Product-Market Fit Phase: Offer Testing - You can Reach your Early Adopters.
              +
              Your Next Step: Test multiple versions of your marketing copy/Call to Action. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will help you identify the emotions your customers' emotions. + +

              By identifying and addressing your customers' emotional needs, you'll significantly increase your conversion rate. +
              +
              +

              Found in FOCUS Workbook 2...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: There are large enough customer segments for you to achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Scaling to Product-Market Fit.
              +
              Your Next Step: Identify, size and test related customer segments. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will show you how to transition from your Early Adopters to your Early Majority segment. + +

              By acquiring secondary and tertiary segments you'll be able to accelerate your path to Product-Market Fit. + +
              +
              +

              Found in FOCUS Workbook 5...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your solution is solving your customer's problem well enough, and they are incentivized enough, to share your product with others. +
              +
              +
              +
              Product-Market Fit Phase: Utility Testing - You can Satisfy your Early Adopters.
              +
              Your Next Step: Increase your Viral Coefficent (i.e. K Factor). +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will help you brainstorm and prioritize ways to increase the virality of your product.
              +
              +

              Found in FOCUS Workbook 4...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Why is your Customer Lifetime Value too low?

              +
              +
              +
                +
              • Customer churn is too high (i.e. they cancel your service too soon)17
              • +

                +
              • Price is too low18
              • +

                +
              • Cost of customer acquisition is too high19
              • +

                +
              +
              Not sure? Starting at the top, pick the first answer you think could be the reason.
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your solution is solving your customer's problem well enough that they'll continue paying for it. +
              +
              +
              +
              Product-Market Fit Phase: Utility Testing - You can Satisfy your Early Adopters.
              +
              Your Next Step: Test ways to increase the value your solution is providing to customers. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will provide four different techniques to increase your Customer Lifetime Value making it more likely you'll achieve Product-Market Fit..
              +
              +

              Found in FOCUS Workbook 4...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Customers will pay enough to solve their problem for you to achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Currency Testing - Your Early Adopters will Pay you.
              +
              Your Next Step: Optimize your price via price testing. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Whether you're B2B or B2C, this exercise will show how to optimize your price - without upsetting your customers!
              +
              +

              Found in FOCUS Workbook 3...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You can lower your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Offer Testing: You can Reach your Early Adopters.
              +
              Your Next Step: Test alternative channels to determine your optimal acquisition ROI. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This spreadsheet will show you what combination of marketing channels, price point, and conversion rates you'll need to acheive in order to find Product-Market Fit. +
              +
              +

              Found in FOCUS Workbook 2...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Have you defined a metric that represents when you have acheived Product-Market Fit?

              +
              +
              +
                +
              • No21
              • +

                +
              • Yes22
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You know what Product-Market Fit means for you and your team. +
              +
              +
              +
              Product-Market Fit Phase: Finding Early Adopters for your product.
              +
              Your Next Step: Define Product-Market Fit for you and your team. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: You can't achieve Product-Market Fit until you've defined it for you and your team. + +

              This exercise will walk your entire team through the process of defining the most important metric of your startup...what success looks like.
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: The problem you're solving will lead you on a path to Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Currency Testing - Your Early Adopters will Pay you.
              +
              Your Next Step: Calculate your the size of this market to determine if Product-Market Fit is achievable. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This spreadsheet will tell you how large your segment has the potential to be and exactly what conversion rates you'll need to achieve in order to find Product-Market Fit.
              +
              +

              Found in FOCUS Workbook 3...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Are customers using the product?

              +
              +
              +
                +
              • No41
              • +

                +
              • Yes24
              • +

                +
              +
              +
              +
              +
              +
              +

              Why aren't your customers paying to use your product?

              +
              +
              +
                +
              • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
              • +

                +
              • Going to monetize after reaching critical mass26
              • +

                +
              • Pursuing a freemium model and haven't built paid features yet25
              • +

                +
              • Tried charging but no one would pay10
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Customers will pay you enough that you'll achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Currency Testing: Your Early Adopters will Pay you.
              +
              Your Next Step: Charge customers via pre-orders or Letters of Intent for future functionality. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Whether you're B2B or B2C, this exercise will show you how to pre-sell a solution to a problem - without deceiving or disappointing your customers.
              +
              +

              Found in FOCUS Workbook 3...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

              +
              +
              +
                +
              • No28
              • +

                +
              • Yes38
              • +

                +
              • Not sure20
              • +

                +
              +
              +
              +
              + +
              +
              +
              +

              Why aren't enough customers using for you to achieve Product-Market Fit?

              +
              +
              +
                +
              • Having trouble finding them7
              • +

                +
              • Conversion rate it too low10
              • +

                +
              • Customer segment is too small14
              • +

                +
              • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
              • +

                +
              +
              Not sure? Starting at the top, pick the first answer you think could be the reason.
              +
              +
              +
              +
              +
              +

              Have you defined a metric that represents when you have acheived Product-Market Fit?

              +
              +
              +
                +
              • No21
              • +

                +
              • Yes22
              • +

                +
              +
              +
              +
              +
              +
              +

              Have you generated any pre-sales or signed Letters of Intent?

              +
              +
              +
                +
              • No35
              • +

                +
              • Yes31
              • +

                +
              +
              +
              +
              +
              +
              +

              Are enough customers pre-paying for it that, if you solve their problems, you'll achieve Product-Market Fit?

              +
              +
              +
                +
              • No5
              • +

                +
              • Yes32
              • +

                +
              • Not sure20
              • +

                +
              +
              +
              +
              +
              +
              +

              Why haven't you launched the product yet?

              +
              +
              +
                +
              • No development team33
              • +

                +
              • Solution is still under development33
              • +

                +
              • Testing the solution privately before making it available publicly34
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You can solve your customers' problems. +
              +
              +
              +
              Product-Market Fit Phase: Utility Testing - You can Satisfy your Early Adopters.
              +
              Your Next Step: Test a manual solution. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will walk you through how to create a manual solution in the most efficient way possible.
              +
              +

              Found in FOCUS Workbook 4...

              + +
              +
              +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: You can solve your customers' problems at scale. +
              +
              +
              +
              Product-Market Fit Phase: Scaling to Fit - You can achieve Product-Market Fit.
              +
              Your Next Step: Test an automated solution. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will help you transition from a manual solution to an automated one in the most efficient way possible.
              +
              +

              Found in FOCUS Workbook 5...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Have you identified a problem at least 60% of your customers are actively trying to solve?

              +
              +
              +
                +
              • No40
              • +

                +
              • Yes36
              • +

                +
              +
              +
              +
              +
              +
              +

              If you solve the problem, will you achieve Product-Market Fit?

              +
              +
              +
                +
              • No5
              • +

                +
              • Yes37
              • +

                +
              • Not sure39
              • +

                +
              +
              +
              +
              +
              +
              +

              Why aren't you collecting pre-orders or Letters of Intent?

              +
              +
              +
                +
              • Can't finding customers to pre-sell7
              • +

                +
              • Don't know how38
              • +

                +
              • Tried but no one bought10
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Customers will pay you enough that you'll achieve Product-Market Fit. +
              +
              +
              +
              Product-Market Fit Phase: Currency Testing - Your Early Adopters will Pay you.
              +
              Your Next Step: Charge customers via pre-orders or Letters of Intent for future functionality. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will introduce you to Currency Testing so you can confidently validate whether customers will pay you enough for you to achieve Product-Market Fit.
              +
              +

              Found in FOCUS Workbook 3...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Have you defined a metric that represents when you have acheived Product-Market Fit?

              +
              +
              +
                +
              • No21
              • +

                +
              • Yes9
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Customers are actively trying to solve a problem your product will solve for them. +
              +
              +
              +
              Product-Market Fit Phase: Finding Early Adopters for your product.
              +
              Your Next Step: Interview customers to determine what problems they are actively trying to solve. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: Understand who your Early Adopters are, and where to find them, by contrasting their behavior with your Early Majority, Late Majority, etc.

              Use this information to make your interviews + easier and faster to get.
              +
              +

              Found in FOCUS Workbook 1...

              + +
              +
              +
              +
              +
              +
              +
              +
              +

              Why aren't customers using your product?

              +
              +
              +
                +
              • I'm not sure how/where to find customers to tell about it8
              • +

                +
              • I've told them about it, but they don't really use it11
              • +

                +
              • Customers use it a little, but then they stop42
              • +

                +
              +
              +
              +
              +
              +
              + Your Riskiest Assumption: Your product solves your customers' problems. +
              +
              +
              +
              Product-Market Fit Phase: Utility Testing - You can Satisfy your Early Adopters.
              +
              Your Next Step: Test ways to increase the value your solution is providing to customers. +
              +
              + This will help... +
              + +
              +

              Recommended FOCUS Exercise...

              + +
              +
              Description: This exercise will provide four different techniques to increase your Customer Lifetime Value making it more likely you'll achieve Product-Market Fit..
              +
              +

              Found in FOCUS Workbook 4...

              + +
              +
              +
              +
              +
              +
              + + diff --git a/digitalWorksheets/css/adoptionBehaviorCurve.css b/digitalWorksheets/css/adoptionBehaviorCurve.css new file mode 100644 index 0000000..658ab68 --- /dev/null +++ b/digitalWorksheets/css/adoptionBehaviorCurve.css @@ -0,0 +1,69 @@ +.behavior-curve .yes-field { + color: #36B363; +} + +.segment-field { + bottom: 85%; + left: 19%; + width: 41%; +} + +.problem-field { + bottom: 54%; + left: 26%; + width: 66.5%; +} + +.grid-field { + width: 16%; +} + +.laggard { + left: 76%; +} + +.late { + left: 59.5%; +} + +.early { + left: 43%; +} + +.adopters { + left: 26% +} + +.have-problem { + bottom: 49%; +} + +.know-problem { + bottom: 44.5%; +} + +.paying-problem { + bottom: 40%; +} + +.behavior-curve .behaviors-field { + text-align: left; +} + +.internal { + left: 9.5%; + top: 69.5%; + width: 40%; +} + +.external { + left: 51%; + top: 72.5%; + width: 41.5%; +} + +.ea-feedback-opt-in-field { + bottom: 4.5%; + left: 20%; + width: 20%; +} \ No newline at end of file diff --git a/digitalWorksheets/css/assessment.css b/digitalWorksheets/css/assessment.css new file mode 100644 index 0000000..2e4d077 --- /dev/null +++ b/digitalWorksheets/css/assessment.css @@ -0,0 +1,137 @@ +.treeTable td { + padding: 3px 1em; + /*border: 1px solid #ccc; + border-radius: 5px; + background-color: #FeF;*/ +} + +.treeTable { + width: 100%; + border-spacing: 0.5em +} + +.treeTable li { + cursor: pointer +} + +.qTable tr { + display: none +} + +.treeTable p { + font-weight: bold; + /*line-height: 50%*/ +} + +#errdiv { + display: none; + font-weight: bold; + color: #903; + padding: 0.3em +} + +.selectedAnswer { + font-weight: bold; + color: #060 +} + +.treeTable i { + display: none +} + +.hintLabel { + font-weight: bold; + padding-left: 40px; +} + +.btn { + font-size: 16px; +} + +.panel-title { + font-size: 18px; + font-weight: bold; +} + +.assumptionLabel { + font-weight: bold; +} + +.exercisePic { + float: right; + background-color: white; + max-width: 50%; + width: 500px; + border: 1px solid #ccc; + margin-right: 10px; + margin-left: 10px; + box-shadow: 8px 8px 5px #bbb; + padding: 0px; +} + +.exerciseHeader { + font-size: 18px; + font-weight: bold; +} + +.panel-success { + border-color: #474949; +} + +.panel-success > .panel-heading { + color: #ffffff; + background-color: #474949; + border-color: #474949; +} + +.phaseTitle { + margin-bottom: 10px; +} + +.exerciseLabel { + font-weight: bold; + margin-top: 5px; + margin-bottom: 0px; +} + +.exerciseName { + text-align: center; + margin-top: 20px; +} + +.exerciseDiv { + font-size: 24px; + font-weight: bold; +} + +.recommendedExercise { + margin-top: 20px; +} + +.exerciseDescription { + margin-top: 30px; + margin-bottom: 20px; +} + +.descriptionHeader { + font-weight: bold; + color: #444; +} + +.workbookLabel { + font-weight: normal; + ; + text-align: center; +} + +.workbookDiv { + margin-top: 40px; +} + +.workbookHeader { + font-weight: bold; +} + +.assessmentIntro { + margin-left: 20px; +} diff --git a/digitalWorksheets/css/currencyTest.css b/digitalWorksheets/css/currencyTest.css new file mode 100644 index 0000000..fc8750d --- /dev/null +++ b/digitalWorksheets/css/currencyTest.css @@ -0,0 +1,70 @@ +.currency-channel-blank { + top: 13.5%; + left: 30%; + width: 62%; + text-align: left !important; +} + +.currency-mvp-blank { + top: 21%; + left: 9%; + width: 82%; + height: 24%; + text-align: left !important; +} + +.currency-start-blank { + top: 52.5%; + left: 15%; + width: 36%; + text-align: left !important; +} + +.currency-end-blank { + top: 52.5%; + left: 56%; + width: 35%; + text-align: left !important; +} + +.currency-metric-blank { + top: 64%; + left: 16%; + width: 22%; + text-align: left !important; +} + +.currency-success-blank { + top: 71.5%; + left: 30%; + width: 8%; + text-align: left !important; +} + +.currency-fail-blank { + top: 80.5%; + left: 30%; + width: 8%; + text-align: left !important; +} + +.currency-proceed-blank { + top: 67%; + left: 62%; + width: 31%; + text-align: left !important; +} + +.currency-optimize-blank { + top: 77%; + left: 62%; + width: 31%; + text-align: left !important; +} + +.currency-pivot-blank { + top: 85.5%; + left: 62%; + width: 31%; + text-align: left !important; +} diff --git a/digitalWorksheets/css/declaringVictory.css b/digitalWorksheets/css/declaringVictory.css new file mode 100644 index 0000000..06627bc --- /dev/null +++ b/digitalWorksheets/css/declaringVictory.css @@ -0,0 +1,334 @@ +.worksheet-container { + background-image: url("../img/wood.jpg"); + height: 100%; + width: 100%; +} + +@font-face { + font-family: 'CaptureIt'; + src: url('../fonts/Capture_it-webfont.eot'); + src: url('../fonts/Capture_it-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/Capture_it-webfont.woff') format('woff'), + url('../fonts/Capture_it-webfont.ttf') format('truetype'), + url('../fonts/Capture_it-webfont.svg#capture_itregular') format('svg'); + font-weight: normal; + font-style: normal; +} + +/* .declaring-victory */ .worksheet { + position: absolute; + width: 100%; + top: 50px; +} + +.instruction-panel { + top: 0%; + width: 0%; + left: 0%; + position: absolute; + + background-color: rgba(255, 255, 255, 0.5); + display: none; +} + +.instruction-panel .panel-body { + background-color: rgba(130,130,130,.8); +} + +.instruction-panel > .panel-heading { + background-color: #3e444c; + font-weight: normal; +} + +.jumbotron { + padding-top: 30px; + padding-bottom: 30px; + margin-bottom: 30px; + color: inherit; + background-color: #FFFFFF; + font-size: 18pt; + width: 50%; + color: #A00101; + border: 0px solid transparent; +} + +h1, h2, h3, h4, h5, h6 { + text-shadow: none; +} + +.instruction-panel > .panel-footer { +} + +.worksheet .btn-primary { + background-image: -webkit-linear-gradient(#6d94bf, #446e9b 50%, #3e648d); + background-image: -o-linear-gradient(#6d94bf, #446e9b 50%, #3e648d); + background-image: -webkit-gradient(linear, left top, left bottom, from(#6d94bf), color-stop(50%, #446e9b), to(#3e648d)); + background-image: linear-gradient(#6d94bf, #446e9b 50%, #3e648d); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff6d94bf', endColorstr='#ff3e648d', GradientType=0); + -webkit-filter: none; + filter: none; + border: 1px solid #345578; +} + +.worksheet .btn-primary:hover { + background-image: -webkit-linear-gradient(#5f8ab9, #3e648d 50%, #385a7f); + background-image: -o-linear-gradient(#5f8ab9, #3e648d 50%, #385a7f); + background-image: -webkit-gradient(linear, left top, left bottom, from(#5f8ab9), color-stop(50%, #3e648d), to(#385a7f)); + background-image: linear-gradient(#5f8ab9, #3e648d 50%, #385a7f); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5f8ab9', endColorstr='#ff385a7f', GradientType=0); + -webkit-filter: none; + filter: none; + border: 1px solid #2e4b69; +} + +.instructions .content { + margin-bottom: 0px; + background-color: rgba(255, 255, 255, 0.95); + color: black; + border: 1px solid #B9B9B9; + overflow-y: auto; + + max-height: 80%; +} + +textarea { + word-wrap: break-word; + word-break: break-all; + height: 100px; + vertical-align:middle; +} + +/* .declaring-victory */ .blank { + position: absolute; + font-family: 'Shadows Into Light Two', cursive; + font-size: 14pt; + font-weight: bold; + color: #B30000; + outline: 0px solid transparent; + display: none; + text-align: center; +} + +.feedback-blank { + display: inherit; +} + +.steps { + display: none; +} + +.stepNumber { + float: right; + color: #999; + display: none; +} + +.date-field { + bottom: 90.75%; + left: 65%; + width: 20%; +} + +.step1-field { + bottom: 75.25%; + left: 65%; + width: 20%; +} + +.step2-field { + bottom: 52.5%; + left: 65%; + width: 20%; +} + +.number-field { + bottom: 18.5%; + left: 42%; + width: 7%; +} + +.things-field { + bottom: 18.5%; + left: 50.5%; + width: 15%; +} + +.feedback-opt-in-field { + bottom: 18.5%; + left: 65%; + width: 20%; +} + +.emotion-field { + bottom: 5.5%; + left: 51.5%; + width: 14%; +} + +.signature-field { + bottom: 5.5%; + left: 65%; + width: 20%; +} + +.instruction-panel { + /*animation-duration: 1s; + animation-timing-function: ease-in-out; + animation-fill-mode: forwards; + + -webkit-animation-duration: 1s; + -webkit-animation-timing-function: ease-in-out; + -webkit-animation-fill-mode: forwards;*/ +} + +.transitions-1s { + -webkit-transition: all 1s ease-in-out; + transition: all 1s ease-in-out; +} + +.transitions { + -webkit-transition: all 1.2s ease-in-out; + transition: all 1.2s ease-in-out; + width: 50%; +} + +/* .declaring-victory */ .worksheet-img { + width: 70%; + top: -1000px; + left: 100%; + + position: relative; +} + +/* .declaring-victory */ .worksheet-img { + -ms-transform: rotate(180deg); /* IE 9 */ + -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */ + transform: rotate(180deg); +} + +/* .declaring-victory */ .fly-in { + -ms-transform: rotate(360deg); /* IE 9 */ + -webkit-transform: rotate(360deg); /* Chrome, Safari, Opera */ + transform: rotate(360deg); + + top: 0px; + left: 15%; +} + +/* .declaring-victory */ .centered-medium { + top: 30%; + width: 40%; + left: 30%; +} + +/* .declaring-victory */ .centered-top { + top: 0%; + width: 40%; + left: 30%; +} + +/* .declaring-victory */ .full-page { + top: 0px; + width: 80%; + left: 10%; +} + +/* .declaring-victory */ .left { + top: 10%; + width: 30%; + left: 5%; +} + +/* .declaring-victory */ .top-left { + top: 0%; + width: 34%; + left: 5%; +} + +/* .declaring-victory */ .top-right { + top: 10%; + width: 30%; + left: 50%; +} + +.worksheet-shadow { + margin-top: 5px; + margin-bottom: 5px; + border: 1px solid #DDD; +} + +/*@-webkit-keyframes centered-medium { + to { + top: 30%; + width: 50%; + left: 25%; + } +} + +@keyframes centered-medium { + to { + top: 30%; + width: 50%; + left: 25%; + } +} + +@-webkit-keyframes full-page { + to { + top: 0%; + width: 80%; + left: 10%; + height: 100%; + } +} + +@keyframes full-page { + to { + top: 0%; + width: 80%; + left: 10%; + } +} + +@-webkit-keyframes date { + to { + top: 0%; + width: 20%; + left: 40%; + } +} + +@keyframes date { + to { + top: 0%; + width: 20%; + left: 40%; + } +} + +.step2-animation { + animation-name: example; + -webkit-animation-name: example; +} + +/* Chrome, Safari, Opera */ +@-webkit-keyframes example { + to {width: 90%;} +} + +/* Standard syntax */ +@keyframes example { + to {width: 90%;} +} + +/* .declaring-victory */ .absoluteContainer { + position: absolute; + left: 0; + right: 0; + top: 10%; + margin-left: auto; + margin-right: auto; + max-width: 740px; +} diff --git a/digitalWorksheets/css/ideaGeneration.css b/digitalWorksheets/css/ideaGeneration.css new file mode 100644 index 0000000..07f7317 --- /dev/null +++ b/digitalWorksheets/css/ideaGeneration.css @@ -0,0 +1,80 @@ +.idea-generation-worksheet .blank { + +} + +.cross-out { + top: 5.5%; + left: 8%; + width: 16%; + font-size: 20pt !important; +} + +.segment-member { + top: 25.5%; + left: 9%; + width: 26%; + text-align: left !important; +} + +.segment-former-member { + top: 25.5%; + left: 37%; + width: 26%; + text-align: left !important; +} + +.segment-passion { + top: 25.5%; + left: 65.5%; + width: 26%; + text-align: left !important; +} + +.victory-number { + bottom: 35%; + left: 23%; + width: 14%; +} + +.victory-things { + bottom: 35%; + left: 38%; + width: 28%; +} + +.segment-1 { + bottom: 24.5%; + left: 14%; + width: 26%; +} + +.segment-2 { + bottom: 17%; + left: 14%; + width: 26%; +} + +.segment-3 { + bottom: 9.5%; + left: 14%; + width: 26%; +} + +.problem-1 { + bottom: 24.5%; + left: 56%; + width: 25%; +} + +.problem-2 { + bottom: 17%; + left: 56%; + width: 25%; +} + +.problem-3 { + bottom: 9.5%; + left: 56%; + width: 25%; +} + diff --git a/digitalWorksheets/css/ideaGenerationStudent.css b/digitalWorksheets/css/ideaGenerationStudent.css new file mode 100644 index 0000000..a567ed9 --- /dev/null +++ b/digitalWorksheets/css/ideaGenerationStudent.css @@ -0,0 +1,38 @@ +.cross-out { + top: 5.5%; + left: 8%; + width: 16%; + font-size: 20pt !important; +} + +.idea-column-blank { + width: 26%; + height: 27%; + text-align: left !important; +} + +.idea-left-blank { + left: 9%; +} + +.idea-middle-blank { + left: 37%; +} + +.idea-right-blank { + left: 65.5%; +} + +.idea-top-blank { + top: 22.5%; +} + +.idea-bottom-blank { + top: 67.5%; +} + +.idea-segment-blank { + width: 26%; + height: 4%; + top: 60% +} diff --git a/digitalWorksheets/css/interviewTemplate.css b/digitalWorksheets/css/interviewTemplate.css new file mode 100644 index 0000000..c07fad5 --- /dev/null +++ b/digitalWorksheets/css/interviewTemplate.css @@ -0,0 +1,88 @@ +.interview-template-worksheet .blank { + text-align: left; +} + +.interview-template-worksheet .fill-in { + text-align: left; +} + +.question-problem { + top: 21%; + left: 8%; + width: 55%; +} + +.question-last-time { + top: 36.5%; + left: 8%; + width: 55%; +} + +.question-why { + top: 21%; + left: 63.5%; + width: 29%; +} + +.question-current-solutions { + top: 59%; + left: 8%; + width: 26%; + height: 7%; +} + +.question-deficiencies { + top: 59%; + left: 34%; + width: 29%; + height: 7%; +} + +.question-channels { + top: 59%; + left: 63.5%; + width: 29%; + height: 7%; +} + +.question-problem-response { + top: 26.5%; + left: 8%; + width: 55%; + height: 10%; +} + +.question-last-time-response { + top: 40.5%; + left: 8%; + width: 55%; + height: 11%; +} + +.question-why-response { + top: 26.5%; + left: 64%; + width: 28%; + height: 25%; +} + +.question-current-solutions-response { + top: 67%; + left: 8%; + width: 25%; + height: 22%; +} + +.question-deficiencies-response { + top: 67%; + left: 34.5%; + width: 28%; + height: 22%; +} + +.question-channels-response { + top: 67%; + left: 64%; + width: 28%; + height: 22%; +} \ No newline at end of file diff --git a/digitalWorksheets/css/lightbox.css b/digitalWorksheets/css/lightbox.css new file mode 100644 index 0000000..f0c1d7b --- /dev/null +++ b/digitalWorksheets/css/lightbox.css @@ -0,0 +1,206 @@ +/* Preload images */ +body:after { + content: url(../img/close.png) url(../img/loading.gif) url(../img/prev.png) url(../img/next.png); + display: none; +} + +body.lb-disable-scrolling { + overflow: hidden; +} + +.lightboxOverlay { + position: absolute; + top: 0; + left: 0; + z-index: 9999; + background-color: black; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); + opacity: 0.8; + display: none; +} + +.lightbox { + position: absolute; + left: 0; + width: 100%; + z-index: 10000; + text-align: center; + line-height: 0; + font-weight: normal; +} + +.lightbox .lb-image { + display: block; + height: auto; + max-width: inherit; + border-radius: 3px; +} + +.lightbox a img { + border: none; +} + +.lb-outerContainer { + position: relative; + background-color: white; + *zoom: 1; + width: 250px; + height: 250px; + margin: 0 auto; + border-radius: 4px; +} + +.lb-outerContainer:after { + content: ""; + display: table; + clear: both; +} + +.lb-container { + padding: 4px; +} + +.lb-loader { + position: absolute; + top: 43%; + left: 0; + height: 25%; + width: 100%; + text-align: center; + line-height: 0; +} + +.lb-cancel { + display: block; + width: 32px; + height: 32px; + margin: 0 auto; + background: url(../img/loading.gif) no-repeat; +} + +.lb-nav { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 10; +} + +.lb-container > .nav { + left: 0; +} + +.lb-nav a { + outline: none; + background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); +} + +.lb-prev, .lb-next { + height: 100%; + cursor: pointer; + display: block; +} + +.lb-nav a.lb-prev { + width: 34%; + left: 0; + float: left; + background: url(../img/prev.png) left 48% no-repeat; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); + opacity: 0; + -webkit-transition: opacity 0.6s; + -moz-transition: opacity 0.6s; + -o-transition: opacity 0.6s; + transition: opacity 0.6s; +} + +.lb-nav a.lb-prev:hover { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} + +.lb-nav a.lb-next { + width: 64%; + right: 0; + float: right; + background: url(../img/next.png) right 48% no-repeat; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); + opacity: 0; + -webkit-transition: opacity 0.6s; + -moz-transition: opacity 0.6s; + -o-transition: opacity 0.6s; + transition: opacity 0.6s; +} + +.lb-nav a.lb-next:hover { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} + +.lb-dataContainer { + margin: 0 auto; + padding-top: 5px; + *zoom: 1; + width: 100%; + -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; +} + +.lb-dataContainer:after { + content: ""; + display: table; + clear: both; +} + +.lb-data { + padding: 0 4px; + color: #ccc; +} + +.lb-data .lb-details { + width: 85%; + float: left; + text-align: left; + line-height: 1.1em; +} + +.lb-data .lb-caption { + font-size: 13px; + font-weight: bold; + line-height: 1em; +} + +.lb-data .lb-number { + display: block; + clear: left; + padding-bottom: 1em; + font-size: 12px; + color: #999999; +} + +.lb-data .lb-close { + display: block; + float: right; + width: 30px; + height: 30px; + background: url(../img/close.png) top right no-repeat; + text-align: right; + outline: none; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); + opacity: 0.7; + -webkit-transition: opacity 0.2s; + -moz-transition: opacity 0.2s; + -o-transition: opacity 0.2s; + transition: opacity 0.2s; +} + +.lb-data .lb-close:hover { + cursor: pointer; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} diff --git a/digitalWorksheets/css/offerDesign.css b/digitalWorksheets/css/offerDesign.css new file mode 100644 index 0000000..7d10193 --- /dev/null +++ b/digitalWorksheets/css/offerDesign.css @@ -0,0 +1,56 @@ +.channel1-field { + bottom: 79%; + left: 8%; + width: 27%; +} + +.channel2-field { + bottom: 74%; + left: 8%; + width: 27%; +} + +.channel3-field { + bottom: 69.5%; + left: 8%; + width: 27%; +} + +.channel4-field { + bottom: 65%; + left: 8%; + width: 27%; +} + +.channel5-field { + bottom: 60%; + left: 8%; + width: 27%; +} + +.pcm-fields { + left: 12%; + width: 78.5%; + text-align: left !important; +} + +.pcm1-field { + bottom: 51%; +} + +.pcm2-field { + bottom: 47.5%; +} + +.pcm3-field { + bottom: 44.5%; +} + +.pcm4-field { + bottom: 41.5%; +} + +.pcm5-field { + bottom: 38.5%; +} + diff --git a/digitalWorksheets/css/problemsNotProducts.css b/digitalWorksheets/css/problemsNotProducts.css new file mode 100644 index 0000000..a0298d3 --- /dev/null +++ b/digitalWorksheets/css/problemsNotProducts.css @@ -0,0 +1,65 @@ +.left-column-blank { + left: 15%; + width: 33%; + height: 4%; + text-align: left !important; +} + +.right-column-blank { + left: 58%; + width: 33%; + height: 4%; + text-align: left !important; +} + +.top-who-blank { + top: 14.5% +} + +.top-where-blank { + top: 19% +} + +.middle-who-blank { + top: 37.5% +} + +.middle-where-blank { + top: 42% +} + +.bottom-who-blank { + top: 60.5% +} + +.bottom-where-blank { + top: 65% +} + +.left-problem-blank { + left: 17%; + width: 30%; + height: 8%; + text-align: left !important; +} + +.right-problem-blank { + left: 60%; + width: 30%; + height: 8%; + text-align: left !important; +} + +.top-problem-blank { + top: 22.5%; +} + +.middle-problem-blank { + top: 45.5%; +} + +.bottom-problem-blank { + top: 68.5%; +} + + diff --git a/digitalWorksheets/css/worksheets.css b/digitalWorksheets/css/worksheets.css new file mode 100644 index 0000000..ac7a0b5 --- /dev/null +++ b/digitalWorksheets/css/worksheets.css @@ -0,0 +1,46 @@ +.worksheet-container { + padding: 0px !important; +} + +.wood-background { + background-image: url('../img/wood.jpg'); +} + +.digital-worksheet { + position: absolute; + width: 100%; + padding-top: 30px; + padding-bottom: 30px; +} + +.digital-worksheet .blank { + position: absolute; + font-family: 'Shadows Into Light Two', cursive; + font-size: 12pt; + font-weight: bold; + color: #B30000; + outline: 0px solid transparent; + text-align: center; + display: inline-block; + /*border: 1px solid;*/ +} + +.digital-worksheet .fill-in { + position: absolute; + font-family: 'Arial', 'Helvetica'; + font-size: 11pt; + font-weight: bold; + color: #000; + outline: 0px solid transparent; + text-align: center; + display: inline-block; + /*border: 1px solid;*/ +} + +.digital-worksheet .worksheet-background-img { + width: 90%; + top: 0px; + left: 5%; + + position: relative; +} diff --git a/digitalWorksheets/declaringVictory.html b/digitalWorksheets/declaringVictory.html new file mode 100644 index 0000000..8436bd0 --- /dev/null +++ b/digitalWorksheets/declaringVictory.html @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
              +
              + + +
              Write here
              +
              Write here
              +
              Write here
              +
              Number
              +
              of things here
              +
              Write here
              +
              Write here
              + +
              +
              + +
              +
              +
              +
              +
              + +
              +
              +
              + +
              + +
              +
              Defining Product-Market Fit
              +
              + Ready to define Product-Market Fit for you? +
              +
              + +
              +
              Declaring Victory Worksheet
              +
              + This worksheet will walk you through defining Product-Market Fit. +
              +
              + +
              +
              Today's Date
              +
                +
              • +
              +
              + Start by writing in today's date in the field on the right.

              +
              +
              + +
              +
              Declaring Victory
              +
              + Before you go any further, wait for me to describe why this first exercise is critically important to achieving Product-Market Fit. +
              +
              + + + +
              +
              What's your Product?
              +
              +

              Write in the product or service that you would like to build.

              +

              Click for an Example

              +

              + + 2015-12-03_1108_001 + +

              +

              As you move through FOCUS's exercises, I'll illustrate each step using my own experiments and experiences.

              +
              +
                +
              • +
              +
              + +
              +
              Who's your Customer?
              +
              + Write in the customers or people whom you would like to serve.

              + + 2015-12-03_1107 + +
              +
                +
              • +
              +
              + +
              +
              Fold on the Dotted Line
              +
              + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
              +
                +
              +
              + +
              +
              Your Promise
              +
              + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                +
              1. Even if you never get to build your product and
              2. +
              3. Even if you are not able to help the people you want to help...
              4. +
              +
              You are still going to achieve victory.
              +
              +
                +
              +
              + + + +
              +
              Enter your Victory
              +
              +

              Write in your measurable Victory metric.

              + While it may be a bit challenging to come up with, your Victory must be measurable. If it's not, you won't be able to tell if you're on track to get it. + 2015-12-03_1144_001 +
              +
                +
              • +
              • +
              +
              + +
              +
              What Emotions are you Seeking?
              +
              + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

              What emotions come to mind when you imagine what will be different in your life when you declare victory? +

              Why emotions?
              +

              Remember that misplaced emotional attachment kills companies. Instead of emotionally attaching to a specific product, you're going to focus your energy where it's most efficient: achieving the emotion that is driving your entrepreneurial journey.

              + + + +

              (Wanna know a secret? The reason your starting a company isn't to achieve your victory. You're starting a company to achieve the emotion you think the victory will give you.)

              +
              +
                +
              • +
              +
              + +
              +
              Make it Official
              +
              +

              Congratulations! You have your victory.

              Now you know exactly what Andreesen meant when he said, "Being in a good market with a product that can satisfy that market."

              + You will have found Product-Market Fit, when you satisfy a "good market" that enables you to achieve your victory!

              + Sign your name and post this paper in a very visible place (e.g. your desk, your night stand, your bathroom mirror, your car, etc.).

              +

              (Posting it will be easier when you're using an actual FOCUS worksheet :)

              This paper will remind you of your true aim - even if you have to kill your idea, even if you have to pivot your customer segment, you will still be moving towards your victory by focusing on your personal outcomes.

              + + + +
              +
                +
              • +
              +
              + +
              +
              What are your Co-Founders' Victories?
              +
              + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

              It can be awkward to sit down with your co-founder(s) to understand why they want to start a company - what "victory" looks like for them. At the same time, it's the most important conversation you will have with them. +

              Misaligned goals is the #1 reason founding teams break up.
              + This exercise makes this crucial conversation with your co-founders easy. Simply have each co-founder fill out the worksheet individually (Steps 1 - 6) and then... +

              Merge your Victories

              + + + + On the back side of the worksheet is a place for your team to merge your declarations into a single, unifying victory.

              By merging your goals into a team-wide victory declaration, you can ensure everyone is on the same page and have a common reference point you all turn to when making decisions.

              If you're not able to align your goals, better to discover that now than later. So often one founder wants to change the world, while another simply wants personal financial freedom - both are great, but not in the same founding team.

              The sooner you find out what you and your co-founder(s) want, the more quickly you can get it...either together, or apart. +

              +
              + + + +
              +
              Find your FOCUS
              +
              +

              Congratulations, you've taken the most important step of your startup journey, you've Declared Victory and in doing so, defined your Product-Market Fit. +

              Now it's time, to go get it!
              + +
              +
              + +
              + + + + + + diff --git a/digitalWorksheets/fonts/Capture_it-webfont.eot b/digitalWorksheets/fonts/Capture_it-webfont.eot new file mode 100644 index 0000000..3c1ba3b Binary files /dev/null and b/digitalWorksheets/fonts/Capture_it-webfont.eot differ diff --git a/digitalWorksheets/fonts/Capture_it-webfont.svg b/digitalWorksheets/fonts/Capture_it-webfont.svg new file mode 100644 index 0000000..aec47a0 --- /dev/null +++ b/digitalWorksheets/fonts/Capture_it-webfont.svg @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/digitalWorksheets/fonts/Capture_it-webfont.ttf b/digitalWorksheets/fonts/Capture_it-webfont.ttf new file mode 100644 index 0000000..3f2c8db Binary files /dev/null and b/digitalWorksheets/fonts/Capture_it-webfont.ttf differ diff --git a/digitalWorksheets/fonts/Capture_it-webfont.woff b/digitalWorksheets/fonts/Capture_it-webfont.woff new file mode 100644 index 0000000..19a5e2f Binary files /dev/null and b/digitalWorksheets/fonts/Capture_it-webfont.woff differ diff --git a/digitalWorksheets/ideaGeneration.html b/digitalWorksheets/ideaGeneration.html new file mode 100644 index 0000000..78a74ad --- /dev/null +++ b/digitalWorksheets/ideaGeneration.html @@ -0,0 +1,39 @@ + + + + + + + + + + + +
              +
              + + +
              Write here
              +
              Write here
              + +
              +
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              +
              Write here
              + +
              Write here
              +
              Write here
              +
              +
              + + + + diff --git a/digitalWorksheets/img/Offer-Design---Front.jpg b/digitalWorksheets/img/Offer-Design---Front.jpg new file mode 100644 index 0000000..3af94c5 Binary files /dev/null and b/digitalWorksheets/img/Offer-Design---Front.jpg differ diff --git a/digitalWorksheets/img/adoptionBehaviorCurve-te.jpg b/digitalWorksheets/img/adoptionBehaviorCurve-te.jpg new file mode 100644 index 0000000..31a33b6 Binary files /dev/null and b/digitalWorksheets/img/adoptionBehaviorCurve-te.jpg differ diff --git a/digitalWorksheets/img/adoptionBehaviorCurve.jpg b/digitalWorksheets/img/adoptionBehaviorCurve.jpg new file mode 100644 index 0000000..97c13a6 Binary files /dev/null and b/digitalWorksheets/img/adoptionBehaviorCurve.jpg differ diff --git a/digitalWorksheets/img/back.png b/digitalWorksheets/img/back.png new file mode 100644 index 0000000..bf651d1 Binary files /dev/null and b/digitalWorksheets/img/back.png differ diff --git a/digitalWorksheets/img/close.png b/digitalWorksheets/img/close.png new file mode 100644 index 0000000..20baa1d Binary files /dev/null and b/digitalWorksheets/img/close.png differ diff --git a/digitalWorksheets/img/currency.jpg b/digitalWorksheets/img/currency.jpg new file mode 100644 index 0000000..30ed4c1 Binary files /dev/null and b/digitalWorksheets/img/currency.jpg differ diff --git a/digitalWorksheets/img/folded.png b/digitalWorksheets/img/folded.png new file mode 100644 index 0000000..636ccf3 Binary files /dev/null and b/digitalWorksheets/img/folded.png differ diff --git a/digitalWorksheets/img/front.jpg b/digitalWorksheets/img/front.jpg new file mode 100644 index 0000000..586a7fa Binary files /dev/null and b/digitalWorksheets/img/front.jpg differ diff --git a/digitalWorksheets/img/ideaGeneration.jpg b/digitalWorksheets/img/ideaGeneration.jpg new file mode 100644 index 0000000..3ecb591 Binary files /dev/null and b/digitalWorksheets/img/ideaGeneration.jpg differ diff --git a/digitalWorksheets/img/ideaGenerationStudent-te.jpg b/digitalWorksheets/img/ideaGenerationStudent-te.jpg new file mode 100644 index 0000000..c33806c Binary files /dev/null and b/digitalWorksheets/img/ideaGenerationStudent-te.jpg differ diff --git a/digitalWorksheets/img/ideaGenerationStudent.jpg b/digitalWorksheets/img/ideaGenerationStudent.jpg new file mode 100644 index 0000000..a466ea8 Binary files /dev/null and b/digitalWorksheets/img/ideaGenerationStudent.jpg differ diff --git a/digitalWorksheets/img/interview-template.jpg b/digitalWorksheets/img/interview-template.jpg new file mode 100644 index 0000000..71de6c2 Binary files /dev/null and b/digitalWorksheets/img/interview-template.jpg differ diff --git a/digitalWorksheets/img/loading.gif b/digitalWorksheets/img/loading.gif new file mode 100644 index 0000000..5087c2a Binary files /dev/null and b/digitalWorksheets/img/loading.gif differ diff --git a/digitalWorksheets/img/next.png b/digitalWorksheets/img/next.png new file mode 100644 index 0000000..08365ac Binary files /dev/null and b/digitalWorksheets/img/next.png differ diff --git a/digitalWorksheets/img/prev.png b/digitalWorksheets/img/prev.png new file mode 100644 index 0000000..329fa98 Binary files /dev/null and b/digitalWorksheets/img/prev.png differ diff --git a/digitalWorksheets/img/problems-te.jpg b/digitalWorksheets/img/problems-te.jpg new file mode 100644 index 0000000..57487b5 Binary files /dev/null and b/digitalWorksheets/img/problems-te.jpg differ diff --git a/digitalWorksheets/img/problems.jpg b/digitalWorksheets/img/problems.jpg new file mode 100644 index 0000000..115e311 Binary files /dev/null and b/digitalWorksheets/img/problems.jpg differ diff --git a/digitalWorksheets/img/wood.jpg b/digitalWorksheets/img/wood.jpg new file mode 100644 index 0000000..d7a6213 Binary files /dev/null and b/digitalWorksheets/img/wood.jpg differ diff --git a/digitalWorksheets/js/adoptionBehaviorCurve.js b/digitalWorksheets/js/adoptionBehaviorCurve.js new file mode 100644 index 0000000..e69de29 diff --git a/digitalWorksheets/js/assessment.js b/digitalWorksheets/js/assessment.js new file mode 100644 index 0000000..d0ecd59 --- /dev/null +++ b/digitalWorksheets/js/assessment.js @@ -0,0 +1,110 @@ +$(document).ready(function () { + + $('#qTable a').each(function () { + var link = $(this); + + if (link.attr("href").toLowerCase().indexOf("customerdevlabs.com/focus") >= 0) { + link.attr("href", "https://www.thefocusframework.com/#toc"); + link.attr("target", "_blank"); + } + }); + + configDynamicQuestionSurvey("#qTable", "#treeTable", function () { + setCurrentPhase($('#treeTable .phaseTitle:visible')); + setAssessmentPath(); + }); + + configDynamicQuestionSurvey("#pollQTable", "#pollTreeTable", function () { + setPollAnswer(); + if (refreshPollCharts) { + refreshPollCharts() + } + }); + +}); + +function setPollAnswer() { + var path = ""; + var questions = {}; + + if (!myPollRef) { + return; + } + + // get selected buttons + $('#pollTreeTable .question .btn-primary').each(function (ndx) { + if ($(this).text()) { + var html = $(this).html(); + + if (html.indexOf("") != -1) { + html = html.substring(0, html.indexOf("")); + } + + questions["Question_" + (ndx + 1)] = html; + } + }); + + myPollRef.update(questions); +} + +function configDynamicQuestionSurvey(questionTableSelector, treeTableSelector, onSelectionFunction) { + $(questionTableSelector + ' li').on('click', function () { + //style the selected answer + $(this).removeClass('btn-default').addClass('btn-primary').siblings("li").removeClass('btn-primary').addClass('btn-default'); + //hide all rows after the currently displayed row and remove selectedAnswer style + $(this).closest("tr").prevAll("tr").remove(); + + //show the next row that matches the question id + var italNum = $(this).find('i').text(); + var qNextSelector = ' tr:nth-child(' + italNum + ')'; + var nextQuestion = $(questionTableSelector + qNextSelector).clone(true).hide(); + + $(treeTableSelector).prepend(nextQuestion); + nextQuestion.fadeIn(800, onSelectionFunction); + }) + + // setup first question + var firstQuestion = $(questionTableSelector + ' tr').first().clone(true); + $(treeTableSelector).prepend(firstQuestion); +} + +function setAssessmentPath() { + var path = ""; + + // get selected buttons + $('#treeTable .question .btn-primary').each(function (ndx) { + if ($(this).text()) { + path = $(this).text() + ", " + path; + } + }); + + if (myPMFAssessmentRef) { + myPMFAssessmentRef.update({ + assessmentPath: path + }); + } +} + +function setCurrentPhase(result) { + // is a final assessment visible + if (myPMFAssessmentRef && result.length > 0) { + var text = result.first().text().toLowerCase(); + var phase; + + if (text.indexOf("finding early adopters") != -1) { + phase = "Finding Early Adopters"; + } else if (text.indexOf("offer testing") != -1) { + phase = "Offer Testing"; + } else if (text.indexOf("currency testing") != -1) { + phase = "Currency Testing"; + } else if (text.indexOf("utility testing") != -1) { + phase = "Utility Testing"; + } else if (text.indexOf("scaling") != -1) { + phase = "Scaling"; + } + + myPMFAssessmentRef.update({ + currentPhase: phase + }); + } +} \ No newline at end of file diff --git a/digitalWorksheets/js/declaringVictory.js b/digitalWorksheets/js/declaringVictory.js new file mode 100644 index 0000000..ce36705 --- /dev/null +++ b/digitalWorksheets/js/declaringVictory.js @@ -0,0 +1,116 @@ +var currentStep = -1; +var previousLayout; + +$(document).ready(function() { + $('.prev-button').click(prevStep); + $('.next-button').click(nextStep); + + $(window).resize(initInstructionDimensions); +}); + +$(window).load(function() { + nextStep(); +}); + +function initInstructionDimensions() { + const INSTRUCTION_RATIO = .8; + + if ($('.worksheet').height() > 0) { + $('.instructions > .content').css('max-height', $('.worksheet').height() * INSTRUCTION_RATIO); + } +} + +function nextStep() { + currentStep++; + setStep(); +} + +function prevStep() { + currentStep--; + setStep(); +} + +function setStep() { + initInstructionDimensions(); + + var panel = $(".instruction-panel"); + var title = panel.find('.panel-title'); + var content = panel.find('.content'); + var step = $('.step:eq(' + currentStep + ')'); + var wrkshtImg = $('#declaring-victory-worksheet'); + var newLayout = step.attr('layout'); + var fields = step.find('.fields').children(); + + panel.fadeOut("slow", function() { + if (currentStep == 1 && !wrkshtImg.hasClass('fly-in')) { + wrkshtImg.addClass('transitions'); + wrkshtImg.addClass('fly-in'); + + setTimeout(setStep, 1500); + return; + } + + var changeImage = step.attr('changeImage'); + + if (changeImage != null && wrkshtImg.attr('src') != changeImage) { + wrkshtImg.removeClass('transitions'); + + $('.blank:visible').addClass('comeback').fadeOut("slow"); + + wrkshtImg.fadeOut("slow", function() { + wrkshtImg.attr('src', changeImage); + wrkshtImg.fadeIn("slow"); + + $('.comeback').fadeIn("slow").removeClass('comeback'); + }); + + setTimeout(setStep, 1000); + return; + } + + title.html(step.find('.title').html() + " " + (currentStep + 1) + ' of ' + $('.step').length + ""); + content.html(step.find('.content').html()); + + content.find('.lightboxable').attr('data-lightbox', 'step' + currentStep); + + if (newLayout != previousLayout) { + panel.addClass(newLayout); + panel.removeClass(previousLayout); + + previousLayout = newLayout; + } + + fields.each(function() { + var field = $(this).attr("class"); + $('div.' + field).fadeIn("slow").get(0).focus(); + }); + + if (fields.length > 0) { + var firstField = fields.first().attr('class'); + $('div.' + firstField).get(0).focus(); + } + + if (currentStep == 0) { + // first step + $('.prev-button').hide(); + $('.next-button').text("Start"); + } + else if (currentStep >= $('.step').length - 1) { + // last step + $('.next-button').hide(); + } + else { + // middle step + $('.prev-button').show().text('Prev'); + $('.next-button').show().text('Next'); + } + + panel.fadeIn("slow"); + }); +} + +function swapImage(img) { + var wrkshtImg = $('.worksheet img'); + + wrkshtImg.attr('src', img); +} diff --git a/digitalWorksheets/js/lightbox.js b/digitalWorksheets/js/lightbox.js new file mode 100644 index 0000000..352bb86 --- /dev/null +++ b/digitalWorksheets/js/lightbox.js @@ -0,0 +1,453 @@ +/*! + * Lightbox v2.8.2 + * by Lokesh Dhakar + * + * More info: + * http://lokeshdhakar.com/projects/lightbox2/ + * + * Copyright 2007, 2015 Lokesh Dhakar + * Released under the MIT license + * https://github.com/lokesh/lightbox2/blob/master/LICENSE + */ + +// Uses Node, AMD or browser globals to create a module. +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + // Browser globals (root is window) + root.lightbox = factory(root.jQuery); + } +}(this, function ($) { + + function Lightbox(options) { + this.album = []; + this.currentImageIndex = void 0; + this.init(); + + // options + this.options = $.extend({}, this.constructor.defaults); + this.option(options); + } + + // Descriptions of all options available on the demo site: + // http://lokeshdhakar.com/projects/lightbox2/index.html#options + Lightbox.defaults = { + albumLabel: 'Image %1 of %2', + alwaysShowNavOnTouchDevices: false, + fadeDuration: 500, + fitImagesInViewport: true, + // maxWidth: 800, + // maxHeight: 600, + positionFromTop: 50, + resizeDuration: 700, + showImageNumberLabel: true, + wrapAround: false, + disableScrolling: false + }; + + Lightbox.prototype.option = function(options) { + $.extend(this.options, options); + }; + + Lightbox.prototype.imageCountLabel = function(currentImageNum, totalImages) { + return this.options.albumLabel.replace(/%1/g, currentImageNum).replace(/%2/g, totalImages); + }; + + Lightbox.prototype.init = function() { + this.enable(); + this.build(); + }; + + // Loop through anchors and areamaps looking for either data-lightbox attributes or rel attributes + // that contain 'lightbox'. When these are clicked, start lightbox. + Lightbox.prototype.enable = function() { + var self = this; + $('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function(event) { + self.start($(event.currentTarget)); + return false; + }); + }; + + // Build html for the lightbox and the overlay. + // Attach event handlers to the new DOM elements. click click click + Lightbox.prototype.build = function() { + var self = this; + $('
              ').appendTo($('body')); + + // Cache jQuery objects + this.$lightbox = $('#lightbox'); + this.$overlay = $('#lightboxOverlay'); + this.$outerContainer = this.$lightbox.find('.lb-outerContainer'); + this.$container = this.$lightbox.find('.lb-container'); + + // Store css values for future lookup + this.containerTopPadding = parseInt(this.$container.css('padding-top'), 10); + this.containerRightPadding = parseInt(this.$container.css('padding-right'), 10); + this.containerBottomPadding = parseInt(this.$container.css('padding-bottom'), 10); + this.containerLeftPadding = parseInt(this.$container.css('padding-left'), 10); + + // Attach event handlers to the newly minted DOM elements + this.$overlay.hide().on('click', function() { + self.end(); + return false; + }); + + this.$lightbox.hide().on('click', function(event) { + if ($(event.target).attr('id') === 'lightbox') { + self.end(); + } + return false; + }); + + this.$outerContainer.on('click', function(event) { + if ($(event.target).attr('id') === 'lightbox') { + self.end(); + } + return false; + }); + + this.$lightbox.find('.lb-prev').on('click', function() { + if (self.currentImageIndex === 0) { + self.changeImage(self.album.length - 1); + } else { + self.changeImage(self.currentImageIndex - 1); + } + return false; + }); + + this.$lightbox.find('.lb-next').on('click', function() { + if (self.currentImageIndex === self.album.length - 1) { + self.changeImage(0); + } else { + self.changeImage(self.currentImageIndex + 1); + } + return false; + }); + + this.$lightbox.find('.lb-loader, .lb-close').on('click', function() { + self.end(); + return false; + }); + }; + + // Show overlay and lightbox. If the image is part of a set, add siblings to album array. + Lightbox.prototype.start = function($link) { + var self = this; + var $window = $(window); + + $window.on('resize', $.proxy(this.sizeOverlay, this)); + + $('select, object, embed').css({ + visibility: 'hidden' + }); + + this.sizeOverlay(); + + this.album = []; + var imageNumber = 0; + + function addToAlbum($link) { + self.album.push({ + link: $link.attr('href'), + title: $link.attr('data-title') || $link.attr('title') + }); + } + + // Support both data-lightbox attribute and rel attribute implementations + var dataLightboxValue = $link.attr('data-lightbox'); + var $links; + + if (dataLightboxValue) { + $links = $($link.prop('tagName') + '[data-lightbox="' + dataLightboxValue + '"]'); + for (var i = 0; i < $links.length; i = ++i) { + addToAlbum($($links[i])); + if ($links[i] === $link[0]) { + imageNumber = i; + } + } + } else { + if ($link.attr('rel') === 'lightbox') { + // If image is not part of a set + addToAlbum($link); + } else { + // If image is part of a set + $links = $($link.prop('tagName') + '[rel="' + $link.attr('rel') + '"]'); + for (var j = 0; j < $links.length; j = ++j) { + addToAlbum($($links[j])); + if ($links[j] === $link[0]) { + imageNumber = j; + } + } + } + } + + // Position Lightbox + var top = $window.scrollTop() + this.options.positionFromTop; + var left = $window.scrollLeft(); + this.$lightbox.css({ + top: top + 'px', + left: left + 'px' + }).fadeIn(this.options.fadeDuration); + + // Disable scrolling of the page while open + if (this.options.disableScrolling) { + $('body').addClass('lb-disable-scrolling'); + } + + this.changeImage(imageNumber); + }; + + // Hide most UI elements in preparation for the animated resizing of the lightbox. + Lightbox.prototype.changeImage = function(imageNumber) { + var self = this; + + this.disableKeyboardNav(); + var $image = this.$lightbox.find('.lb-image'); + + this.$overlay.fadeIn(this.options.fadeDuration); + + $('.lb-loader').fadeIn('slow'); + this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide(); + + this.$outerContainer.addClass('animating'); + + // When image to show is preloaded, we send the width and height to sizeContainer() + var preloader = new Image(); + preloader.onload = function() { + var $preloader; + var imageHeight; + var imageWidth; + var maxImageHeight; + var maxImageWidth; + var windowHeight; + var windowWidth; + + $image.attr('src', self.album[imageNumber].link); + + $preloader = $(preloader); + + $image.width(preloader.width); + $image.height(preloader.height); + + if (self.options.fitImagesInViewport) { + // Fit image inside the viewport. + // Take into account the border around the image and an additional 10px gutter on each side. + + windowWidth = $(window).width(); + windowHeight = $(window).height(); + maxImageWidth = windowWidth - self.containerLeftPadding - self.containerRightPadding - 20; + maxImageHeight = windowHeight - self.containerTopPadding - self.containerBottomPadding - 120; + + // Check if image size is larger then maxWidth|maxHeight in settings + if (self.options.maxWidth && self.options.maxWidth < maxImageWidth) { + maxImageWidth = self.options.maxWidth; + } + if (self.options.maxHeight && self.options.maxHeight < maxImageWidth) { + maxImageHeight = self.options.maxHeight; + } + + // Is there a fitting issue? + if ((preloader.width > maxImageWidth) || (preloader.height > maxImageHeight)) { + if ((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)) { + imageWidth = maxImageWidth; + imageHeight = parseInt(preloader.height / (preloader.width / imageWidth), 10); + $image.width(imageWidth); + $image.height(imageHeight); + } else { + imageHeight = maxImageHeight; + imageWidth = parseInt(preloader.width / (preloader.height / imageHeight), 10); + $image.width(imageWidth); + $image.height(imageHeight); + } + } + } + self.sizeContainer($image.width(), $image.height()); + }; + + preloader.src = this.album[imageNumber].link; + this.currentImageIndex = imageNumber; + }; + + // Stretch overlay to fit the viewport + Lightbox.prototype.sizeOverlay = function() { + this.$overlay + .width($(document).width()) + .height($(document).height()); + }; + + // Animate the size of the lightbox to fit the image we are showing + Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) { + var self = this; + + var oldWidth = this.$outerContainer.outerWidth(); + var oldHeight = this.$outerContainer.outerHeight(); + var newWidth = imageWidth + this.containerLeftPadding + this.containerRightPadding; + var newHeight = imageHeight + this.containerTopPadding + this.containerBottomPadding; + + function postResize() { + self.$lightbox.find('.lb-dataContainer').width(newWidth); + self.$lightbox.find('.lb-prevLink').height(newHeight); + self.$lightbox.find('.lb-nextLink').height(newHeight); + self.showImage(); + } + + if (oldWidth !== newWidth || oldHeight !== newHeight) { + this.$outerContainer.animate({ + width: newWidth, + height: newHeight + }, this.options.resizeDuration, 'swing', function() { + postResize(); + }); + } else { + postResize(); + } + }; + + // Display the image and its details and begin preload neighboring images. + Lightbox.prototype.showImage = function() { + this.$lightbox.find('.lb-loader').stop(true).hide(); + this.$lightbox.find('.lb-image').fadeIn('slow'); + + this.updateNav(); + this.updateDetails(); + this.preloadNeighboringImages(); + this.enableKeyboardNav(); + }; + + // Display previous and next navigation if appropriate. + Lightbox.prototype.updateNav = function() { + // Check to see if the browser supports touch events. If so, we take the conservative approach + // and assume that mouse hover events are not supported and always show prev/next navigation + // arrows in image sets. + var alwaysShowNav = false; + try { + document.createEvent('TouchEvent'); + alwaysShowNav = (this.options.alwaysShowNavOnTouchDevices) ? true : false; + } catch (e) {} + + this.$lightbox.find('.lb-nav').show(); + + if (this.album.length > 1) { + if (this.options.wrapAround) { + if (alwaysShowNav) { + this.$lightbox.find('.lb-prev, .lb-next').css('opacity', '1'); + } + this.$lightbox.find('.lb-prev, .lb-next').show(); + } else { + if (this.currentImageIndex > 0) { + this.$lightbox.find('.lb-prev').show(); + if (alwaysShowNav) { + this.$lightbox.find('.lb-prev').css('opacity', '1'); + } + } + if (this.currentImageIndex < this.album.length - 1) { + this.$lightbox.find('.lb-next').show(); + if (alwaysShowNav) { + this.$lightbox.find('.lb-next').css('opacity', '1'); + } + } + } + } + }; + + // Display caption, image number, and closing button. + Lightbox.prototype.updateDetails = function() { + var self = this; + + // Enable anchor clicks in the injected caption html. + // Thanks Nate Wright for the fix. @https://github.com/NateWr + if (typeof this.album[this.currentImageIndex].title !== 'undefined' && + this.album[this.currentImageIndex].title !== '') { + this.$lightbox.find('.lb-caption') + .html(this.album[this.currentImageIndex].title) + .fadeIn('fast') + .find('a').on('click', function(event) { + if ($(this).attr('target') !== undefined) { + window.open($(this).attr('href'), $(this).attr('target')); + } else { + location.href = $(this).attr('href'); + } + }); + } + + if (this.album.length > 1 && this.options.showImageNumberLabel) { + var labelText = this.imageCountLabel(this.currentImageIndex + 1, this.album.length); + this.$lightbox.find('.lb-number').text(labelText).fadeIn('fast'); + } else { + this.$lightbox.find('.lb-number').hide(); + } + + this.$outerContainer.removeClass('animating'); + + this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration, function() { + return self.sizeOverlay(); + }); + }; + + // Preload previous and next images in set. + Lightbox.prototype.preloadNeighboringImages = function() { + if (this.album.length > this.currentImageIndex + 1) { + var preloadNext = new Image(); + preloadNext.src = this.album[this.currentImageIndex + 1].link; + } + if (this.currentImageIndex > 0) { + var preloadPrev = new Image(); + preloadPrev.src = this.album[this.currentImageIndex - 1].link; + } + }; + + Lightbox.prototype.enableKeyboardNav = function() { + $(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this)); + }; + + Lightbox.prototype.disableKeyboardNav = function() { + $(document).off('.keyboard'); + }; + + Lightbox.prototype.keyboardAction = function(event) { + var KEYCODE_ESC = 27; + var KEYCODE_LEFTARROW = 37; + var KEYCODE_RIGHTARROW = 39; + + var keycode = event.keyCode; + var key = String.fromCharCode(keycode).toLowerCase(); + if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) { + this.end(); + } else if (key === 'p' || keycode === KEYCODE_LEFTARROW) { + if (this.currentImageIndex !== 0) { + this.changeImage(this.currentImageIndex - 1); + } else if (this.options.wrapAround && this.album.length > 1) { + this.changeImage(this.album.length - 1); + } + } else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) { + if (this.currentImageIndex !== this.album.length - 1) { + this.changeImage(this.currentImageIndex + 1); + } else if (this.options.wrapAround && this.album.length > 1) { + this.changeImage(0); + } + } + }; + + // Closing time. :-( + Lightbox.prototype.end = function() { + this.disableKeyboardNav(); + $(window).off('resize', this.sizeOverlay); + this.$lightbox.fadeOut(this.options.fadeDuration); + this.$overlay.fadeOut(this.options.fadeDuration); + $('select, object, embed').css({ + visibility: 'visible' + }); + if (this.options.disableScrolling) { + $('body').removeClass('lb-disable-scrolling'); + } + }; + + return new Lightbox(); +})); diff --git a/earlystage.html b/earlystage.html new file mode 100644 index 0000000..e34258f --- /dev/null +++ b/earlystage.html @@ -0,0 +1,2329 @@ + + + + + 5 Experiments to Build Stuff that Sells | Justin Wilcox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              +
              +
              5 Experiments to Startup Success with EarlyStage and Justin Wilcox
              +
              + +
              + +
              +
              +
              +
              + +
              + +
              + +
              +
              + +
              +
              +

              Questions: Ask and up vote.

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

                Welcome to the Workshop!

                You can take notes during the workshop here. +

                +   +

                5 Phases of Product-Market Fit

                +
                  +
                1. F
                2. +
                3. O
                4. +
                5. C
                6. +
                7. U
                8. +
                9. S
                10. +
                +

                +

                Takeaways

                +

                + + +

                Where are your Early Adopters:

                +

                +
                +
                +
                +
                + +
                +
                + + + + +
                +
                +
                + +
                +
                +
                + +
                +
                + + + + +
                +
                +
                + +
                +
                +
                + +
                + +
                +
                + + + + + + + + + + + +
                +
                + +
                + +
                + +
                +
                + + + + +
                + +
                +
                + + +
                +
                +
                +
                +
                +
                +
                + + +
                +
                + +
                +
                +
                +
                +
                + +
                +
                +
                + +
                + +
                +
                Defining Product-Market Fit
                +
                + Ready to define Product-Market Fit? +
                +
                + +
                +
                Declaring Victory Worksheet
                +
                + This worksheet will walk you through defining Product-Market Fit. +
                +
                + +
                +
                Today's Date
                +
                  +
                • +
                +
                + Start by writing in today's date in the field on the right.

                +
                +
                + + + + + +
                +
                What's your Product?
                +
                +

                Write in the product or service that you would like to build.

                + +
                +
                  +
                • +
                +
                + +
                +
                Who's your Customer?
                +
                + Write in the customers or people whom you would like to serve.

                +
                +
                  +
                • +
                +
                + +
                +
                Fold on the Dotted Line
                +
                + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
                +
                  +
                +
                + +
                +
                Your Promise
                +
                + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                  +
                1. Even if you never get to build your product and
                2. +
                3. Even if you are not able to help the people you want to help...
                4. +
                +
                You are still going to achieve victory.
                +
                +
                  +
                +
                + + + +
                +
                Enter your Victory
                +
                +

                Write in your measurable Victory metric.

                + +
                +
                  +
                • +
                • +
                +
                + +
                +
                Find your FOCUS
                +
                + Want Feedback?

                + Type "Yes" if you'd like me to review your Victory.

                + + Bonus: you'll also be helping others learn. +
                +
                  + +
                +
                + +
                +
                What Emotions are you Seeking?
                +
                + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

                + +
                +
                  +
                • +
                +
                + +
                +
                Make it Official
                +
                +

                Congratulations! You have your victory.

                + + + +
                +
                  +
                • +
                +
                + +
                +
                What are your Co-Founders' Victories?
                +
                + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

                + +
                +
                + + + +
                +
                Find your FOCUS
                +
                +

                Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

                Write your Victory Declaration in your Notes tab!
                + +
                +
                + +
                + +
                + +
                +
                + + + + +
                +
                +
                + +
                +
                + + +
                +
                + +
                +
                +
                +
                +
                +
                +
                +
                +
                +
                +
                +
                + +
                1. +
                2. +
                3. +
                4. +
                5. +
                +
                +
                1. +
                2. +
                3. +
                4. +
                5. +
                +
                + +
                + +
                +
                +
                +
                +
                + +
                +
                +
                + + + + + +
                N
                +
                N
                +
                N
                +
                Y
                +
                N
                +
                N
                +
                Y
                +
                Y
                +
                N
                +
                Y
                +
                Y
                +
                Y
                + + + + + +
                + +
                +
                +
                + +
                +
                + + + + +
                +
                +
                + +
                +
                + + +
                +
                +
                +
                +
                + +
                +
                +
                +
                +
                + +
                +
                +
                +
                +
                + +
                +
                +
                + + + + + + + + + + + + + + +
                + +
                +
                +
                + +
                +
                + + + + +
                +
                +
                + +
                +
                + + +
                + +
                + 1. +
                2. +
                3. +
                4. +
                5. +
                +
                + +
                + 1. +
                2. +
                3. +
                4. +
                5. +
                +
                + +
                + 1. +
                2. +
                3. +
                4. +
                5. +
                +
                + +
                #
                +
                of things
                + +
                +
                +
                +
                +
                +
                + +
                +
                +
                +
                +
                + +
                +
                + + + + +
                +
                +
                + +
                +

                Product-Market Fit Assessment

                This exercise will tell you: +
                  +
                1. What phase of Product-Market Fit you're in
                2. +
                3. Your startup's "Riskiest Assumption"
                4. +
                5. Your next step to test that assumption
                6. +
                +

                Just answer these questions...

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

                Have you launched your product?

                +
                +
                +
                  +
                • No30
                • +

                  +
                • Yes2
                • +

                  +
                +
                +
                +
                +
                +
                +

                Are customers paying for it?

                +
                +
                +
                  +
                • No23
                • +

                  +
                • Yes3
                • +

                  +
                +
                +
                +
                +
                +
                +

                Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve + Product-Market Fit?

                +
                +
                +
                  +
                • No5
                • +

                  +
                • Yes4
                • +

                  +
                • Not sure20
                • +

                  +
                +
                +
                +
                +
                +
                + Congrats! You're on the path to Product-Market + Fit. +
                +
                +
                + Keep doing what you're doing! +
                +
                +
                +
                +
                +
                +

                Why aren't you on track to acheive Product-Market Fit?

                +
                +
                +
                  +
                • Not enough customers6
                • +

                  +
                • Customer Lifetime Value is too low16
                • +

                  +
                +
                Not sure? Go with your gut. Eventually you'll test both.
                +
                +
                +
                +
                +
                +

                Why don't you have enough customers?

                +
                +
                +
                  +
                • Having trouble finding them7
                • +

                  +
                • Conversion rate it too low10
                • +

                  +
                • Customer segment is too small14
                • +

                  +
                • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                • +

                  +
                +
                Not sure? Starting at the top, pick the first answer you think could be the reason.
                +
                +
                +
                +
                +
                +

                Where are you looking for customers?

                +
                +
                +
                  +
                • Places I think my customers are.8
                • +

                  +
                • Places customers have told me they are.9
                • +

                  +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
                +
                +
                +
                Product-Market Fit Phase: Finding Early Adopters for + your product.
                +
                Your Your Next Step: Interview customers to validate + where they look for solutions.
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                Use this information to make your interviews easier and faster + to get.
                +
                +

                Found in FOCUS Workbook 1...

                + +
                +
                +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
                +
                +
                +
                Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                +
                Your Next Step: Test alternative channels to determine + potential customer segment size.
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

                You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
                +
                +

                Found in FOCUS Workbook 2...

                + +
                +
                +
                +
                +
                +
                +
                +
                +

                What emotions are you evoking in your Call to Action?

                +
                +
                +
                  +
                • I'm not evoking emotions in my Call to Action11
                • +

                  +
                • Emotions I think my customers are experiencing12
                • +

                  +
                • Emotions my customers have told me they are experiencing13
                • +

                  +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
                +
                +
                +
                Product-Market Fit Phase: Finding Early Adopters for + your product.
                +
                Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

                Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
                +
                +

                Found in FOCUS Workbook 1...

                + +
                +
                +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: You understand + your customer's emotional desires. +
                +
                +
                +
                Product-Market Fit Phase: .
                +
                Your Next Step: Interview your customers to understand + their emotional desires. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                Use this information to make your interviews easier and faster + to get.
                +
                +

                Found in FOCUS Workbook 1...

                + +
                +
                +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
                +
                +
                +
                Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                +
                Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This exercise will help you identify + the emotions your customers' emotions. + +

                By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
                +
                +

                Found in FOCUS Workbook 2...

                + +
                +
                +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
                +
                +
                +
                Product-Market Fit Phase: Scaling to Product-Market + Fit. +
                +
                Your Next Step: Identify, size and test related customer + segments. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

                By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
                +
                +

                Found in FOCUS Workbook 5...

                + +
                +
                +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
                +
                +
                +
                Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                +
                Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
                +
                +

                Found in FOCUS Workbook 4...

                + +
                +
                +
                +
                +
                +
                +
                +
                +

                Why is your Customer Lifetime Value too low?

                +
                +
                +
                  +
                • Customer churn is too high (i.e. they cancel your service too soon)17
                • +

                  +
                • Price is too low18
                • +

                  +
                • Cost of customer acquisition is too high19
                • +

                  +
                +
                Not sure? Starting at the top, pick the first answer you think could be the reason.
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
                +
                +
                +
                Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                +
                Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                +
                +

                Found in FOCUS Workbook 4...

                + +
                +
                +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
                +
                +
                +
                Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                +
                Your Next Step: Optimize your price via price testing. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
                +
                +

                Found in FOCUS Workbook 3...

                + +
                +
                +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
                +
                +
                +
                Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
                +
                Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
                +
                +

                Found in FOCUS Workbook 2...

                + +
                +
                +
                +
                +
                +
                +
                +
                +

                Have you defined a metric that represents when you have acheived Product-Market Fit?

                +
                +
                +
                  +
                • No21
                • +

                  +
                • Yes22
                • +

                  +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
                +
                +
                +
                Product-Market Fit Phase: Finding Early Adopters for + your product.
                +
                Your Next Step: Define Product-Market Fit for you + and your team. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

                This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
                +
                +

                Found in FOCUS Workbook 1...

                + +
                +
                +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
                +
                +
                +
                Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                +
                Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
                +
                +

                Found in FOCUS Workbook 3...

                + +
                +
                +
                +
                +
                +
                +
                +
                +

                Are customers using the product?

                +
                +
                +
                  +
                • No41
                • +

                  +
                • Yes24
                • +

                  +
                +
                +
                +
                +
                +
                +

                Why aren't your customers paying to use your product?

                +
                +
                +
                  +
                • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
                • +

                  +
                • Going to monetize after reaching critical mass26
                • +

                  +
                • Pursuing a freemium model and haven't built paid features yet25
                • +

                  +
                • Tried charging but no one would pay10
                • +

                  +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                +
                +
                +
                Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
                +
                Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
                +
                +

                Found in FOCUS Workbook 3...

                + +
                +
                +
                +
                +
                +
                +
                +
                +

                Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market + Fit? +

                +
                +
                +
                  +
                • No28
                • +

                  +
                • Yes38
                • +

                  +
                • Not sure20
                • +

                  +
                +
                +
                +
                + +
                +
                +
                +

                Why aren't enough customers using for you to achieve Product-Market Fit?

                +
                +
                +
                  +
                • Having trouble finding them7
                • +

                  +
                • Conversion rate it too low10
                • +

                  +
                • Customer segment is too small14
                • +

                  +
                • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                • +

                  +
                +
                Not sure? Starting at the top, pick the first answer you think could be the reason.
                +
                +
                +
                +
                +
                +

                Have you defined a metric that represents when you have acheived Product-Market Fit?

                +
                +
                +
                  +
                • No21
                • +

                  +
                • Yes22
                • +

                  +
                +
                +
                +
                +
                +
                +

                Have you generated any pre-sales or signed Letters of Intent?

                +
                +
                +
                  +
                • No35
                • +

                  +
                • Yes31
                • +

                  +
                +
                +
                +
                +
                +
                +

                Are enough customers pre-paying for it that, if you solve their problems, you'll achieve + Product-Market Fit?

                +
                +
                +
                  +
                • No5
                • +

                  +
                • Yes32
                • +

                  +
                • Not sure20
                • +

                  +
                +
                +
                +
                +
                +
                +

                Why haven't you launched the product yet?

                +
                +
                +
                  +
                • No development team33
                • +

                  +
                • Solution is still under development33
                • +

                  +
                • Testing the solution privately before making it available publicly34
                • +

                  +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: You can solve + your customers' problems. +
                +
                +
                +
                Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                +
                Your Next Step: Test a manual solution. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
                +
                +

                Found in FOCUS Workbook 4...

                + +
                +
                +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
                +
                +
                +
                Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
                +
                Your Next Step: Test an automated solution. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
                +
                +

                Found in FOCUS Workbook 5...

                + +
                +
                +
                +
                +
                +
                +
                +
                +

                Have you identified a problem at least 60% of your customers are actively trying to solve?

                +
                +
                +
                  +
                • No40
                • +

                  +
                • Yes36
                • +

                  +
                +
                +
                +
                +
                +
                +

                If you solve the problem, will you achieve Product-Market Fit?

                +
                +
                +
                  +
                • No5
                • +

                  +
                • Yes37
                • +

                  +
                • Not sure39
                • +

                  +
                +
                +
                +
                +
                +
                +

                Why aren't you collecting pre-orders or Letters of Intent?

                +
                +
                +
                  +
                • Can't finding customers to pre-sell7
                • +

                  +
                • Don't know how38
                • +

                  +
                • Tried but no one bought10
                • +

                  +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                +
                +
                +
                Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                +
                Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
                +
                +

                Found in FOCUS Workbook 3...

                + +
                +
                +
                +
                +
                +
                +
                +
                +

                Have you defined a metric that represents when you have acheived Product-Market Fit?

                +
                +
                +
                  +
                • No21
                • +

                  +
                • Yes9
                • +

                  +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
                +
                +
                +
                Product-Market Fit Phase: Finding Early Adopters for + your product.
                +
                Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                Use this information to make your interviews easier and faster + to get.
                +
                +

                Found in FOCUS Workbook 1...

                + +
                +
                +
                +
                +
                +
                +
                +
                +

                Why aren't customers using your product?

                +
                +
                +
                  +
                • I'm not sure how/where to find customers to tell about it8
                • +

                  +
                • I've told them about it, but they don't really use it11
                • +

                  +
                • Customers use it a little, but then they stop42
                • +

                  +
                +
                +
                +
                +
                +
                + Your Riskiest Assumption: Your product solves + your customers' problems. +
                +
                +
                +
                Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                +
                Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                +
                + This will help... +
                + +
                +

                Recommended FOCUS Exercise...

                + +
                +
                Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                +
                +

                Found in FOCUS Workbook 4...

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

                Bonus #1

                +
                +
                +
                +

                + FREE Customer Interview Email Course
                +

                +
                + You'll learn... +
                  +
                • Which customers to ask for interviews
                • +
                • A cold email script that works to get interviews
                • +
                • How to analyze your interview answers
                • +
                + +
                + +
                + +
                +
                +

                Bonus #2

                +
                +
                +
                +

                FOCUS Framework

                +

                $20 Off Coupon

                + +
                + +
                +
                +

                Use coupon: SWAlum
                (next 24 hours)

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

                How likely would you be to recommend this workshop to a friend?

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

                What's one thing we can improve next time?

                +
                +
                + +
                +
                + +
                +
                +

                What was your favorite part of the workshop?

                +
                +
                + +
                + +
                + +
                +
                +
                +
                +
                +
                +
                + + +
                + +
                + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/earlystage.js b/earlystage.js new file mode 100644 index 0000000..c182c1f --- /dev/null +++ b/earlystage.js @@ -0,0 +1,1657 @@ +//var app = angular.module('app', ['firebase']); +var firebaseRoot = "https://cdlwebshops.firebaseio.com/earlystage"; + +var rootRef = new Firebase(firebaseRoot); +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var emailsRef = new Firebase(firebaseRoot + "/emails"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); +var notesRef = new Firebase(firebaseRoot + "/notes"); +var exerciseValuesRef = new Firebase(firebaseRoot + "/exerciseValues"); + +var declaringVictoryRef = exerciseValuesRef.child("declaringVictory"); +var earlyAdoptersRef = exerciseValuesRef.child("earlyAdopters"); +var offerDesignRef = exerciseValuesRef.child("offerDesign"); +var pmfAssessmentRef = exerciseValuesRef.child("pmfAssessment"); + +var loggedInUserId; +var questionPad, responsePad; +var myPMFAssessmentRef; + +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +const GET_PARTNER = false; + +var publicChat; + +var firstName = null; +var emailAddress = null; + +var lastSoloPriority = 0; +var lastQuestionAnswered; + +var app = angular.module('app', [ + 'ui.grid', + 'ui.grid.resizeColumns', + 'ui.grid.autoResize', + 'ui.grid.moveColumns', + 'ui.grid.saveState', + 'ngSanitize', + 'ui.bootstrap', + 'firebase']). + directive('contenteditable', ['$sce', function ($sce) { + return { + restrict: 'A', // only activate on element attribute + require: '?ngModel', // get a hold of NgModelController + link: function (scope, element, attrs, ngModel) { + if (!ngModel) return; // do nothing if no ng-model + + // Specify how UI should be updated + ngModel.$render = function () { + element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); + }; + + // Listen for change events to enable binding + element.on('blur keyup change', function () { + scope.$evalAsync(read); + }); + read(); // initialize + + // Write data to the model + function read() { + var html = element.html(); + // When we clear the content editable the browser leaves a
                behind + // If strip-br attribute is provided then we strip this out + if (attrs.stripBr && html == '
                ') { + html = ''; + } + ngModel.$setViewValue(html); + } + } + }; + }]); + +app.controller('MainCtrl', ['$scope', '$firebaseArray', '$firebaseAuth', '$firebaseObject', 'uiGridConstants', function ($scope, $firebaseArray, $firebaseAuth, $firebaseObject, uiGridConstants) { + var vm = this; + var vm2 = this; + var vm3 = this; + + var VictoryDeclarationFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + date: 'Write here', + step1: 'Write here', + step2: 'Write here', + number: '#', + things: 'things here', + emotion: 'Write here', + signature: 'Sign here', + optIn: 'Want Feedback?' + } + }); + + vm.gridOptions = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Number', + field: 'number' + }, + { + displayName: 'Things', + field: 'things' + }, + { + displayName: 'Emotion', + field: 'emotion', + }, + { + displayName: 'Product', + field: 'step1', + }, + { + displayName: 'Customer', + field: 'step2', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm.gridApi = gridApi; + } + }; + + var EarlyAdoptersFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + segment: 'Your customer segment', + problem: "Your customer's problem (in their words)", + behaviors: '1.
                2.
                3.
                4.
                5.
                ', + externalBehaviors: '1.
                2.
                3.
                4.
                5.
                ', + optIn: 'Want Feedback?' + } + }); + + vm2.earlyAdoptersFeedbackGrid = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Behaviors', + field: 'behaviors' + }, + { + displayName: 'Ext. Behaviors', + field: 'externalBehaviors' + }, + { + displayName: 'Segment', + field: 'segment', + }, + { + displayName: 'Problem', + field: 'problem', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm2.gridApi = gridApi; + } + }; + + var OfferDesignFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + channel1: 'Write here', + pcm1: "Write here" + } + }); + + vm3.offerDesignFeedbackGrid = { + columnDefs: [ + { + displayName: 'PCM1', + field: 'pcm1' + }, + { + displayName: 'PCM2', + field: 'pcm2' + }, + { + displayName: 'PCM3', + field: 'pcm3' + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm3.gridApi = gridApi; + } + }; + + + if (isSimpleMode()) { + vm.properties = $firebaseArray(declaringVictoryRef); + vm.properties.$loaded().then(function () { + vm.gridOptions.data = vm.properties; + }); + + vm2.earlyAdopterProperties = $firebaseArray(earlyAdoptersRef); + vm2.earlyAdopterProperties.$loaded().then(function () { + vm2.earlyAdoptersFeedbackGrid.data = vm2.earlyAdopterProperties; + }); + + vm3.offerDesignProperties = $firebaseArray(offerDesignRef); + vm3.offerDesignProperties.$loaded().then(function () { + vm3.offerDesignFeedbackGrid.data = vm3.offerDesignProperties; + }); + + vm.giveFeedback = function (exercise) { + var victoryRef = declaringVictoryRef.child(exercise.$id); + + if (vm.feedbackObj) { + vm.feedbackObj.$destroy(); + } + + vm.feedbackObj = VictoryDeclarationFactory(victoryRef); + vm.feedbackObj.$bindTo($scope, "declaringVictoryFeedback"); + }; + + vm2.giveEarlyAdopterFeedback = function (exercise) { + var eaRef = earlyAdoptersRef.child(exercise.$id); + + if (vm2.feedbackObj) { + vm2.feedbackObj.$destroy(); + } + + vm2.feedbackObj = EarlyAdoptersFactory(eaRef); + vm2.feedbackObj.$bindTo($scope, "earlyAdoptersFeedback"); + }; + + vm3.giveOfferDesignFeedback = function (exercise) { + var odRef = offerDesignRef.child(exercise.$id); + + if (vm3.feedbackObj) { + vm3.feedbackObj.$destroy(); + } + + vm3.feedbackObj = OfferDesignFactory(odRef); + vm3.feedbackObj.$bindTo($scope, "offerDesignFeedback"); + }; + } + + // $scope.giveFeedback = function(exercise) { + // console.log(exercise); + // // $state.transitionTo('club', { clubId: club.id }); + // }; + + // vm.getTableHeight = function () { + // var rowHeight = 33; + // var headerHeight = 33; + // var height = vm.gridOptions.data.length * rowHeight + headerHeight; + // if (height > window.innerHeight) { + // height = window.innerHeight - 250; + // } + // return { + // height: height + "px" + // }; + // }; + + + if (!initParameters()) { + initModal(); + return; + } + + var auth = $firebaseAuth(rootRef); + var dataFromAuth = auth.$getAuth(); + + if (!dataFromAuth) { + auth.$authAnonymously(); + } + + auth.$onAuth(function (authData) { + postAuthConfig(authData, publicChat, PUBLIC_CHAT_ROOM_ID, GET_PARTNER); + + var victoryRef = declaringVictoryRef.child(authData.uid); + var victorySyncObj = VictoryDeclarationFactory(victoryRef); + + victorySyncObj.$bindTo($scope, "declaringVictory"); + + var eaRef = earlyAdoptersRef.child(authData.uid); + var eaSyncObj = EarlyAdoptersFactory(eaRef); + + eaSyncObj.$bindTo($scope, "earlyAdopters"); + + var odRef = offerDesignRef.child(authData.uid); + var odSyncObj = OfferDesignFactory(odRef); + + odSyncObj.$bindTo($scope, "offerDesign"); + }); +}]); + +function connectExercisesToFirebase(userId) { + myPMFAssessmentRef = pmfAssessmentRef.child(userId); + + if (isSimpleMode()) { + $('#refreshPMFChartsButton').show(); + + refreshPMFCharts(); + } +} + +function refreshPMFCharts() { + pmfAssessmentRef.once("value", function (data) { + populateChart(data.val()); + }); +} + +function populateChart(model, chartContainer, title) { + var countMap = {}; + var pathMap = {} + + for (value in model) { + var node = model[value]; + + if (countMap[node.currentPhase]) { + countMap[node.currentPhase].data += 1; + } + else { + countMap[node.currentPhase] = { + name: node.currentPhase, + data: 1 + }; + } + + if (pathMap[node.assessmentPath]) { + pathMap[node.assessmentPath].data += 1; + } + else { + pathMap[node.assessmentPath] = { + name: node.assessmentPath, + data: 1 + }; + } + } + + var phases = []; + var phaseCounts = []; + + for (key in Object.keys(countMap)) { + phases.push(countMap[Object.keys(countMap)[key]].name); + phaseCounts.push(countMap[Object.keys(countMap)[key]].data); + } + + var paths = []; + var pathCounts = []; + + for (key in Object.keys(pathMap)) { + paths.push(pathMap[Object.keys(pathMap)[key]].name); + pathCounts.push(pathMap[Object.keys(pathMap)[key]].data); + } + + $('#pmfPhaseChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Current Phase' }, + xAxis: { + categories: phases + }, + series: [{ + data: phaseCounts + }] + }); + + $('#pmfPathChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Popular Paths' }, + xAxis: { + categories: paths + }, + series: [{ + data: pathCounts + }] + }); +} + +function initParameters() { + firstName = getParameterByName('firstName'); + + return firstName != null; +} + +function getAttendees() { + emailsRef.once('value', function (emailsSnap) { + console.log(emailsSnap.numChildren()); + }); +} + +function getEnrollees() { + enrolledRef.once('value', function (enrolledSnap) { + enrolledSnap.forEach(function (snapshot) { + console.log(snapshot.val().email); + }); + }); +} + +function escapeRegExp(str) { + return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); +} + +function replaceAll(str, find, replace) { + if (str && find && replace) { + return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); + } +} + +function getFeedback() { + feedbackRef.once('value', function (feedbackSnap) { + feedbackSnap.forEach(function (snapshot) { + var feedback = snapshot.val(); + console.log(feedback.nps + ",'" + replaceAll(feedback.favorite, "\r\n", " ") + "','" + replaceAll(feedback.improve, "\r\n", " ") + "'"); + }); + }); +} + +function initUI() { + $('.carousel').carousel({ + interval: 5000 + }); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + $("#newPartner").hide(); + $("#newPartner").click(function () { + leavePartnership(); + }); + + $('.meetYourPartnerMe').on("input", function () { + updateMyInfo($(this)); + }); + + keepTabsOnTabs(); + initEnrollForm(); + setupFeedbackForm(); + //setupInterviewScriptGenerator(); + //setupQuizzes(); + + setupiFrames(); + + if (isWebViewerMode()) { + // load video stream + var youTubeIFrame = $('.youtube-iframe'); + youTubeIFrame.attr("src", youTubeIFrame.attr("data-youtube-src")); + } + else { + // get rid of video holder + $('.left-column .top-row').hide(); + $('.left-column .bottom-row').addClass("full-height").removeClass("bottom-row"); + } + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } +} + +function setupTextEditors() { + + tinymce.init({ + selector: '.text-editor', + menubar: false, + plugins: 'autoresize autosave', + autosave_interval: "2s", + setup: function (ed) { + ed.on('init', function () { + this.getDoc().body.style.fontSize = '16px'; + this.getDoc().body.style.fontName = 'Lato'; + // ed.target.editorCommands.execCommand("fontSize", false, "2"); + // ed.target.editorCommands.execCommand("fontName", false, "Lato"); + }); + } + }); +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function () { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function () { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $('#enrollForm').ajaxChimp({ + url: 'http://CustomerDevLabs.us6.list-manage.com/subscribe/post?u=7de22f15c9e97df7b49df664f&id=583a7a794d', + callback: function (resp) { + $('#enrollSuccessAlert').html(resp.msg); + $('#enrollSuccessAlert').show(); + enrolledRef.child(loggedInUserId).set({ email: $('#enrollEmail').val() }); + } + }); + + $("#enrollForm").submit(function (event) { + event.preventDefault(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function isWebViewerMode() { + // Special case for EarlyStage + return false; + //return !isSimpleMode() && document.URL.indexOf("vip.html") == -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + exercisesRef.child("active").update({ exercise: exerciseName }); + }); + + $(".showTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + }); + + $(".hideTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: false }); + }); + + $(".soloTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each(function (index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({ exercise: tabName.replace("Tab", '') }); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function (exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each(function (index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.uid).once('value', function (snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function (snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "That's not your name", + validators: { + notEmpty: { + message: 'We need your name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We can do names between 2 and 20 characters' + } + } + }, + attendeeEmail: { + message: "Hmm, something doesn't look right.", + validators: { + notEmpty: { + message: 'Please enter your email address' + }, + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#welcomeForm").submit(function (event) { + firstName = $("#attendeeName").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function () { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function postAuthConfig(authData, chatUI, roomId, getPartner) { + console.log("Authenticated successfully with payload: ", authData); + + var user = authData; + + loggedInUserId = user.uid; + user.firstName = firstName; + //chatUI.setUser(user.uid, firstName); + //enterRoomAfterUserSessionCreated(chatUI, roomId); + + connectExercisesToFirebase(loggedInUserId); + + emailsRef.child(loggedInUserId).set({ name: firstName }); + + setupTextEditors(); + + if (getPartner) { + searchForPartner(user); + } + + authUserName = firstName; + fbid = user.uid; + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestion; + + allQuestionsSnapshot.forEach(function (snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
              • "); + var divmediabody = $("
                "); + var divmedia = $("
                "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = + "Top | " + + "Middle | " + + "" + answerText + " | " + + "" + hideText + ""; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 0; + var votesElement = "" + voteLink + ": " + voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
                "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
                " + userNameElement + "
                " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestion = questionElement; + divmediabody2.addClass('bg-warning'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-info'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-primary'); + } + else { + divmediabody2.addClass('this-class-does-not-exist'); + } + + questionList.prepend(questionElement); + } + }); + + questionList.prepend(activeQuestion); + }); +} + +function logInToChat(ref, chatUI, roomId, getPartner) { + var dataFromAuth = ref.getAuth(); + + if (dataFromAuth) { + postAuthConfig(dataFromAuth, chatUI, roomId, getPartner); + return; + } + + ref.authAnonymously(function (error, authData) { + if (error) { + console.log("Login Failed!", error); + return; + } + + postAuthConfig(authData, chatUI, roomId, getPartner); + + }); +} + +// var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { +// if (user) { +// loggedInUserId = user.uid; +// +// user.firstName = firstName; +// chatUI.setUser(user.uid, firstName); +// +// if (roomId != null) { +// setTimeout(function() { +// console.log("About to enter room. User: " + JSON.stringify(user) + ". Room: " + roomId); +// chatUI._chat.enterRoom(roomId); +// }, 500); +// } +// +// if (getPartner) { +// searchForPartner(user); +// } +// +// authUserName = firstName; +// fbid = user.uid; +// +// // simple should see all of the questions, everyone else should only see the unhidden ones +// var startAtNum = isSimpleMode() ? -1000000 : 1; +// +// // Add a callback that is triggered for each chat question. +// questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { +// questionList.empty(); +// +// var activeQuestion; +// +// allQuestionsSnapshot.forEach(function(snapshot) { +// +// //GET DATA +// var questionId = snapshot.key(); +// var data = snapshot.val(); +// var fbid_d = data.fbid; +// var username_d = data.name; +// var question_d = data.text; +// var date_d = data.currentdate; +// var votes_d = data.votes; +// +// divdir = ""; +// +// //CREATE ELEMENTS question & SANITIZE TEXT +// var questionElement = $("
              • "); +// var divmediabody = $("
                "); +// var divmedia = $("
                "); +// +// var voteLink; +// var userAskedQuestion = fbid_d == fbid; +// +// if (isSimpleMode()) { +// var answerText = data.isActive ? "Unanswer" : "Answer"; +// var hideText = data.votes <= 0 ? "Show" : "Hide"; +// +// voteLink = "" + answerText + " " + hideText + ""; +// } +// else if (userAskedQuestion) { +// // This user submitted the question +// voteLink = "Delete"; +// } +// else { +// var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; +// voteLink = "" + voteText + ""; +// } +// +// var voteCount = data.votes ? data.votes : 1; +// var votesElement = "" + voteLink + ": "+ voteCount + ""; +// var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; +// var dateElement = " " + date_d + ""; +// +// var divmediabody2 = $("
                "); +// questionElement.append(divmediabody); +// divmediabody.append(divmedia); +// //divmedia.append(a); +// //divmedia.append(votesElement); +// divmedia.append(divmediabody2); +// +// var usernamediv = $(""); +// divmediabody2.html(question_d); +// +// divmediabody2.append(usernamediv); +// usernamediv.html("
                " + userNameElement + "
                " + votesElement); +// +// //ADD question +// if (data.isActive) { +// activeQuestion = questionElement; +// divmediabody2.addClass('bg-danger'); +// } +// else { +// if (userAskedQuestion) { +// divmediabody2.addClass('bg-success'); +// // divmediabody2.css('background', "#476982"); +// // usernamediv.css('color', "#CCC") +// } +// else if (data.votes > 0) { +// // divmediabody2.css('background', "#73B3D7"); +// divmediabody2.addClass('bg-info'); +// } +// else { +// divmediabody2.addClass('bg-warning'); +// } +// +// questionList.prepend(questionElement); +// } +// }); +// +// questionList.prepend(activeQuestion); +// }); +// +// } else { +// simpleLogin.login('anonymous', { +// rememberMe: true +// }); +// } +// }); +// } + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


                You'll see what your partner types, as she/he does.


                Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


                (Delete this too :)" : ""); + + questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                 
                Note: your partner will be able to see your text as you type it.
                 
                Try editing this text!
                 
                 
                2. Secretly pick a company below to pitch:
                 

                • AirBnB
                • Pampers (diapers)
                • Twitter
                • Facebook
                • Subway (sandwiches)
                • Instagram
                • Disney
                • SnapChat
                • Angry Birds (Rovio)
                • RedBull
                 
                3. Fill out the pitch template for the company you're pitching:
                 
                - Problem:
                 
                 
                 
                - Solution:
                 
                 
                 
                - Market:
                 
                 
                 
                - Business Model:
                 
                 
                 
                -------------------------------------------------------
                 
                4. Guess which company your partner is pitching:
                 
                 
                 
                5. Which elements of your partner's pitch could be improved? 
                 
                 
                " : ""); + responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                 
                Note: your partner will be able to see your text as you type it.
                 
                Try editing this text!
                 
                 
                2. Secretly pick a company below to pitch:
                 
                • AirBnB
                • Pampers (diapers)
                • Twitter
                • Facebook
                • Subway (sandwiches)
                • Instagram
                • Disney
                • SnapChat
                • Angry Birds (Rovio)
                • RedBull
                 
                3. Fill out the pitch template for the company you're pitching:
                 
                - Problem:
                 
                 
                 
                - Solution:
                 
                 
                 
                - Market:
                 
                 
                 
                - Business Model:
                 
                 
                 
                -------------------------------------------------------
                 
                4. Guess which company your partner is pitching:
                 
                 
                 
                5. Which elements of your partner's pitch could be improved? 
                 
                 
                " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(useruser.uid, ""); + + attendeesRef.child(user.uid).update(user); + + leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + $("#partnerName").html("Your partner isn't available. Let's find another for you!"); + + return; + } + else if (part.room != null) { + console.log("Entering our partner chat room: " + part.room); + publicChat._chat.enterRoom(part.room); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.uid).update(user); + } + }); + + soloRef.off('child_changed'); + + // intro partners + $("#partnerName").html("Say hi to your workshop partner, !"); + $('.partnerName').text(user.partnerName); + $("#newPartner").show(); + + getMeetYourPartnerUpdates(user); +} + +function lookingForPartnerUI() { + $("#partnerName").html("Looking for a partner for you..."); + $("#newPartner").hide(); +} + +function joinSoloList(user) { + soloRef.child(user.uid).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.uid; + user.responsesPad = "r-" + user.uid; + + // store my pad addresses + attendeesRef.child(user.uid).update(user); + + //loadFirepads(user, true); + + soloRef.on('child_changed', function (soloSnap) { + var solo = soloSnap.val(); + + if (solo.id != user.uid) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + soloRef.child(user.uid).remove(function (error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function (roomId) { + console.log('Created our partnership chat room'); + partnershipsRef.child(solo.partnership).set({ "room": roomId }); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + }); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function (solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function (soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.id == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.id).transaction(function (currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.uid.localeCompare(solo.id) < 0) { + partnership = user.uid + solo.id; + } + else { + partnership = solo.id + user.uid; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.id; + user.responsesPad = "r-" + solo.id; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function () { confirmPartnershipAccepted(user) }, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.uid, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function (error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + //loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.uid).transaction(function (currentData) { + + // Always return null because we want off this list + return null; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.uid).once('value', function (attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.uid).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + console.log("My user id is: " + user.uid); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership() { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + searchForSolos(user); + } + else { + console.log("This user is requesting to leave partnership."); + lookingForPartnerUI(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function (error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(true); + } + }); + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + leavePrivateChatRooms(); + clearPartnerFromUser(user); + unloadFirepads(); + + attendeesRef.child(user.uid).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +const DEFAULT_QUESTION_VOTES = 1; +const MIDDLE_OF_LIST_VOTES = 50; +const TOP_OF_LIST_VOTES = 100; + +$(document).ready(function () { + initUI(); +}); + +function toggleQuestionVisibility(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function (question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (question.votes == 0) { + question.votes = 1; + } + else { + question.votes = question.votes * -1; + question.isActive = 0; + } + + return question; + }); +} + +function moveQuestionToMiddle(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: MIDDLE_OF_LIST_VOTES }); +} + +function moveQuestionToTop(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: TOP_OF_LIST_VOTES }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + if (lastQuestionAnswered) { + questionsRef.child(lastQuestionAnswered).update({ isActive: false }); + } + + lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false }); + + lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function (confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function (currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null) { + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: DEFAULT_QUESTION_VOTES }); + + $("#question-txt").val(''); + +} diff --git a/entedu.html b/entedu.html new file mode 100644 index 0000000..dbc1386 --- /dev/null +++ b/entedu.html @@ -0,0 +1,2154 @@ + + + + + Experiential Entrepreneurship Education | Justin Wilcox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                +
                +
                Experiential Entrepreneurship Education with Justin Wilcox, Diana Kander & Doan Winkle
                +
                + +
                + +
                +
                +
                +
                + +
                + +
                + +
                +
                + +
                +
                +

                Questions: Ask and up vote.

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

                  Welcome to How to Find Product-Market Fit!

                  You can take notes during the workshop here. +

                  +   +

                  5 Phases of Product-Market Fit

                  +
                    +
                  1. F
                  2. +
                  3. O
                  4. +
                  5. C
                  6. +
                  7. U
                  8. +
                  9. S
                  10. +
                  +

                  +

                  Takeaways

                  +

                  +
                  +
                  +
                  +
                  + +
                  +
                  + + + + +
                  +
                  +
                  + +
                  +
                  +
                  + +
                  + + +
                  +
                  + + + + + + + + + + + +
                  +
                  + +
                  + +
                  + +
                  +
                  + + + + +
                  + +
                  +
                  + + +
                  +
                  +
                  +
                  +
                  +
                  +
                  + + +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  + +
                  + +
                  +
                  Defining Product-Market Fit
                  +
                  + Ready to define Product-Market Fit? +
                  +
                  + +
                  +
                  Declaring Victory Worksheet
                  +
                  + This worksheet will walk you through defining Product-Market Fit. +
                  +
                  + +
                  +
                  Today's Date
                  +
                    +
                  • +
                  +
                  + Start by writing in today's date in the field on the right.

                  +
                  +
                  + + + + + +
                  +
                  What's your Product?
                  +
                  +

                  Write in the product or service that you would like to build.

                  + +
                  +
                    +
                  • +
                  +
                  + +
                  +
                  Who's your Customer?
                  +
                  + Write in the customers or people whom you would like to serve.

                  +
                  +
                    +
                  • +
                  +
                  + +
                  +
                  Fold on the Dotted Line
                  +
                  + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
                  +
                    +
                  +
                  + +
                  +
                  Your Promise
                  +
                  + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                    +
                  1. Even if you never get to build your product and
                  2. +
                  3. Even if you are not able to help the people you want to help...
                  4. +
                  +
                  You are still going to achieve victory.
                  +
                  +
                    +
                  +
                  + + + +
                  +
                  Enter your Victory
                  +
                  +

                  Write in your measurable Victory metric.

                  + +
                  +
                    +
                  • +
                  • +
                  +
                  + +
                  +
                  Find your FOCUS
                  +
                  + Want Feedback?

                  + Type "Yes" if you'd like me to review your Victory.

                  + + Bonus: you'll also be helping others learn. +
                  +
                    + +
                  +
                  + +
                  +
                  What Emotions are you Seeking?
                  +
                  + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

                  + +
                  +
                    +
                  • +
                  +
                  + +
                  +
                  Make it Official
                  +
                  +

                  Congratulations! You have your victory.

                  + + + +
                  +
                    +
                  • +
                  +
                  + +
                  +
                  What are your Co-Founders' Victories?
                  +
                  + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

                  + +
                  +
                  + + + +
                  +
                  Find your FOCUS
                  +
                  +

                  Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

                  Write your Victory Declaration in your Notes tab!
                  + +
                  +
                  + +
                  + +
                  + +
                  +
                  + + + + +
                  +
                  +
                  + +
                  +
                  + + +
                  Your customer segment
                  +
                  Your customer's problem (in their words)
                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  1. +
                  2. +
                  3. +
                  4. +
                  5. +
                  +
                  +
                  1. +
                  2. +
                  3. +
                  4. +
                  5. +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  + + + + +
                  +
                  +
                  + +
                  +
                  + + +
                  + +
                  + 1. +
                  2. +
                  3. +
                  4. +
                  5. +
                  +
                  + +
                  + 1. +
                  2. +
                  3. +
                  4. +
                  5. +
                  +
                  + +
                  + 1. +
                  2. +
                  3. +
                  4. +
                  5. +
                  +
                  + +
                  #
                  +
                  of things
                  + +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  + +
                  +
                  + + + + +
                  +
                  +
                  + +
                  +

                  Product-Market Fit Assessment

                  This exercise will tell you: +
                    +
                  1. What phase of Product-Market Fit you're in
                  2. +
                  3. Your startup's "Riskiest Assumption"
                  4. +
                  5. Your next step to test that assumption
                  6. +
                  +

                  Just answer these questions...

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

                  Have you launched your product?

                  +
                  +
                  +
                    +
                  • No30
                  • +

                    +
                  • Yes2
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  +

                  Are customers paying for it?

                  +
                  +
                  +
                    +
                  • No23
                  • +

                    +
                  • Yes3
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  +

                  Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                  +
                  +
                  +
                    +
                  • No5
                  • +

                    +
                  • Yes4
                  • +

                    +
                  • Not sure20
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  + Congrats! You're on the path to Product-Market + Fit. +
                  +
                  +
                  + Keep doing what you're doing! +
                  +
                  +
                  +
                  +
                  +
                  +

                  Why aren't you on track to acheive Product-Market Fit?

                  +
                  +
                  +
                    +
                  • Not enough customers6
                  • +

                    +
                  • Customer Lifetime Value is too low16
                  • +

                    +
                  +
                  Not sure? Go with your gut. Eventually you'll test both.
                  +
                  +
                  +
                  +
                  +
                  +

                  Why don't you have enough customers?

                  +
                  +
                  +
                    +
                  • Having trouble finding them7
                  • +

                    +
                  • Conversion rate it too low10
                  • +

                    +
                  • Customer segment is too small14
                  • +

                    +
                  • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                  • +

                    +
                  +
                  Not sure? Starting at the top, pick the first answer you think could be the reason.
                  +
                  +
                  +
                  +
                  +
                  +

                  Where are you looking for customers?

                  +
                  +
                  +
                    +
                  • Places I think my customers are.8
                  • +

                    +
                  • Places customers have told me they are.9
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Finding Early Adopters for + your product.
                  +
                  Your Your Next Step: Interview customers to validate + where they look for solutions.
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                  Use this information to make your interviews easier and faster + to get.
                  +
                  +

                  Found in FOCUS Workbook 1...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                  +
                  Your Next Step: Test alternative channels to determine + potential customer segment size.
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

                  You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
                  +
                  +

                  Found in FOCUS Workbook 2...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  What emotions are you evoking in your Call to Action?

                  +
                  +
                  +
                    +
                  • I'm not evoking emotions in my Call to Action11
                  • +

                    +
                  • Emotions I think my customers are experiencing12
                  • +

                    +
                  • Emotions my customers have told me they are experiencing13
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Finding Early Adopters for + your product.
                  +
                  Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

                  Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
                  +
                  +

                  Found in FOCUS Workbook 1...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: You understand + your customer's emotional desires. +
                  +
                  +
                  +
                  Product-Market Fit Phase: .
                  +
                  Your Next Step: Interview your customers to understand + their emotional desires. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                  Use this information to make your interviews easier and faster + to get.
                  +
                  +

                  Found in FOCUS Workbook 1...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                  +
                  Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This exercise will help you identify + the emotions your customers' emotions. + +

                  By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
                  +
                  +

                  Found in FOCUS Workbook 2...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Scaling to Product-Market + Fit. +
                  +
                  Your Next Step: Identify, size and test related customer + segments. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

                  By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
                  +
                  +

                  Found in FOCUS Workbook 5...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                  +
                  Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
                  +
                  +

                  Found in FOCUS Workbook 4...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  Why is your Customer Lifetime Value too low?

                  +
                  +
                  +
                    +
                  • Customer churn is too high (i.e. they cancel your service too soon)17
                  • +

                    +
                  • Price is too low18
                  • +

                    +
                  • Cost of customer acquisition is too high19
                  • +

                    +
                  +
                  Not sure? Starting at the top, pick the first answer you think could be the reason.
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                  +
                  Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                  +
                  +

                  Found in FOCUS Workbook 4...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                  +
                  Your Next Step: Optimize your price via price testing. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
                  +
                  +

                  Found in FOCUS Workbook 3...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
                  +
                  Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
                  +
                  +

                  Found in FOCUS Workbook 2...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  Have you defined a metric that represents when you have acheived Product-Market Fit?

                  +
                  +
                  +
                    +
                  • No21
                  • +

                    +
                  • Yes22
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Finding Early Adopters for + your product.
                  +
                  Your Next Step: Define Product-Market Fit for you + and your team. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

                  This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
                  +
                  +

                  Found in FOCUS Workbook 1...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                  +
                  Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
                  +
                  +

                  Found in FOCUS Workbook 3...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  Are customers using the product?

                  +
                  +
                  +
                    +
                  • No41
                  • +

                    +
                  • Yes24
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  +

                  Why aren't your customers paying to use your product?

                  +
                  +
                  +
                    +
                  • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
                  • +

                    +
                  • Going to monetize after reaching critical mass26
                  • +

                    +
                  • Pursuing a freemium model and haven't built paid features yet25
                  • +

                    +
                  • Tried charging but no one would pay10
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
                  +
                  Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
                  +
                  +

                  Found in FOCUS Workbook 3...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                  +
                  +
                  +
                    +
                  • No28
                  • +

                    +
                  • Yes38
                  • +

                    +
                  • Not sure20
                  • +

                    +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +

                  Why aren't enough customers using for you to achieve Product-Market Fit?

                  +
                  +
                  +
                    +
                  • Having trouble finding them7
                  • +

                    +
                  • Conversion rate it too low10
                  • +

                    +
                  • Customer segment is too small14
                  • +

                    +
                  • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                  • +

                    +
                  +
                  Not sure? Starting at the top, pick the first answer you think could be the reason.
                  +
                  +
                  +
                  +
                  +
                  +

                  Have you defined a metric that represents when you have acheived Product-Market Fit?

                  +
                  +
                  +
                    +
                  • No21
                  • +

                    +
                  • Yes22
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  +

                  Have you generated any pre-sales or signed Letters of Intent?

                  +
                  +
                  +
                    +
                  • No35
                  • +

                    +
                  • Yes31
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  +

                  Are enough customers pre-paying for it that, if you solve their problems, you'll achieve Product-Market Fit?

                  +
                  +
                  +
                    +
                  • No5
                  • +

                    +
                  • Yes32
                  • +

                    +
                  • Not sure20
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  +

                  Why haven't you launched the product yet?

                  +
                  +
                  +
                    +
                  • No development team33
                  • +

                    +
                  • Solution is still under development33
                  • +

                    +
                  • Testing the solution privately before making it available publicly34
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: You can solve + your customers' problems. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                  +
                  Your Next Step: Test a manual solution. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
                  +
                  +

                  Found in FOCUS Workbook 4...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
                  +
                  Your Next Step: Test an automated solution. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
                  +
                  +

                  Found in FOCUS Workbook 5...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  Have you identified a problem at least 60% of your customers are actively trying to solve?

                  +
                  +
                  +
                    +
                  • No40
                  • +

                    +
                  • Yes36
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  +

                  If you solve the problem, will you achieve Product-Market Fit?

                  +
                  +
                  +
                    +
                  • No5
                  • +

                    +
                  • Yes37
                  • +

                    +
                  • Not sure39
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  +

                  Why aren't you collecting pre-orders or Letters of Intent?

                  +
                  +
                  +
                    +
                  • Can't finding customers to pre-sell7
                  • +

                    +
                  • Don't know how38
                  • +

                    +
                  • Tried but no one bought10
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                  +
                  Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
                  +
                  +

                  Found in FOCUS Workbook 3...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  Have you defined a metric that represents when you have acheived Product-Market Fit?

                  +
                  +
                  +
                    +
                  • No21
                  • +

                    +
                  • Yes9
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Finding Early Adopters for + your product.
                  +
                  Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                  Use this information to make your interviews easier and faster + to get.
                  +
                  +

                  Found in FOCUS Workbook 1...

                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  +

                  Why aren't customers using your product?

                  +
                  +
                  +
                    +
                  • I'm not sure how/where to find customers to tell about it8
                  • +

                    +
                  • I've told them about it, but they don't really use it11
                  • +

                    +
                  • Customers use it a little, but then they stop42
                  • +

                    +
                  +
                  +
                  +
                  +
                  +
                  + Your Riskiest Assumption: Your product solves + your customers' problems. +
                  +
                  +
                  +
                  Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                  +
                  Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                  +
                  + This will help... +
                  + +
                  +

                  Recommended FOCUS Exercise...

                  + +
                  +
                  Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                  +
                  +

                  Found in FOCUS Workbook 4...

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

                  FOCUS Framework

                  +
                  +
                  +
                  +

                  + FREE 60-Day Eval of FOCUS Framework
                  +

                  +

                  FOCUS Framework Coupon

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

                  How likely would you be to recommend this workshop to a friend?

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

                  What's one thing we can improve next time?

                  +
                  +
                  + +
                  +
                  + +
                  +
                  +

                  What was your favorite part of the workshop?

                  +
                  +
                  + +
                  + +
                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  + + +
                  + +
                  + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/entedu.js b/entedu.js new file mode 100644 index 0000000..7611266 --- /dev/null +++ b/entedu.js @@ -0,0 +1,1612 @@ +//var app = angular.module('app', ['firebase']); +var firebaseRoot = "https://cdlwebshops.firebaseio.com/entedu"; + +var rootRef = new Firebase(firebaseRoot); +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var emailsRef = new Firebase(firebaseRoot + "/emails"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); +var notesRef = new Firebase(firebaseRoot + "/notes"); +var exerciseValuesRef = new Firebase(firebaseRoot + "/exerciseValues"); + +var declaringVictoryRef = exerciseValuesRef.child("declaringVictory"); +var pmfAssessmentRef = exerciseValuesRef.child("pmfAssessment"); + +var loggedInUserId; +var questionPad, responsePad; +var myPMFAssessmentRef; + +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +const GET_PARTNER = false; + +var publicChat; + +var firstName = null; +var emailAddress = null; + +var lastSoloPriority = 0; +var lastQuestionAnswered; + +var app = angular.module('app', [ + 'ui.grid', + 'ui.grid.resizeColumns', + 'ui.grid.autoResize', + 'ui.grid.moveColumns', + 'ui.grid.saveState', + 'ngSanitize', + 'ui.bootstrap', + 'firebase']). + directive('contenteditable', ['$sce', function ($sce) { + return { + restrict: 'A', // only activate on element attribute + require: '?ngModel', // get a hold of NgModelController + link: function (scope, element, attrs, ngModel) { + if (!ngModel) return; // do nothing if no ng-model + + // Specify how UI should be updated + ngModel.$render = function () { + element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); + }; + + // Listen for change events to enable binding + element.on('blur keyup change', function () { + scope.$evalAsync(read); + }); + read(); // initialize + + // Write data to the model + function read() { + var html = element.html(); + // When we clear the content editable the browser leaves a
                  behind + // If strip-br attribute is provided then we strip this out + if (attrs.stripBr && html == '
                  ') { + html = ''; + } + ngModel.$setViewValue(html); + } + } + }; + }]); + +app.controller('MainCtrl', ['$scope', '$firebaseArray', '$firebaseAuth', '$firebaseObject', 'uiGridConstants', function ($scope, $firebaseArray, $firebaseAuth, $firebaseObject, uiGridConstants) { + var vm = this; + + var VictoryDeclarationFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + date: 'Write here', + step1: 'Write here', + step2: 'Write here', + number: '#', + things: 'things here', + emotion: 'Write here', + signature: 'Sign here', + optIn: 'Want Feedback?' + } + }); + + vm.gridOptions = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Number', + field: 'number' + }, + { + displayName: 'Things', + field: 'things' + }, + { + displayName: 'Emotion', + field: 'emotion', + }, + { + displayName: 'Product', + field: 'step1', + }, + { + displayName: 'Customer', + field: 'step2', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm.gridApi = gridApi; + } + }; + + if (isSimpleMode()) { + vm.properties = $firebaseArray(declaringVictoryRef); + vm.properties.$loaded().then(function () { + vm.gridOptions.data = vm.properties; + }); + + vm.giveFeedback = function (exercise) { + var victoryRef = declaringVictoryRef.child(exercise.$id); + + if (vm.feedbackObj) { + vm.feedbackObj.$destroy(); + } + + vm.feedbackObj = VictoryDeclarationFactory(victoryRef); + vm.feedbackObj.$bindTo($scope, "declaringVictoryFeedback"); + }; + } + + // $scope.giveFeedback = function(exercise) { + // console.log(exercise); + // // $state.transitionTo('club', { clubId: club.id }); + // }; + + // vm.getTableHeight = function () { + // var rowHeight = 33; + // var headerHeight = 33; + // var height = vm.gridOptions.data.length * rowHeight + headerHeight; + // if (height > window.innerHeight) { + // height = window.innerHeight - 250; + // } + // return { + // height: height + "px" + // }; + // }; + + + if (!initParameters()) { + initModal(); + return; + } + + var auth = $firebaseAuth(rootRef); + var dataFromAuth = auth.$getAuth(); + + if (!dataFromAuth) { + auth.$authAnonymously(); + } + + auth.$onAuth(function (authData) { + postAuthConfig(authData, publicChat, PUBLIC_CHAT_ROOM_ID, GET_PARTNER); + + // var VictoryDeclarationGridFactory = $firebaseArray.$extend({ + // // each time an update arrives from the server, apply the change locally + // columnDefs: [ + // { field: 'date', displayName: 'Id' }, + // { field: 'step1', displayName: 'Club Id', visible: false }, + // { field: 'step2', displayName: 'Club Name' }, + // { name: 'select', displayName: 'Select', cellTemplate: ' ' } + // ] + // }); + + var victoryRef = declaringVictoryRef.child(authData.uid); + var victorySyncObj = VictoryDeclarationFactory(victoryRef); + + victorySyncObj.$bindTo($scope, "declaringVictory"); + + // $scope.victoryDeclarations = { + // data: '$firebaseArray(declaringVictoryRef)', + // columnDefs: [ + // {field: 'date', displayName: 'Id'}, + // {field: 'step1', displayName: 'Club Id', visible: false}, + // {field: 'step2', displayName: 'Club Name'}, + // {name: 'select', displayName: 'Select', cellTemplate: ' '} + // ] + // }; + + // $scope.victoryDeclarations = { + // columnDefs: [ + // {field: 'date', displayName: 'Id'}, + // {field: 'step1', displayName: 'Club Id', visible: false}, + // {field: 'step2', displayName: 'Club Name'}, + // {name: 'select', displayName: 'Select', cellTemplate: ' '} + // ] + // }; + + // var vm = this; + + + // vm.gridOptions = { + // columnDefs: [ + // { + // displayName: 'PROS Number', + // field: 'date' + // }, + // { + // displayName: 'MLS Status', + // field: 'step1' + // }, + // { + // displayName: 'Deal Status', + // field: 'step2', + // enableColumnMenu: false, + // enableSorting: false + // } + // ], + // //enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + // flatEntityAccess: true, + // //rowHeight: '33', + // enableGridMenu: true, + // enableFiltering: true, + // onRegisterApi: function (gridApi) { + // vm.gridApi = gridApi; + // } + // }; + + + // //var dataRef = new Firebase('https://itjustwerks.firebaseio.com/data/properties'); // jshint ignore:line + // vm.properties = $firebaseArray(declaringVictoryRef); + // vm.properties.$loaded().then(function() { + // vm.gridOptions.data = vm.properties; + // }); + + + + // $scope.victoryDeclarations = { + // columnDefs: [ + // { field: 'date', displayName: 'Id' }, + // { field: 'step1', displayName: 'Club Id', visible: false }, + // { field: 'step2', displayName: 'Club Name' }, + // { name: 'select', displayName: 'Select', cellTemplate: ' ' } + // ] + // }; + + // var hope = $firebaseArray(declaringVictoryRef); + + // hope.$loaded().then(function () { + // $scope.victoryDeclarations.data = hope; + // }); + + // hope.columnDefs = [ + // {field: 'date', displayName: 'Id'}, + // {field: 'step1', displayName: 'Club Id', visible: false}, + // {field: 'step2', displayName: 'Club Name'}, + // {name: 'select', displayName: 'Select', cellTemplate: ' '} + // ]; + + //$scope.victoryDeclarations = hope; + }); +}]); + +function connectExercisesToFirebase(userId) { + myPMFAssessmentRef = pmfAssessmentRef.child(userId); + + if (isSimpleMode()) { + $('#refreshPMFChartsButton').show(); + + refreshPMFCharts(); + } +} + +function refreshPMFCharts() { + pmfAssessmentRef.once("value", function (data) { + populateChart(data.val()); + }); +} + +function populateChart(model, chartContainer, title) { + var countMap = {}; + var pathMap = {} + + for (value in model) { + var node = model[value]; + + if (countMap[node.currentPhase]) { + countMap[node.currentPhase].data += 1; + } + else { + countMap[node.currentPhase] = { + name: node.currentPhase, + data: 1 + }; + } + + if (pathMap[node.assessmentPath]) { + pathMap[node.assessmentPath].data += 1; + } + else { + pathMap[node.assessmentPath] = { + name: node.assessmentPath, + data: 1 + }; + } + } + + var phases = []; + var phaseCounts = []; + + for (key in Object.keys(countMap)) { + phases.push(countMap[Object.keys(countMap)[key]].name); + phaseCounts.push(countMap[Object.keys(countMap)[key]].data); + } + + var paths = []; + var pathCounts = []; + + for (key in Object.keys(pathMap)) { + paths.push(pathMap[Object.keys(pathMap)[key]].name); + pathCounts.push(pathMap[Object.keys(pathMap)[key]].data); + } + + $('#pmfPhaseChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Current Phase' }, + xAxis: { + categories: phases + }, + series: [{ + data: phaseCounts + }] + }); + + $('#pmfPathChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Popular Paths' }, + xAxis: { + categories: paths + }, + series: [{ + data: pathCounts + }] + }); +} + +function initParameters() { + firstName = getParameterByName('firstName'); + + return firstName != null; +} + +function getAttendees() { + emailsRef.once('value', function (emailsSnap) { + console.log(emailsSnap.numChildren()); + }); +} + +function getEnrollees() { + enrolledRef.once('value', function (enrolledSnap) { + enrolledSnap.forEach(function (snapshot) { + console.log(snapshot.val().email); + }); + }); +} + +function escapeRegExp(str) { + return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); +} + +function replaceAll(str, find, replace) { + if (str && find && replace) { + return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); + } +} + +function getFeedback() { + feedbackRef.once('value', function (feedbackSnap) { + feedbackSnap.forEach(function (snapshot) { + var feedback = snapshot.val(); + console.log(feedback.nps + ",'" + replaceAll(feedback.favorite, "\r\n", " ") + "','" + replaceAll(feedback.improve, "\r\n", " ") + "'"); + }); + }); +} + +function initUI() { + $('.carousel').carousel({ + interval: 5000 + }); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + $("#newPartner").hide(); + $("#newPartner").click(function () { + leavePartnership(); + }); + + $('.meetYourPartnerMe').on("input", function () { + updateMyInfo($(this)); + }); + + keepTabsOnTabs(); + initEnrollForm(); + setupFeedbackForm(); + //setupInterviewScriptGenerator(); + //setupQuizzes(); + + setupiFrames(); + + if (isWebViewerMode()) { + // load video stream + var youTubeIFrame = $('.youtube-iframe'); + youTubeIFrame.attr("src", youTubeIFrame.attr("data-youtube-src")); + } + else { + // get ride of video holder + $('.left-column .top-row').hide(); + $('.left-column .bottom-row').addClass("full-height").removeClass("bottom-row"); + } + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } +} + +function setupTextEditors() { + + tinymce.init({ + selector: '.text-editor', + menubar: false, + plugins: 'autoresize autosave', + autosave_interval: "2s", + setup: function (ed) { + ed.on('init', function () { + this.getDoc().body.style.fontSize = '16px'; + this.getDoc().body.style.fontName = 'Lato'; + // ed.target.editorCommands.execCommand("fontSize", false, "2"); + // ed.target.editorCommands.execCommand("fontName", false, "Lato"); + }); + } + }); +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function () { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function () { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $('#enrollForm').ajaxChimp({ + url: 'http://CustomerDevLabs.us6.list-manage.com/subscribe/post?u=7de22f15c9e97df7b49df664f&id=583a7a794d', + callback: function (resp) { + $('#enrollSuccessAlert').show(); + enrolledRef.child(loggedInUserId).set({ email: $('#enrollEmail').val() }); + } + }); + + // $("#enrollForm").submit(function (event) { + // event.preventDefault(); + // enrolledRef.child(loggedInUserId).set({ email: $('#enrollEmail').val() }); + // $('#enrollSuccessAlert').show(); + // }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function isWebViewerMode() { + return !isSimpleMode() && document.URL.indexOf("vip.html") == -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + exercisesRef.child("active").update({ exercise: exerciseName }); + }); + + $(".showTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + }); + + $(".hideTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: false }); + }); + + $(".soloTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each(function (index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({ exercise: tabName.replace("Tab", '') }); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function (exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each(function (index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.uid).once('value', function (snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function (snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "That's not your name", + validators: { + notEmpty: { + message: 'We need your name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We can do names between 2 and 20 characters' + } + } + }, + attendeeEmail: { + message: "Hmm, something doesn't look right.", + validators: { + notEmpty: { + message: 'Please enter your email address' + }, + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#welcomeForm").submit(function (event) { + firstName = $("#attendeeName").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function () { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function postAuthConfig(authData, chatUI, roomId, getPartner) { + console.log("Authenticated successfully with payload: ", authData); + + var user = authData; + + loggedInUserId = user.uid; + user.firstName = firstName; + //chatUI.setUser(user.uid, firstName); + //enterRoomAfterUserSessionCreated(chatUI, roomId); + + connectExercisesToFirebase(loggedInUserId); + + emailsRef.child(loggedInUserId).set({ name: firstName }); + + setupTextEditors(); + + if (getPartner) { + searchForPartner(user); + } + + authUserName = firstName; + fbid = user.uid; + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestion; + + allQuestionsSnapshot.forEach(function (snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
                • "); + var divmediabody = $("
                  "); + var divmedia = $("
                  "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = + "Top | " + + "Middle | " + + "" + answerText + " | " + + "" + hideText + ""; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 0; + var votesElement = "" + voteLink + ": " + voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
                  "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
                  " + userNameElement + "
                  " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestion = questionElement; + divmediabody2.addClass('bg-warning'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-info'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-primary'); + } + else { + divmediabody2.addClass('this-class-does-not-exist'); + } + + questionList.prepend(questionElement); + } + }); + + questionList.prepend(activeQuestion); + }); +} + +function logInToChat(ref, chatUI, roomId, getPartner) { + var dataFromAuth = ref.getAuth(); + + if (dataFromAuth) { + postAuthConfig(dataFromAuth, chatUI, roomId, getPartner); + return; + } + + ref.authAnonymously(function (error, authData) { + if (error) { + console.log("Login Failed!", error); + return; + } + + postAuthConfig(authData, chatUI, roomId, getPartner); + + }); +} + +// var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { +// if (user) { +// loggedInUserId = user.uid; +// +// user.firstName = firstName; +// chatUI.setUser(user.uid, firstName); +// +// if (roomId != null) { +// setTimeout(function() { +// console.log("About to enter room. User: " + JSON.stringify(user) + ". Room: " + roomId); +// chatUI._chat.enterRoom(roomId); +// }, 500); +// } +// +// if (getPartner) { +// searchForPartner(user); +// } +// +// authUserName = firstName; +// fbid = user.uid; +// +// // simple should see all of the questions, everyone else should only see the unhidden ones +// var startAtNum = isSimpleMode() ? -1000000 : 1; +// +// // Add a callback that is triggered for each chat question. +// questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { +// questionList.empty(); +// +// var activeQuestion; +// +// allQuestionsSnapshot.forEach(function(snapshot) { +// +// //GET DATA +// var questionId = snapshot.key(); +// var data = snapshot.val(); +// var fbid_d = data.fbid; +// var username_d = data.name; +// var question_d = data.text; +// var date_d = data.currentdate; +// var votes_d = data.votes; +// +// divdir = ""; +// +// //CREATE ELEMENTS question & SANITIZE TEXT +// var questionElement = $("
                • "); +// var divmediabody = $("
                  "); +// var divmedia = $("
                  "); +// +// var voteLink; +// var userAskedQuestion = fbid_d == fbid; +// +// if (isSimpleMode()) { +// var answerText = data.isActive ? "Unanswer" : "Answer"; +// var hideText = data.votes <= 0 ? "Show" : "Hide"; +// +// voteLink = "" + answerText + " " + hideText + ""; +// } +// else if (userAskedQuestion) { +// // This user submitted the question +// voteLink = "Delete"; +// } +// else { +// var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; +// voteLink = "" + voteText + ""; +// } +// +// var voteCount = data.votes ? data.votes : 1; +// var votesElement = "" + voteLink + ": "+ voteCount + ""; +// var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; +// var dateElement = " " + date_d + ""; +// +// var divmediabody2 = $("
                  "); +// questionElement.append(divmediabody); +// divmediabody.append(divmedia); +// //divmedia.append(a); +// //divmedia.append(votesElement); +// divmedia.append(divmediabody2); +// +// var usernamediv = $(""); +// divmediabody2.html(question_d); +// +// divmediabody2.append(usernamediv); +// usernamediv.html("
                  " + userNameElement + "
                  " + votesElement); +// +// //ADD question +// if (data.isActive) { +// activeQuestion = questionElement; +// divmediabody2.addClass('bg-danger'); +// } +// else { +// if (userAskedQuestion) { +// divmediabody2.addClass('bg-success'); +// // divmediabody2.css('background', "#476982"); +// // usernamediv.css('color', "#CCC") +// } +// else if (data.votes > 0) { +// // divmediabody2.css('background', "#73B3D7"); +// divmediabody2.addClass('bg-info'); +// } +// else { +// divmediabody2.addClass('bg-warning'); +// } +// +// questionList.prepend(questionElement); +// } +// }); +// +// questionList.prepend(activeQuestion); +// }); +// +// } else { +// simpleLogin.login('anonymous', { +// rememberMe: true +// }); +// } +// }); +// } + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


                  You'll see what your partner types, as she/he does.


                  Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


                  (Delete this too :)" : ""); + + questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                   
                  Note: your partner will be able to see your text as you type it.
                   
                  Try editing this text!
                   
                   
                  2. Secretly pick a company below to pitch:
                   

                  • AirBnB
                  • Pampers (diapers)
                  • Twitter
                  • Facebook
                  • Subway (sandwiches)
                  • Instagram
                  • Disney
                  • SnapChat
                  • Angry Birds (Rovio)
                  • RedBull
                   
                  3. Fill out the pitch template for the company you're pitching:
                   
                  - Problem:
                   
                   
                   
                  - Solution:
                   
                   
                   
                  - Market:
                   
                   
                   
                  - Business Model:
                   
                   
                   
                  -------------------------------------------------------
                   
                  4. Guess which company your partner is pitching:
                   
                   
                   
                  5. Which elements of your partner's pitch could be improved? 
                   
                   
                  " : ""); + responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                   
                  Note: your partner will be able to see your text as you type it.
                   
                  Try editing this text!
                   
                   
                  2. Secretly pick a company below to pitch:
                   
                  • AirBnB
                  • Pampers (diapers)
                  • Twitter
                  • Facebook
                  • Subway (sandwiches)
                  • Instagram
                  • Disney
                  • SnapChat
                  • Angry Birds (Rovio)
                  • RedBull
                   
                  3. Fill out the pitch template for the company you're pitching:
                   
                  - Problem:
                   
                   
                   
                  - Solution:
                   
                   
                   
                  - Market:
                   
                   
                   
                  - Business Model:
                   
                   
                   
                  -------------------------------------------------------
                   
                  4. Guess which company your partner is pitching:
                   
                   
                   
                  5. Which elements of your partner's pitch could be improved? 
                   
                   
                  " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(useruser.uid, ""); + + attendeesRef.child(user.uid).update(user); + + leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + $("#partnerName").html("Your partner isn't available. Let's find another for you!"); + + return; + } + else if (part.room != null) { + console.log("Entering our partner chat room: " + part.room); + publicChat._chat.enterRoom(part.room); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.uid).update(user); + } + }); + + soloRef.off('child_changed'); + + // intro partners + $("#partnerName").html("Say hi to your workshop partner, !"); + $('.partnerName').text(user.partnerName); + $("#newPartner").show(); + + getMeetYourPartnerUpdates(user); +} + +function lookingForPartnerUI() { + $("#partnerName").html("Looking for a partner for you..."); + $("#newPartner").hide(); +} + +function joinSoloList(user) { + soloRef.child(user.uid).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.uid; + user.responsesPad = "r-" + user.uid; + + // store my pad addresses + attendeesRef.child(user.uid).update(user); + + //loadFirepads(user, true); + + soloRef.on('child_changed', function (soloSnap) { + var solo = soloSnap.val(); + + if (solo.id != user.uid) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + soloRef.child(user.uid).remove(function (error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function (roomId) { + console.log('Created our partnership chat room'); + partnershipsRef.child(solo.partnership).set({ "room": roomId }); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + }); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function (solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function (soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.id == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.id).transaction(function (currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.uid.localeCompare(solo.id) < 0) { + partnership = user.uid + solo.id; + } + else { + partnership = solo.id + user.uid; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.id; + user.responsesPad = "r-" + solo.id; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function () { confirmPartnershipAccepted(user) }, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.uid, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function (error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + //loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.uid).transaction(function (currentData) { + + // Always return null because we want off this list + return null; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.uid).once('value', function (attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.uid).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + console.log("My user id is: " + user.uid); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership() { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + searchForSolos(user); + } + else { + console.log("This user is requesting to leave partnership."); + lookingForPartnerUI(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function (error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(true); + } + }); + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + leavePrivateChatRooms(); + clearPartnerFromUser(user); + unloadFirepads(); + + attendeesRef.child(user.uid).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +const DEFAULT_QUESTION_VOTES = 0; +const MIDDLE_OF_LIST_VOTES = 50; +const TOP_OF_LIST_VOTES = 100; + +$(document).ready(function () { + initUI(); +}); + +function toggleQuestionVisibility(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function (question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (question.votes == 0) { + question.votes = 1; + } + else { + question.votes = question.votes * -1; + question.isActive = 0; + } + + return question; + }); +} + +function moveQuestionToMiddle(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: MIDDLE_OF_LIST_VOTES }); +} + +function moveQuestionToTop(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: TOP_OF_LIST_VOTES }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + if (lastQuestionAnswered) { + questionsRef.child(lastQuestionAnswered).update({ isActive: false }); + } + + lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false }); + + lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function (confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function (currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null) { + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: DEFAULT_QUESTION_VOTES }); + + $("#question-txt").val(''); + +} diff --git a/entedu_not_working.html b/entedu_not_working.html new file mode 100644 index 0000000..e9c5887 --- /dev/null +++ b/entedu_not_working.html @@ -0,0 +1,2150 @@ + + + + + Experiential Entrepreneurship Education | Justin Wilcox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +
                  +
                  5 Experiments to Product-Market Fit with Justin Wilcox
                  +
                  + +
                  + +
                  +
                  +
                  +
                  + +
                  + +
                  + +
                  +
                  + +
                  +
                  +

                  Questions: Ask and up vote.

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

                    Welcome to How to Find Product-Market Fit!

                    You can take notes during the workshop here. +

                    +   +

                    5 Phases of Product-Market Fit

                    +
                      +
                    1. F
                    2. +
                    3. O
                    4. +
                    5. C
                    6. +
                    7. U
                    8. +
                    9. S
                    10. +
                    +

                    +

                    Takeaways

                    +

                    +
                    +
                    +
                    +
                    + +
                    +
                    + + + + +
                    +
                    + +
                    +
                    +
                    + +
                    + + +
                    +
                    + + + + + + + + + + + +
                    +
                    + +
                    + +
                    + +
                    +
                    + + + + +
                    + +
                    +
                    + + +
                    +
                    +
                    +
                    +
                    +
                    +
                    + + +
                    +
                    + +
                    +
                    +
                    +
                    +
                    + +
                    +
                    +
                    + +
                    + +
                    +
                    Defining Product-Market Fit
                    +
                    + Ready to define Product-Market Fit? +
                    +
                    + +
                    +
                    Declaring Victory Worksheet
                    +
                    + This worksheet will walk you through defining Product-Market Fit. +
                    +
                    + +
                    +
                    Today's Date
                    +
                      +
                    • +
                    +
                    + Start by writing in today's date in the field on the right.

                    +
                    +
                    + + + + + +
                    +
                    What's your Product?
                    +
                    +

                    Write in the product or service that you would like to build.

                    + +
                    +
                      +
                    • +
                    +
                    + +
                    +
                    Who's your Customer?
                    +
                    + Write in the customers or people whom you would like to serve.

                    +
                    +
                      +
                    • +
                    +
                    + +
                    +
                    Fold on the Dotted Line
                    +
                    + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
                    +
                      +
                    +
                    + +
                    +
                    Your Promise
                    +
                    + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                      +
                    1. Even if you never get to build your product and
                    2. +
                    3. Even if you are not able to help the people you want to help...
                    4. +
                    +
                    You are still going to achieve victory.
                    +
                    +
                      +
                    +
                    + + + +
                    +
                    Enter your Victory
                    +
                    +

                    Write in your measurable Victory metric.

                    + +
                    +
                      +
                    • +
                    • +
                    +
                    + +
                    +
                    Find your FOCUS
                    +
                    + Want Feedback?

                    + Type "Yes" if you'd like me to review your Victory.

                    + + Bonus: you'll also be helping others learn. +
                    +
                      + +
                    +
                    + +
                    +
                    What Emotions are you Seeking?
                    +
                    + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

                    + +
                    +
                      +
                    • +
                    +
                    + +
                    +
                    Make it Official
                    +
                    +

                    Congratulations! You have your victory.

                    + + + +
                    +
                      +
                    • +
                    +
                    + +
                    +
                    What are your Co-Founders' Victories?
                    +
                    + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

                    + +
                    +
                    + + + +
                    +
                    Find your FOCUS
                    +
                    +

                    Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

                    Write your Victory Declaration in your Notes tab!
                    + +
                    +
                    + +
                    + +
                    + +
                    +
                    + + + + +
                    +
                    +
                    + +
                    +
                    + + +
                    Your customer segment
                    +
                    Your customer's problem (in their words)
                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + +
                    1. +
                    2. +
                    3. +
                    4. +
                    5. +
                    +
                    +
                    1. +
                    2. +
                    3. +
                    4. +
                    5. +
                    +
                    +
                    +
                    +
                    +
                    +
                    + +
                    +
                    + + + + +
                    +
                    +
                    + +
                    +
                    + + +
                    + +
                    + 1. +
                    2. +
                    3. +
                    4. +
                    5. +
                    +
                    + +
                    + 1. +
                    2. +
                    3. +
                    4. +
                    5. +
                    +
                    + +
                    + 1. +
                    2. +
                    3. +
                    4. +
                    5. +
                    +
                    + +
                    #
                    +
                    of things
                    + +
                    +
                    +
                    +
                    +
                    +
                    + +
                    +
                    +
                    +
                    +
                    + +
                    +
                    + + + + +
                    +
                    +
                    + +
                    +

                    Product-Market Fit Assessment

                    This exercise will tell you: +
                      +
                    1. What phase of Product-Market Fit you're in
                    2. +
                    3. Your startup's "Riskiest Assumption"
                    4. +
                    5. Your next step to test that assumption
                    6. +
                    +

                    Just answer these questions...

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

                    Have you launched your product?

                    +
                    +
                    +
                      +
                    • No30
                    • +

                      +
                    • Yes2
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    +

                    Are customers paying for it?

                    +
                    +
                    +
                      +
                    • No23
                    • +

                      +
                    • Yes3
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    +

                    Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                    +
                    +
                    +
                      +
                    • No5
                    • +

                      +
                    • Yes4
                    • +

                      +
                    • Not sure20
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    + Congrats! You're on the path to Product-Market + Fit. +
                    +
                    +
                    + Keep doing what you're doing! +
                    +
                    +
                    +
                    +
                    +
                    +

                    Why aren't you on track to acheive Product-Market Fit?

                    +
                    +
                    +
                      +
                    • Not enough customers6
                    • +

                      +
                    • Customer Lifetime Value is too low16
                    • +

                      +
                    +
                    Not sure? Go with your gut. Eventually you'll test both.
                    +
                    +
                    +
                    +
                    +
                    +

                    Why don't you have enough customers?

                    +
                    +
                    +
                      +
                    • Having trouble finding them7
                    • +

                      +
                    • Conversion rate it too low10
                    • +

                      +
                    • Customer segment is too small14
                    • +

                      +
                    • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                    • +

                      +
                    +
                    Not sure? Starting at the top, pick the first answer you think could be the reason.
                    +
                    +
                    +
                    +
                    +
                    +

                    Where are you looking for customers?

                    +
                    +
                    +
                      +
                    • Places I think my customers are.8
                    • +

                      +
                    • Places customers have told me they are.9
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Finding Early Adopters for + your product.
                    +
                    Your Your Next Step: Interview customers to validate + where they look for solutions.
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                    Use this information to make your interviews easier and faster + to get.
                    +
                    +

                    Found in FOCUS Workbook 1...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                    +
                    Your Next Step: Test alternative channels to determine + potential customer segment size.
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

                    You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
                    +
                    +

                    Found in FOCUS Workbook 2...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +

                    What emotions are you evoking in your Call to Action?

                    +
                    +
                    +
                      +
                    • I'm not evoking emotions in my Call to Action11
                    • +

                      +
                    • Emotions I think my customers are experiencing12
                    • +

                      +
                    • Emotions my customers have told me they are experiencing13
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Finding Early Adopters for + your product.
                    +
                    Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

                    Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
                    +
                    +

                    Found in FOCUS Workbook 1...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: You understand + your customer's emotional desires. +
                    +
                    +
                    +
                    Product-Market Fit Phase: .
                    +
                    Your Next Step: Interview your customers to understand + their emotional desires. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                    Use this information to make your interviews easier and faster + to get.
                    +
                    +

                    Found in FOCUS Workbook 1...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                    +
                    Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This exercise will help you identify + the emotions your customers' emotions. + +

                    By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
                    +
                    +

                    Found in FOCUS Workbook 2...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Scaling to Product-Market + Fit. +
                    +
                    Your Next Step: Identify, size and test related customer + segments. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

                    By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
                    +
                    +

                    Found in FOCUS Workbook 5...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                    +
                    Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
                    +
                    +

                    Found in FOCUS Workbook 4...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +

                    Why is your Customer Lifetime Value too low?

                    +
                    +
                    +
                      +
                    • Customer churn is too high (i.e. they cancel your service too soon)17
                    • +

                      +
                    • Price is too low18
                    • +

                      +
                    • Cost of customer acquisition is too high19
                    • +

                      +
                    +
                    Not sure? Starting at the top, pick the first answer you think could be the reason.
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                    +
                    Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                    +
                    +

                    Found in FOCUS Workbook 4...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                    +
                    Your Next Step: Optimize your price via price testing. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
                    +
                    +

                    Found in FOCUS Workbook 3...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
                    +
                    Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
                    +
                    +

                    Found in FOCUS Workbook 2...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +

                    Have you defined a metric that represents when you have acheived Product-Market Fit?

                    +
                    +
                    +
                      +
                    • No21
                    • +

                      +
                    • Yes22
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Finding Early Adopters for + your product.
                    +
                    Your Next Step: Define Product-Market Fit for you + and your team. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

                    This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
                    +
                    +

                    Found in FOCUS Workbook 1...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                    +
                    Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
                    +
                    +

                    Found in FOCUS Workbook 3...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +

                    Are customers using the product?

                    +
                    +
                    +
                      +
                    • No41
                    • +

                      +
                    • Yes24
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    +

                    Why aren't your customers paying to use your product?

                    +
                    +
                    +
                      +
                    • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
                    • +

                      +
                    • Going to monetize after reaching critical mass26
                    • +

                      +
                    • Pursuing a freemium model and haven't built paid features yet25
                    • +

                      +
                    • Tried charging but no one would pay10
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
                    +
                    Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
                    +
                    +

                    Found in FOCUS Workbook 3...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +

                    Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                    +
                    +
                    +
                      +
                    • No28
                    • +

                      +
                    • Yes38
                    • +

                      +
                    • Not sure20
                    • +

                      +
                    +
                    +
                    +
                    + +
                    +
                    +
                    +

                    Why aren't enough customers using for you to achieve Product-Market Fit?

                    +
                    +
                    +
                      +
                    • Having trouble finding them7
                    • +

                      +
                    • Conversion rate it too low10
                    • +

                      +
                    • Customer segment is too small14
                    • +

                      +
                    • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                    • +

                      +
                    +
                    Not sure? Starting at the top, pick the first answer you think could be the reason.
                    +
                    +
                    +
                    +
                    +
                    +

                    Have you defined a metric that represents when you have acheived Product-Market Fit?

                    +
                    +
                    +
                      +
                    • No21
                    • +

                      +
                    • Yes22
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    +

                    Have you generated any pre-sales or signed Letters of Intent?

                    +
                    +
                    +
                      +
                    • No35
                    • +

                      +
                    • Yes31
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    +

                    Are enough customers pre-paying for it that, if you solve their problems, you'll achieve Product-Market Fit?

                    +
                    +
                    +
                      +
                    • No5
                    • +

                      +
                    • Yes32
                    • +

                      +
                    • Not sure20
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    +

                    Why haven't you launched the product yet?

                    +
                    +
                    +
                      +
                    • No development team33
                    • +

                      +
                    • Solution is still under development33
                    • +

                      +
                    • Testing the solution privately before making it available publicly34
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: You can solve + your customers' problems. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                    +
                    Your Next Step: Test a manual solution. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
                    +
                    +

                    Found in FOCUS Workbook 4...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
                    +
                    Your Next Step: Test an automated solution. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
                    +
                    +

                    Found in FOCUS Workbook 5...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +

                    Have you identified a problem at least 60% of your customers are actively trying to solve?

                    +
                    +
                    +
                      +
                    • No40
                    • +

                      +
                    • Yes36
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    +

                    If you solve the problem, will you achieve Product-Market Fit?

                    +
                    +
                    +
                      +
                    • No5
                    • +

                      +
                    • Yes37
                    • +

                      +
                    • Not sure39
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    +

                    Why aren't you collecting pre-orders or Letters of Intent?

                    +
                    +
                    +
                      +
                    • Can't finding customers to pre-sell7
                    • +

                      +
                    • Don't know how38
                    • +

                      +
                    • Tried but no one bought10
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                    +
                    Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
                    +
                    +

                    Found in FOCUS Workbook 3...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +

                    Have you defined a metric that represents when you have acheived Product-Market Fit?

                    +
                    +
                    +
                      +
                    • No21
                    • +

                      +
                    • Yes9
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Finding Early Adopters for + your product.
                    +
                    Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                    Use this information to make your interviews easier and faster + to get.
                    +
                    +

                    Found in FOCUS Workbook 1...

                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    +

                    Why aren't customers using your product?

                    +
                    +
                    +
                      +
                    • I'm not sure how/where to find customers to tell about it8
                    • +

                      +
                    • I've told them about it, but they don't really use it11
                    • +

                      +
                    • Customers use it a little, but then they stop42
                    • +

                      +
                    +
                    +
                    +
                    +
                    +
                    + Your Riskiest Assumption: Your product solves + your customers' problems. +
                    +
                    +
                    +
                    Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                    +
                    Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                    +
                    + This will help... +
                    + +
                    +

                    Recommended FOCUS Exercise...

                    + +
                    +
                    Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                    +
                    +

                    Found in FOCUS Workbook 4...

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

                    FOCUS Framework

                    +
                    +
                    +
                    +

                    + FREE 60-Day Eval of FOCUS Framework
                    +

                    +

                    FOCUS Framework Coupon

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

                    How likely would you be to recommend this workshop to a friend?

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

                    What's one thing we can improve next time?

                    +
                    +
                    + +
                    +
                    + +
                    +
                    +

                    What was your favorite part of the workshop?

                    +
                    +
                    + +
                    + +
                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    + + +
                    + +
                    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fail.html b/fail.html new file mode 100644 index 0000000..8ef81a9 --- /dev/null +++ b/fail.html @@ -0,0 +1,895 @@ + + + + + Bad Ass Customer Interviews...Live! | Customer Development Labs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                    + + + +
                    +
                    +

                    Welcome to...

                    +
                    +

                    Interviewing your Customers

                    +

                    ...the Right Way

                    +
                    +

                    By Customer Development Labs

                    +
                    +
                    +
                    + +
                    +
                    +

                    Live Stream

                    + +
                    +
                    +

                    Questions

                    +
                    +
                    +
                      +
                      + +
                      +
                      +
                      +
                      +
                      +

                      Looking for a partner for you...

                      + +
                      +
                      + +
                      + +
                      +
                      +
                      +

                      Excercises

                      +
                      + +
                      +
                      +

                      Meet your Partner

                      +
                      +
                      +
                      +

                      Where do you live?

                      +

                      What's your company name?

                      +

                      Do you have a company website?

                      +

                      Who are your target customers?

                      +

                      What problem will you solve for them?

                      +

                      What do you hope to get out of this workshop?

                      +

                      Do you have a LinkedIn or Twitter profile?

                      +
                      +
                      +

                      Your partner lives in:

                      +

                      Your partner's company is:

                      +

                      The URL is:

                      +

                      Your partner's is serving:

                      +

                      Helping them:

                      +

                      Your partner is here to:

                      +

                      More about them is here:

                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +
                      +

                      Interview Questions

                      + This notepad is shared with your Workshop Partner. +
                      +
                      +
                      +

                      Interview Responses

                      + This notepad is shared with your Workshop Partner. +
                      +
                      +
                      +
                      +
                      + +
                      +
                      + + +
                      +
                      +

                      Chat

                      +

                      Use the tabs below to switch between chatting with your partner and everyone.

                      +
                      +
                      +
                      + + +
                      +
                      + + + + + diff --git a/fieast-staging.html b/fieast-staging.html new file mode 100644 index 0000000..07a8292 --- /dev/null +++ b/fieast-staging.html @@ -0,0 +1,2125 @@ + + + + + How to Find Product-Market Fit | Justin Wilcox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                      +
                      +
                      How to Find Product-Market Fit with Justin Wilcox
                      +
                      + +
                      + +
                      +
                      +
                      +
                      + +
                      + +
                      + +
                      +
                      + +
                      +
                      +

                      Questions: Ask and up vote.

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

                        Welcome to How to Find Product-Market Fit!

                        You can take notes during the workshop here. +

                        +   +

                        5 Phases of Product-Market Fit

                        +
                          +
                        1. F
                        2. +
                        3. O
                        4. +
                        5. C
                        6. +
                        7. U
                        8. +
                        9. S
                        10. +
                        +

                        +

                        Takeaways

                        +

                        +

                        - Declaring Victory: What's your Victory?

                        +

                        +   +

                        - Product-Market Fit Assessment:

                        +
                          +
                        • Phase are you in:
                        • +
                        • Riskiest Assumption:
                        • +
                        • Next step:
                        • +
                        +

                        +   + +

                        Where are your Early Adopters:

                        +

                        +
                        +
                        +
                        +
                        + +
                        +
                        + + + + +
                        +
                        +
                        + +
                        +
                        +
                        + +
                        + + +
                        +
                        + + + + + + + + + + + +
                        +
                        + +
                        + +
                        + +
                        +
                        + + + + +
                        + +
                        +
                        + + +
                        +
                        +
                        +
                        +
                        +
                        +
                        + + +
                        +
                        + +
                        +
                        +
                        +
                        +
                        + +
                        +
                        +
                        + +
                        + +
                        +
                        Defining Product-Market Fit
                        +
                        + Ready to define Product-Market Fit? +
                        +
                        + +
                        +
                        Declaring Victory Worksheet
                        +
                        + This worksheet will walk you through defining Product-Market Fit. +
                        +
                        + +
                        +
                        Today's Date
                        +
                          +
                        • +
                        +
                        + Start by writing in today's date in the field on the right.

                        +
                        +
                        + + + + + +
                        +
                        What's your Product?
                        +
                        +

                        Write in the product or service that you would like to build.

                        + +
                        +
                          +
                        • +
                        +
                        + +
                        +
                        Who's your Customer?
                        +
                        + Write in the customers or people whom you would like to serve.

                        +
                        +
                          +
                        • +
                        +
                        + +
                        +
                        Fold on the Dotted Line
                        +
                        + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
                        +
                          +
                        +
                        + +
                        +
                        Your Promise
                        +
                        + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                          +
                        1. Even if you never get to build your product and
                        2. +
                        3. Even if you are not able to help the people you want to help...
                        4. +
                        +
                        You are still going to achieve victory.
                        +
                        +
                          +
                        +
                        + + + +
                        +
                        Enter your Victory
                        +
                        +

                        Write in your measurable Victory metric.

                        + +
                        +
                          +
                        • +
                        • +
                        +
                        + +
                        +
                        Find your FOCUS
                        +
                        + Want Feedback?

                        + Type "Yes" if you'd like me to review your Victory.

                        + + Bonus: you'll also be helping others learn. +
                        +
                          + +
                        +
                        + +
                        +
                        What Emotions are you Seeking?
                        +
                        + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

                        + +
                        +
                          +
                        • +
                        +
                        + +
                        +
                        Make it Official
                        +
                        +

                        Congratulations! You have your victory.

                        + + + +
                        +
                          +
                        • +
                        +
                        + +
                        +
                        What are your Co-Founders' Victories?
                        +
                        + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

                        + +
                        +
                        + + + +
                        +
                        Find your FOCUS
                        +
                        +

                        Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

                        Write your Victory Declaration in your Notes tab!
                        + +
                        +
                        + +
                        + +
                        + +
                        +
                        + + + + +
                        +
                        +
                        + +
                        +
                        + + +
                        Your customer segment
                        +
                        Your customer's problem (in their words)
                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + +
                        1. +
                        2. +
                        3. +
                        4. +
                        5. +
                        +
                        +
                        1. +
                        2. +
                        3. +
                        4. +
                        5. +
                        +
                        +
                        +
                        +
                        +
                        +
                        + +
                        +
                        + + + + +
                        +
                        +
                        + +
                        +

                        Product-Market Fit Assessment

                        This exercise will tell you: +
                          +
                        1. What phase of Product-Market Fit you're in
                        2. +
                        3. Your startup's "Riskiest Assumption"
                        4. +
                        5. Your next step to test that assumption
                        6. +
                        +

                        Just answer these questions...

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

                        Have you launched your product?

                        +
                        +
                        +
                          +
                        • No30
                        • +

                          +
                        • Yes2
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        +

                        Are customers paying for it?

                        +
                        +
                        +
                          +
                        • No23
                        • +

                          +
                        • Yes3
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        +

                        Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                        +
                        +
                        +
                          +
                        • No5
                        • +

                          +
                        • Yes4
                        • +

                          +
                        • Not sure20
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        + Congrats! You're on the path to Product-Market + Fit. +
                        +
                        +
                        + Keep doing what you're doing! +
                        +
                        +
                        +
                        +
                        +
                        +

                        Why aren't you on track to acheive Product-Market Fit?

                        +
                        +
                        +
                          +
                        • Not enough customers6
                        • +

                          +
                        • Customer Lifetime Value is too low16
                        • +

                          +
                        +
                        Not sure? Go with your gut. Eventually you'll test both.
                        +
                        +
                        +
                        +
                        +
                        +

                        Why don't you have enough customers?

                        +
                        +
                        +
                          +
                        • Having trouble finding them7
                        • +

                          +
                        • Conversion rate it too low10
                        • +

                          +
                        • Customer segment is too small14
                        • +

                          +
                        • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                        • +

                          +
                        +
                        Not sure? Starting at the top, pick the first answer you think could be the reason.
                        +
                        +
                        +
                        +
                        +
                        +

                        Where are you looking for customers?

                        +
                        +
                        +
                          +
                        • Places I think my customers are.8
                        • +

                          +
                        • Places customers have told me they are.9
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Finding Early Adopters for + your product.
                        +
                        Your Your Next Step: Interview customers to validate + where they look for solutions.
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                        Use this information to make your interviews easier and faster + to get.
                        +
                        +

                        Found in FOCUS Workbook 1...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                        +
                        Your Next Step: Test alternative channels to determine + potential customer segment size.
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

                        You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
                        +
                        +

                        Found in FOCUS Workbook 2...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +

                        What emotions are you evoking in your Call to Action?

                        +
                        +
                        +
                          +
                        • I'm not evoking emotions in my Call to Action11
                        • +

                          +
                        • Emotions I think my customers are experiencing12
                        • +

                          +
                        • Emotions my customers have told me they are experiencing13
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Finding Early Adopters for + your product.
                        +
                        Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

                        Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
                        +
                        +

                        Found in FOCUS Workbook 1...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: You understand + your customer's emotional desires. +
                        +
                        +
                        +
                        Product-Market Fit Phase: .
                        +
                        Your Next Step: Interview your customers to understand + their emotional desires. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                        Use this information to make your interviews easier and faster + to get.
                        +
                        +

                        Found in FOCUS Workbook 1...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                        +
                        Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This exercise will help you identify + the emotions your customers' emotions. + +

                        By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
                        +
                        +

                        Found in FOCUS Workbook 2...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Scaling to Product-Market + Fit. +
                        +
                        Your Next Step: Identify, size and test related customer + segments. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

                        By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
                        +
                        +

                        Found in FOCUS Workbook 5...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                        +
                        Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
                        +
                        +

                        Found in FOCUS Workbook 4...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +

                        Why is your Customer Lifetime Value too low?

                        +
                        +
                        +
                          +
                        • Customer churn is too high (i.e. they cancel your service too soon)17
                        • +

                          +
                        • Price is too low18
                        • +

                          +
                        • Cost of customer acquisition is too high19
                        • +

                          +
                        +
                        Not sure? Starting at the top, pick the first answer you think could be the reason.
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                        +
                        Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                        +
                        +

                        Found in FOCUS Workbook 4...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                        +
                        Your Next Step: Optimize your price via price testing. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
                        +
                        +

                        Found in FOCUS Workbook 3...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
                        +
                        Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
                        +
                        +

                        Found in FOCUS Workbook 2...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +

                        Have you defined a metric that represents when you have acheived Product-Market Fit?

                        +
                        +
                        +
                          +
                        • No21
                        • +

                          +
                        • Yes22
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Finding Early Adopters for + your product.
                        +
                        Your Next Step: Define Product-Market Fit for you + and your team. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

                        This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
                        +
                        +

                        Found in FOCUS Workbook 1...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                        +
                        Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
                        +
                        +

                        Found in FOCUS Workbook 3...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +

                        Are customers using the product?

                        +
                        +
                        +
                          +
                        • No41
                        • +

                          +
                        • Yes24
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        +

                        Why aren't your customers paying to use your product?

                        +
                        +
                        +
                          +
                        • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
                        • +

                          +
                        • Going to monetize after reaching critical mass26
                        • +

                          +
                        • Pursuing a freemium model and haven't built paid features yet25
                        • +

                          +
                        • Tried charging but no one would pay10
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
                        +
                        Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
                        +
                        +

                        Found in FOCUS Workbook 3...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +

                        Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                        +
                        +
                        +
                          +
                        • No28
                        • +

                          +
                        • Yes38
                        • +

                          +
                        • Not sure20
                        • +

                          +
                        +
                        +
                        +
                        + +
                        +
                        +
                        +

                        Why aren't enough customers using for you to achieve Product-Market Fit?

                        +
                        +
                        +
                          +
                        • Having trouble finding them7
                        • +

                          +
                        • Conversion rate it too low10
                        • +

                          +
                        • Customer segment is too small14
                        • +

                          +
                        • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                        • +

                          +
                        +
                        Not sure? Starting at the top, pick the first answer you think could be the reason.
                        +
                        +
                        +
                        +
                        +
                        +

                        Have you defined a metric that represents when you have acheived Product-Market Fit?

                        +
                        +
                        +
                          +
                        • No21
                        • +

                          +
                        • Yes22
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        +

                        Have you generated any pre-sales or signed Letters of Intent?

                        +
                        +
                        +
                          +
                        • No35
                        • +

                          +
                        • Yes31
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        +

                        Are enough customers pre-paying for it that, if you solve their problems, you'll achieve Product-Market Fit?

                        +
                        +
                        +
                          +
                        • No5
                        • +

                          +
                        • Yes32
                        • +

                          +
                        • Not sure20
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        +

                        Why haven't you launched the product yet?

                        +
                        +
                        +
                          +
                        • No development team33
                        • +

                          +
                        • Solution is still under development33
                        • +

                          +
                        • Testing the solution privately before making it available publicly34
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: You can solve + your customers' problems. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                        +
                        Your Next Step: Test a manual solution. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
                        +
                        +

                        Found in FOCUS Workbook 4...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
                        +
                        Your Next Step: Test an automated solution. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
                        +
                        +

                        Found in FOCUS Workbook 5...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +

                        Have you identified a problem at least 60% of your customers are actively trying to solve?

                        +
                        +
                        +
                          +
                        • No40
                        • +

                          +
                        • Yes36
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        +

                        If you solve the problem, will you achieve Product-Market Fit?

                        +
                        +
                        +
                          +
                        • No5
                        • +

                          +
                        • Yes37
                        • +

                          +
                        • Not sure39
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        +

                        Why aren't you collecting pre-orders or Letters of Intent?

                        +
                        +
                        +
                          +
                        • Can't finding customers to pre-sell7
                        • +

                          +
                        • Don't know how38
                        • +

                          +
                        • Tried but no one bought10
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                        +
                        Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
                        +
                        +

                        Found in FOCUS Workbook 3...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +

                        Have you defined a metric that represents when you have acheived Product-Market Fit?

                        +
                        +
                        +
                          +
                        • No21
                        • +

                          +
                        • Yes9
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Finding Early Adopters for + your product.
                        +
                        Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                        Use this information to make your interviews easier and faster + to get.
                        +
                        +

                        Found in FOCUS Workbook 1...

                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        +
                        +

                        Why aren't customers using your product?

                        +
                        +
                        +
                          +
                        • I'm not sure how/where to find customers to tell about it8
                        • +

                          +
                        • I've told them about it, but they don't really use it11
                        • +

                          +
                        • Customers use it a little, but then they stop42
                        • +

                          +
                        +
                        +
                        +
                        +
                        +
                        + Your Riskiest Assumption: Your product solves + your customers' problems. +
                        +
                        +
                        +
                        Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                        +
                        Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                        +
                        + This will help... +
                        + +
                        +

                        Recommended FOCUS Exercise...

                        + +
                        +
                        Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                        +
                        +

                        Found in FOCUS Workbook 4...

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

                        Bonus #1

                        +
                        +
                        +
                        +

                        + FREE Customer Interview Email Course
                        +

                        +
                        + You'll learn... +
                          +
                        • Which customers to ask for interviews
                        • +
                        • A cold email script that works to get interviews
                        • +
                        • How to analyze your interview answers
                        • +
                        +
                        +
                        +
                        +
                        +

                        Bonus #2

                        +
                        +
                        +
                        +

                        FOCUS Framework

                        +

                        $20 Off Launch-Day Coupon

                        + +
                        + +
                        +
                        +

                        Crowdfunding on May 3rd

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

                        How likely would you be to recommend this workshop to a friend?

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

                        What's one thing we can improve next time?

                        +
                        +
                        + +
                        +
                        + +
                        +
                        +

                        What was your favorite part of the workshop?

                        +
                        +
                        + +
                        + +
                        + +
                        +
                        +
                        +
                        +
                        +
                        +
                        + + +
                        + +
                        + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fieast.html b/fieast.html new file mode 100644 index 0000000..440ce75 --- /dev/null +++ b/fieast.html @@ -0,0 +1,2126 @@ + + + + + How to Find Product-Market Fit | Justin Wilcox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                        +
                        +
                        How to Find Product-Market Fit with Justin Wilcox
                        +
                        + +
                        + +
                        +
                        +
                        +
                        + +
                        + +
                        + +
                        +
                        + +
                        +
                        +

                        Questions: Ask and up vote.

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

                          Welcome to How to Find Product-Market Fit!

                          You can take notes during the workshop here. +

                          +   +

                          5 Phases of Product-Market Fit

                          +
                            +
                          1. F
                          2. +
                          3. O
                          4. +
                          5. C
                          6. +
                          7. U
                          8. +
                          9. S
                          10. +
                          +

                          +

                          Takeaways

                          +

                          +

                          - Declaring Victory: What's your Victory?

                          +

                          +   +

                          - Product-Market Fit Assessment:

                          +
                            +
                          • Phase are you in:
                          • +
                          • Riskiest Assumption:
                          • +
                          • Next step:
                          • +
                          +

                          +   + +

                          Where are your Early Adopters:

                          +

                          +
                          +
                          +
                          +
                          + +
                          +
                          + + + + +
                          +
                          +
                          + +
                          +
                          +
                          + +
                          + + +
                          +
                          + + + + + + + + + + + +
                          +
                          + +
                          + +
                          + +
                          +
                          + + + + +
                          + +
                          +
                          + + +
                          +
                          +
                          +
                          +
                          +
                          +
                          + + +
                          +
                          + +
                          +
                          +
                          +
                          +
                          + +
                          +
                          +
                          + +
                          + +
                          +
                          Defining Product-Market Fit
                          +
                          + Ready to define Product-Market Fit? +
                          +
                          + +
                          +
                          Declaring Victory Worksheet
                          +
                          + This worksheet will walk you through defining Product-Market Fit. +
                          +
                          + +
                          +
                          Today's Date
                          +
                            +
                          • +
                          +
                          + Start by writing in today's date in the field on the right.

                          +
                          +
                          + + + + + +
                          +
                          What's your Product?
                          +
                          +

                          Write in the product or service that you would like to build.

                          + +
                          +
                            +
                          • +
                          +
                          + +
                          +
                          Who's your Customer?
                          +
                          + Write in the customers or people whom you would like to serve.

                          +
                          +
                            +
                          • +
                          +
                          + +
                          +
                          Fold on the Dotted Line
                          +
                          + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
                          +
                            +
                          +
                          + +
                          +
                          Your Promise
                          +
                          + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                            +
                          1. Even if you never get to build your product and
                          2. +
                          3. Even if you are not able to help the people you want to help...
                          4. +
                          +
                          You are still going to achieve victory.
                          +
                          +
                            +
                          +
                          + + + +
                          +
                          Enter your Victory
                          +
                          +

                          Write in your measurable Victory metric.

                          + +
                          +
                            +
                          • +
                          • +
                          +
                          + +
                          +
                          Find your FOCUS
                          +
                          + Want Feedback?

                          + Type "Yes" if you'd like me to review your Victory.

                          + + Bonus: you'll also be helping others learn. +
                          +
                            + +
                          +
                          + +
                          +
                          What Emotions are you Seeking?
                          +
                          + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

                          + +
                          +
                            +
                          • +
                          +
                          + +
                          +
                          Make it Official
                          +
                          +

                          Congratulations! You have your victory.

                          + + + +
                          +
                            +
                          • +
                          +
                          + +
                          +
                          What are your Co-Founders' Victories?
                          +
                          + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

                          + +
                          +
                          + + + +
                          +
                          Find your FOCUS
                          +
                          +

                          Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

                          Write your Victory Declaration in your Notes tab!
                          + +
                          +
                          + +
                          + +
                          + +
                          +
                          + + + + +
                          +
                          +
                          + +
                          +
                          + + +
                          Your customer segment
                          +
                          Your customer's problem (in their words)
                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + +
                          1. +
                          2. +
                          3. +
                          4. +
                          5. +
                          +
                          +
                          1. +
                          2. +
                          3. +
                          4. +
                          5. +
                          +
                          +
                          +
                          +
                          +
                          +
                          + +
                          +
                          + + + + +
                          +
                          +
                          + +
                          +

                          Product-Market Fit Assessment

                          This exercise will tell you: +
                            +
                          1. What phase of Product-Market Fit you're in
                          2. +
                          3. Your startup's "Riskiest Assumption"
                          4. +
                          5. Your next step to test that assumption
                          6. +
                          +

                          Just answer these questions...

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

                          Have you launched your product?

                          +
                          +
                          +
                            +
                          • No30
                          • +

                            +
                          • Yes2
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          +

                          Are customers paying for it?

                          +
                          +
                          +
                            +
                          • No23
                          • +

                            +
                          • Yes3
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          +

                          Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                          +
                          +
                          +
                            +
                          • No5
                          • +

                            +
                          • Yes4
                          • +

                            +
                          • Not sure20
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          + Congrats! You're on the path to Product-Market + Fit. +
                          +
                          +
                          + Keep doing what you're doing! +
                          +
                          +
                          +
                          +
                          +
                          +

                          Why aren't you on track to acheive Product-Market Fit?

                          +
                          +
                          +
                            +
                          • Not enough customers6
                          • +

                            +
                          • Customer Lifetime Value is too low16
                          • +

                            +
                          +
                          Not sure? Go with your gut. Eventually you'll test both.
                          +
                          +
                          +
                          +
                          +
                          +

                          Why don't you have enough customers?

                          +
                          +
                          +
                            +
                          • Having trouble finding them7
                          • +

                            +
                          • Conversion rate it too low10
                          • +

                            +
                          • Customer segment is too small14
                          • +

                            +
                          • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                          • +

                            +
                          +
                          Not sure? Starting at the top, pick the first answer you think could be the reason.
                          +
                          +
                          +
                          +
                          +
                          +

                          Where are you looking for customers?

                          +
                          +
                          +
                            +
                          • Places I think my customers are.8
                          • +

                            +
                          • Places customers have told me they are.9
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Finding Early Adopters for + your product.
                          +
                          Your Your Next Step: Interview customers to validate + where they look for solutions.
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                          Use this information to make your interviews easier and faster + to get.
                          +
                          +

                          Found in FOCUS Workbook 1...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                          +
                          Your Next Step: Test alternative channels to determine + potential customer segment size.
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

                          You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
                          +
                          +

                          Found in FOCUS Workbook 2...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +

                          What emotions are you evoking in your Call to Action?

                          +
                          +
                          +
                            +
                          • I'm not evoking emotions in my Call to Action11
                          • +

                            +
                          • Emotions I think my customers are experiencing12
                          • +

                            +
                          • Emotions my customers have told me they are experiencing13
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Finding Early Adopters for + your product.
                          +
                          Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

                          Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
                          +
                          +

                          Found in FOCUS Workbook 1...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: You understand + your customer's emotional desires. +
                          +
                          +
                          +
                          Product-Market Fit Phase: .
                          +
                          Your Next Step: Interview your customers to understand + their emotional desires. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                          Use this information to make your interviews easier and faster + to get.
                          +
                          +

                          Found in FOCUS Workbook 1...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                          +
                          Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This exercise will help you identify + the emotions your customers' emotions. + +

                          By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
                          +
                          +

                          Found in FOCUS Workbook 2...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Scaling to Product-Market + Fit. +
                          +
                          Your Next Step: Identify, size and test related customer + segments. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

                          By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
                          +
                          +

                          Found in FOCUS Workbook 5...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                          +
                          Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
                          +
                          +

                          Found in FOCUS Workbook 4...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +

                          Why is your Customer Lifetime Value too low?

                          +
                          +
                          +
                            +
                          • Customer churn is too high (i.e. they cancel your service too soon)17
                          • +

                            +
                          • Price is too low18
                          • +

                            +
                          • Cost of customer acquisition is too high19
                          • +

                            +
                          +
                          Not sure? Starting at the top, pick the first answer you think could be the reason.
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                          +
                          Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                          +
                          +

                          Found in FOCUS Workbook 4...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                          +
                          Your Next Step: Optimize your price via price testing. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
                          +
                          +

                          Found in FOCUS Workbook 3...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
                          +
                          Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
                          +
                          +

                          Found in FOCUS Workbook 2...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +

                          Have you defined a metric that represents when you have acheived Product-Market Fit?

                          +
                          +
                          +
                            +
                          • No21
                          • +

                            +
                          • Yes22
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Finding Early Adopters for + your product.
                          +
                          Your Next Step: Define Product-Market Fit for you + and your team. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

                          This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
                          +
                          +

                          Found in FOCUS Workbook 1...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                          +
                          Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
                          +
                          +

                          Found in FOCUS Workbook 3...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +

                          Are customers using the product?

                          +
                          +
                          +
                            +
                          • No41
                          • +

                            +
                          • Yes24
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          +

                          Why aren't your customers paying to use your product?

                          +
                          +
                          +
                            +
                          • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
                          • +

                            +
                          • Going to monetize after reaching critical mass26
                          • +

                            +
                          • Pursuing a freemium model and haven't built paid features yet25
                          • +

                            +
                          • Tried charging but no one would pay10
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
                          +
                          Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
                          +
                          +

                          Found in FOCUS Workbook 3...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +

                          Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                          +
                          +
                          +
                            +
                          • No28
                          • +

                            +
                          • Yes38
                          • +

                            +
                          • Not sure20
                          • +

                            +
                          +
                          +
                          +
                          + +
                          +
                          +
                          +

                          Why aren't enough customers using for you to achieve Product-Market Fit?

                          +
                          +
                          +
                            +
                          • Having trouble finding them7
                          • +

                            +
                          • Conversion rate it too low10
                          • +

                            +
                          • Customer segment is too small14
                          • +

                            +
                          • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                          • +

                            +
                          +
                          Not sure? Starting at the top, pick the first answer you think could be the reason.
                          +
                          +
                          +
                          +
                          +
                          +

                          Have you defined a metric that represents when you have acheived Product-Market Fit?

                          +
                          +
                          +
                            +
                          • No21
                          • +

                            +
                          • Yes22
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          +

                          Have you generated any pre-sales or signed Letters of Intent?

                          +
                          +
                          +
                            +
                          • No35
                          • +

                            +
                          • Yes31
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          +

                          Are enough customers pre-paying for it that, if you solve their problems, you'll achieve Product-Market Fit?

                          +
                          +
                          +
                            +
                          • No5
                          • +

                            +
                          • Yes32
                          • +

                            +
                          • Not sure20
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          +

                          Why haven't you launched the product yet?

                          +
                          +
                          +
                            +
                          • No development team33
                          • +

                            +
                          • Solution is still under development33
                          • +

                            +
                          • Testing the solution privately before making it available publicly34
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: You can solve + your customers' problems. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                          +
                          Your Next Step: Test a manual solution. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
                          +
                          +

                          Found in FOCUS Workbook 4...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
                          +
                          Your Next Step: Test an automated solution. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
                          +
                          +

                          Found in FOCUS Workbook 5...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +

                          Have you identified a problem at least 60% of your customers are actively trying to solve?

                          +
                          +
                          +
                            +
                          • No40
                          • +

                            +
                          • Yes36
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          +

                          If you solve the problem, will you achieve Product-Market Fit?

                          +
                          +
                          +
                            +
                          • No5
                          • +

                            +
                          • Yes37
                          • +

                            +
                          • Not sure39
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          +

                          Why aren't you collecting pre-orders or Letters of Intent?

                          +
                          +
                          +
                            +
                          • Can't finding customers to pre-sell7
                          • +

                            +
                          • Don't know how38
                          • +

                            +
                          • Tried but no one bought10
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                          +
                          Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
                          +
                          +

                          Found in FOCUS Workbook 3...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +

                          Have you defined a metric that represents when you have acheived Product-Market Fit?

                          +
                          +
                          +
                            +
                          • No21
                          • +

                            +
                          • Yes9
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Finding Early Adopters for + your product.
                          +
                          Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                          Use this information to make your interviews easier and faster + to get.
                          +
                          +

                          Found in FOCUS Workbook 1...

                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          +
                          +

                          Why aren't customers using your product?

                          +
                          +
                          +
                            +
                          • I'm not sure how/where to find customers to tell about it8
                          • +

                            +
                          • I've told them about it, but they don't really use it11
                          • +

                            +
                          • Customers use it a little, but then they stop42
                          • +

                            +
                          +
                          +
                          +
                          +
                          +
                          + Your Riskiest Assumption: Your product solves + your customers' problems. +
                          +
                          +
                          +
                          Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                          +
                          Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                          +
                          + This will help... +
                          + +
                          +

                          Recommended FOCUS Exercise...

                          + +
                          +
                          Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                          +
                          +

                          Found in FOCUS Workbook 4...

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

                          Bonus #1

                          +
                          +
                          +
                          +

                          + FREE Customer Interview Email Course
                          +

                          +
                          + You'll learn... +
                            +
                          • Which customers to ask for interviews
                          • +
                          • A cold email script that works to get interviews
                          • +
                          • How to analyze your interview answers
                          • +
                          + +
                          + +
                          +
                          +
                          +

                          Bonus #2

                          +
                          +
                          +
                          +

                          FOCUS Framework

                          +

                          $20 Off Coupon

                          + +
                          + +
                          +
                          +

                          Use coupon: CDLFIT
                          (next 24 hours)

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

                          How likely would you be to recommend this workshop to a friend?

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

                          What's one thing we can improve next time?

                          +
                          +
                          + +
                          +
                          + +
                          +
                          +

                          What was your favorite part of the workshop?

                          +
                          +
                          + +
                          + +
                          + +
                          +
                          +
                          +
                          +
                          +
                          +
                          + + +
                          + +
                          + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fieast.js b/fieast.js new file mode 100644 index 0000000..a06757d --- /dev/null +++ b/fieast.js @@ -0,0 +1,1589 @@ +//var app = angular.module('app', ['firebase']); +var firebaseRoot = "https://cdlwebshops.firebaseio.com/fiEast"; + +var rootRef = new Firebase(firebaseRoot); +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var emailsRef = new Firebase(firebaseRoot + "/emails"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); +var notesRef = new Firebase(firebaseRoot + "/notes"); +var exerciseValuesRef = new Firebase(firebaseRoot + "/exerciseValues"); + +var declaringVictoryRef = exerciseValuesRef.child("declaringVictory"); +var pmfAssessmentRef = exerciseValuesRef.child("pmfAssessment"); + +var loggedInUserId; +var questionPad, responsePad; +var myPMFAssessmentRef; + +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +const GET_PARTNER = false; + +var publicChat; + +var firstName = null; +var emailAddress = null; + +var lastSoloPriority = 0; +var lastQuestionAnswered; + +var app = angular.module('app', [ + 'ui.grid', + 'ui.grid.resizeColumns', + 'ui.grid.autoResize', + 'ui.grid.moveColumns', + 'ui.grid.saveState', + 'ngSanitize', + 'ui.bootstrap', + 'firebase']). + directive('contenteditable', ['$sce', function ($sce) { + return { + restrict: 'A', // only activate on element attribute + require: '?ngModel', // get a hold of NgModelController + link: function (scope, element, attrs, ngModel) { + if (!ngModel) return; // do nothing if no ng-model + + // Specify how UI should be updated + ngModel.$render = function () { + element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); + }; + + // Listen for change events to enable binding + element.on('blur keyup change', function () { + scope.$evalAsync(read); + }); + read(); // initialize + + // Write data to the model + function read() { + var html = element.html(); + // When we clear the content editable the browser leaves a
                          behind + // If strip-br attribute is provided then we strip this out + if (attrs.stripBr && html == '
                          ') { + html = ''; + } + ngModel.$setViewValue(html); + } + } + }; + }]); + +app.controller('MainCtrl', ['$scope', '$firebaseArray', '$firebaseAuth', '$firebaseObject', 'uiGridConstants', function ($scope, $firebaseArray, $firebaseAuth, $firebaseObject, uiGridConstants) { + var vm = this; + + var VictoryDeclarationFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + date: 'Write here', + step1: 'Write here', + step2: 'Write here', + number: '#', + things: 'things here', + emotion: 'Write here', + signature: 'Sign here', + optIn: 'Want Feedback?' + } + }); + + vm.gridOptions = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Number', + field: 'number' + }, + { + displayName: 'Things', + field: 'things' + }, + { + displayName: 'Emotion', + field: 'emotion', + }, + { + displayName: 'Product', + field: 'step1', + }, + { + displayName: 'Customer', + field: 'step2', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm.gridApi = gridApi; + } + }; + + if (isSimpleMode()) { + vm.properties = $firebaseArray(declaringVictoryRef); + vm.properties.$loaded().then(function () { + vm.gridOptions.data = vm.properties; + }); + + vm.giveFeedback = function (exercise) { + var victoryRef = declaringVictoryRef.child(exercise.$id); + + if (vm.feedbackObj) { + vm.feedbackObj.$destroy(); + } + + vm.feedbackObj = VictoryDeclarationFactory(victoryRef); + vm.feedbackObj.$bindTo($scope, "declaringVictoryFeedback"); + }; + } + + // $scope.giveFeedback = function(exercise) { + // console.log(exercise); + // // $state.transitionTo('club', { clubId: club.id }); + // }; + + // vm.getTableHeight = function () { + // var rowHeight = 33; + // var headerHeight = 33; + // var height = vm.gridOptions.data.length * rowHeight + headerHeight; + // if (height > window.innerHeight) { + // height = window.innerHeight - 250; + // } + // return { + // height: height + "px" + // }; + // }; + + + if (!initParameters()) { + initModal(); + return; + } + + var auth = $firebaseAuth(rootRef); + var dataFromAuth = auth.$getAuth(); + + if (!dataFromAuth) { + auth.$authAnonymously(); + } + + auth.$onAuth(function (authData) { + postAuthConfig(authData, publicChat, PUBLIC_CHAT_ROOM_ID, GET_PARTNER); + + // var VictoryDeclarationGridFactory = $firebaseArray.$extend({ + // // each time an update arrives from the server, apply the change locally + // columnDefs: [ + // { field: 'date', displayName: 'Id' }, + // { field: 'step1', displayName: 'Club Id', visible: false }, + // { field: 'step2', displayName: 'Club Name' }, + // { name: 'select', displayName: 'Select', cellTemplate: ' ' } + // ] + // }); + + var victoryRef = declaringVictoryRef.child(authData.uid); + var victorySyncObj = VictoryDeclarationFactory(victoryRef); + + victorySyncObj.$bindTo($scope, "declaringVictory"); + + // $scope.victoryDeclarations = { + // data: '$firebaseArray(declaringVictoryRef)', + // columnDefs: [ + // {field: 'date', displayName: 'Id'}, + // {field: 'step1', displayName: 'Club Id', visible: false}, + // {field: 'step2', displayName: 'Club Name'}, + // {name: 'select', displayName: 'Select', cellTemplate: ' '} + // ] + // }; + + // $scope.victoryDeclarations = { + // columnDefs: [ + // {field: 'date', displayName: 'Id'}, + // {field: 'step1', displayName: 'Club Id', visible: false}, + // {field: 'step2', displayName: 'Club Name'}, + // {name: 'select', displayName: 'Select', cellTemplate: ' '} + // ] + // }; + + // var vm = this; + + + // vm.gridOptions = { + // columnDefs: [ + // { + // displayName: 'PROS Number', + // field: 'date' + // }, + // { + // displayName: 'MLS Status', + // field: 'step1' + // }, + // { + // displayName: 'Deal Status', + // field: 'step2', + // enableColumnMenu: false, + // enableSorting: false + // } + // ], + // //enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + // flatEntityAccess: true, + // //rowHeight: '33', + // enableGridMenu: true, + // enableFiltering: true, + // onRegisterApi: function (gridApi) { + // vm.gridApi = gridApi; + // } + // }; + + + // //var dataRef = new Firebase('https://itjustwerks.firebaseio.com/data/properties'); // jshint ignore:line + // vm.properties = $firebaseArray(declaringVictoryRef); + // vm.properties.$loaded().then(function() { + // vm.gridOptions.data = vm.properties; + // }); + + + + // $scope.victoryDeclarations = { + // columnDefs: [ + // { field: 'date', displayName: 'Id' }, + // { field: 'step1', displayName: 'Club Id', visible: false }, + // { field: 'step2', displayName: 'Club Name' }, + // { name: 'select', displayName: 'Select', cellTemplate: ' ' } + // ] + // }; + + // var hope = $firebaseArray(declaringVictoryRef); + + // hope.$loaded().then(function () { + // $scope.victoryDeclarations.data = hope; + // }); + + // hope.columnDefs = [ + // {field: 'date', displayName: 'Id'}, + // {field: 'step1', displayName: 'Club Id', visible: false}, + // {field: 'step2', displayName: 'Club Name'}, + // {name: 'select', displayName: 'Select', cellTemplate: ' '} + // ]; + + //$scope.victoryDeclarations = hope; + }); +}]); + +function connectExercisesToFirebase(userId) { + myPMFAssessmentRef = pmfAssessmentRef.child(userId); + + if (isSimpleMode()) { + $('#refreshPMFChartsButton').show(); + + refreshPMFCharts(); + } +} + +function refreshPMFCharts() { + pmfAssessmentRef.once("value", function (data) { + populateChart(data.val()); + }); +} + +function populateChart(model, chartContainer, title) { + var countMap = {}; + var pathMap = {} + + for (value in model) { + var node = model[value]; + + if (countMap[node.currentPhase]) { + countMap[node.currentPhase].data += 1; + } + else { + countMap[node.currentPhase] = { + name: node.currentPhase, + data: 1 + }; + } + + if (pathMap[node.assessmentPath]) { + pathMap[node.assessmentPath].data += 1; + } + else { + pathMap[node.assessmentPath] = { + name: node.assessmentPath, + data: 1 + }; + } + } + + var phases = []; + var phaseCounts = []; + + for (key in Object.keys(countMap)) { + phases.push(countMap[Object.keys(countMap)[key]].name); + phaseCounts.push(countMap[Object.keys(countMap)[key]].data); + } + + var paths = []; + var pathCounts = []; + + for (key in Object.keys(pathMap)) { + paths.push(pathMap[Object.keys(pathMap)[key]].name); + pathCounts.push(pathMap[Object.keys(pathMap)[key]].data); + } + + $('#pmfPhaseChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Current Phase' }, + xAxis: { + categories: phases + }, + series: [{ + data: phaseCounts + }] + }); + + $('#pmfPathChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Popular Paths' }, + xAxis: { + categories: paths + }, + series: [{ + data: pathCounts + }] + }); +} + +function initParameters() { + firstName = getParameterByName('firstName'); + + return firstName != null; +} + +function getEnrollees() { + enrolledRef.once('value', function (enrolledSnap) { + enrolledSnap.forEach(function (snapshot) { + console.log(snapshot.val().email); + }); + }); +} + +function getFeedback() { + feedbackRef.once('value', function (feedbackSnap) { + feedbackSnap.forEach(function (snapshot) { + var feedback = snapshot.val(); + console.log(feedback.nps + ",'" + feedback.favorite + "','" + feedback.improve + "'"); + }); + }); +} + +function initUI() { + $('.carousel').carousel({ + interval: 5000 + }); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + $("#newPartner").hide(); + $("#newPartner").click(function () { + leavePartnership(); + }); + + $('.meetYourPartnerMe').on("input", function () { + updateMyInfo($(this)); + }); + + keepTabsOnTabs(); + initEnrollForm(); + setupFeedbackForm(); + //setupInterviewScriptGenerator(); + //setupQuizzes(); + + setupiFrames(); + + if (isWebViewerMode()) { + // load video stream + var youTubeIFrame = $('.youtube-iframe'); + youTubeIFrame.attr("src", youTubeIFrame.attr("data-youtube-src")); + } + else { + // get ride of video holder + $('.left-column .top-row').hide(); + $('.left-column .bottom-row').addClass("full-height").removeClass("bottom-row"); + } + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } +} + +function setupTextEditors() { + + tinymce.init({ + selector: '.text-editor', + menubar: false, + plugins: 'autoresize autosave', + autosave_interval: "2s", + setup: function (ed) { + ed.on('init', function () { + this.getDoc().body.style.fontSize = '16px'; + this.getDoc().body.style.fontName = 'Lato'; + // ed.target.editorCommands.execCommand("fontSize", false, "2"); + // ed.target.editorCommands.execCommand("fontName", false, "Lato"); + }); + } + }); +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function () { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function () { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#enrollForm").submit(function (event) { + event.preventDefault(); + + enrolledRef.child(loggedInUserId).set({ email: $('#enrollEmail').val() }); + $('#enrollSuccessAlert').show(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function isWebViewerMode() { + return !isSimpleMode() && document.URL.indexOf("vip.html") == -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + exercisesRef.child("active").update({ exercise: exerciseName }); + }); + + $(".showTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + }); + + $(".hideTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: false }); + }); + + $(".soloTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each(function (index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({ exercise: tabName.replace("Tab", '') }); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function (exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each(function (index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.uid).once('value', function (snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function (snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "That's not your name", + validators: { + notEmpty: { + message: 'We need your name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We can do names between 2 and 20 characters' + } + } + }, + attendeeEmail: { + message: "Hmm, something doesn't look right.", + validators: { + notEmpty: { + message: 'Please enter your email address' + }, + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#welcomeForm").submit(function (event) { + firstName = $("#attendeeName").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function () { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function postAuthConfig(authData, chatUI, roomId, getPartner) { + console.log("Authenticated successfully with payload: ", authData); + + var user = authData; + + loggedInUserId = user.uid; + user.firstName = firstName; + //chatUI.setUser(user.uid, firstName); + //enterRoomAfterUserSessionCreated(chatUI, roomId); + + connectExercisesToFirebase(loggedInUserId); + + emailsRef.child(loggedInUserId).set({ name: firstName }); + + setupTextEditors(); + + if (getPartner) { + searchForPartner(user); + } + + authUserName = firstName; + fbid = user.uid; + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestion; + + allQuestionsSnapshot.forEach(function (snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
                        • "); + var divmediabody = $("
                          "); + var divmedia = $("
                          "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = + "Top | " + + "Middle | " + + "" + answerText + " | " + + "" + hideText + ""; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 0; + var votesElement = "" + voteLink + ": " + voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
                          "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
                          " + userNameElement + "
                          " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestion = questionElement; + divmediabody2.addClass('bg-warning'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-info'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-primary'); + } + else { + divmediabody2.addClass('this-class-does-not-exist'); + } + + questionList.prepend(questionElement); + } + }); + + questionList.prepend(activeQuestion); + }); +} + +function logInToChat(ref, chatUI, roomId, getPartner) { + var dataFromAuth = ref.getAuth(); + + if (dataFromAuth) { + postAuthConfig(dataFromAuth, chatUI, roomId, getPartner); + return; + } + + ref.authAnonymously(function (error, authData) { + if (error) { + console.log("Login Failed!", error); + return; + } + + postAuthConfig(authData, chatUI, roomId, getPartner); + + }); +} + +// var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { +// if (user) { +// loggedInUserId = user.uid; +// +// user.firstName = firstName; +// chatUI.setUser(user.uid, firstName); +// +// if (roomId != null) { +// setTimeout(function() { +// console.log("About to enter room. User: " + JSON.stringify(user) + ". Room: " + roomId); +// chatUI._chat.enterRoom(roomId); +// }, 500); +// } +// +// if (getPartner) { +// searchForPartner(user); +// } +// +// authUserName = firstName; +// fbid = user.uid; +// +// // simple should see all of the questions, everyone else should only see the unhidden ones +// var startAtNum = isSimpleMode() ? -1000000 : 1; +// +// // Add a callback that is triggered for each chat question. +// questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { +// questionList.empty(); +// +// var activeQuestion; +// +// allQuestionsSnapshot.forEach(function(snapshot) { +// +// //GET DATA +// var questionId = snapshot.key(); +// var data = snapshot.val(); +// var fbid_d = data.fbid; +// var username_d = data.name; +// var question_d = data.text; +// var date_d = data.currentdate; +// var votes_d = data.votes; +// +// divdir = ""; +// +// //CREATE ELEMENTS question & SANITIZE TEXT +// var questionElement = $("
                        • "); +// var divmediabody = $("
                          "); +// var divmedia = $("
                          "); +// +// var voteLink; +// var userAskedQuestion = fbid_d == fbid; +// +// if (isSimpleMode()) { +// var answerText = data.isActive ? "Unanswer" : "Answer"; +// var hideText = data.votes <= 0 ? "Show" : "Hide"; +// +// voteLink = "" + answerText + " " + hideText + ""; +// } +// else if (userAskedQuestion) { +// // This user submitted the question +// voteLink = "Delete"; +// } +// else { +// var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; +// voteLink = "" + voteText + ""; +// } +// +// var voteCount = data.votes ? data.votes : 1; +// var votesElement = "" + voteLink + ": "+ voteCount + ""; +// var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; +// var dateElement = " " + date_d + ""; +// +// var divmediabody2 = $("
                          "); +// questionElement.append(divmediabody); +// divmediabody.append(divmedia); +// //divmedia.append(a); +// //divmedia.append(votesElement); +// divmedia.append(divmediabody2); +// +// var usernamediv = $(""); +// divmediabody2.html(question_d); +// +// divmediabody2.append(usernamediv); +// usernamediv.html("
                          " + userNameElement + "
                          " + votesElement); +// +// //ADD question +// if (data.isActive) { +// activeQuestion = questionElement; +// divmediabody2.addClass('bg-danger'); +// } +// else { +// if (userAskedQuestion) { +// divmediabody2.addClass('bg-success'); +// // divmediabody2.css('background', "#476982"); +// // usernamediv.css('color', "#CCC") +// } +// else if (data.votes > 0) { +// // divmediabody2.css('background', "#73B3D7"); +// divmediabody2.addClass('bg-info'); +// } +// else { +// divmediabody2.addClass('bg-warning'); +// } +// +// questionList.prepend(questionElement); +// } +// }); +// +// questionList.prepend(activeQuestion); +// }); +// +// } else { +// simpleLogin.login('anonymous', { +// rememberMe: true +// }); +// } +// }); +// } + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


                          You'll see what your partner types, as she/he does.


                          Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


                          (Delete this too :)" : ""); + + questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                           
                          Note: your partner will be able to see your text as you type it.
                           
                          Try editing this text!
                           
                           
                          2. Secretly pick a company below to pitch:
                           

                          • AirBnB
                          • Pampers (diapers)
                          • Twitter
                          • Facebook
                          • Subway (sandwiches)
                          • Instagram
                          • Disney
                          • SnapChat
                          • Angry Birds (Rovio)
                          • RedBull
                           
                          3. Fill out the pitch template for the company you're pitching:
                           
                          - Problem:
                           
                           
                           
                          - Solution:
                           
                           
                           
                          - Market:
                           
                           
                           
                          - Business Model:
                           
                           
                           
                          -------------------------------------------------------
                           
                          4. Guess which company your partner is pitching:
                           
                           
                           
                          5. Which elements of your partner's pitch could be improved? 
                           
                           
                          " : ""); + responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                           
                          Note: your partner will be able to see your text as you type it.
                           
                          Try editing this text!
                           
                           
                          2. Secretly pick a company below to pitch:
                           
                          • AirBnB
                          • Pampers (diapers)
                          • Twitter
                          • Facebook
                          • Subway (sandwiches)
                          • Instagram
                          • Disney
                          • SnapChat
                          • Angry Birds (Rovio)
                          • RedBull
                           
                          3. Fill out the pitch template for the company you're pitching:
                           
                          - Problem:
                           
                           
                           
                          - Solution:
                           
                           
                           
                          - Market:
                           
                           
                           
                          - Business Model:
                           
                           
                           
                          -------------------------------------------------------
                           
                          4. Guess which company your partner is pitching:
                           
                           
                           
                          5. Which elements of your partner's pitch could be improved? 
                           
                           
                          " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(useruser.uid, ""); + + attendeesRef.child(user.uid).update(user); + + leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + $("#partnerName").html("Your partner isn't available. Let's find another for you!"); + + return; + } + else if (part.room != null) { + console.log("Entering our partner chat room: " + part.room); + publicChat._chat.enterRoom(part.room); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.uid).update(user); + } + }); + + soloRef.off('child_changed'); + + // intro partners + $("#partnerName").html("Say hi to your workshop partner, !"); + $('.partnerName').text(user.partnerName); + $("#newPartner").show(); + + getMeetYourPartnerUpdates(user); +} + +function lookingForPartnerUI() { + $("#partnerName").html("Looking for a partner for you..."); + $("#newPartner").hide(); +} + +function joinSoloList(user) { + soloRef.child(user.uid).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.uid; + user.responsesPad = "r-" + user.uid; + + // store my pad addresses + attendeesRef.child(user.uid).update(user); + + //loadFirepads(user, true); + + soloRef.on('child_changed', function (soloSnap) { + var solo = soloSnap.val(); + + if (solo.id != user.uid) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + soloRef.child(user.uid).remove(function (error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function (roomId) { + console.log('Created our partnership chat room'); + partnershipsRef.child(solo.partnership).set({ "room": roomId }); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + }); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function (solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function (soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.id == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.id).transaction(function (currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.uid.localeCompare(solo.id) < 0) { + partnership = user.uid + solo.id; + } + else { + partnership = solo.id + user.uid; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.id; + user.responsesPad = "r-" + solo.id; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function () { confirmPartnershipAccepted(user) }, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.uid, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function (error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + //loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.uid).transaction(function (currentData) { + + // Always return null because we want off this list + return null; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.uid).once('value', function (attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.uid).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + console.log("My user id is: " + user.uid); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership() { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + searchForSolos(user); + } + else { + console.log("This user is requesting to leave partnership."); + lookingForPartnerUI(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function (error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(true); + } + }); + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + leavePrivateChatRooms(); + clearPartnerFromUser(user); + unloadFirepads(); + + attendeesRef.child(user.uid).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +const DEFAULT_QUESTION_VOTES = 0; +const MIDDLE_OF_LIST_VOTES = 50; +const TOP_OF_LIST_VOTES = 100; + +$(document).ready(function () { + initUI(); +}); + +function toggleQuestionVisibility(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function (question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (question.votes == 0) { + question.votes = 1; + } + else { + question.votes = question.votes * -1; + question.isActive = 0; + } + + return question; + }); +} + +function moveQuestionToMiddle(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: MIDDLE_OF_LIST_VOTES }); +} + +function moveQuestionToTop(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: TOP_OF_LIST_VOTES }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + if (lastQuestionAnswered) { + questionsRef.child(lastQuestionAnswered).update({ isActive: false }); + } + + lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false }); + + lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function (confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function (currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null) { + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: DEFAULT_QUESTION_VOTES }); + + $("#question-txt").val(''); + +} diff --git a/firechat/firechat-default-custom.css b/firechat/firechat-default-custom.css new file mode 100644 index 0000000..8d32308 --- /dev/null +++ b/firechat/firechat-default-custom.css @@ -0,0 +1,950 @@ +@charset "UTF-8"; +/* Boilerplate: Reset +============================================================ */ +#firechat div, +#firechat span, +#firechat applet, +#firechat object, +#firechat iframe, +#firechat h1, +#firechat h2, +#firechat h3, +#firechat h4, +#firechat h5, +#firechat h6, +#firechat p, +#firechat blockquote, +#firechat pre, +#firechat a, +#firechat abbr, +#firechat acronym, +#firechat address, +#firechat big, +#firechat cite, +#firechat code, +#firechat del, +#firechat dfn, +#firechat em, +#firechat img, +#firechat ins, +#firechat kbd, +#firechat q, +#firechat s, +#firechat samp, +#firechat small, +#firechat strike, +#firechat strong, +#firechat sub, +#firechat sup, +#firechat tt, +#firechat var, +#firechat b, +#firechat u, +#firechat i, +#firechat center, +#firechat dl, +#firechat dt, +#firechat dd, +#firechat ol, +#firechat ul, +#firechat li, +#firechat fieldset, +#firechat form, +#firechat label, +#firechat legend, +#firechat table, +#firechat caption, +#firechat tbody, +#firechat tfoot, +#firechat thead, +#firechat tr, +#firechat th, +#firechat td, +#firechat article, +#firechat aside, +#firechat canvas, +#firechat details, +#firechat embed, +#firechat figure, +#firechat figcaption, +#firechat footer, +#firechat header, +#firechat hgroup, +#firechat menu, +#firechat nav, +#firechat output, +#firechat ruby, +#firechat section, +#firechat summary, +#firechat time, +#firechat mark, +#firechat audio, +#firechat video { + border: 0; + font-size: 12px; + font-family: arial, helvetica, sans-serif; + vertical-align: baseline; + margin: 0; + padding: 0; +} +#firechat article, +#firechat aside, +#firechat details, +#firechat figcaption, +#firechat figure, +#firechat footer, +#firechat header, +#firechat hgroup, +#firechat menu, +#firechat nav, +#firechat section { + display: block; +} +#firechat body { + line-height: 1; +} +#firechat ol, +#firechat ul { + list-style: none; +} +#firechat blockquote, +#firechat q { + quotes: none; +} +#firechat blockquote:before, +#firechat blockquote:after, +#firechat q:before, +#firechat q:after { + content: none; +} +#firechat table { + border-collapse: collapse; + border-spacing: 0; +} +/* Boilerplate: Mixins +============================================================ */ +.clearfix { + *zoom: 1; +} +.clearfix:before, +.clearfix:after { + display: table; + content: ""; + line-height: 0; +} +.clearfix:after { + clear: both; +} +/* Boilerplate: Responsive Layout +============================================================ */ +#firechat { + color: #333; + text-align: left; +} +#firechat .center { + float: none !important; + margin-left: auto !important; + margin-right: auto !important; +} +#firechat .left { + float: left !important; +} +#firechat .right { + float: right !important; +} +#firechat .alignleft { + text-align: left !important; +} +#firechat .alignright { + text-align: right !important; +} +#firechat .aligncenter { + text-align: center !important; +} +#firechat .hidden { + display: none !important; +} +#firechat .row { + clear: both; +} +#firechat .fifth, +#firechat .fivesixth, +#firechat .fourfifth, +#firechat .half, +#firechat .ninetenth, +#firechat .quarter, +#firechat .sevententh, +#firechat .sixth, +#firechat .tenth, +#firechat .third, +#firechat .threefifth, +#firechat .threequarter, +#firechat .threetenth, +#firechat .twofifth, +#firechat .twothird, +#firechat .full { + margin-left: 2.127659574468085%; + float: left; + min-height: 1px; +} +#firechat .fifth:first-child, +#firechat .fivesixth:first-child, +#firechat .fourfifth:first-child, +#firechat .half:first-child, +#firechat .ninetenth:first-child, +#firechat .quarter:first-child, +#firechat .sevententh:first-child, +#firechat .sixth:first-child, +#firechat .tenth:first-child, +#firechat .third:first-child, +#firechat .threefifth:first-child, +#firechat .threequarter:first-child, +#firechat .threetenth:first-child, +#firechat .twofifth:first-child, +#firechat .twothird:first-child, +#firechat .full:first-child { + margin-left: 0; +} +#firechat .tenth { + width: 8.08510638297872%; +} +#firechat .sixth { + width: 14.893617021276595%; +} +#firechat .fifth { + width: 18.297872340425535%; + display: none; +} +#firechat .quarter { + width: 23.404255319148938%; +} +#firechat .threetenth { + width: 26.3829787235%; +} +#firechat .third { + width: 31.914893617021278%; +} +#firechat .twofifth { + width: 38.72340425531915%; +} +#firechat .half { + width: 48.93617021276596%; +} +#firechat .sevententh { + width: 58.7234042555%; +} +#firechat .threefifth { + width: 59.14893617021278%; +} +#firechat .twothird { + width: 65.95744680851064%; +} +#firechat .threequarter { + width: 74.46808510638297%; +} +#firechat .ninetenth { + width: 74.8936170215%; +} +#firechat .fourfifth { + width: 79.57446808510639%; +} +#firechat .fivesixth { + width: 82.9787234042553%; +} +#firechat .full { + width: 100%; +} +#firechat .clipped { + overflow: hidden; +} +#firechat strong { + font-weight: bold; +} +#firechat em { + font-style: italic; +} +#firechat label { + display: block; +} +#firechat a { + color: #005580; +} +#firechat a:visited, +#firechat a:hover, +#firechat a:active { + color: #005580; +} +#firechat p { + margin: 10px 0; +} +#firechat h1, +#firechat h2, +#firechat h3, +#firechat h4, +#firechat h5, +#firechat h6 { + margin: 10px 0; + font-family: inherit; + font-weight: bold; + line-height: 20px; + color: inherit; +} +#firechat h1, +#firechat h2, +#firechat h3 { + line-height: 40px; +} +#firechat h1 { + font-size: 38.5px; +} +#firechat h2 { + font-size: 31.5px; +} +#firechat h3 { + font-size: 24.5px; +} +#firechat h4 { + font-size: 17.5px; +} +#firechat h5 { + font-size: 14px; +} +#firechat h6 { + font-size: 11.9px; +} +#firechat small { + font-size: 90%; +} +/* Component: Tabs +============================================================ */ +#firechat .nav { + list-style: none; +} +#firechat .nav > li > a { + display: block; + background-color: #eeeeee; + text-decoration: none; + overflow: hidden; + white-space: nowrap; +} +#firechat .nav > li > a:hover, +#firechat .nav > li > a:focus { + background-color: #ffffff; +} +#firechat .nav-tabs { + border-bottom: 1px solid #ddd; + clear: both; +} +#firechat .nav-tabs > li { + float: left; + margin-bottom: -1px; + max-width: 45%; +} +#firechat .nav-tabs > li > a { + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -moz-border-radius-topleft: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-top-left-radius: 4px; + padding: 4px 8px; + margin-right: 2px; + line-height: 20px; + border: 1px solid transparent; + border-color: #cccccc; +} +#firechat .nav-tabs > .active > a, +#firechat .nav-tabs > .active > a:hover, +#firechat .nav-tabs > .active > a:focus { + border-bottom-color: transparent; + background-color: #ffffff; + cursor: default; +} +#firechat .tab-content { + overflow: auto; +} +#firechat .tab-content > .tab-pane { + display: none; +} +#firechat .tab-content > .active { + display: block; + background-color: #ffffff; +} +/* Component: Dropdowns +============================================================ */ +#firechat .caret { + display: inline-block; + width: 0; + height: 0; + vertical-align: top; + border-top: 4px solid #000000; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + content: ""; + margin-top: 8px; + margin-left: 2px; +} +#firechat .dropdown { + position: relative; +} +#firechat .dropdown-toggle { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + text-decoration: none; +} +#firechat .dropdown-toggle:focus, +#firechat .dropdown-toggle:active { + outline: none; + text-decoration: none; +} +#firechat .dropdown-toggle.btn { + padding: 4px 0 0; + height: 22px; +} +#firechat .dropdown-menu { + *zoom: 1; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + border-top-left-radius: 0; + z-index: 1000; + display: none; + float: left; + position: absolute; + top: 100%; + left: 0; + width: 100%; + background-color: #ffffff; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + border: 1px solid #ccc; + min-width: 98%; + padding: 0; + margin: -1px 0 0; +} +#firechat .dropdown-menu:before, +#firechat .dropdown-menu:after { + display: table; + content: ""; + line-height: 0; +} +#firechat .dropdown-menu:after { + clear: both; +} +#firechat .dropdown-menu ul { + background-color: #ffffff; + list-style: none; + overflow-y: scroll; + max-height: 300px; +} +#firechat .dropdown-menu ul > li > a { + display: block; + padding: 1px 1px 1px 3px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; +} +#firechat .dropdown-menu ul > li > a.highlight { + background-color: #d9edf7; +} +#firechat .dropdown-menu ul > li > a:hover, +#firechat .dropdown-menu ul > li > a:focus, +#firechat .dropdown-menu ul > .active > a, +#firechat .dropdown-menu ul > .active > a:hover, +#firechat .dropdown-menu ul > .active > a:focus { + text-decoration: none; + color: #000000; + background-color: #d9edf7; + outline: 0; +} +#firechat .dropdown-menu ul > .disabled > a, +#firechat .dropdown-menu ul > .disabled > a:hover, +#firechat .dropdown-menu ul > .disabled > a:focus { + color: #999999; + text-decoration: none; + background-color: transparent; + background-image: none; + cursor: default; +} +#firechat .dropdown-header { + position: relative; + width: 100%; + padding: 10px 0; + background-color: #eeeeee; + border-bottom: 1px solid #cccccc; +} +#firechat .dropdown-footer { + position: relative; + width: 100%; + padding: 10px 0px; + background-color: #eeeeee; + border-top: 1px solid #cccccc; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +#firechat .open { + *z-index: 1000; +} +#firechat .open > .dropdown-menu { + display: block; + border: 1px solid #cccccc; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + border-top-left-radius: 0; +} +#firechat .open > .dropdown-toggle { + outline: none; + text-decoration: none; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -moz-border-radius-topleft: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-top-left-radius: 4px; +} +/* Component: Prompts +============================================================ */ +#firechat .prompt-wrapper { + position: absolute; + z-index: 1000; +} +#firechat .prompt { + position: absolute; + z-index: 1001; + background-color: #ffffff; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.45); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.45); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.45); +} +#firechat .prompt-header { + padding: 4px 8px; + font-weight: bold; + background-color: #eeeeee; + border: 1px solid #cccccc; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -moz-border-radius-topleft: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-top-left-radius: 4px; +} +#firechat .prompt-header a.close { + opacity: 0.6; + font-size: 13px; + margin-top: 2px; +} +#firechat .prompt-header a.close:hover { + opacity: 0.9; +} +#firechat .prompt-body { + background-color: #ffffff; + padding: 4px 8px; + border-left: 1px solid #cccccc; + border-right: 1px solid #cccccc; +} +#firechat .prompt-footer { + padding: 4px 8px; + background-color: #eeeeee; + border: 1px solid #cccccc; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + border-top-left-radius: 0; +} +#firechat .prompt-background { + background-color: #333333; + border: 1px solid #333333; + opacity: 0.8; + z-index: 1000; + height: 100%; + width: 100%; +} +/* Component: Buttons +============================================================ */ +#firechat .btn { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + height: 24px; + display: inline-block; + *display: inline; + *zoom: 1; + padding: 2px 5px; + margin-bottom: 0; + text-align: center; + vertical-align: middle; + cursor: pointer; + color: #333333; + font-size: 12px; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + background-color: #f5f5f5; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #e6e6e6; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + border: 1px solid #cccccc; + *border: 0; + border-bottom-color: #b3b3b3; + *margin-left: .3em; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} +#firechat .btn:hover, +#firechat .btn:focus, +#firechat .btn:active, +#firechat .btn.active, +#firechat .btn.disabled, +#firechat .btn[disabled] { + color: #333333; + background-color: #e6e6e6; + *background-color: #d9d9d9; + outline: 0; +} +#firechat .btn:active, +#firechat .btn.active { + background-color: #cccccc; +} +#firechat .btn:first-child { + *margin-left: 0; +} +#firechat .btn:hover, +#firechat .btn:focus { + color: #333333; + text-decoration: none; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} +#firechat .btn.active, +#firechat .btn:active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} +#firechat .btn.disabled, +#firechat .btn[disabled] { + cursor: default; + background-image: none; + opacity: 0.65; + filter: alpha(opacity=65); +} +#firechat .btn.disabled:active, +#firechat .btn[disabled]:active { + -webkit-box-shadow: inherit; + -moz-box-shadow: inherit; + box-shadow: inherit; + background-color: #e6e6e6; +} +/* Component: Context Menu +============================================================ */ +#firechat .contextmenu { + position: fixed; + z-index: 1001; + min-width: 150px; + border: 1px solid #cccccc; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +#firechat .contextmenu ul { + background-color: #ffffff; + list-style: none; +} +#firechat .contextmenu ul > li > a { + display: block; + padding: 3px 10px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; +} +#firechat .contextmenu ul > li > a.highlight { + background-color: #d9edf7; +} +#firechat .contextmenu ul > li > a:hover, +#firechat .contextmenu ul > li > a:focus { + text-decoration: none; + color: #ffffff; + background-color: #0081c2; + outline: 0; +} +/* Custom Styles +============================================================ */ +#firechat { + padding: 0; + font-family: sans-serif; + font-size: 12px; + line-height: 18px; +} +#firechat input, +#firechat textarea { + width: 100%; + font-family: sans-serif; + font-size: 12px; + line-height: 18px; + padding: 2px 5px; + border: 1px solid #cccccc; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +#firechat input:-moz-placeholder, +#firechat textarea:-moz-placeholder { + color: #aaaaaa; +} +#firechat input:-ms-input-placeholder, +#firechat textarea:-ms-input-placeholder { + color: #aaaaaa; +} +#firechat input::-webkit-input-placeholder, +#firechat textarea::-webkit-input-placeholder { + color: #aaaaaa; +} +#firechat input[disabled], +#firechat textarea[disabled] { + background-color: #eeeeee; +} +#firechat input { + height: 24px; +} +#firechat textarea { + resize: none; + height: 40px; +} +#firechat .search-wrapper { + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; + border: 1px solid #cccccc; + margin: 0 5px; + padding: 2px 5px; + background: #ffffff; +} +#firechat .search-wrapper > input[type=text] { + padding-left: 0px; + border: none; +} +#firechat .search-wrapper > input[type=text]:focus, +#firechat .search-wrapper > input[type=text]:active { + outline: 0; +} +#firechat .chat { + overflow: auto; + -ms-overflow-x: hidden; + overflow-x: hidden; + position: absolute; + margin-bottom: 5px; + border: 1px solid #cccccc; + border-top: none; + overflow-y: scroll; + right: 11px; + left: 11px; + bottom: 70px; + top: 41px; +} +#firechat .chat textarea { + overflow: auto; + vertical-align: top; +} +#firechat .message { + color: #333; + padding: 3px 5px; + border-bottom: 1px solid #ccc; +} +#firechat .message.highlighted { + background-color: #d9edf7; +} +#firechat .message .name { + font-weight: bold; + overflow-x: hidden; +} +#firechat .message.message-self { + color: #2675ab; +} +#firechat .message:nth-child(odd) { + background-color: #f9f9f9; +} +#firechat .message:nth-child(odd).highlighted { + background-color: #d9edf7; +} +#firechat .message:nth-child(odd).message-local { + background-color: #effafc; +} +#firechat .message-content { + word-wrap: break-word; + padding-right: 45px; +} +#firechat .message-content.red { + color: red; +} +#firechat .message.message-notification .message-content { + font-style: italic; +} +#firechat ul::-webkit-scrollbar { + -webkit-appearance: none; + width: 7px; +} +#firechat ul::-webkit-scrollbar-thumb { + border-radius: 4px; + -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5); +} +#firechat #firechat-header { + padding: 6px 0 0 0; + height: 40px; + display: none; +} +#firechat #firechat-tabs { + height: 100%; +} +#firechat #firechat-tab-list { + background-color: #ffffff; +} +#firechat #firechat-tab-content { + width: 100%; + background-color: #ffffff; +} +#firechat .tab-pane-menu { + border: 1px solid #ccc; + border-top: none; + vertical-align: middle; + padding-bottom: 5px; + display: none; +} +#firechat .tab-pane-menu .dropdown { + margin: 5px 0 0 5px; +} +#firechat .tab-pane-menu > .icon { + margin: 5px 2px 0; +} +#firechat .icon { + display: inline-block; + *margin-right: .3em; + line-height: 20px; + vertical-align: middle; + background-repeat: no-repeat; + padding: 0; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL8AAAANEAYAAACoeGM7AAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAM80lEQVR42t2cZ4xWRRfHZ3dhwbK7CJZYYiOxV+wlUQzCKmBBsWPvYjQiaiyxYUwULLErltgrNpRF4q5iV0BRLFE0diUi7LIq6Pqw74f//rzO4Zm9d+5z9c37ni//3OfemXtm5sypc58q55xzrrpauHSpcOONheedJ9x9d2Hv3sLvvxfefbfw5puFf/5Zvr+8VFUl7Ozs/rkNNxTef79w222F77wjPOoo4ccfF/O+UDvGzTVEf8wH1zU1wlJJePTRwv33Fx57rPDnn/1+wbzzG+IXvrhmPUPzY/kJEc/HzqslK1fLLy8cMUK4667CFVYQ/vqr8PXXhU884f8eL6eXXKJ2wqSd3tDY2KOHc84NGqSRnnCC7tbVCdvbhRMnasWnTdt5Z+eca2pK6797Yh6ef1641lrCPfYQfv21UNwl62qv115b2Nws/PZb4d57C3/7LftalaOQ/C63nPCII4Tsg6228scHffqp8LHHhPfe6/8eu49feEH44YfCq64S/v67cMGC7tuvu65w6FDhllsKkS/0zoQJaZzMmSO+JaEzZmgkY8b88Ydzzs2b19HhnHNffSWJ6tVLM1cq/fKLrjXiUaPUrn9/XZ9yip6rqVmyxDnnnnrKvPbAA4V6TTJxP/zgT4zdyC+9JOzXz++PgceSVSS1tUJtE+c22si/f+21Pj9Wwd54o//8ZpsJd9xR2KtX9+8vmkLzcsABPt9z5wr32af88xiOf4oaGoSHH17M+/LKg203aJDwiy+EVh5DyHzuuWcxfDn31lvOOffMM7Nn6z1SsZ2dn30m/OQT4eefC7/8UvjBB0LaVzav7D873vfeE6LQISvv3Of50P6OJetgWFp5ZeFzz5V/b1bEEd1333x80g+O4mWXCXEQMDB33CG8/XYhBhuDmMZnOn30kZ5/+23nnGtpefNN55wbP96Xl/nzhYsWCdvauEbeQP1Of6US/XRZfDz8Bx8U9uwpPPFE4eOPC/EMVl9dOG6ccORI4Q03CA87LHbA5RcCwgO47TbhokXCYcOERCKQ7GJiMLiPokeQ2QCjRwtvukkY6zHg0V10kXDAAH++EIz77hM++aRwxRWFq64q3H57v9/+/YVPPy2cOFF47rnCNE8kll/Gi4eIAWU9v/vOnz8MA4qjb18hG51+2JiLF+ebX/hA4U+b5t+/7jrhAw8IkQ88WvnPiZzi4Q0eXL6/dEJhawaGDydmk4uEQmhu1kj79tVImb8RI8TZwIG0p78ddnAubOhDhIcPIXd4nnh4OHYYzPXXF7K/ed5GBLb/NLKRFOtMfyCZAiIKns8aSVp9xP4i8nv//Ti+icjgl0iDeUsjpKDSyJYeqqs1A+3taDBpkn79Qi5YW9vf5wXq0YP+1L5U6loAUjpW4WPhQhN00EFC2SXnDj1UiAF44w2hTWnEEqkcCIWJYkShQNbDIIJZZx2h9Xhs/7EpFDwCNs6UKf584tGQsiFCGTJEuMEG/jxBzBe/H3+8cJddhBiAZ58thl/eM2uW8MgjhWyAyy8XojhRUGuuKayvF7Jhf/pJ+O67wltvFU6dGscv78fTgg45RPjII+XbYZA23bT8/Vtu8ecBDy9MpHS0EROFr1B76lQp7r32su20EwYMkGSOG4dq4I0a4fDh9G9TQN0TKR0iB8aD3G+9tRDHDoPPenKf53GYiABiPWm7f046SUgKDs8aQwxlVfiQTVXh0BChxir+kDol5WPv24im+Ahcb6iu9jVnR4euGX9oXsLj7GKYHP68eUI8ANsRA7WKE8sNkUopdvgJsW0QUBbc3oewl6GQs9LUDgr85JOF5OZHjRKyESZNEp55ppBIC7IbxgoSkQzt2OgXX1wMv9RCFBAuG4HgSREKU0vB42Jjo6gxtPvtJ8TzTM91+kQOf731hHj4KHybA0bRK8B1bpNNhAqkE8OH40CKLZ3I4a+0kq6l8JuapPAbGx991Lm/r5s8+aFDlWOdOVMuS0ODNm5bm1RWSwsSrJY2FZVGRFYYYgwt+wO5EpeJ4eaa+zxPexQ+/Wcl+iFCxeBvs43QRujW048lu09Y16KI/m3Ewu8h/VS55w/5b7AGMrbW5lyXImQh8EhtqGBDGOu525QDnm5RhOcBzZ8vfO01IYIaev/Mmf5zpALsfSiv5bYLfeqpQhSUrYHY92GYbD+shx0XKSOKlrFk1xHFTQRon7M1FNtepaOErwsvFBIqkzKKlQ8MDoTnCpFKwyCi2FZbTYhDgydO6gfaaaesnFC0xQcUUQwlBi6VpPCHDJGKmDyZGWMldY2nPmmSP5NEdlkJRYSCZr7FRbiIzTX3eZ72tiiclZjf444rzyd6hkid9+fNCNhxvfJKvn5C/YVy9nZVYw89ZCdfI6TVEuCLCI4Zhp+Ojq6FIAdLFR0PjpQOFpyFsQMidw5ZxRo7ATaEI6fMgFD8FJsxXCgee00qSiWPJNfKaYLp08u/P1YQ4ZfxWgWDAcOjZmMR8G+3nZBTPbwffhYuFJ5zjhCPKi9ZBUzkh8dpBTkk2KSKLr1UiAIJEYYhK2GQIOto4OGj8NdYQ4hck8tnvkmtQSGDHKK6On8nUNtIPHwUvp05SeSwYTI1s2YpJhk5kliO/uP4Qe6IxMnhk9JhXqyCtQ4Oz9Oe/nwzl05EtJbI5fMeTs8QscIP+zwtEuA+csz+fvjhOH5tf6SSoZCjEipeKw5MVj12PemZ9tXVvunt2dOuHE+K06oqvbG2lp2ikS1ZIknv3burO45lXn+9kKItOfzQwhO6jR0r5PiXPaUQmzNHkMllIyhMMBudmgKnjqxnwnSssooQhWpTLOR6UVwc/4ul1lYhx7rwRBF4PBEEwxLFavhkeTmmN2aMEAG3ghdrqHx149z555efx9DGY37vvFNoPcxQe1v0SyObe8cRIYf/4otCPHwUPsVge4yXWgTEumWl9nZtsPp6irbk8OVyTJ5sYyRJdGOjkitJjUP3FyzwNzIOV1ZivdinFG3J4dt5twqW9eJ5nUFKDIB1xNIIh8p6oijUa64RcnyT2SLSJHWXdtqKcdD/BRcIifBiCf44TIGe2WILYaiGhWHFoaFGxnxtvnlWDvwZY/yLF6toy+8LF2rGamrESXK8WRIwe7YcjKYmzdD06Xpi7lzFWqR4/1pYeywMT5ncL4rpiiuE9tgnIRyeozP9ZyVSBNZyskHxpFFUCGroOCf36Zf28MtzRCqxOXPaM24iJxsJQQgOCgyiqM4GJvduKZRbjOWXXH+fPkKKiUQmOnyYRBrwZeeXCIxxQ/mPSfpEkZn3KZO+7PHiH38U2mKurQHY478ooHSSaZswgWOZum5uFra2iqPOTs0g93EE4NzWAKZM4RioIoDx4/PNE4YQxWNTs6HUgL1Pe3sMNCuF9qOVG2penIPHYOHokcJ8+WVhS4sQR4NaJP3F7luI9tSALBFxovhBW6uonFSORm7mzMEAzJjhnHMNDdLI9fXgq68651xdnZLYffpY+cpIhLzkUNNySd98I7QKFPs0cGC+4dv3sCAYIE4bhXJboWvwrruExxwjJPWStyjD8/b0AyEiCt4Wh6xBpCi+225CG5kUdWogxC/HMyldshGJ7IhcWIfTTxciLxhWqKgcJxuPc/h2nTAAaYrq4IP9dni01jCEiVM3nIdWdaizUxuTDdvaSgQQ6kfPNTVhKPgOgP7j5id0Dh9DbR05Unlch54PfQeQRuyrUM7ZOoxkCq6+WkikhiOBIQ/JEx7sGWfE8QlZOYKyOi7sS+uQgdn3ra/4LT/ZSS1razEEfBgoOf0rdRUaIB4rXyCedpqQFAu5KzxdPyBJPPRlj7d1Tw89JLznHiGeb+hDFVIWIQPll9SS3ynKUUwj5RWbI6Q/inWVEgJsUxRFKdKi+T3rLKEtshf9IZytPdgIgNM75PA5dWQ9fBAFE0+cu+dDGQyAHwGMHi0P/sordT12LB4+Ct//0Cbvh1zWINr9gAePIYe4thGCbU//sYRHn/fDLBwyawhDOfe8ESbvCx3/zHuKJp5Cil8cVlVlxcjXhv5yICvh4aPwreDlJY5nUay1Cj2rINn2lD4qPX6KwcPzRQHhKeP5WeQ+ng2nSyhCcv4fKip1EuIXRQlfXIMUn7nPl9SkhKhFFM2v7QcDEIoAQoiHbxV+5V/uEgGQAuJLXRQ7X/KS0sHD///8cpcIl/P69MN3GDh2RBzUvvjLFVI2NuK1einty+CsZDMY/z0qyuOvkGwIY8+zMuE2ZYGHj8JHUWQlm/sm1ENRZ81dWrShLEVAy1/20F9EEZrTQnk9HJCNYL+YLMrD+F/jF7IbnBQQNQDOi/MFJ9fk8O26xisMQmb7OykaagD+p/RLl3JNDj+U0gn13z0xLhQ0BtEqfLtP7TXP057+YvcDCpvDInwvYInUcnIqqjLKK2/IydlnF8NHfvq3FP9/ANgTCJ9z9ZF7AAAAAElFTkSuQmCC) no-repeat top left; + opacity: 0.3; + font-size: 22px; + font-family: Arial; + font-weight: bold; + overflow: hidden; +} +#firechat .icon.plus { + margin-top: 0; + vertical-align: top; + background: transparent; +} +#firechat .icon.search { + background-position: 0 0; + width: 13px; + height: 13px; +} +#firechat .icon.close { + background-position: -120px 0; + width: 13px; + height: 13px; +} +#firechat .icon.user-chat { + background-position: -138px 0; + width: 17px; + height: 13px; +} +#firechat .icon.user-group { + background-position: -18px 0; + width: 17px; + height: 13px; +} +#firechat .icon.user-mute { + background-position: -84px 0; + width: 13px; + height: 13px; +} +#firechat .icon.user-mute.red { + background-position: -102px 0; + width: 13px; + height: 13px; +} +#firechat .icon:hover, +#firechat .btn:hover > .icon { + opacity: 0.6; +} +#firechat a > .icon { + margin: 3px 1px; +} diff --git a/firechat/firechat-default.js b/firechat/firechat-default.js index f1c2824..40f7b87 100644 --- a/firechat/firechat-default.js +++ b/firechat/firechat-default.js @@ -7,7 +7,8 @@ this["FirechatDefaultTemplates"]["templates/layout-popout.html"] = function(obj) this["FirechatDefaultTemplates"]["templates/message-context-menu.html"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __j = Array.prototype.join;function print() { __p += __j.call(arguments, '') }with (obj) {__p += '
                          \n\n
                          ';}return __p}; -this["FirechatDefaultTemplates"]["templates/message.html"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __j = Array.prototype.join;function print() { __p += __j.call(arguments, '') }with (obj) {__p += '
                          \n
                          \n'; if (!disableActions) { ;__p += '\n\n'; } ;__p += '
                          \n
                          \n' +((__t = ( message )) == null ? '' : __t) +'\n
                          \n
                          ';}return __p}; +//this["FirechatDefaultTemplates"]["templates/message.html"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __j = Array.prototype.join;function print() { __p += __j.call(arguments, '') }with (obj) {__p += '
                          \n
                          \n'; if (!disableActions) { ;__p += '\n\n'; } ;__p += '
                          \n
                          \n' +((__t = ( message )) == null ? '' : __t) +'\n
                          \n
                          ';}return __p}; +this["FirechatDefaultTemplates"]["templates/message.html"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __j = Array.prototype.join;function print() { __p += __j.call(arguments, '') }with (obj) {__p += '
                          \n'; if (!disableActions) { ;__p += '\n\n'; } ;__p += '\n
                          \n' +((__t = ( message )) == null ? '' : __t) +'\n
                          \n
                          ';}return __p}; this["FirechatDefaultTemplates"]["templates/prompt-alert.html"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape;with (obj) {__p += '
                          \n
                          ' +__e( message ) +'
                          \n

                          \n\n

                          \n
                          ';}return __p}; @@ -42,15 +43,15 @@ this["FirechatDefaultTemplates"]["templates/user-search-list-item.html"] = funct if (typeof this !== "function") { throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); } - - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, + + var aArgs = Array.prototype.slice.call(arguments, 1), + fToBind = this, fNOP = function() {}, fBound = function() { return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); }; - + fNOP.prototype = this.prototype; fBound.prototype = new fNOP(); return fBound; @@ -58,14 +59,14 @@ this["FirechatDefaultTemplates"]["templates/user-search-list-item.html"] = funct } // Shim for Object.keys(...) - (Required by IE < 9, FF < 4) - Object.keys = Object.keys || function(oObj) { - var result = []; - for (var name in oObj) { + Object.keys = Object.keys || function(oObj) { + var result = []; + for (var name in oObj) { if (oObj.hasOwnProperty(name)) { - result.push(name); + result.push(name); } - } - return result; + } + return result; }; })(); @@ -406,6 +407,8 @@ this["FirechatDefaultTemplates"]["templates/user-search-list-item.html"] = funct }); // Set presence bit for the room and queue it for removal on disconnect. + console.log("self session: " + self._sessionId); + var presenceRef = self._firebase.child('room-users').child(roomId).child(self._userId).child(self._sessionId); self._queuePresenceOperation(presenceRef, { id: self._userId, @@ -1755,7 +1758,7 @@ this["FirechatDefaultTemplates"]["templates/user-search-list-item.html"] = funct var date = (timestamp) ? new Date(timestamp) : new Date(), hours = date.getHours() || 12, minutes = '' + date.getMinutes(), - ampm = (date.getHours() >= 12) ? 'pm' : 'am'; + ampm = (date.getHours() >= 12) ? 'pm' : 'am'; hours = (hours > 12) ? hours - 12 : hours; minutes = (minutes.length < 2) ? '0' + minutes : minutes; diff --git a/fiwest.html b/fiwest.html new file mode 100644 index 0000000..ccfe6f8 --- /dev/null +++ b/fiwest.html @@ -0,0 +1,1904 @@ + + + + + How to Find Product-Market Fit | Justin Wilcox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          +
                          +
                          How to Find Product-Market Fit with Justin Wilcox
                          +
                          + +
                          + +
                          +
                          +
                          +
                          + +
                          + +
                          + +
                          +
                          + +
                          +
                          +

                          Questions: Ask and up vote.

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

                            Welcome to How to Find Product-Market Fit!

                            You can take notes during the workshop here. +

                            +   +

                            Takeaways

                            +

                            +

                            - Declaring Victory: What's your Victory?

                            +

                            +   +

                            - Product-Market Fit Assessment:

                            +
                              +
                            • Phase are you in:
                            • +
                            • Riskiest Assumption:
                            • +
                            • Next step:
                            • +

                              +   + +

                              Where are your Early Adopters:

                              +

                              +
                            +
                            +
                            +
                            + +
                            +
                            + + + + +
                            +
                            +
                            + +
                            +
                            +
                            + +
                            +
                            + + + + +
                            + +
                            +
                            + + +
                            Write here
                            +
                            Write here
                            +
                            Write here
                            +
                            #
                            +
                            of things here
                            +
                            Write here
                            +
                            Write here
                            + +
                            +
                            + +
                            +
                            +
                            +
                            +
                            + +
                            +
                            +
                            + +
                            + +
                            +
                            Defining Product-Market Fit
                            +
                            + Ready to define Product-Market Fit? +
                            +
                            + +
                            +
                            Declaring Victory Worksheet
                            +
                            + This worksheet will walk you through defining Product-Market Fit. +
                            +
                            + +
                            +
                            Today's Date
                            +
                              +
                            • +
                            +
                            + Start by writing in today's date in the field on the right.

                            +
                            +
                            + + + + + +
                            +
                            What's your Product?
                            +
                            +

                            Write in the product or service that you would like to build.

                            + +
                            +
                              +
                            • +
                            +
                            + +
                            +
                            Who's your Customer?
                            +
                            + Write in the customers or people whom you would like to serve.

                            +
                            +
                              +
                            • +
                            +
                            + +
                            +
                            Fold on the Dotted Line
                            +
                            + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
                            +
                              +
                            +
                            + +
                            +
                            Your Promise
                            +
                            + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                              +
                            1. Even if you never get to build your product and
                            2. +
                            3. Even if you are not able to help the people you want to help...
                            4. +
                            +
                            You are still going to achieve victory.
                            +
                            +
                              +
                            +
                            + + + +
                            +
                            Enter your Victory
                            +
                            +

                            Write in your measurable Victory metric.

                            + +
                            +
                              +
                            • +
                            • +
                            +
                            + +
                            +
                            What Emotions are you Seeking?
                            +
                            + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

                            + +
                            +
                              +
                            • +
                            +
                            + +
                            +
                            Make it Official
                            +
                            +

                            Congratulations! You have your victory.

                            + + + +
                            +
                              +
                            • +
                            +
                            + +
                            +
                            What are your Co-Founders' Victories?
                            +
                            + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

                            + +
                            +
                            + + + +
                            +
                            Find your FOCUS
                            +
                            +

                            Congratulations, you've taken the most important step of your startup journey, you've Declared Victory and in doing so, defined your Product-Market Fit. +

                            Write your Victory Declaration in your Notes tab!
                            + +
                            +
                            + +
                            + +
                            + +
                            +
                            + + + + +
                            +
                            +
                            + +
                            +
                            + + +
                            Your customer segment
                            +
                            Your customer's problem (in their words)
                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + +
                            1. +
                            2. +
                            3. +
                            4. +
                            5. +
                            +
                            +
                            1. +
                            2. +
                            3. +
                            4. +
                            5. +
                            +
                            +
                            +
                            +
                            +
                            +
                            + +
                            +
                            + + + + +
                            +
                            +
                            + +
                            +

                            Product-Market Fit Assessment

                            This exercise will tell you: +
                              +
                            1. What phase of Product-Market Fit you're in
                            2. +
                            3. Your startup's "Riskiest Assumption"
                            4. +
                            5. Your next step to test that assumption
                            6. +
                            +

                            Just answer these questions...

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

                            Have you launched your product?

                            +
                            +
                            +
                              +
                            • No30
                            • +

                              +
                            • Yes2
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            +

                            Are customers paying for it?

                            +
                            +
                            +
                              +
                            • No23
                            • +

                              +
                            • Yes3
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            +

                            Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                            +
                            +
                            +
                              +
                            • No5
                            • +

                              +
                            • Yes4
                            • +

                              +
                            • Not sure20
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            + Congrats! You're on the path to Product-Market Fit. +
                            +
                            +
                            + Keep doing what you're doing! +
                            +
                            +
                            +
                            +
                            +
                            +

                            Why aren't you on track to acheive Product-Market Fit?

                            +
                            +
                            +
                              +
                            • Not enough customers6
                            • +

                              +
                            • Customer Lifetime Value is too low16
                            • +

                              +
                            +
                            Not sure? Go with your gut. Eventually you'll test both.
                            +
                            +
                            +
                            +
                            +
                            +

                            Why don't you have enough customers?

                            +
                            +
                            +
                              +
                            • Having trouble finding them7
                            • +

                              +
                            • Conversion rate it too low10
                            • +

                              +
                            • Customer segment is too small14
                            • +

                              +
                            • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                            • +

                              +
                            +
                            Not sure? Starting at the top, pick the first answer you think could be the reason.
                            +
                            +
                            +
                            +
                            +
                            +

                            Where are you looking for customers?

                            +
                            +
                            +
                              +
                            • Places I think my customers are.8
                            • +

                              +
                            • Places customers have told me they are.9
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption is: You know where your customers look for solutions to their problems. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Finding Early Adopters for your product.
                            +
                            Your Your Next Step: Interview customers to validate where they look for solutions.
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: Understand who your Early Adopters are, and where to find them, by contrasting their behavior with your Early Majority, Late Majority, etc.

                            Use this information + to make your interviews easier and faster to get.
                            +
                            +

                            Found in FOCUS Workbook 1...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: Your marketing channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Offer Testing - You can Reach your Early Adopters.
                            +
                            Your Next Step: Test alternative channels to determine potential customer segment size.
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This spreadsheet will show you if your segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, data. + +

                            You'll also be able to estimate the size of your marketing channels, conversion rates, and price points to determine the best approach for you to achieve Product-Market Fit. +
                            +
                            +

                            Found in FOCUS Workbook 2...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            What emotions are you evoking in your Call to Action?

                            +
                            +
                            +
                              +
                            • I'm not evoking emotions in my Call to Action11
                            • +

                              +
                            • Emotions I think my customers are experiencing12
                            • +

                              +
                            • Emotions my customers have told me they are experiencing13
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: You understand what your customers are trying to accomplish in their roles. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Finding Early Adopters for your product.
                            +
                            Your Next Step: Interview your customers to understand what problems they are actively trying to solve. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This exercise will help you brainstorm specific groups of customers you can serve by focusing on their problems. + +

                            Everything is easier when you center your attention on your customer's problems: asking for interviews, marketing, sales, product development, etc. Take this step now, and you'll move much faster through the rest + of your journey. +
                            +
                            +

                            Found in FOCUS Workbook 1...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: You understand your customer's emotional desires. +
                            +
                            +
                            +
                            Product-Market Fit Phase: .
                            +
                            Your Next Step: Interview your customers to understand their emotional desires. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: Understand who your Early Adopters are, and where to find them, by contrasting their behavior with your Early Majority, Late Majority, etc.

                            Use this information + to make your interviews easier and faster to get.
                            +
                            +

                            Found in FOCUS Workbook 1...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: Your marketing copy reasonates emotionally with your customers. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Offer Testing - You can Reach your Early Adopters.
                            +
                            Your Next Step: Test multiple versions of your marketing copy/Call to Action. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This exercise will help you identify the emotions your customers' emotions. + +

                            By identifying and addressing your customers' emotional needs, you'll significantly increase your conversion rate. +
                            +
                            +

                            Found in FOCUS Workbook 2...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: There are large enough customer segments for you to achieve Product-Market Fit. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Scaling to Product-Market Fit.
                            +
                            Your Next Step: Identify, size and test related customer segments. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This exercise will show you how to transition from your Early Adopters to your Early Majority segment. + +

                            By acquiring secondary and tertiary segments you'll be able to accelerate your path to Product-Market Fit. + +
                            +
                            +

                            Found in FOCUS Workbook 5...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: Your solution is solving your customer's problem well enough, and they are incentivized enough, to share your product with others. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Utility Testing - You can Satisfy your Early Adopters.
                            +
                            Your Next Step: Increase your Viral Coefficent (i.e. K Factor). +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This exercise will help you brainstorm and prioritize ways to increase the virality of your product.
                            +
                            +

                            Found in FOCUS Workbook 4...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            Why is your Customer Lifetime Value too low?

                            +
                            +
                            +
                              +
                            • Customer churn is too high (i.e. they cancel your service too soon)17
                            • +

                              +
                            • Price is too low18
                            • +

                              +
                            • Cost of customer acquisition is too high19
                            • +

                              +
                            +
                            Not sure? Starting at the top, pick the first answer you think could be the reason.
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: Your solution is solving your customer's problem well enough that they'll continue paying for it. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Utility Testing - You can Satisfy your Early Adopters.
                            +
                            Your Next Step: Test ways to increase the value your solution is providing to customers. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This exercise will provide four different techniques to increase your Customer Lifetime Value making it more likely you'll achieve Product-Market Fit..
                            +
                            +

                            Found in FOCUS Workbook 4...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: Customers will pay enough to solve their problem for you to achieve Product-Market Fit. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Currency Testing - Your Early Adopters will Pay you.
                            +
                            Your Next Step: Optimize your price via price testing. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: Whether you're B2B or B2C, this exercise will show how to optimize your price - without upsetting your customers!
                            +
                            +

                            Found in FOCUS Workbook 3...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: You can lower your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Offer Testing: You can Reach your Early Adopters.
                            +
                            Your Next Step: Test alternative channels to determine your optimal acquisition ROI. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This spreadsheet will show you what combination of marketing channels, price point, and conversion rates you'll need to acheive in order to find Product-Market Fit. +
                            +
                            +

                            Found in FOCUS Workbook 2...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            Have you defined a metric that represents when you have acheived Product-Market Fit?

                            +
                            +
                            +
                              +
                            • No21
                            • +

                              +
                            • Yes22
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: You know what Product-Market Fit means for you and your team. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Finding Early Adopters for your product.
                            +
                            Your Next Step: Define Product-Market Fit for you and your team. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: You can't achieve Product-Market Fit until you've defined it for you and your team. + +

                            This exercise will walk your entire team through the process of defining the most important metric of your startup...what success looks like.
                            +
                            +

                            Found in FOCUS Workbook 1...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: The problem you're solving will lead you on a path to Product-Market Fit. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Currency Testing - Your Early Adopters will Pay you.
                            +
                            Your Next Step: Calculate your the size of this market to determine if Product-Market Fit is achievable. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This spreadsheet will tell you how large your segment has the potential to be and exactly what conversion rates you'll need to achieve in order to find Product-Market + Fit. +
                            +
                            +

                            Found in FOCUS Workbook 3...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            Are customers using the product?

                            +
                            +
                            +
                              +
                            • No41
                            • +

                              +
                            • Yes24
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            +

                            Why aren't your customers paying to use your product?

                            +
                            +
                            +
                              +
                            • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
                            • +

                              +
                            • Going to monetize after reaching critical mass26
                            • +

                              +
                            • Pursuing a freemium model and haven't built paid features yet25
                            • +

                              +
                            • Tried charging but no one would pay10
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: Customers will pay you enough that you'll achieve Product-Market Fit. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Currency Testing: Your Early Adopters will Pay you.
                            +
                            Your Next Step: Charge customers via pre-orders or Letters of Intent for future functionality. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: Whether you're B2B or B2C, this exercise will show you how to pre-sell a solution to a problem - without deceiving or disappointing your customers.
                            +
                            +

                            Found in FOCUS Workbook 3...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                            +
                            +
                            +
                              +
                            • No28
                            • +

                              +
                            • Yes38
                            • +

                              +
                            • Not sure20
                            • +

                              +
                            +
                            +
                            +
                            + +
                            +
                            +
                            +

                            Why aren't enough customers using for you to achieve Product-Market Fit?

                            +
                            +
                            +
                              +
                            • Having trouble finding them7
                            • +

                              +
                            • Conversion rate it too low10
                            • +

                              +
                            • Customer segment is too small14
                            • +

                              +
                            • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                            • +

                              +
                            +
                            Not sure? Starting at the top, pick the first answer you think could be the reason.
                            +
                            +
                            +
                            +
                            +
                            +

                            Have you defined a metric that represents when you have acheived Product-Market Fit?

                            +
                            +
                            +
                              +
                            • No21
                            • +

                              +
                            • Yes22
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            +

                            Have you generated any pre-sales or signed Letters of Intent?

                            +
                            +
                            +
                              +
                            • No35
                            • +

                              +
                            • Yes31
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            +

                            Are enough customers pre-paying for it that, if you solve their problems, you'll achieve Product-Market Fit?

                            +
                            +
                            +
                              +
                            • No5
                            • +

                              +
                            • Yes32
                            • +

                              +
                            • Not sure20
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            +

                            Why haven't you launched the product yet?

                            +
                            +
                            +
                              +
                            • No development team33
                            • +

                              +
                            • Solution is still under development33
                            • +

                              +
                            • Testing the solution privately before making it available publicly34
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: You can solve your customers' problems. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Utility Testing - You can Satisfy your Early Adopters.
                            +
                            Your Next Step: Test a manual solution. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This exercise will walk you through how to create a manual solution in the most efficient way possible.
                            +
                            +

                            Found in FOCUS Workbook 4...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: You can solve your customers' problems at scale. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Scaling to Fit - You can achieve Product-Market Fit.
                            +
                            Your Next Step: Test an automated solution. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This exercise will help you transition from a manual solution to an automated one in the most efficient way possible.
                            +
                            +

                            Found in FOCUS Workbook 5...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            Have you identified a problem at least 60% of your customers are actively trying to solve?

                            +
                            +
                            +
                              +
                            • No40
                            • +

                              +
                            • Yes36
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            +

                            If you solve the problem, will you achieve Product-Market Fit?

                            +
                            +
                            +
                              +
                            • No5
                            • +

                              +
                            • Yes37
                            • +

                              +
                            • Not sure39
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            +

                            Why aren't you collecting pre-orders or Letters of Intent?

                            +
                            +
                            +
                              +
                            • Can't finding customers to pre-sell7
                            • +

                              +
                            • Don't know how38
                            • +

                              +
                            • Tried but no one bought10
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: Customers will pay you enough that you'll achieve Product-Market Fit. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Currency Testing - Your Early Adopters will Pay you.
                            +
                            Your Next Step: Charge customers via pre-orders or Letters of Intent for future functionality. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This exercise will introduce you to Currency Testing so you can confidently validate whether customers will pay you enough for you to achieve Product-Market Fit.
                            +
                            +

                            Found in FOCUS Workbook 3...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            Have you defined a metric that represents when you have acheived Product-Market Fit?

                            +
                            +
                            +
                              +
                            • No21
                            • +

                              +
                            • Yes9
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: Customers are actively trying to solve a problem your product will solve for them. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Finding Early Adopters for your product.
                            +
                            Your Next Step: Interview customers to determine what problems they are actively trying to solve. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: Understand who your Early Adopters are, and where to find them, by contrasting their behavior with your Early Majority, Late Majority, etc.

                            Use this information + to make your interviews easier and faster to get.
                            +
                            +

                            Found in FOCUS Workbook 1...

                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            +
                            +

                            Why aren't customers using your product?

                            +
                            +
                            +
                              +
                            • I'm not sure how/where to find customers to tell about it8
                            • +

                              +
                            • I've told them about it, but they don't really use it11
                            • +

                              +
                            • Customers use it a little, but then they stop42
                            • +

                              +
                            +
                            +
                            +
                            +
                            +
                            + Your Riskiest Assumption: Your product solves your customers' problems. +
                            +
                            +
                            +
                            Product-Market Fit Phase: Utility Testing - You can Satisfy your Early Adopters.
                            +
                            Your Next Step: Test ways to increase the value your solution is providing to customers. +
                            +
                            + This will help... +
                            + +
                            +

                            Recommended FOCUS Exercise...

                            + +
                            +
                            Description: This exercise will provide four different techniques to increase your Customer Lifetime Value making it more likely you'll achieve Product-Market Fit..
                            +
                            +

                            Found in FOCUS Workbook 4...

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

                            Bonus #1

                            +
                            +
                            +
                            +

                            + FREE Customer Interview Email Course
                            +

                            +
                            + You'll learn... +
                              +
                            • Which customers to ask for interviews
                            • +
                            • A cold email script that works to get interviews
                            • +
                            • How to analyze your interview answers
                            • +
                            +
                            +
                            +
                            +
                            +

                            Bonus #2

                            +
                            +
                            +
                            +

                            FOCUS Framework

                            +

                            $20 Off Launch-Day Coupon

                            + +
                            + +
                            +
                            +

                            Crowdfunding on May 3rd

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

                            How likely would you be to recommend this workshop to a friend?

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

                            What's one thing we can improve next time?

                            +
                            +
                            + +
                            +
                            + +
                            +
                            +

                            What was your favorite part of the workshop?

                            +
                            +
                            + +
                            + +
                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            + + +
                            + +
                            + + + + + + diff --git a/fiwest.js b/fiwest.js new file mode 100644 index 0000000..58b2527 --- /dev/null +++ b/fiwest.js @@ -0,0 +1,1217 @@ +var firebaseRoot = "https://cdlwebshops.firebaseio.com"; + +var rootRef = new Firebase(firebaseRoot); +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var emailsRef = new Firebase(firebaseRoot + "/emails"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); +var notesRef = new Firebase(firebaseRoot + "/notes"); + +var loggedInUserId; +var questionPad, responsePad; + +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +var publicChat; + +var firstName = null; +var emailAddress = null; + +var lastSoloPriority = 0; +var lastQuestionAnswered; + +function getEnrollees() { + enrolledRef.once('value', function(enrolledSnap) { + enrolledSnap.forEach(function(snapshot) { + console.log(snapshot.val().email); + }); + }); +} + +function init() { + firstName = getParameterByName('firstName'); + emailAddress = getParameterByName('attendeeEmail'); + + $('.carousel').carousel({ + interval: 5000 + }); + + if (firstName == null /*|| attendeeEmail == null*/) { + initModal(); + return; + } + + // publicChat = new FirechatUI(publicChatRef, document.getElementById("public-firechat-wrapper"), { + // numMaxMessages: 101 + // }); + + // publicChat.maxLengthMessage = 1024; + // publicChat.numMaxMessages = 500; + // + // publicChat.on('room-enter', function() { + // stylizeChatRooms(); + // }); + + logInToChat(publicChatRef, publicChat, PUBLIC_CHAT_ROOM_ID, false); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + $("#newPartner").hide(); + $("#newPartner").click(function () { + leavePartnership(); + }); + + $('.meetYourPartnerMe').on("input", function() { + updateMyInfo($(this)); + }); + + keepTabsOnTabs(); + initEnrollForm(); + setupFeedbackForm(); + //setupInterviewScriptGenerator(); + //setupQuizzes(); + + setupiFrames(); + + if (isWebViewerMode()) { + // load video stream + var youTubeIFrame = $('.youtube-iframe'); + youTubeIFrame.attr("src", youTubeIFrame.attr("data-youtube-src")); + } + else { + // get ride of video holder + $('.left-column .top-row').hide(); + $('.left-column .bottom-row').addClass("full-height").removeClass("bottom-row"); + } + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } +} + +function setupTextEditors() { + + tinymce.init({ + selector:'.text-editor', + menubar: false, + plugins: 'autoresize autosave', + autosave_interval: "2s", + setup : function(ed) { + ed.on('init', function() + { + this.getDoc().body.style.fontSize = '16px'; + this.getDoc().body.style.fontName = 'Lato'; + // ed.target.editorCommands.execCommand("fontSize", false, "2"); + // ed.target.editorCommands.execCommand("fontName", false, "Lato"); + }); + } + }); +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function() { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function() { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#enrollForm").submit(function(event) { + event.preventDefault(); + + enrolledRef.child(loggedInUserId).set({email: $('#enrollEmail').val()}); + $('#enrollSuccessAlert').show(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function isWebViewerMode() { + return !isSimpleMode() && document.URL.indexOf("vip.html") == -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: true}); + exercisesRef.child("active").update({exercise: exerciseName}); + }); + + $(".showTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: true}); + }); + + $(".hideTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: false}); + }); + + $(".soloTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each( function(index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({exercise: tabName.replace("Tab", '')}); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function(exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each( function(index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.uid).once('value', function(snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function(snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "That's not your name", + validators: { + notEmpty: { + message: 'We need your name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We can do names between 2 and 20 characters' + } + } + }, + attendeeEmail: { + message: "Hmm, something doesn't look right.", + validators: { + notEmpty: { + message: 'Please enter your email address' + }, + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $( "#welcomeForm" ).submit(function(event) { + firstName = $("#attendeeName").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function() { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function logInToChat(ref, chatUI, roomId, getPartner) { + ref.authAnonymously(function(error, authData) { + if (error) { + console.log("Login Failed!", error); + return; + } + + console.log("Authenticated successfully with payload: ", authData); + + var user = authData; + loggedInUserId = user.uid; + + user.firstName = firstName; + //chatUI.setUser(user.uid, firstName); + + //enterRoomAfterUserSessionCreated(chatUI, roomId); + + emailsRef.child(loggedInUserId).set({email: emailAddress}); + $('#enrollEmail').val(emailAddress); + + + setupTextEditors(); + + if (getPartner) { + searchForPartner(user); + } + + authUserName = firstName; + fbid = user.uid; + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestion; + + allQuestionsSnapshot.forEach(function(snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
                          • "); + var divmediabody = $("
                            "); + var divmedia = $("
                            "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = "" + answerText + " " + hideText + ""; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 1; + var votesElement = "" + voteLink + ": "+ voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
                            "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
                            " + userNameElement + "
                            " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestion = questionElement; + divmediabody2.addClass('bg-warning'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-success'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-primary'); + } + else { + divmediabody2.addClass('this-class-does-not-exist'); + } + + questionList.prepend(questionElement); + } + }); + + questionList.prepend(activeQuestion); + }); + }); +} + +// var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { +// if (user) { +// loggedInUserId = user.uid; +// +// user.firstName = firstName; +// chatUI.setUser(user.uid, firstName); +// +// if (roomId != null) { +// setTimeout(function() { +// console.log("About to enter room. User: " + JSON.stringify(user) + ". Room: " + roomId); +// chatUI._chat.enterRoom(roomId); +// }, 500); +// } +// +// if (getPartner) { +// searchForPartner(user); +// } +// +// authUserName = firstName; +// fbid = user.uid; +// +// // simple should see all of the questions, everyone else should only see the unhidden ones +// var startAtNum = isSimpleMode() ? -1000000 : 1; +// +// // Add a callback that is triggered for each chat question. +// questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { +// questionList.empty(); +// +// var activeQuestion; +// +// allQuestionsSnapshot.forEach(function(snapshot) { +// +// //GET DATA +// var questionId = snapshot.key(); +// var data = snapshot.val(); +// var fbid_d = data.fbid; +// var username_d = data.name; +// var question_d = data.text; +// var date_d = data.currentdate; +// var votes_d = data.votes; +// +// divdir = ""; +// +// //CREATE ELEMENTS question & SANITIZE TEXT +// var questionElement = $("
                          • "); +// var divmediabody = $("
                            "); +// var divmedia = $("
                            "); +// +// var voteLink; +// var userAskedQuestion = fbid_d == fbid; +// +// if (isSimpleMode()) { +// var answerText = data.isActive ? "Unanswer" : "Answer"; +// var hideText = data.votes <= 0 ? "Show" : "Hide"; +// +// voteLink = "" + answerText + " " + hideText + ""; +// } +// else if (userAskedQuestion) { +// // This user submitted the question +// voteLink = "Delete"; +// } +// else { +// var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; +// voteLink = "" + voteText + ""; +// } +// +// var voteCount = data.votes ? data.votes : 1; +// var votesElement = "" + voteLink + ": "+ voteCount + ""; +// var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; +// var dateElement = " " + date_d + ""; +// +// var divmediabody2 = $("
                            "); +// questionElement.append(divmediabody); +// divmediabody.append(divmedia); +// //divmedia.append(a); +// //divmedia.append(votesElement); +// divmedia.append(divmediabody2); +// +// var usernamediv = $(""); +// divmediabody2.html(question_d); +// +// divmediabody2.append(usernamediv); +// usernamediv.html("
                            " + userNameElement + "
                            " + votesElement); +// +// //ADD question +// if (data.isActive) { +// activeQuestion = questionElement; +// divmediabody2.addClass('bg-danger'); +// } +// else { +// if (userAskedQuestion) { +// divmediabody2.addClass('bg-success'); +// // divmediabody2.css('background', "#476982"); +// // usernamediv.css('color', "#CCC") +// } +// else if (data.votes > 0) { +// // divmediabody2.css('background', "#73B3D7"); +// divmediabody2.addClass('bg-info'); +// } +// else { +// divmediabody2.addClass('bg-warning'); +// } +// +// questionList.prepend(questionElement); +// } +// }); +// +// questionList.prepend(activeQuestion); +// }); +// +// } else { +// simpleLogin.login('anonymous', { +// rememberMe: true +// }); +// } +// }); +// } + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


                            You'll see what your partner types, as she/he does.


                            Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


                            (Delete this too :)" : ""); + + questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                             
                            Note: your partner will be able to see your text as you type it.
                             
                            Try editing this text!
                             
                             
                            2. Secretly pick a company below to pitch:
                             

                            • AirBnB
                            • Pampers (diapers)
                            • Twitter
                            • Facebook
                            • Subway (sandwiches)
                            • Instagram
                            • Disney
                            • SnapChat
                            • Angry Birds (Rovio)
                            • RedBull
                             
                            3. Fill out the pitch template for the company you're pitching:
                             
                            - Problem:
                             
                             
                             
                            - Solution:
                             
                             
                             
                            - Market:
                             
                             
                             
                            - Business Model:
                             
                             
                             
                            -------------------------------------------------------
                             
                            4. Guess which company your partner is pitching:
                             
                             
                             
                            5. Which elements of your partner's pitch could be improved? 
                             
                             
                            " : ""); + responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                             
                            Note: your partner will be able to see your text as you type it.
                             
                            Try editing this text!
                             
                             
                            2. Secretly pick a company below to pitch:
                             
                            • AirBnB
                            • Pampers (diapers)
                            • Twitter
                            • Facebook
                            • Subway (sandwiches)
                            • Instagram
                            • Disney
                            • SnapChat
                            • Angry Birds (Rovio)
                            • RedBull
                             
                            3. Fill out the pitch template for the company you're pitching:
                             
                            - Problem:
                             
                             
                             
                            - Solution:
                             
                             
                             
                            - Market:
                             
                             
                             
                            - Business Model:
                             
                             
                             
                            -------------------------------------------------------
                             
                            4. Guess which company your partner is pitching:
                             
                             
                             
                            5. Which elements of your partner's pitch could be improved? 
                             
                             
                            " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(useruser.uid, ""); + + attendeesRef.child(user.uid).update(user); + + leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function(partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + $("#partnerName").html("Your partner isn't available. Let's find another for you!"); + + return; + } + else if (part.room != null) { + console.log("Entering our partner chat room: " + part.room); + publicChat._chat.enterRoom(part.room); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.uid).update(user); + } + }); + + soloRef.off('child_changed'); + + // intro partners + $("#partnerName").html("Say hi to your workshop partner, !"); + $('.partnerName').text(user.partnerName); + $("#newPartner").show(); + + getMeetYourPartnerUpdates(user); +} + +function lookingForPartnerUI() { + $("#partnerName").html("Looking for a partner for you..."); + $("#newPartner").hide(); +} + +function joinSoloList(user) { + soloRef.child(user.uid).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.uid; + user.responsesPad = "r-" + user.uid; + + // store my pad addresses + attendeesRef.child(user.uid).update(user); + + //loadFirepads(user, true); + + soloRef.on('child_changed', function(soloSnap) { + var solo = soloSnap.val(); + + if (solo.id != user.uid) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + soloRef.child(user.uid).remove(function(error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function(roomId) { + console.log('Created our partnership chat room'); + partnershipsRef.child(solo.partnership).set({"room": roomId}); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + }); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function(solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function(soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.id == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.id).transaction(function(currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.uid.localeCompare(solo.id) < 0) { + partnership = user.uid + solo.id; + } + else { + partnership = solo.id + user.uid; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.id; + user.responsesPad = "r-" + solo.id; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function(){confirmPartnershipAccepted(user)}, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function(partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.uid, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function(error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + //loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.uid).transaction(function(currentData) { + + // Always return null because we want off this list + return null; + + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.uid).once('value', function(attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.uid).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + console.log("My user id is: " + user.uid); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership() { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function(attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + searchForSolos(user); + } + else { + console.log("This user is requesting to leave partnership."); + lookingForPartnerUI(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function(error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(true); + } + }); + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function(attendeeSnap) { + var user = attendeeSnap.val(); + + leavePrivateChatRooms(); + clearPartnerFromUser(user); + unloadFirepads(); + + attendeesRef.child(user.uid).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +$(document).ready( function() { + init(); +}); + +function hideQuestion(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function(question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + question.votes = question.votes * -1; + question.isActive = 0; + return question; + }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + if (lastQuestionAnswered) { + questionsRef.child(lastQuestionAnswered).update({ isActive: false}); + } + + lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false}); + + lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function(confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function(currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null){ + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: 1 }); + + $("#question-txt").val(''); + +} diff --git a/focuscon.html b/focuscon.html new file mode 100644 index 0000000..5d3c3da --- /dev/null +++ b/focuscon.html @@ -0,0 +1,2572 @@ + + + + + FOCUS Con: Mastering Customer Interviews + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            +
                            +
                            FOCUS Con: Mastering Customer Interviews by Justin Wilcox, Founder Institute and Startup Weekend
                            +
                            + +
                            + +
                            +
                            +
                            +
                            + +
                            + +
                            + +
                            +
                            + +
                            +
                            +

                            Questions: Ask Below

                            +

                            To Chat: Join us on Slack

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

                              Welcome to the Workshop!

                              You can take notes during the workshop here. +

                              +   +

                              5 Phases of Product-Market Fit

                              +
                                +
                              1. F
                              2. +
                              3. O
                              4. +
                              5. C
                              6. +
                              7. U
                              8. +
                              9. S
                              10. +
                              +

                              +

                              Takeaways

                              +

                              + + +

                              Where are your Early Adopters:

                              +

                              +
                              +
                              +
                              +
                              + +
                              +
                              + + + + +
                              +
                              +
                              + +
                              +
                              +
                              + + +
                              +
                              + + + + +
                              +
                              +
                              +
                              +
                              +
                              + +
                              +
                              + + + + +
                              +
                              +
                              +
                              +
                              +
                              Want to grow your network?
                              + + + + +
                              +
                              +
                              + +
                              +
                              +
                              +
                              + +
                              +
                              + + + + +
                              +
                              +
                              + +
                              +
                              +
                              + +
                              + +
                              +
                              + + + + + + + + + + + +
                              +
                              + +
                              + +
                              + +
                              +
                              + + + + +
                              + +
                              +
                              + + +
                              +
                              +
                              +
                              +
                              +
                              +
                              + + +
                              +
                              + +
                              +
                              +
                              +
                              +
                              + +
                              +
                              +
                              + +
                              + +
                              +
                              Defining Product-Market Fit
                              +
                              + Ready to define Product-Market Fit? +
                              +
                              + +
                              +
                              Declaring Victory Worksheet
                              +
                              + This worksheet will walk you through defining Product-Market Fit. +
                              +
                              + +
                              +
                              Today's Date
                              +
                                +
                              • +
                              +
                              + Start by writing in today's date in the field on the right.

                              +
                              +
                              + + + + + +
                              +
                              What's your Product?
                              +
                              +

                              Write in the product or service that you would like to build.

                              + +
                              +
                                +
                              • +
                              +
                              + +
                              +
                              Who's your Customer?
                              +
                              + Write in the customers or people whom you would like to serve.

                              +
                              +
                                +
                              • +
                              +
                              + +
                              +
                              Fold on the Dotted Line
                              +
                              + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
                              +
                                +
                              +
                              + +
                              +
                              Your Promise
                              +
                              + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                                +
                              1. Even if you never get to build your product and
                              2. +
                              3. Even if you are not able to help the people you want to help...
                              4. +
                              +
                              You are still going to achieve victory.
                              +
                              +
                                +
                              +
                              + + + +
                              +
                              Enter your Victory
                              +
                              +

                              Write in your measurable Victory metric.

                              + +
                              +
                                +
                              • +
                              • +
                              +
                              + +
                              +
                              Find your FOCUS
                              +
                              + Want Feedback?

                              + Type "Yes" if you'd like me to review your Victory.

                              + + Bonus: you'll also be helping others learn. +
                              +
                                + +
                              +
                              + +
                              +
                              What Emotions are you Seeking?
                              +
                              + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

                              + +
                              +
                                +
                              • +
                              +
                              + +
                              +
                              Make it Official
                              +
                              +

                              Congratulations! You have your victory.

                              + + + +
                              +
                                +
                              • +
                              +
                              + +
                              +
                              What are your Co-Founders' Victories?
                              +
                              + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

                              + +
                              +
                              + + + +
                              +
                              Find your FOCUS
                              +
                              +

                              Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

                              Write your Victory Declaration in your Notes tab!
                              + +
                              +
                              + +
                              + +
                              + +
                              +
                              + + + + +
                              +
                              + +
                              +
                              +
                              + +
                              +
                              + + +
                              +
                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + +
                              1. +
                              2. +
                              3. +
                              4. +
                              5. +
                              +
                              +
                              1. +
                              2. +
                              3. +
                              4. +
                              5. +
                              +
                              + +
                              + +
                              +
                              +
                              +
                              +
                              + +
                              +
                              +
                              + + + + + +
                              N
                              +
                              N
                              +
                              N
                              +
                              Y
                              +
                              N
                              +
                              N
                              +
                              Y
                              +
                              Y
                              +
                              N
                              +
                              Y
                              +
                              Y
                              +
                              Y
                              + + + + + +
                              + +
                              +
                              +
                              + +
                              +
                              + + + + +
                              +
                              +
                              + +
                              +
                              + + +
                              +
                              +
                              +
                              +
                              + +
                              +
                              +
                              +
                              +
                              + +
                              +
                              +
                              +
                              +
                              + +
                              +
                              +
                              + + + + + + + + + + + + + + +
                              + +
                              +
                              +
                              + +
                              +
                              + + + + +
                              +
                              + +
                              +
                              +
                              + +
                              +
                              + + +
                              +
                              +
                              +
                              +
                              +
                              + +
                              +
                              +
                              +
                              +
                              +
                              + +
                              +
                              +
                              +
                              +
                              + +
                              +
                              + + + + +
                              +
                              +
                              + +
                              +
                              + + +
                              + +
                              + 1. +
                              2. +
                              3. +
                              4. +
                              5. +
                              +
                              + +
                              + 1. +
                              2. +
                              3. +
                              4. +
                              5. +
                              +
                              + +
                              + 1. +
                              2. +
                              3. +
                              4. +
                              5. +
                              +
                              + +
                              #
                              +
                              of things
                              + +
                              +
                              +
                              +
                              +
                              +
                              + +
                              +
                              +
                              +
                              +
                              + +
                              +
                              + + + + +
                              +
                              +
                              + +
                              +

                              Product-Market Fit Assessment

                              This exercise will tell you: +
                                +
                              1. What phase of Product-Market Fit you're in
                              2. +
                              3. Your startup's "Riskiest Assumption"
                              4. +
                              5. Your next step to test that assumption
                              6. +
                              +

                              Just answer these questions...

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

                              Have you launched your product?

                              +
                              +
                              +
                                +
                              • No30
                              • +

                                +
                              • Yes2
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              +

                              Are customers paying for it?

                              +
                              +
                              +
                                +
                              • No23
                              • +

                                +
                              • Yes3
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              +

                              Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve + Product-Market Fit?

                              +
                              +
                              +
                                +
                              • No5
                              • +

                                +
                              • Yes4
                              • +

                                +
                              • Not sure20
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              + Congrats! You're on the path to Product-Market + Fit. +
                              +
                              +
                              + Keep doing what you're doing! +
                              +
                              +
                              +
                              +
                              +
                              +

                              Why aren't you on track to acheive Product-Market Fit?

                              +
                              +
                              +
                                +
                              • Not enough customers6
                              • +

                                +
                              • Customer Lifetime Value is too low16
                              • +

                                +
                              +
                              Not sure? Go with your gut. Eventually you'll test both.
                              +
                              +
                              +
                              +
                              +
                              +

                              Why don't you have enough customers?

                              +
                              +
                              +
                                +
                              • Having trouble finding them7
                              • +

                                +
                              • Conversion rate it too low10
                              • +

                                +
                              • Customer segment is too small14
                              • +

                                +
                              • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                              • +

                                +
                              +
                              Not sure? Starting at the top, pick the first answer you think could be the reason.
                              +
                              +
                              +
                              +
                              +
                              +

                              Where are you looking for customers?

                              +
                              +
                              +
                                +
                              • Places I think my customers are.8
                              • +

                                +
                              • Places customers have told me they are.9
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Finding Early Adopters for + your product.
                              +
                              Your Your Next Step: Interview customers to validate + where they look for solutions.
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                              Use this information to make your interviews easier and faster + to get.
                              +
                              +

                              Found in FOCUS Workbook 1...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                              +
                              Your Next Step: Test alternative channels to determine + potential customer segment size.
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

                              You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
                              +
                              +

                              Found in FOCUS Workbook 2...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +

                              What emotions are you evoking in your Call to Action?

                              +
                              +
                              +
                                +
                              • I'm not evoking emotions in my Call to Action11
                              • +

                                +
                              • Emotions I think my customers are experiencing12
                              • +

                                +
                              • Emotions my customers have told me they are experiencing13
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Finding Early Adopters for + your product.
                              +
                              Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

                              Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
                              +
                              +

                              Found in FOCUS Workbook 1...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: You understand + your customer's emotional desires. +
                              +
                              +
                              +
                              Product-Market Fit Phase: .
                              +
                              Your Next Step: Interview your customers to understand + their emotional desires. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                              Use this information to make your interviews easier and faster + to get.
                              +
                              +

                              Found in FOCUS Workbook 1...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                              +
                              Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This exercise will help you identify + the emotions your customers' emotions. + +

                              By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
                              +
                              +

                              Found in FOCUS Workbook 2...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Scaling to Product-Market + Fit. +
                              +
                              Your Next Step: Identify, size and test related customer + segments. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

                              By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
                              +
                              +

                              Found in FOCUS Workbook 5...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                              +
                              Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
                              +
                              +

                              Found in FOCUS Workbook 4...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +

                              Why is your Customer Lifetime Value too low?

                              +
                              +
                              +
                                +
                              • Customer churn is too high (i.e. they cancel your service too soon)17
                              • +

                                +
                              • Price is too low18
                              • +

                                +
                              • Cost of customer acquisition is too high19
                              • +

                                +
                              +
                              Not sure? Starting at the top, pick the first answer you think could be the reason.
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                              +
                              Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                              +
                              +

                              Found in FOCUS Workbook 4...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                              +
                              Your Next Step: Optimize your price via price testing. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
                              +
                              +

                              Found in FOCUS Workbook 3...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
                              +
                              Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
                              +
                              +

                              Found in FOCUS Workbook 2...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +

                              Have you defined a metric that represents when you have acheived Product-Market Fit?

                              +
                              +
                              +
                                +
                              • No21
                              • +

                                +
                              • Yes22
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Finding Early Adopters for + your product.
                              +
                              Your Next Step: Define Product-Market Fit for you + and your team. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

                              This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
                              +
                              +

                              Found in FOCUS Workbook 1...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                              +
                              Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
                              +
                              +

                              Found in FOCUS Workbook 3...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +

                              Are customers using the product?

                              +
                              +
                              +
                                +
                              • No41
                              • +

                                +
                              • Yes24
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              +

                              Why aren't your customers paying to use your product?

                              +
                              +
                              +
                                +
                              • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
                              • +

                                +
                              • Going to monetize after reaching critical mass26
                              • +

                                +
                              • Pursuing a freemium model and haven't built paid features yet25
                              • +

                                +
                              • Tried charging but no one would pay10
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
                              +
                              Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
                              +
                              +

                              Found in FOCUS Workbook 3...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +

                              Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market + Fit? +

                              +
                              +
                              +
                                +
                              • No28
                              • +

                                +
                              • Yes38
                              • +

                                +
                              • Not sure20
                              • +

                                +
                              +
                              +
                              +
                              + +
                              +
                              +
                              +

                              Why aren't enough customers using for you to achieve Product-Market Fit?

                              +
                              +
                              +
                                +
                              • Having trouble finding them7
                              • +

                                +
                              • Conversion rate it too low10
                              • +

                                +
                              • Customer segment is too small14
                              • +

                                +
                              • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                              • +

                                +
                              +
                              Not sure? Starting at the top, pick the first answer you think could be the reason.
                              +
                              +
                              +
                              +
                              +
                              +

                              Have you defined a metric that represents when you have acheived Product-Market Fit?

                              +
                              +
                              +
                                +
                              • No21
                              • +

                                +
                              • Yes22
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              +

                              Have you generated any pre-sales or signed Letters of Intent?

                              +
                              +
                              +
                                +
                              • No35
                              • +

                                +
                              • Yes31
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              +

                              Are enough customers pre-paying for it that, if you solve their problems, you'll achieve + Product-Market Fit?

                              +
                              +
                              +
                                +
                              • No5
                              • +

                                +
                              • Yes32
                              • +

                                +
                              • Not sure20
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              +

                              Why haven't you launched the product yet?

                              +
                              +
                              +
                                +
                              • No development team33
                              • +

                                +
                              • Solution is still under development33
                              • +

                                +
                              • Testing the solution privately before making it available publicly34
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: You can solve + your customers' problems. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                              +
                              Your Next Step: Test a manual solution. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
                              +
                              +

                              Found in FOCUS Workbook 4...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
                              +
                              Your Next Step: Test an automated solution. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
                              +
                              +

                              Found in FOCUS Workbook 5...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +

                              Have you identified a problem at least 60% of your customers are actively trying to solve?

                              +
                              +
                              +
                                +
                              • No40
                              • +

                                +
                              • Yes36
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              +

                              If you solve the problem, will you achieve Product-Market Fit?

                              +
                              +
                              +
                                +
                              • No5
                              • +

                                +
                              • Yes37
                              • +

                                +
                              • Not sure39
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              +

                              Why aren't you collecting pre-orders or Letters of Intent?

                              +
                              +
                              +
                                +
                              • Can't finding customers to pre-sell7
                              • +

                                +
                              • Don't know how38
                              • +

                                +
                              • Tried but no one bought10
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                              +
                              Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
                              +
                              +

                              Found in FOCUS Workbook 3...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +

                              Have you defined a metric that represents when you have acheived Product-Market Fit?

                              +
                              +
                              +
                                +
                              • No21
                              • +

                                +
                              • Yes9
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Finding Early Adopters for + your product.
                              +
                              Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                              Use this information to make your interviews easier and faster + to get.
                              +
                              +

                              Found in FOCUS Workbook 1...

                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              +
                              +

                              Why aren't customers using your product?

                              +
                              +
                              +
                                +
                              • I'm not sure how/where to find customers to tell about it8
                              • +

                                +
                              • I've told them about it, but they don't really use it11
                              • +

                                +
                              • Customers use it a little, but then they stop42
                              • +

                                +
                              +
                              +
                              +
                              +
                              +
                              + Your Riskiest Assumption: Your product solves + your customers' problems. +
                              +
                              +
                              +
                              Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                              +
                              Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                              +
                              + This will help... +
                              + +
                              +

                              Recommended FOCUS Exercise...

                              + +
                              +
                              Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                              +
                              +

                              Found in FOCUS Workbook 4...

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

                              Upgrade to Silver

                              +
                              +
                              +
                              +

                              Electronic FOCUS Framework

                              +

                              Plus:

                              +

                              Lifetime access to FOCUS Con recordings

                              +

                              Small-group Mentoring

                              + +
                              + +
                              +
                              +

                              Normally $299.
                              Upgrade: Only $99

                              + Upgrade +
                              +
                              +
                              +
                              + +
                              +
                              +

                              Upgrade to Gold

                              +
                              +
                              +
                              +

                              Video or Printed FOCUS Framework +

                              +

                              Plus:

                              +

                              Lifetime access to FOCUS Con recordings

                              +

                              Small-group Mentoring

                              + +
                              + +
                              +
                              +

                              Normally $499.
                              Upgrade: Only $299

                              + Upgrade +
                              +
                              +
                              +
                              + +
                              +
                              + +
                              +
                              + + + + +
                              + + +
                              + +
                              +
                              + + + + +
                              + + +
                              +
                              +
                              + + + + +
                              + + +
                              +
                              +
                              + + + + +
                              + +
                              + +
                              +
                              + + + + +
                              +
                              + +
                              +
                              +

                              How likely would you be to recommend this workshop to a friend?

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

                              What's one thing we can improve next time?

                              +
                              +
                              + +
                              +
                              + +
                              +
                              +

                              What was your favorite part of the workshop?

                              +
                              +
                              + +
                              + +
                              + +
                              +
                              +
                              +
                              +
                              +
                              +
                              + + +
                              + +
                              + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/focuscon.js b/focuscon.js new file mode 100644 index 0000000..6b6b40b --- /dev/null +++ b/focuscon.js @@ -0,0 +1,2144 @@ +//var app = angular.module('app', ['firebase']); +var firebaseRoot = "https://cdlwebshops.firebaseio.com/focuscon"; + +var rootRef = new Firebase(firebaseRoot); +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var profilesRef = new Firebase(firebaseRoot + "/profiles"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var emailsRef = new Firebase(firebaseRoot + "/emails"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); +var notesRef = new Firebase(firebaseRoot + "/notes"); +var exerciseValuesRef = new Firebase(firebaseRoot + "/exerciseValues"); +var youTubeStreamsUrlRef = new Firebase(firebaseRoot + "/youTubeStreams"); +var hangoutUrlsRef = new Firebase(firebaseRoot + "/hangouts"); + +var declaringVictoryRef = exerciseValuesRef.child("declaringVictory"); +var earlyAdoptersRef = exerciseValuesRef.child("earlyAdopters"); +var offerDesignRef = exerciseValuesRef.child("offerDesign"); +var pmfAssessmentRef = exerciseValuesRef.child("pmfAssessment"); +var interviewTemplateRef = exerciseValuesRef.child("interviewTemplate"); + +var loggedInUserId; +var globalUser; +var questionPad, responsePad; +var myPMFAssessmentRef; +var thisUsersProfileRef; + +const PROFILE_PIC_URL = 'https://s3-us-west-2.amazonaws.com/focus-con-avatars/'; +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +const RTC_URL = 'https://focus-rtc.herokuapp.com/'; +const GET_PARTNER = false; + +var publicChat; + +var firstName = null; +var emailAddress = null; +var cameraWorks = false; + +var lastSoloPriority = 0; +var lastQuestionAnswered; + +var app = angular.module('app', [ + 'ui.grid', + 'ui.grid.resizeColumns', + 'ui.grid.autoResize', + 'ui.grid.moveColumns', + 'ui.grid.saveState', + 'ngSanitize', + 'ui.bootstrap', + 'firebase']). + directive('contenteditable', ['$sce', function ($sce) { + return { + restrict: 'A', // only activate on element attribute + require: '?ngModel', // get a hold of NgModelController + link: function (scope, element, attrs, ngModel) { + if (!ngModel) return; // do nothing if no ng-model + + // Specify how UI should be updated + ngModel.$render = function () { + element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); + }; + + // Listen for change events to enable binding + element.on('blur keyup change', function () { + scope.$evalAsync(read); + }); + read(); // initialize + + // Write data to the model + function read() { + var html = element.html(); + // When we clear the content editable the browser leaves a
                              behind + // If strip-br attribute is provided then we strip this out + if (attrs.stripBr && html == '
                              ') { + html = ''; + } + ngModel.$setViewValue(html); + } + } + }; + }]); + +app.controller('MainCtrl', ['$scope', '$firebaseArray', '$firebaseAuth', '$firebaseObject', 'uiGridConstants', function ($scope, $firebaseArray, $firebaseAuth, $firebaseObject, uiGridConstants) { + var vm = this; + var vm2 = this; + var vm3 = this; + var vm4 = this; + + var VictoryDeclarationFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + date: 'Write here', + step1: 'Write here', + step2: 'Write here', + number: '#', + things: 'things here', + emotion: 'Write here', + signature: 'Sign here', + optIn: 'Want Feedback?' + } + }); + + vm.gridOptions = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Number', + field: 'number' + }, + { + displayName: 'Things', + field: 'things' + }, + { + displayName: 'Emotion', + field: 'emotion', + }, + { + displayName: 'Product', + field: 'step1', + }, + { + displayName: 'Customer', + field: 'step2', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm.gridApi = gridApi; + } + }; + + var EarlyAdoptersFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + segment: 'Your customer segment', + problem: "Your customer's problem (in their words)", + behaviors: '1.
                              2.
                              3.
                              4.
                              5.
                              ', + externalBehaviors: '1.
                              2.
                              3.
                              4.
                              5.
                              ', + optIn: 'Want Feedback?' + } + }); + + vm2.earlyAdoptersFeedbackGrid = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Behaviors', + field: 'behaviors' + }, + { + displayName: 'Ext. Behaviors', + field: 'externalBehaviors' + }, + { + displayName: 'Segment', + field: 'segment', + }, + { + displayName: 'Problem', + field: 'problem', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm2.gridApi = gridApi; + } + }; + + var OfferDesignFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + channel1: 'Write here', + pcm1: "Write here" + } + }); + + vm3.offerDesignFeedbackGrid = { + columnDefs: [ + { + displayName: 'PCM1', + field: 'pcm1' + }, + { + displayName: 'PCM2', + field: 'pcm2' + }, + { + displayName: 'PCM3', + field: 'pcm3' + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm3.gridApi = gridApi; + } + }; + + var InterviewTemplateFactory = $firebaseObject.$extend({ + $$defaults: { + problem: "What's the hardest part about being a ___________?", + lastTime: "Can you tell me about the last time that happened?", + why: "In your words, why is that hard for you?", + solutions: "When was the last time you tried to solve the problem?", + deficiencies: "What's not ideal about your current solution?", + channels: "How did you find out about your current solution?" + } + }); + + if (isSimpleMode()) { + vm.properties = $firebaseArray(declaringVictoryRef); + vm.properties.$loaded().then(function () { + vm.gridOptions.data = vm.properties; + }); + + vm2.earlyAdopterProperties = $firebaseArray(earlyAdoptersRef); + vm2.earlyAdopterProperties.$loaded().then(function () { + vm2.earlyAdoptersFeedbackGrid.data = vm2.earlyAdopterProperties; + }); + + vm3.offerDesignProperties = $firebaseArray(offerDesignRef); + vm3.offerDesignProperties.$loaded().then(function () { + vm3.offerDesignFeedbackGrid.data = vm3.offerDesignProperties; + }); + + vm.giveFeedback = function (exercise) { + var victoryRef = declaringVictoryRef.child(exercise.$id); + + if (vm.feedbackObj) { + vm.feedbackObj.$destroy(); + } + + vm.feedbackObj = VictoryDeclarationFactory(victoryRef); + vm.feedbackObj.$bindTo($scope, "declaringVictoryFeedback"); + }; + + vm2.giveEarlyAdopterFeedback = function (exercise) { + var eaRef = earlyAdoptersRef.child(exercise.$id); + + if (vm2.feedbackObj) { + vm2.feedbackObj.$destroy(); + } + + vm2.feedbackObj = EarlyAdoptersFactory(eaRef); + vm2.feedbackObj.$bindTo($scope, "earlyAdoptersFeedback"); + }; + + vm3.giveOfferDesignFeedback = function (exercise) { + var odRef = offerDesignRef.child(exercise.$id); + + if (vm3.feedbackObj) { + vm3.feedbackObj.$destroy(); + } + + vm3.feedbackObj = OfferDesignFactory(odRef); + vm3.feedbackObj.$bindTo($scope, "offerDesignFeedback"); + }; + } + + // $scope.giveFeedback = function(exercise) { + // console.log(exercise); + // // $state.transitionTo('club', { clubId: club.id }); + // }; + + // vm.getTableHeight = function () { + // var rowHeight = 33; + // var headerHeight = 33; + // var height = vm.gridOptions.data.length * rowHeight + headerHeight; + // if (height > window.innerHeight) { + // height = window.innerHeight - 250; + // } + // return { + // height: height + "px" + // }; + // }; + + + if (!initParameters()) { + initModal(); + return; + } + + var auth = $firebaseAuth(rootRef); + var dataFromAuth = auth.$getAuth(); + + if (!dataFromAuth) { + auth.$authAnonymously(); + } + + auth.$onAuth(function (authData) { + if (authData == null) { + console.warn("authData is null. Returning and waiting for another auth w/ data."); + return; + } + + postAuthConfig(authData, publicChat, PUBLIC_CHAT_ROOM_ID, GET_PARTNER); + + var uid = authData.uid; + var victoryRef = declaringVictoryRef.child(uid); + var victorySyncObj = VictoryDeclarationFactory(victoryRef); + victorySyncObj.$bindTo($scope, "declaringVictory"); + + var eaRef = earlyAdoptersRef.child(uid); + var eaSyncObj = EarlyAdoptersFactory(eaRef); + eaSyncObj.$bindTo($scope, "earlyAdopters"); + + var odRef = offerDesignRef.child(uid); + var odSyncObj = OfferDesignFactory(odRef); + odSyncObj.$bindTo($scope, "offerDesign"); + + var itRef = interviewTemplateRef.child(uid); + var itSyncObj = InterviewTemplateFactory(itRef); + itSyncObj.$bindTo($scope, "interviewTemplate"); + }); +}]); + +function connectExercisesToFirebase(userId) { + myPMFAssessmentRef = pmfAssessmentRef.child(userId); + + if (isSimpleMode()) { + $('#refreshPMFChartsButton').show(); + + refreshPMFCharts(); + } +} + +function refreshPMFCharts() { + pmfAssessmentRef.once("value", function (data) { + populateChart(data.val()); + }); +} + +function populateChart(model, chartContainer, title) { + var countMap = {}; + var pathMap = {} + + for (value in model) { + var node = model[value]; + + if (countMap[node.currentPhase]) { + countMap[node.currentPhase].data += 1; + } + else { + countMap[node.currentPhase] = { + name: node.currentPhase, + data: 1 + }; + } + + if (pathMap[node.assessmentPath]) { + pathMap[node.assessmentPath].data += 1; + } + else { + pathMap[node.assessmentPath] = { + name: node.assessmentPath, + data: 1 + }; + } + } + + var phases = []; + var phaseCounts = []; + + for (key in Object.keys(countMap)) { + phases.push(countMap[Object.keys(countMap)[key]].name); + phaseCounts.push(countMap[Object.keys(countMap)[key]].data); + } + + var paths = []; + var pathCounts = []; + + for (key in Object.keys(pathMap)) { + paths.push(pathMap[Object.keys(pathMap)[key]].name); + pathCounts.push(pathMap[Object.keys(pathMap)[key]].data); + } + + $('#pmfPhaseChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Current Phase' }, + xAxis: { + categories: phases + }, + series: [{ + data: phaseCounts + }] + }); + + $('#pmfPathChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Popular Paths' }, + xAxis: { + categories: paths + }, + series: [{ + data: pathCounts + }] + }); +} + +function initParameters() { + firstName = getParameterByName('firstName'); + attendeeEmail = getParameterByName('attendeeEmail'); + attendeeLocation = getParameterByName('attendeeLocation'); + attendeeUrl = getParameterByName('attendeeUrl'); + photoId = getParameterByName('photoId'); + + return (firstName != null || attendeeEmail != null || attendeeLocation != null || attendeeUrl != null || photoId != null); +} + +function getAttendees() { + emailsRef.once('value', function (emailsSnap) { + console.log(emailsSnap.numChildren()); + }); +} + +function getEnrollees() { + enrolledRef.once('value', function (enrolledSnap) { + enrolledSnap.forEach(function (snapshot) { + console.log(snapshot.val().email); + }); + }); +} + +function escapeRegExp(str) { + return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); +} + +function replaceAll(str, find, replace) { + if (str && find && replace) { + return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); + } +} + +function getFeedback() { + feedbackRef.once('value', function (feedbackSnap) { + feedbackSnap.forEach(function (snapshot) { + var feedback = snapshot.val(); + console.log(feedback.nps + ",'" + replaceAll(feedback.favorite, "\r\n", " ") + "','" + replaceAll(feedback.improve, "\r\n", " ") + "'"); + }); + }); +} + +function initUI() { + $('.carousel').carousel({ + interval: 5000 + }); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + profilePics = $('#profile-pics'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + // $("#newPartner").hide(); + // $("#newPartner").click(function () { + // leavePartnership(); + // }); + + $("#stopNetworkingBtn").click(function () { + leavePartnership(); + }); + + $("#startNetworkingBtn").click(function () { + searchForPartner(); + }); + + $("#cancelNetworkingBtn").click(function () { + cancelSearchForPartnership(); + }); + + showNewRTCConversationButton(); + + $('.meetYourPartnerMe').on("input", function () { + updateMyInfo($(this)); + }); + + keepTabsOnTabs(); + initEnrollForm(); + setupFeedbackForm(); + //setupInterviewScriptGenerator(); + //setupQuizzes(); + + setupiFrames(); + + if (isWebViewerMode()) { + // load video stream + youTubeStreamsUrlRef.on('value', function (snapshot) { + var youTubeIFrame = $('.youtube-iframe'); + youTubeIFrame.attr("src", snapshot.val().url); + }); + } + else { + // get rid of video holder + $('.left-column .top-row').hide(); + $('.left-column .bottom-row').addClass("full-height").removeClass("bottom-row"); + } + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } + + setupSaveToGoogleButtons(); +} + +function setupSaveToGoogleButtons() { + $(".saveToGoogleButton").click(function (obj) { + $('#worksheetSavedModalSaving').show(); + $('#worksheetSavedModalSaved').hide(); + $('#worksheetSavedModalSavingBody').show(); + $('#worksheetSavedModalSavedBody').hide(); + $('#worksheetSavedModalErrorBody').hide(); + $('#savedWorksheetUrl').attr("href", ""); + + $('#worksheetSavedModalOKButton').hide(); + + $('#worksheetSavedModal').modal({ + keyboard: true, + backdrop: 'static' + }); + + var exerciseName = getExerciseName(this); + var userId = loggedInUserId; + var templateId = $(this).attr('data-template-id'); + + $.ajax({ + url: "https://script.google.com/macros/s/AKfycbwVlyn5ntlr1HRXap69I66sdG7TYCiPQKHxNkPSzTajHvbZZVY/exec?userId=" + userId + "&worksheetName=" + exerciseName + "&templateId=" + templateId, + method: "GET", + jsonp: "callback", + dataType: "jsonp", + success: function (response) { + $('#worksheetSavedModalSaving').hide(); + $('#worksheetSavedModalSaved').show(); + $('#worksheetSavedModalSavingBody').hide(); + $('#worksheetSavedModalSavedBody').show(); + $('#savedWorksheetUrl').attr("href", response); + + $('#worksheetSavedModalOKButton').show(); + }, + error: function (xhr, status, error) { + $('#worksheetSavedModalSavingBody').hide(); + $('#worksheetSavedModalErrorBody').show(); + + $('#worksheetSavedModalOKButton').show(); + } + }); + }); +} + +function setupTextEditors() { + + tinymce.init({ + selector: '.text-editor', + menubar: false, + plugins: 'autoresize autosave', + autosave_interval: "2s", + setup: function (ed) { + ed.on('init', function () { + this.getDoc().body.style.fontSize = '16px'; + this.getDoc().body.style.fontName = 'Lato'; + // ed.target.editorCommands.execCommand("fontSize", false, "2"); + // ed.target.editorCommands.execCommand("fontName", false, "Lato"); + }); + } + }); +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function () { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function () { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $('#enrollForm').ajaxChimp({ + url: 'http://CustomerDevLabs.us6.list-manage.com/subscribe/post?u=7de22f15c9e97df7b49df664f&id=583a7a794d', + callback: function (resp) { + $('#enrollSuccessAlert').html(resp.msg); + $('#enrollSuccessAlert').show(); + enrolledRef.child(loggedInUserId).set({ email: $('#enrollEmail').val() }); + } + }); + + $("#enrollForm").submit(function (event) { + event.preventDefault(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function isWebViewerMode() { + return !isSimpleMode() && document.URL.indexOf("vip.html") == -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + exercisesRef.child("active").update({ exercise: exerciseName }); + }); + + $(".showTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + }); + + $(".hideTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: false }); + }); + + $(".soloTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each(function (index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({ exercise: tabName.replace("Tab", '') }); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function (exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each(function (index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.uid).once('value', function (snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function (snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + excluded: [':disabled'], + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "Hmm, something doesn't look right with your first name.", + validators: { + notEmpty: { + message: 'Enter your first name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We support names between 2 and 20 characters' + } + } + }, + attendeeEmail: { + message: "Hmm, something doesn't look right with your email address.", + validators: { + notEmpty: { + message: 'Please enter your email address' + }, + emailAddress: { + message: "Your email address isn't valid" + } + } + }, + attendeeLocation: { + message: "Hmm, something doesn't look right with your location.", + validators: { + notEmpty: { + message: "Please enter your location" + } + } + }, + attendeeUrl: { + message: "Hmm, something doesn't look right with your Internet address.", + validators: { + notEmpty: { + message: "Please enter a web page" + }, + regexp: { + regexp: /^((https?|ftp):\/\/){0,1}(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, + message: 'Please enter a web page' + } + } + }, + photoId: { + message: "Hmm, something doesn't look right with your picture.", + validators: { + notEmpty: { + message: "Pleas take a picture" + } + } + } + } + }); + + $("#welcomeForm").submit(function (event) { + console.log("submit hit"); + firstName = $("#attendeeName").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); + + /*var element = document.querySelector('#rtc-camera'); + var options = { + insertMode: 'append' + }; + + window.component = createOpentokHardwareSetupComponent(element, options, function(error) { + console.log('ot called back'); + if (error) { + console.error('Error: ', error); + element.innerHTML = 'Error getting devices: ' + error.message; + return; + } + // Add a button to call component.destroy() to close the component. + });*/ + + if (OT.checkSystemRequirements() == 0) { + console.log("your camera isn't working (checkSystemRequirements)"); + displayNoWebRtcErrorMessage(); + return; + } + + OT.getDevices(function (error, devices) { + videoInputDevices = devices.filter(function (element) { + return element.kind == "videoInput"; + }); + + console.log(videoInputDevices.length); + if (videoInputDevices.length == 0) { + console.log("your camera isn't working (no cameras attached to the system)"); + displayNoWebRtcErrorMessage(); + return; + } + + var publisherOptions = { insertMode: 'append', mirror: false, style: { buttonDisplayMode: 'off' }, resolution: '320x240' }; + var publisher = OT.initPublisher('rtc-camera', publisherOptions, function (error) { + if (error) { + console.log("your camera isn't working (initPublisher callback)"); + displayNoWebRtcErrorMessage(); + } else { + console.log("your camera is working (initPublisher callback)"); + cameraWorks = true; + } + }); + + publisher.on('accessAllowed', function (event) { + console.log('granted access to camera'); + }); + + publisher.on('accessDenied', function (event) { + console.log('denied access to camera'); + }); + + $("#rtc-shoot").click(function () { + console.log("shoot clicked"); + $("#rtc-shoot").hide(); + $("#rtc-uploading").show(); + + var imgData = publisher.getImgData(); + var imgBinary = convertImgFromBase64ToBinary(imgData); + publisher.destroy(); + + $('#rtc-shot').attr("src", "data:image/png;base64," + imgData); + $('#rtc-shot').show(); + + var albumBucketName = 'focus-con-avatars'; + var bucketRegion = 'us-west-2'; + var IdentityPoolId = 'us-west-2:f5420202-fbee-4491-a43e-cec00477d656'; + + AWS.config.update({ + region: bucketRegion, + credentials: new AWS.CognitoIdentityCredentials({ + IdentityPoolId: IdentityPoolId + }) + }); + + var s3 = new AWS.S3({ + apiVersion: '2006-03-01', + params: { Bucket: albumBucketName } + }); + + var photoId = guid(); + s3.upload({ + Key: photoId, + Body: imgBinary, + ACL: 'public-read' + }, function (err, data) { + if (err) { + console.error('There was an error uploading your photo: ', err.message); + } else { + console.log('Successfully uploaded photo (' + photoId + ').'); + $('#photoId').val(photoId); + $('#welcomeForm').data('bootstrapValidator').updateStatus('photoId', 'VALID'); + + $("#rtc-uploading").hide(); + $("#rtc-submit").show(); + $("#rtc-retake").show(); + } + }); + }); + + $("#rtc-retake").click(function () { + $('#rtc-shot').hide(); + + publisher = OT.initPublisher('rtc-camera', publisherOptions, function (error) { + if (error) { + console.log("your camera isn't working (initPublisher callback)"); + displayNoWebRtcErrorMessage(); + } else { + console.log("your camera is working (initPublisher callback)"); + cameraWorks = true; + } + }); + + $('#photoId').val(''); + $('#welcomeForm').data('bootstrapValidator').updateStatus('photoId', 'NOT_VALIDATED'); + + $("#rtc-shoot").show(); + $("#rtc-retake").hide(); + $("#rtc-submit").hide(); + }); + }); +} + +function displayNoWebRtcErrorMessage() { + $("#rtc-shoot").hide(); + $("#rtc-camera").hide(); + + $('#camera-problem-error').show(); + cameraWorks = false; +} + +function convertImgFromBase64ToBinary(imgData) { + // http://stackoverflow.com/a/14988118 + var binaryImg = atob(imgData); + var length = binaryImg.length; + var ab = new ArrayBuffer(length); + var ua = new Uint8Array(ab); + for (var i = 0; i < length; i++) { + ua[i] = binaryImg.charCodeAt(i); + } + + return ua; +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function () { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function loadUserSnap() { + (function () { + var s = document.createElement("script"); + s.type = "text/javascript"; + s.async = true; + s.src = '//api.usersnap.com/load/' + + '5b8cbdbf-b9d1-487d-bf09-bac5e6e7d46f.js'; + var x = document.getElementsByTagName('script')[0]; + x.parentNode.insertBefore(s, x); + })(); +} + +function postAuthConfig(authData, chatUI, roomId, getPartner) { + console.log("Authenticated successfully with payload: ", authData); + + loadUserSnap(); + + var user = authData; + + // At some point we should remove one of thesee redundant variables + loggedInUserId = user.uid; + fbid = user.uid; + + user.firstName = firstName; + authUserName = firstName; + + //chatUI.setUser(user.uid, firstName); + //enterRoomAfterUserSessionCreated(chatUI, roomId); + + // if (thisUsersProfileRef != null) { + // console.log("Re-authorizing this user. Remove previous profile."); + // thisUsersProfileRef.remove(); + // } + //thisUsersProfileRef = profilesRef.child(loggedInUserId).update({ + + profilesRef.child(loggedInUserId).update({ + name: firstName, + email: attendeeEmail, + location: attendeeLocation, + url: attendeeUrl, + photoId: photoId, + updated: new Date().getTime() + }); + + // Add user to attendees + attendeesRef.child(user.uid).update(user); + + connectExercisesToFirebase(loggedInUserId); + + emailsRef.child(loggedInUserId).set({ name: firstName }); + + setupTextEditors(); + + if (getPartner) { + searchForPartner(user); + } + + configWhoIsHere(); + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestions = []; + + allQuestionsSnapshot.forEach(function (snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
                            • "); + var divmediabody = $("
                              "); + var divmedia = $("
                              "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = + "Top | " + + "Middle | " + + "" + answerText + " | " + + "" + hideText + " | " + + "Archive"; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 0; + var votesElement = "" + voteLink + ": " + voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
                              "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
                              " + userNameElement + "
                              " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestions.push(questionElement); + divmediabody2.addClass('bg-warning'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-info'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-primary'); + } + else if (data.votes <= -10000) { + divmediabody2.css('background', "#808080"); + } + else { + divmediabody2.addClass('this-class-does-not-exist'); + } + + questionList.prepend(questionElement); + } + }); + + if (activeQuestions && activeQuestions.length) { + for (var ndx = 0; ndx < activeQuestions.length; ndx++) { + questionList.prepend(activeQuestions[ndx]); + } + } + }); +} + +function configWhoIsHere() { + profilesRef.orderByChild('updated').on('value', function (allProfilesSnapshot) { + profilePics.empty(); + + $('#attendeeCount').html(allProfilesSnapshot.numChildren()); + + allProfilesSnapshot.forEach(function (snapshot) { + var data = snapshot.val(); + var profileDiv = $("
                              "); + + var url = data.url; + + if (!url.startsWith("http")) { + url = "http://" + url; + } + + var linkToUrl = $(""); + + var overlayDiv = $("
                              "); + overlayDiv.html(data.name + "
                              " + data.location); + + var img = $(""); + + linkToUrl.append(overlayDiv); + linkToUrl.append(img); + + profileDiv.append(linkToUrl); + + profilePics.prepend(profileDiv); + }); + }); +} + +// function logInToChat(ref, chatUI, roomId, getPartner) { +// var dataFromAuth = ref.getAuth(); + +// if (dataFromAuth) { +// postAuthConfig(dataFromAuth, chatUI, roomId, getPartner); +// return; +// } + +// ref.authAnonymously(function (error, authData) { +// if (error) { +// console.log("Login Failed!", error); +// return; +// } + +// postAuthConfig(authData, chatUI, roomId, getPartner); + +// }); +// } + +// var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { +// if (user) { +// loggedInUserId = user.uid; +// +// user.firstName = firstName; +// chatUI.setUser(user.uid, firstName); +// +// if (roomId != null) { +// setTimeout(function() { +// console.log("About to enter room. User: " + JSON.stringify(user) + ". Room: " + roomId); +// chatUI._chat.enterRoom(roomId); +// }, 500); +// } +// +// if (getPartner) { +// searchForPartner(user); +// } +// +// authUserName = firstName; +// fbid = user.uid; +// +// // simple should see all of the questions, everyone else should only see the unhidden ones +// var startAtNum = isSimpleMode() ? -1000000 : 1; +// +// // Add a callback that is triggered for each chat question. +// questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { +// questionList.empty(); +// +// var activeQuestion; +// +// allQuestionsSnapshot.forEach(function(snapshot) { +// +// //GET DATA +// var questionId = snapshot.key(); +// var data = snapshot.val(); +// var fbid_d = data.fbid; +// var username_d = data.name; +// var question_d = data.text; +// var date_d = data.currentdate; +// var votes_d = data.votes; +// +// divdir = ""; +// +// //CREATE ELEMENTS question & SANITIZE TEXT +// var questionElement = $("
                            • "); +// var divmediabody = $("
                              "); +// var divmedia = $("
                              "); +// +// var voteLink; +// var userAskedQuestion = fbid_d == fbid; +// +// if (isSimpleMode()) { +// var answerText = data.isActive ? "Unanswer" : "Answer"; +// var hideText = data.votes <= 0 ? "Show" : "Hide"; +// +// voteLink = "" + answerText + " " + hideText + ""; +// } +// else if (userAskedQuestion) { +// // This user submitted the question +// voteLink = "Delete"; +// } +// else { +// var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; +// voteLink = "" + voteText + ""; +// } +// +// var voteCount = data.votes ? data.votes : 1; +// var votesElement = "" + voteLink + ": "+ voteCount + ""; +// var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; +// var dateElement = " " + date_d + ""; +// +// var divmediabody2 = $("
                              "); +// questionElement.append(divmediabody); +// divmediabody.append(divmedia); +// //divmedia.append(a); +// //divmedia.append(votesElement); +// divmedia.append(divmediabody2); +// +// var usernamediv = $(""); +// divmediabody2.html(question_d); +// +// divmediabody2.append(usernamediv); +// usernamediv.html("
                              " + userNameElement + "
                              " + votesElement); +// +// //ADD question +// if (data.isActive) { +// activeQuestion = questionElement; +// divmediabody2.addClass('bg-danger'); +// } +// else { +// if (userAskedQuestion) { +// divmediabody2.addClass('bg-success'); +// // divmediabody2.css('background', "#476982"); +// // usernamediv.css('color', "#CCC") +// } +// else if (data.votes > 0) { +// // divmediabody2.css('background', "#73B3D7"); +// divmediabody2.addClass('bg-info'); +// } +// else { +// divmediabody2.addClass('bg-warning'); +// } +// +// questionList.prepend(questionElement); +// } +// }); +// +// questionList.prepend(activeQuestion); +// }); +// +// } else { +// simpleLogin.login('anonymous', { +// rememberMe: true +// }); +// } +// }); +// } + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


                              You'll see what your partner types, as she/he does.


                              Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


                              (Delete this too :)" : ""); + + questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                               
                              Note: your partner will be able to see your text as you type it.
                               
                              Try editing this text!
                               
                               
                              2. Secretly pick a company below to pitch:
                               

                              • AirBnB
                              • Pampers (diapers)
                              • Twitter
                              • Facebook
                              • Subway (sandwiches)
                              • Instagram
                              • Disney
                              • SnapChat
                              • Angry Birds (Rovio)
                              • RedBull
                               
                              3. Fill out the pitch template for the company you're pitching:
                               
                              - Problem:
                               
                               
                               
                              - Solution:
                               
                               
                               
                              - Market:
                               
                               
                               
                              - Business Model:
                               
                               
                               
                              -------------------------------------------------------
                               
                              4. Guess which company your partner is pitching:
                               
                               
                               
                              5. Which elements of your partner's pitch could be improved? 
                               
                               
                              " : ""); + responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                               
                              Note: your partner will be able to see your text as you type it.
                               
                              Try editing this text!
                               
                               
                              2. Secretly pick a company below to pitch:
                               
                              • AirBnB
                              • Pampers (diapers)
                              • Twitter
                              • Facebook
                              • Subway (sandwiches)
                              • Instagram
                              • Disney
                              • SnapChat
                              • Angry Birds (Rovio)
                              • RedBull
                               
                              3. Fill out the pitch template for the company you're pitching:
                               
                              - Problem:
                               
                               
                               
                              - Solution:
                               
                               
                               
                              - Market:
                               
                               
                               
                              - Business Model:
                               
                               
                               
                              -------------------------------------------------------
                               
                              4. Guess which company your partner is pitching:
                               
                               
                               
                              5. Which elements of your partner's pitch could be improved? 
                               
                               
                              " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(user.uid, ""); + + attendeesRef.child(user.uid).update(user); + + //leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + setRouletteText("Your partner isn't available. Let's find another for you!"); + + showNewRTCConversationButton(); + + return; + } + else if (part.hangoutUrl != null) { + leaveRTCRoom(); + setRouletteText("We couldn't connect you directly to your partner, so we created a Google Hangout for you two!"); + + showNetworkingHangoutButton(part.hangoutUrl); + } + else if (part.room != null) { + console.log("Update for partnership room: " + part.room); + + if (part.routedFailed /*&& part.room.startsWith(loggedInUserId)*/) { + // This code should only be executed by one of the partners to prevent them both from picking different hangout urls + // console.log("Routed connection failed. Attempting hangout connection."); + + // getHangoutUrl(part); + leavePartnership(true); + } + else if (part.p2pFailed) { + console.log("P2P connection failed. Attempted routed connection."); + joinRTCRoom(part.room, false); + } + else { + console.log("Entering our partner chat room: " + part.room); + //publicChat._chat.enterRoom(part.room); + + joinRTCRoom(part.room, true); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.uid).update(user); + } + } + }); + + soloRef.off('child_changed'); + + // intro partners + setRouletteText("Introducing you to " + user.partnerName + "..."); + + showStopRTCConversationButton(); + + //getMeetYourPartnerUpdates(user); +} + +function getHangoutUrl(partnership) { +} + +function setRouletteText(html) { + if (html == null) { + $("#default-networking-text").show(); + $("#dynamic-networking-text").hide(); + return; + } + + $("#default-networking-text").hide(); + $("#dynamic-networking-text").html(html); + $("#dynamic-networking-text").show(); +} + +function joinRTCRoom(room, isP2P) { + $("#rouletteIFrame").attr('src', RTC_URL + room + (isP2P ? "p2p" : "")); + + $("#rouletteIFrameHolder").show(); + $("#rouletteControls").addClass("inConversationNetworkingButtons"); + $("#rouletteControls").removeClass("defaultNetworkingButtons"); +} + +function leaveRTCRoom() { + $("#rouletteIFrame").attr('src', ""); + + $("#rouletteIFrameHolder").hide(); + $("#rouletteControls").removeClass("inConversationNetworkingButtons"); + $("#rouletteControls").addClass("defaultNetworkingButtons"); +} + +function showStopRTCConversationButton() { + $("#stopNetworkingBtn").show(); + $("#startNetworkingBtn").hide(); + $("#cancelNetworkingBtn").hide(); + $("#networkingHangoutBtn").hide(); +} + +function showNewRTCConversationButton() { + $("#stopNetworkingBtn").hide(); + $("#startNetworkingBtn").show(); + $("#cancelNetworkingBtn").hide(); + $("#networkingHangoutBtn").hide(); +} + +function showCancelNewRTCConversationButton() { + $("#stopNetworkingBtn").hide(); + $("#startNetworkingBtn").hide(); + $("#cancelNetworkingBtn").show(); + $("#networkingHangoutBtn").hide(); +} + +function showNetworkingHangoutButton(hangoutUrl) { + $("#networkingHangoutBtn").click(function () { + window.open(hangoutUrl, '_blank'); + }); + + $("#stopNetworkingBtn").show(); + $("#startNetworkingBtn").hide(); + $("#cancelNetworkingBtn").hide(); + $("#networkingHangoutBtn").show(); +} + +function lookingForPartnerUI() { + setRouletteText("Looking for someone to introduce you to..."); + + showCancelNewRTCConversationButton(); +} + +function cancelSearchForPartnership() { + leaveSoloList(loggedInUserId); + showNewRTCConversationButton(); + setRouletteText(); +} + +function leaveSoloList(userId) { + soloRef.child(userId).remove(function (error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); +} + +function joinSoloList(user) { + soloRef.child(user.uid).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.uid; + user.responsesPad = "r-" + user.uid; + + // store my pad addresses + attendeesRef.child(user.uid).update(user); + + //loadFirepads(user, true); + + soloRef.on('child_changed', function (soloSnap) { + var solo = soloSnap.val(); + + if (solo.uid != user.uid) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + leaveSoloList(user.uid); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + // Text chat version + // publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function (roomId) { + // console.log('Created our partnership chat room'); + // partnershipsRef.child(solo.partnership).set({ "room": roomId }); + + // user.partnerChatRoom = roomId; + // joinPartnership(user, solo.partnership); + // }); + + // Video chat version + var roomId = solo.partnership; + partnershipsRef.child(solo.partnership).set({ "room": roomId }); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function (solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function (soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.uid == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.uid).transaction(function (currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.uid.localeCompare(solo.uid) < 0) { + partnership = user.uid + solo.uid; + } + else { + partnership = solo.uid + user.uid; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.uid; + user.responsesPad = "r-" + solo.uid; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function () { confirmPartnershipAccepted(user) }, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.uid, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function (error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + //loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.uid).transaction(function (currentData) { + + // Always return null because we want off this list + return null; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.uid).once('value', function (attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.uid).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + //loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + if (user == null) { + if (fbid == null) { + console.log("Don't know my user id. Can't search for partner."); + return; + } + + attendeesRef.child(fbid).once('value', function (attendeeSnap) { + var attendee = attendeeSnap.val(); + + searchForPartner(attendee); + }); + return; + } + + console.log("My user id is: " + user.uid); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership(failedConnection) { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + forgetPartnership(true); + } + else { + console.log("This user is requesting to leave partnership."); + showNewRTCConversationButton(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function (error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(false); + } + }); + + if (failedConnection) { + setRouletteText("We had trouble connecting you with that partner. Let's try again!"); + } + else { + setRouletteText(); + } + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + //leavePrivateChatRooms(); + leaveRTCRoom(); + clearPartnerFromUser(user); + //unloadFirepads(); + + attendeesRef.child(user.uid).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +const DEFAULT_QUESTION_VOTES = 0; +const MIDDLE_OF_LIST_VOTES = 50; +const TOP_OF_LIST_VOTES = 100; +const ARCHIVE_VOTES = -10000; + +$(document).ready(function () { + initUI(); +}); + +function toggleQuestionVisibility(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function (question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (question.votes == 0) { + question.votes = 1; + } + else { + question.votes = question.votes * -1; + question.isActive = 0; + } + + return question; + }); +} + +function moveQuestionToMiddle(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: MIDDLE_OF_LIST_VOTES }); +} + +function moveQuestionToArchive(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: ARCHIVE_VOTES }); +} + +function moveQuestionToTop(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: TOP_OF_LIST_VOTES }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + // if (lastQuestionAnswered) { + // questionsRef.child(lastQuestionAnswered).update({ isActive: false }); + // } + + // lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false }); + + // lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function (confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function (currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null) { + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: DEFAULT_QUESTION_VOTES }); + + $("#question-txt").val(''); +} + +function guid() { + function s4() { + return Math.floor((1 + Math.random()) * 0x10000) + .toString(16) + .substring(1); + } + return s4() + s4() + '-' + s4() + '-' + s4() + '-' + + s4() + '-' + s4() + s4() + s4(); +} diff --git a/focuscondev.html b/focuscondev.html new file mode 100644 index 0000000..5d3c3da --- /dev/null +++ b/focuscondev.html @@ -0,0 +1,2572 @@ + + + + + FOCUS Con: Mastering Customer Interviews + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              +
                              +
                              FOCUS Con: Mastering Customer Interviews by Justin Wilcox, Founder Institute and Startup Weekend
                              +
                              + +
                              + +
                              +
                              +
                              +
                              + +
                              + +
                              + +
                              +
                              + +
                              +
                              +

                              Questions: Ask Below

                              +

                              To Chat: Join us on Slack

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

                                Welcome to the Workshop!

                                You can take notes during the workshop here. +

                                +   +

                                5 Phases of Product-Market Fit

                                +
                                  +
                                1. F
                                2. +
                                3. O
                                4. +
                                5. C
                                6. +
                                7. U
                                8. +
                                9. S
                                10. +
                                +

                                +

                                Takeaways

                                +

                                + + +

                                Where are your Early Adopters:

                                +

                                +
                                +
                                +
                                +
                                + +
                                +
                                + + + + +
                                +
                                +
                                + +
                                +
                                +
                                + + +
                                +
                                + + + + +
                                +
                                +
                                +
                                +
                                +
                                + +
                                +
                                + + + + +
                                +
                                +
                                +
                                +
                                +
                                Want to grow your network?
                                + + + + +
                                +
                                +
                                + +
                                +
                                +
                                +
                                + +
                                +
                                + + + + +
                                +
                                +
                                + +
                                +
                                +
                                + +
                                + +
                                +
                                + + + + + + + + + + + +
                                +
                                + +
                                + +
                                + +
                                +
                                + + + + +
                                + +
                                +
                                + + +
                                +
                                +
                                +
                                +
                                +
                                +
                                + + +
                                +
                                + +
                                +
                                +
                                +
                                +
                                + +
                                +
                                +
                                + +
                                + +
                                +
                                Defining Product-Market Fit
                                +
                                + Ready to define Product-Market Fit? +
                                +
                                + +
                                +
                                Declaring Victory Worksheet
                                +
                                + This worksheet will walk you through defining Product-Market Fit. +
                                +
                                + +
                                +
                                Today's Date
                                +
                                  +
                                • +
                                +
                                + Start by writing in today's date in the field on the right.

                                +
                                +
                                + + + + + +
                                +
                                What's your Product?
                                +
                                +

                                Write in the product or service that you would like to build.

                                + +
                                +
                                  +
                                • +
                                +
                                + +
                                +
                                Who's your Customer?
                                +
                                + Write in the customers or people whom you would like to serve.

                                +
                                +
                                  +
                                • +
                                +
                                + +
                                +
                                Fold on the Dotted Line
                                +
                                + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
                                +
                                  +
                                +
                                + +
                                +
                                Your Promise
                                +
                                + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                                  +
                                1. Even if you never get to build your product and
                                2. +
                                3. Even if you are not able to help the people you want to help...
                                4. +
                                +
                                You are still going to achieve victory.
                                +
                                +
                                  +
                                +
                                + + + +
                                +
                                Enter your Victory
                                +
                                +

                                Write in your measurable Victory metric.

                                + +
                                +
                                  +
                                • +
                                • +
                                +
                                + +
                                +
                                Find your FOCUS
                                +
                                + Want Feedback?

                                + Type "Yes" if you'd like me to review your Victory.

                                + + Bonus: you'll also be helping others learn. +
                                +
                                  + +
                                +
                                + +
                                +
                                What Emotions are you Seeking?
                                +
                                + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

                                + +
                                +
                                  +
                                • +
                                +
                                + +
                                +
                                Make it Official
                                +
                                +

                                Congratulations! You have your victory.

                                + + + +
                                +
                                  +
                                • +
                                +
                                + +
                                +
                                What are your Co-Founders' Victories?
                                +
                                + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

                                + +
                                +
                                + + + +
                                +
                                Find your FOCUS
                                +
                                +

                                Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

                                Write your Victory Declaration in your Notes tab!
                                + +
                                +
                                + +
                                + +
                                + +
                                +
                                + + + + +
                                +
                                + +
                                +
                                +
                                + +
                                +
                                + + +
                                +
                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + +
                                1. +
                                2. +
                                3. +
                                4. +
                                5. +
                                +
                                +
                                1. +
                                2. +
                                3. +
                                4. +
                                5. +
                                +
                                + +
                                + +
                                +
                                +
                                +
                                +
                                + +
                                +
                                +
                                + + + + + +
                                N
                                +
                                N
                                +
                                N
                                +
                                Y
                                +
                                N
                                +
                                N
                                +
                                Y
                                +
                                Y
                                +
                                N
                                +
                                Y
                                +
                                Y
                                +
                                Y
                                + + + + + +
                                + +
                                +
                                +
                                + +
                                +
                                + + + + +
                                +
                                +
                                + +
                                +
                                + + +
                                +
                                +
                                +
                                +
                                + +
                                +
                                +
                                +
                                +
                                + +
                                +
                                +
                                +
                                +
                                + +
                                +
                                +
                                + + + + + + + + + + + + + + +
                                + +
                                +
                                +
                                + +
                                +
                                + + + + +
                                +
                                + +
                                +
                                +
                                + +
                                +
                                + + +
                                +
                                +
                                +
                                +
                                +
                                + +
                                +
                                +
                                +
                                +
                                +
                                + +
                                +
                                +
                                +
                                +
                                + +
                                +
                                + + + + +
                                +
                                +
                                + +
                                +
                                + + +
                                + +
                                + 1. +
                                2. +
                                3. +
                                4. +
                                5. +
                                +
                                + +
                                + 1. +
                                2. +
                                3. +
                                4. +
                                5. +
                                +
                                + +
                                + 1. +
                                2. +
                                3. +
                                4. +
                                5. +
                                +
                                + +
                                #
                                +
                                of things
                                + +
                                +
                                +
                                +
                                +
                                +
                                + +
                                +
                                +
                                +
                                +
                                + +
                                +
                                + + + + +
                                +
                                +
                                + +
                                +

                                Product-Market Fit Assessment

                                This exercise will tell you: +
                                  +
                                1. What phase of Product-Market Fit you're in
                                2. +
                                3. Your startup's "Riskiest Assumption"
                                4. +
                                5. Your next step to test that assumption
                                6. +
                                +

                                Just answer these questions...

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

                                Have you launched your product?

                                +
                                +
                                +
                                  +
                                • No30
                                • +

                                  +
                                • Yes2
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                +

                                Are customers paying for it?

                                +
                                +
                                +
                                  +
                                • No23
                                • +

                                  +
                                • Yes3
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                +

                                Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve + Product-Market Fit?

                                +
                                +
                                +
                                  +
                                • No5
                                • +

                                  +
                                • Yes4
                                • +

                                  +
                                • Not sure20
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                + Congrats! You're on the path to Product-Market + Fit. +
                                +
                                +
                                + Keep doing what you're doing! +
                                +
                                +
                                +
                                +
                                +
                                +

                                Why aren't you on track to acheive Product-Market Fit?

                                +
                                +
                                +
                                  +
                                • Not enough customers6
                                • +

                                  +
                                • Customer Lifetime Value is too low16
                                • +

                                  +
                                +
                                Not sure? Go with your gut. Eventually you'll test both.
                                +
                                +
                                +
                                +
                                +
                                +

                                Why don't you have enough customers?

                                +
                                +
                                +
                                  +
                                • Having trouble finding them7
                                • +

                                  +
                                • Conversion rate it too low10
                                • +

                                  +
                                • Customer segment is too small14
                                • +

                                  +
                                • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                                • +

                                  +
                                +
                                Not sure? Starting at the top, pick the first answer you think could be the reason.
                                +
                                +
                                +
                                +
                                +
                                +

                                Where are you looking for customers?

                                +
                                +
                                +
                                  +
                                • Places I think my customers are.8
                                • +

                                  +
                                • Places customers have told me they are.9
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Finding Early Adopters for + your product.
                                +
                                Your Your Next Step: Interview customers to validate + where they look for solutions.
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                                Use this information to make your interviews easier and faster + to get.
                                +
                                +

                                Found in FOCUS Workbook 1...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                                +
                                Your Next Step: Test alternative channels to determine + potential customer segment size.
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

                                You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
                                +
                                +

                                Found in FOCUS Workbook 2...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +

                                What emotions are you evoking in your Call to Action?

                                +
                                +
                                +
                                  +
                                • I'm not evoking emotions in my Call to Action11
                                • +

                                  +
                                • Emotions I think my customers are experiencing12
                                • +

                                  +
                                • Emotions my customers have told me they are experiencing13
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Finding Early Adopters for + your product.
                                +
                                Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

                                Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
                                +
                                +

                                Found in FOCUS Workbook 1...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: You understand + your customer's emotional desires. +
                                +
                                +
                                +
                                Product-Market Fit Phase: .
                                +
                                Your Next Step: Interview your customers to understand + their emotional desires. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                                Use this information to make your interviews easier and faster + to get.
                                +
                                +

                                Found in FOCUS Workbook 1...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                                +
                                Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This exercise will help you identify + the emotions your customers' emotions. + +

                                By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
                                +
                                +

                                Found in FOCUS Workbook 2...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Scaling to Product-Market + Fit. +
                                +
                                Your Next Step: Identify, size and test related customer + segments. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

                                By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
                                +
                                +

                                Found in FOCUS Workbook 5...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                                +
                                Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
                                +
                                +

                                Found in FOCUS Workbook 4...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +

                                Why is your Customer Lifetime Value too low?

                                +
                                +
                                +
                                  +
                                • Customer churn is too high (i.e. they cancel your service too soon)17
                                • +

                                  +
                                • Price is too low18
                                • +

                                  +
                                • Cost of customer acquisition is too high19
                                • +

                                  +
                                +
                                Not sure? Starting at the top, pick the first answer you think could be the reason.
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                                +
                                Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                                +
                                +

                                Found in FOCUS Workbook 4...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                                +
                                Your Next Step: Optimize your price via price testing. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
                                +
                                +

                                Found in FOCUS Workbook 3...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
                                +
                                Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
                                +
                                +

                                Found in FOCUS Workbook 2...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +

                                Have you defined a metric that represents when you have acheived Product-Market Fit?

                                +
                                +
                                +
                                  +
                                • No21
                                • +

                                  +
                                • Yes22
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Finding Early Adopters for + your product.
                                +
                                Your Next Step: Define Product-Market Fit for you + and your team. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

                                This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
                                +
                                +

                                Found in FOCUS Workbook 1...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                                +
                                Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
                                +
                                +

                                Found in FOCUS Workbook 3...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +

                                Are customers using the product?

                                +
                                +
                                +
                                  +
                                • No41
                                • +

                                  +
                                • Yes24
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                +

                                Why aren't your customers paying to use your product?

                                +
                                +
                                +
                                  +
                                • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
                                • +

                                  +
                                • Going to monetize after reaching critical mass26
                                • +

                                  +
                                • Pursuing a freemium model and haven't built paid features yet25
                                • +

                                  +
                                • Tried charging but no one would pay10
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
                                +
                                Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
                                +
                                +

                                Found in FOCUS Workbook 3...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +

                                Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market + Fit? +

                                +
                                +
                                +
                                  +
                                • No28
                                • +

                                  +
                                • Yes38
                                • +

                                  +
                                • Not sure20
                                • +

                                  +
                                +
                                +
                                +
                                + +
                                +
                                +
                                +

                                Why aren't enough customers using for you to achieve Product-Market Fit?

                                +
                                +
                                +
                                  +
                                • Having trouble finding them7
                                • +

                                  +
                                • Conversion rate it too low10
                                • +

                                  +
                                • Customer segment is too small14
                                • +

                                  +
                                • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                                • +

                                  +
                                +
                                Not sure? Starting at the top, pick the first answer you think could be the reason.
                                +
                                +
                                +
                                +
                                +
                                +

                                Have you defined a metric that represents when you have acheived Product-Market Fit?

                                +
                                +
                                +
                                  +
                                • No21
                                • +

                                  +
                                • Yes22
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                +

                                Have you generated any pre-sales or signed Letters of Intent?

                                +
                                +
                                +
                                  +
                                • No35
                                • +

                                  +
                                • Yes31
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                +

                                Are enough customers pre-paying for it that, if you solve their problems, you'll achieve + Product-Market Fit?

                                +
                                +
                                +
                                  +
                                • No5
                                • +

                                  +
                                • Yes32
                                • +

                                  +
                                • Not sure20
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                +

                                Why haven't you launched the product yet?

                                +
                                +
                                +
                                  +
                                • No development team33
                                • +

                                  +
                                • Solution is still under development33
                                • +

                                  +
                                • Testing the solution privately before making it available publicly34
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: You can solve + your customers' problems. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                                +
                                Your Next Step: Test a manual solution. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
                                +
                                +

                                Found in FOCUS Workbook 4...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
                                +
                                Your Next Step: Test an automated solution. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
                                +
                                +

                                Found in FOCUS Workbook 5...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +

                                Have you identified a problem at least 60% of your customers are actively trying to solve?

                                +
                                +
                                +
                                  +
                                • No40
                                • +

                                  +
                                • Yes36
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                +

                                If you solve the problem, will you achieve Product-Market Fit?

                                +
                                +
                                +
                                  +
                                • No5
                                • +

                                  +
                                • Yes37
                                • +

                                  +
                                • Not sure39
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                +

                                Why aren't you collecting pre-orders or Letters of Intent?

                                +
                                +
                                +
                                  +
                                • Can't finding customers to pre-sell7
                                • +

                                  +
                                • Don't know how38
                                • +

                                  +
                                • Tried but no one bought10
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                                +
                                Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
                                +
                                +

                                Found in FOCUS Workbook 3...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +

                                Have you defined a metric that represents when you have acheived Product-Market Fit?

                                +
                                +
                                +
                                  +
                                • No21
                                • +

                                  +
                                • Yes9
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Finding Early Adopters for + your product.
                                +
                                Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                                Use this information to make your interviews easier and faster + to get.
                                +
                                +

                                Found in FOCUS Workbook 1...

                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                +
                                +

                                Why aren't customers using your product?

                                +
                                +
                                +
                                  +
                                • I'm not sure how/where to find customers to tell about it8
                                • +

                                  +
                                • I've told them about it, but they don't really use it11
                                • +

                                  +
                                • Customers use it a little, but then they stop42
                                • +

                                  +
                                +
                                +
                                +
                                +
                                +
                                + Your Riskiest Assumption: Your product solves + your customers' problems. +
                                +
                                +
                                +
                                Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                                +
                                Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                                +
                                + This will help... +
                                + +
                                +

                                Recommended FOCUS Exercise...

                                + +
                                +
                                Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                                +
                                +

                                Found in FOCUS Workbook 4...

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

                                Upgrade to Silver

                                +
                                +
                                +
                                +

                                Electronic FOCUS Framework

                                +

                                Plus:

                                +

                                Lifetime access to FOCUS Con recordings

                                +

                                Small-group Mentoring

                                + +
                                + +
                                +
                                +

                                Normally $299.
                                Upgrade: Only $99

                                + Upgrade +
                                +
                                +
                                +
                                + +
                                +
                                +

                                Upgrade to Gold

                                +
                                +
                                +
                                +

                                Video or Printed FOCUS Framework +

                                +

                                Plus:

                                +

                                Lifetime access to FOCUS Con recordings

                                +

                                Small-group Mentoring

                                + +
                                + +
                                +
                                +

                                Normally $499.
                                Upgrade: Only $299

                                + Upgrade +
                                +
                                +
                                +
                                + +
                                +
                                + +
                                +
                                + + + + +
                                + + +
                                + +
                                +
                                + + + + +
                                + + +
                                +
                                +
                                + + + + +
                                + + +
                                +
                                +
                                + + + + +
                                + +
                                + +
                                +
                                + + + + +
                                +
                                + +
                                +
                                +

                                How likely would you be to recommend this workshop to a friend?

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

                                What's one thing we can improve next time?

                                +
                                +
                                + +
                                +
                                + +
                                +
                                +

                                What was your favorite part of the workshop?

                                +
                                +
                                + +
                                + +
                                + +
                                +
                                +
                                +
                                +
                                +
                                +
                                + + +
                                + +
                                + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gan.html b/gan.html new file mode 100644 index 0000000..82750e2 --- /dev/null +++ b/gan.html @@ -0,0 +1,2299 @@ + + + + + Teaching Lean at Accelerators | Justin Wilcox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                +
                                +
                                Teaching Lean at Accelerators with Global Accelerator Network, + Justin Wilcox, and Brian Ardinger
                                +
                                + +
                                + +
                                +
                                +
                                +
                                + +
                                + +
                                + +
                                +
                                + +
                                +
                                +

                                Questions: Ask and up vote.

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

                                  Welcome to How to Find Product-Market Fit!

                                  You can take notes during the workshop here. +

                                  +   +

                                  5 Phases of Product-Market Fit

                                  +
                                    +
                                  1. F
                                  2. +
                                  3. O
                                  4. +
                                  5. C
                                  6. +
                                  7. U
                                  8. +
                                  9. S
                                  10. +
                                  +

                                  +

                                  Takeaways

                                  +

                                  +

                                  - Declaring Victory: What's your Victory?

                                  +

                                  +   +

                                  - Product-Market Fit Assessment:

                                  +
                                    +
                                  • Phase are you in:
                                  • +
                                  • Riskiest Assumption:
                                  • +
                                  • Next step:
                                  • +
                                  +

                                  +   + +

                                  +
                                  +
                                  +
                                  +
                                  + +
                                  +
                                  + + + + +
                                  +
                                  +
                                  + +
                                  +
                                  +
                                  + +
                                  +
                                  + + + + +
                                  +
                                  +
                                  + + +
                                  +
                                  +
                                  + +
                                  + +
                                  +
                                  + + + + + + + + + + + +
                                  +
                                  + +
                                  + +
                                  + +
                                  +
                                  + + + + +
                                  + +
                                  +
                                  + + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + + +
                                  +
                                  + +
                                  +
                                  +
                                  +
                                  +
                                  + +
                                  +
                                  +
                                  + +
                                  + +
                                  +
                                  Defining Product-Market Fit
                                  +
                                  + Ready to define Product-Market Fit? +
                                  +
                                  + +
                                  +
                                  Declaring Victory Worksheet
                                  +
                                  + This worksheet will walk you through defining Product-Market Fit. +
                                  +
                                  + +
                                  +
                                  Today's Date
                                  +
                                    +
                                  • +
                                  +
                                  + Start by writing in today's date in the field on the right.

                                  +
                                  +
                                  + + + + + +
                                  +
                                  What's your Product?
                                  +
                                  +

                                  Write in the product or service that you would like to build.

                                  + +
                                  +
                                    +
                                  • +
                                  +
                                  + +
                                  +
                                  Who's your Customer?
                                  +
                                  + Write in the customers or people whom you would like to serve.

                                  +
                                  +
                                    +
                                  • +
                                  +
                                  + +
                                  +
                                  Fold on the Dotted Line
                                  +
                                  + Click next to fold the worksheet on the dotted line over and Declare your Victory! +
                                  +
                                    +
                                  +
                                  + +
                                  +
                                  Your Promise
                                  +
                                  + Now that your worksheet is folded, you've revealed a new contract with yourself: +
                                    +
                                  1. Even if you never get to build your product and
                                  2. +
                                  3. Even if you are not able to help the people you want to help...
                                  4. +
                                  +
                                  You are still going to achieve victory.
                                  +
                                  +
                                    +
                                  +
                                  + + + +
                                  +
                                  Enter your Victory
                                  +
                                  +

                                  Write in your measurable Victory metric.

                                  + +
                                  +
                                    +
                                  • +
                                  • +
                                  +
                                  + +
                                  +
                                  Find your FOCUS
                                  +
                                  + Want Feedback?

                                  + Type "Yes" if you'd like me to review your Victory.

                                  + + Bonus: you'll also be helping others learn. +
                                  +
                                    + +
                                  +
                                  + +
                                  +
                                  What Emotions are you Seeking?
                                  +
                                  + Now that you know what your true victory will be, write in how you imagine it will feel to achieve.

                                  + +
                                  +
                                    +
                                  • +
                                  +
                                  + +
                                  +
                                  Make it Official
                                  +
                                  +

                                  Congratulations! You have your victory.

                                  + + + +
                                  +
                                    +
                                  • +
                                  +
                                  + +
                                  +
                                  What are your Co-Founders' Victories?
                                  +
                                  + Ask your co-founder(s) to complete the exercise too - either now, or when they join your team.

                                  + +
                                  +
                                  + + + +
                                  +
                                  Find your FOCUS
                                  +
                                  +

                                  Congratulations, you've taken the most important step of your startup journey, you've Declared Victory + and in doing so, defined your Product-Market Fit. +

                                  Write your Victory Declaration in your Notes tab!
                                  + +
                                  +
                                  + +
                                  + +
                                  + +
                                  +
                                  + + + + +
                                  +
                                  +
                                  + +
                                  +
                                  + + +
                                  +
                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + +
                                  1. +
                                  2. +
                                  3. +
                                  4. +
                                  5. +
                                  +
                                  +
                                  1. +
                                  2. +
                                  3. +
                                  4. +
                                  5. +
                                  +
                                  + +
                                  + +
                                  +
                                  +
                                  +
                                  +
                                  + +
                                  +
                                  +
                                  + + + + + +
                                  N
                                  +
                                  N
                                  +
                                  N
                                  +
                                  Y
                                  +
                                  N
                                  +
                                  N
                                  +
                                  Y
                                  +
                                  Y
                                  +
                                  N
                                  +
                                  Y
                                  +
                                  Y
                                  +
                                  Y
                                  + + + + + +
                                  + +
                                  +
                                  + + + +
                                  + +
                                  +
                                  + + + + +
                                  +
                                  +
                                  + +
                                  +
                                  + + +
                                  + +
                                  + 1. +
                                  2. +
                                  3. +
                                  4. +
                                  5. +
                                  +
                                  + +
                                  + 1. +
                                  2. +
                                  3. +
                                  4. +
                                  5. +
                                  +
                                  + +
                                  + 1. +
                                  2. +
                                  3. +
                                  4. +
                                  5. +
                                  +
                                  + +
                                  #
                                  +
                                  of things
                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + +
                                  +
                                  +
                                  +
                                  +
                                  + +
                                  +
                                  + + + + +
                                  +
                                  +
                                  + +
                                  +

                                  Survey

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

                                  Q1: What relationship best reflects the one between you and your teams?

                                  +
                                  +
                                  +
                                    +
                                  • Boss and Employees2
                                  • +

                                    +
                                  • Teacher and Students2
                                  • +

                                    +
                                  • Business and Customers2
                                  • +

                                    +
                                  • Peers2
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Results

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

                                  Product-Market Fit Assessment

                                  This exercise will tell you: +
                                    +
                                  1. What phase of Product-Market Fit you're in
                                  2. +
                                  3. Your startup's "Riskiest Assumption"
                                  4. +
                                  5. Your next step to test that assumption
                                  6. +
                                  +

                                  Just answer these questions...

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

                                  Have you launched your product?

                                  +
                                  +
                                  +
                                    +
                                  • No30
                                  • +

                                    +
                                  • Yes2
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Are customers paying for it?

                                  +
                                  +
                                  +
                                    +
                                  • No23
                                  • +

                                    +
                                  • Yes3
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Are enough customers paying for it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                                  +
                                  +
                                  +
                                    +
                                  • No5
                                  • +

                                    +
                                  • Yes4
                                  • +

                                    +
                                  • Not sure20
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Congrats! You're on the path to Product-Market + Fit. +
                                  +
                                  +
                                  + Keep doing what you're doing! +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Why aren't you on track to acheive Product-Market Fit?

                                  +
                                  +
                                  +
                                    +
                                  • Not enough customers6
                                  • +

                                    +
                                  • Customer Lifetime Value is too low16
                                  • +

                                    +
                                  +
                                  Not sure? Go with your gut. Eventually you'll test both.
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Why don't you have enough customers?

                                  +
                                  +
                                  +
                                    +
                                  • Having trouble finding them7
                                  • +

                                    +
                                  • Conversion rate it too low10
                                  • +

                                    +
                                  • Customer segment is too small14
                                  • +

                                    +
                                  • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                                  • +

                                    +
                                  +
                                  Not sure? Starting at the top, pick the first answer you think could be the reason.
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Where are you looking for customers?

                                  +
                                  +
                                  +
                                    +
                                  • Places I think my customers are.8
                                  • +

                                    +
                                  • Places customers have told me they are.9
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption is: You know where + your customers look for solutions to their problems. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Finding Early Adopters for + your product.
                                  +
                                  Your Your Next Step: Interview customers to validate + where they look for solutions.
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                                  Use this information to make your interviews easier and faster + to get.
                                  +
                                  +

                                  Found in FOCUS Workbook 1...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: Your marketing + channels can reach a sufficient number of customers for you to achieve Product-Market Fit. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                                  +
                                  Your Next Step: Test alternative channels to determine + potential customer segment size.
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This spreadsheet will show you if your + segment is large enough for you to achieve Product-Market Fit based on real-world, bottoms-up, + data. + +

                                  You'll also be able to estimate the size of your marketing channels, conversion rates, + and price points to determine the best approach for you to achieve Product-Market Fit. +
                                  +
                                  +

                                  Found in FOCUS Workbook 2...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  What emotions are you evoking in your Call to Action?

                                  +
                                  +
                                  +
                                    +
                                  • I'm not evoking emotions in my Call to Action11
                                  • +

                                    +
                                  • Emotions I think my customers are experiencing12
                                  • +

                                    +
                                  • Emotions my customers have told me they are experiencing13
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: You understand + what your customers are trying to accomplish in their roles. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Finding Early Adopters for + your product.
                                  +
                                  Your Next Step: Interview your customers to understand + what problems they are actively trying to solve. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This exercise will help you brainstorm + specific groups of customers you can serve by focusing on their problems. + +

                                  Everything is easier when you center your attention on your customer's problems: + asking for interviews, marketing, sales, product development, etc. Take this step now, + and you'll move much faster through the rest of your journey. +
                                  +
                                  +

                                  Found in FOCUS Workbook 1...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: You understand + your customer's emotional desires. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: .
                                  +
                                  Your Next Step: Interview your customers to understand + their emotional desires. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                                  Use this information to make your interviews easier and faster + to get.
                                  +
                                  +

                                  Found in FOCUS Workbook 1...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: Your marketing + copy reasonates emotionally with your customers. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Offer Testing - You can + Reach your Early Adopters.
                                  +
                                  Your Next Step: Test multiple versions of your marketing + copy/Call to Action. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This exercise will help you identify + the emotions your customers' emotions. + +

                                  By identifying and addressing your customers' emotional needs, you'll significantly + increase your conversion rate. +
                                  +
                                  +

                                  Found in FOCUS Workbook 2...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: There are large + enough customer segments for you to achieve Product-Market Fit. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Scaling to Product-Market + Fit. +
                                  +
                                  Your Next Step: Identify, size and test related customer + segments. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This exercise will show you how to + transition from your Early Adopters to your Early Majority segment. + +

                                  By acquiring secondary and tertiary segments you'll be able to accelerate your path + to Product-Market Fit. + +
                                  +
                                  +

                                  Found in FOCUS Workbook 5...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough, and they are incentivized enough, to share + your product with others. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                                  +
                                  Your Next Step: Increase your Viral Coefficent (i.e. + K Factor). +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This exercise will help you brainstorm + and prioritize ways to increase the virality of your product.
                                  +
                                  +

                                  Found in FOCUS Workbook 4...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Why is your Customer Lifetime Value too low?

                                  +
                                  +
                                  +
                                    +
                                  • Customer churn is too high (i.e. they cancel your service too soon)17
                                  • +

                                    +
                                  • Price is too low18
                                  • +

                                    +
                                  • Cost of customer acquisition is too high19
                                  • +

                                    +
                                  +
                                  Not sure? Starting at the top, pick the first answer you think could be the reason.
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: Your solution + is solving your customer's problem well enough that they'll continue paying for it. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                                  +
                                  Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                                  +
                                  +

                                  Found in FOCUS Workbook 4...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: Customers will + pay enough to solve their problem for you to achieve Product-Market Fit. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                                  +
                                  Your Next Step: Optimize your price via price testing. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: Whether you're B2B or B2C, this exercise + will show how to optimize your price - without upsetting your customers!
                                  +
                                  +

                                  Found in FOCUS Workbook 3...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: You can lower + your Cost of Customer acquisition such that you can achieve Product-Market Fit. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Offer Testing: You can Reach + your Early Adopters.
                                  +
                                  Your Next Step: Test alternative channels to determine + your optimal acquisition ROI. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This spreadsheet will show you what + combination of marketing channels, price point, and conversion rates you'll need to acheive + in order to find Product-Market Fit. +
                                  +
                                  +

                                  Found in FOCUS Workbook 2...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Have you defined a metric that represents when you have acheived Product-Market Fit?

                                  +
                                  +
                                  +
                                    +
                                  • No21
                                  • +

                                    +
                                  • Yes22
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: You know what + Product-Market Fit means for you and your team. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Finding Early Adopters for + your product.
                                  +
                                  Your Next Step: Define Product-Market Fit for you + and your team. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: You can't achieve Product-Market Fit + until you've defined it for you and your team. + +

                                  This exercise will walk your entire team through the process of defining the most + important metric of your startup...what success looks like.
                                  +
                                  +

                                  Found in FOCUS Workbook 1...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: The problem you're + solving will lead you on a path to Product-Market Fit. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                                  +
                                  Your Next Step: Calculate your the size of this market + to determine if Product-Market Fit is achievable. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This spreadsheet will tell you how + large your segment has the potential to be and exactly what conversion rates you'll need + to achieve in order to find Product-Market Fit. +
                                  +
                                  +

                                  Found in FOCUS Workbook 3...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Are customers using the product?

                                  +
                                  +
                                  +
                                    +
                                  • No41
                                  • +

                                    +
                                  • Yes24
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Why aren't your customers paying to use your product?

                                  +
                                  +
                                  +
                                    +
                                  • Product isn't high enough quality to charge yet (i.e. pilot phase, trialing, etc.)25
                                  • +

                                    +
                                  • Going to monetize after reaching critical mass26
                                  • +

                                    +
                                  • Pursuing a freemium model and haven't built paid features yet25
                                  • +

                                    +
                                  • Tried charging but no one would pay10
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Currency Testing: Your Early + Adopters will Pay you.
                                  +
                                  Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: Whether you're B2B or B2C, this exercise + will show you how to pre-sell a solution to a problem - without deceiving or disappointing + your customers.
                                  +
                                  +

                                  Found in FOCUS Workbook 3...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Are enough customers using it that, if you keep doing what you're doing, you'll achieve Product-Market Fit?

                                  +
                                  +
                                  +
                                    +
                                  • No28
                                  • +

                                    +
                                  • Yes38
                                  • +

                                    +
                                  • Not sure20
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  + +
                                  +
                                  +
                                  +

                                  Why aren't enough customers using for you to achieve Product-Market Fit?

                                  +
                                  +
                                  +
                                    +
                                  • Having trouble finding them7
                                  • +

                                    +
                                  • Conversion rate it too low10
                                  • +

                                    +
                                  • Customer segment is too small14
                                  • +

                                    +
                                  • Customer aren't referring enough other customers (i.e. Viral Coefficient is too low)15
                                  • +

                                    +
                                  +
                                  Not sure? Starting at the top, pick the first answer you think could be the reason.
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Have you defined a metric that represents when you have acheived Product-Market Fit?

                                  +
                                  +
                                  +
                                    +
                                  • No21
                                  • +

                                    +
                                  • Yes22
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Have you generated any pre-sales or signed Letters of Intent?

                                  +
                                  +
                                  +
                                    +
                                  • No35
                                  • +

                                    +
                                  • Yes31
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Are enough customers pre-paying for it that, if you solve their problems, you'll achieve Product-Market Fit?

                                  +
                                  +
                                  +
                                    +
                                  • No5
                                  • +

                                    +
                                  • Yes32
                                  • +

                                    +
                                  • Not sure20
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Why haven't you launched the product yet?

                                  +
                                  +
                                  +
                                    +
                                  • No development team33
                                  • +

                                    +
                                  • Solution is still under development33
                                  • +

                                    +
                                  • Testing the solution privately before making it available publicly34
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: You can solve + your customers' problems. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                                  +
                                  Your Next Step: Test a manual solution. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This exercise will walk you through + how to create a manual solution in the most efficient way possible.
                                  +
                                  +

                                  Found in FOCUS Workbook 4...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: You can solve + your customers' problems at scale. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Scaling to Fit - You can + achieve Product-Market Fit.
                                  +
                                  Your Next Step: Test an automated solution. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This exercise will help you transition + from a manual solution to an automated one in the most efficient way possible.
                                  +
                                  +

                                  Found in FOCUS Workbook 5...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Have you identified a problem at least 60% of your customers are actively trying to solve?

                                  +
                                  +
                                  +
                                    +
                                  • No40
                                  • +

                                    +
                                  • Yes36
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  If you solve the problem, will you achieve Product-Market Fit?

                                  +
                                  +
                                  +
                                    +
                                  • No5
                                  • +

                                    +
                                  • Yes37
                                  • +

                                    +
                                  • Not sure39
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Why aren't you collecting pre-orders or Letters of Intent?

                                  +
                                  +
                                  +
                                    +
                                  • Can't finding customers to pre-sell7
                                  • +

                                    +
                                  • Don't know how38
                                  • +

                                    +
                                  • Tried but no one bought10
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: Customers will + pay you enough that you'll achieve Product-Market Fit. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Currency Testing - Your + Early Adopters will Pay you.
                                  +
                                  Your Next Step: Charge customers via pre-orders or + Letters of Intent for future functionality. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This exercise will introduce you to + Currency Testing so you can confidently validate whether customers will pay you enough + for you to achieve Product-Market Fit.
                                  +
                                  +

                                  Found in FOCUS Workbook 3...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Have you defined a metric that represents when you have acheived Product-Market Fit?

                                  +
                                  +
                                  +
                                    +
                                  • No21
                                  • +

                                    +
                                  • Yes9
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: Customers are + actively trying to solve a problem your product will solve for them. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Finding Early Adopters for + your product.
                                  +
                                  Your Next Step: Interview customers to determine what + problems they are actively trying to solve. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: Understand who your Early Adopters + are, and where to find them, by contrasting their behavior with your Early Majority, + Late Majority, etc.

                                  Use this information to make your interviews easier and faster + to get.
                                  +
                                  +

                                  Found in FOCUS Workbook 1...

                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +

                                  Why aren't customers using your product?

                                  +
                                  +
                                  +
                                    +
                                  • I'm not sure how/where to find customers to tell about it8
                                  • +

                                    +
                                  • I've told them about it, but they don't really use it11
                                  • +

                                    +
                                  • Customers use it a little, but then they stop42
                                  • +

                                    +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Your Riskiest Assumption: Your product solves + your customers' problems. +
                                  +
                                  +
                                  +
                                  Product-Market Fit Phase: Utility Testing - You can + Satisfy your Early Adopters.
                                  +
                                  Your Next Step: Test ways to increase the value your + solution is providing to customers. +
                                  +
                                  + This will help... +
                                  + +
                                  +

                                  Recommended FOCUS Exercise...

                                  + +
                                  +
                                  Description: This exercise will provide four different + techniques to increase your Customer Lifetime Value making it more likely you'll achieve + Product-Market Fit..
                                  +
                                  +

                                  Found in FOCUS Workbook 4...

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

                                  FOCUS Framework

                                  +
                                  +
                                  +
                                  +

                                  + One FREE Online Copy of FOCUS Framework
                                  +

                                  +

                                  Per GAN Accelerator

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

                                  How likely would you be to recommend this workshop to a friend?

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

                                  What's one thing we can improve next time?

                                  +
                                  +
                                  + +
                                  +
                                  + +
                                  +
                                  +

                                  What was your favorite part of the workshop?

                                  +
                                  +
                                  + +
                                  + +
                                  + +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + + +
                                  + +
                                  + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gan.js b/gan.js new file mode 100644 index 0000000..97ca230 --- /dev/null +++ b/gan.js @@ -0,0 +1,1654 @@ +//var app = angular.module('app', ['firebase']); +var firebaseRoot = "https://cdlwebshops.firebaseio.com/gan"; + +var rootRef = new Firebase(firebaseRoot); +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var emailsRef = new Firebase(firebaseRoot + "/emails"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); +var notesRef = new Firebase(firebaseRoot + "/notes"); +var exerciseValuesRef = new Firebase(firebaseRoot + "/exerciseValues"); + +var declaringVictoryRef = exerciseValuesRef.child("declaringVictory"); +var earlyAdoptersRef = exerciseValuesRef.child("earlyAdopters"); +var pmfAssessmentRef = exerciseValuesRef.child("pmfAssessment"); +var pollRef = exerciseValuesRef.child("poll"); + +var loggedInUserId; +var questionPad, responsePad; +var myPMFAssessmentRef; + +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +const GET_PARTNER = false; + +var publicChat; + +var firstName = null; +var emailAddress = null; + +var lastSoloPriority = 0; +var lastQuestionAnswered; + +var app = angular.module('app', [ + 'ui.grid', + 'ui.grid.resizeColumns', + 'ui.grid.autoResize', + 'ui.grid.moveColumns', + 'ui.grid.saveState', + 'ngSanitize', + 'ui.bootstrap', + 'firebase']). + directive('contenteditable', ['$sce', function ($sce) { + return { + restrict: 'A', // only activate on element attribute + require: '?ngModel', // get a hold of NgModelController + link: function (scope, element, attrs, ngModel) { + if (!ngModel) return; // do nothing if no ng-model + + // Specify how UI should be updated + ngModel.$render = function () { + element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); + }; + + // Listen for change events to enable binding + element.on('blur keyup change', function () { + scope.$evalAsync(read); + }); + read(); // initialize + + // Write data to the model + function read() { + var html = element.html(); + // When we clear the content editable the browser leaves a
                                  behind + // If strip-br attribute is provided then we strip this out + if (attrs.stripBr && html == '
                                  ') { + html = ''; + } + ngModel.$setViewValue(html); + } + } + }; + }]); + +app.controller('MainCtrl', ['$scope', '$firebaseArray', '$firebaseAuth', '$firebaseObject', 'uiGridConstants', function ($scope, $firebaseArray, $firebaseAuth, $firebaseObject, uiGridConstants) { + var vm = this; + var vm2 = this; + + var VictoryDeclarationFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + date: 'Write here', + step1: 'Write here', + step2: 'Write here', + number: '#', + things: 'things here', + emotion: 'Write here', + signature: 'Sign here', + optIn: 'Want Feedback?' + } + }); + + vm.gridOptions = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Number', + field: 'number' + }, + { + displayName: 'Things', + field: 'things' + }, + { + displayName: 'Emotion', + field: 'emotion', + }, + { + displayName: 'Product', + field: 'step1', + }, + { + displayName: 'Customer', + field: 'step2', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm.gridApi = gridApi; + } + }; + + var EarlyAdoptersFactory = $firebaseObject.$extend({ + // each time an update arrives from the server, apply the change locally + $$defaults: { + segment: 'Your customer segment', + problem: "Your customer's problem (in their words)", + behaviors: '1.
                                  2.
                                  3.
                                  4.
                                  5.
                                  ', + externalBehaviors: '1.
                                  2.
                                  3.
                                  4.
                                  5.
                                  ', + optIn: 'Want Feedback?' + } + }); + + vm2.earlyAdoptersFeedbackGrid = { + columnDefs: [ + { + displayName: 'Help?', + field: 'optIn', + }, + { + displayName: 'Behaviors', + field: 'behaviors' + }, + { + displayName: 'Ext. Behaviors', + field: 'externalBehaviors' + }, + { + displayName: 'Segment', + field: 'segment', + }, + { + displayName: 'Problem', + field: 'problem', + }, + { + name: 'select', + displayName: 'Select', + cellTemplate: ' ', + width: 60, + enableSorting: false + } + ], + // enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER, + flatEntityAccess: true, + enableGridMenu: true, + enableFiltering: true, + onRegisterApi: function (gridApi) { + vm2.gridApi = gridApi; + } + }; + + if (isSimpleMode()) { + vm.properties = $firebaseArray(declaringVictoryRef); + vm.properties.$loaded().then(function () { + vm.gridOptions.data = vm.properties; + }); + + vm2.earlyAdopterProperties = $firebaseArray(earlyAdoptersRef); + vm2.earlyAdopterProperties.$loaded().then(function () { + vm2.earlyAdoptersFeedbackGrid.data = vm2.earlyAdopterProperties; + }); + + vm.giveFeedback = function (exercise) { + var victoryRef = declaringVictoryRef.child(exercise.$id); + + if (vm.feedbackObj) { + vm.feedbackObj.$destroy(); + } + + vm.feedbackObj = VictoryDeclarationFactory(victoryRef); + vm.feedbackObj.$bindTo($scope, "declaringVictoryFeedback"); + }; + + vm2.giveFeedbackEarlyAdopters = function (exercise) { + var eaRef = earlyAdoptersRef.child(exercise.$id); + + if (vm2.feedbackObj) { + vm2.feedbackObj.$destroy(); + } + + vm2.feedbackObj = EarlyAdoptersFactory(eaRef); + vm2.feedbackObj.$bindTo($scope, "earlyAdoptersFeedback"); + }; + } + + // $scope.giveFeedback = function(exercise) { + // console.log(exercise); + // // $state.transitionTo('club', { clubId: club.id }); + // }; + + // vm.getTableHeight = function () { + // var rowHeight = 33; + // var headerHeight = 33; + // var height = vm.gridOptions.data.length * rowHeight + headerHeight; + // if (height > window.innerHeight) { + // height = window.innerHeight - 250; + // } + // return { + // height: height + "px" + // }; + // }; + + + if (!initParameters()) { + initModal(); + return; + } + + var auth = $firebaseAuth(rootRef); + var dataFromAuth = auth.$getAuth(); + + if (!dataFromAuth) { + auth.$authAnonymously(); + } + + auth.$onAuth(function (authData) { + postAuthConfig(authData, publicChat, PUBLIC_CHAT_ROOM_ID, GET_PARTNER); + + var victoryRef = declaringVictoryRef.child(authData.uid); + var victorySyncObj = VictoryDeclarationFactory(victoryRef); + + victorySyncObj.$bindTo($scope, "declaringVictory"); + + var eaRef = earlyAdoptersRef.child(authData.uid); + var eaSyncObj = EarlyAdoptersFactory(eaRef); + + eaSyncObj.$bindTo($scope, "earlyAdopters"); + }); +}]); + +function connectExercisesToFirebase(userId) { + myPMFAssessmentRef = pmfAssessmentRef.child(userId); + myPollRef = pollRef.child(userId); + + if (isSimpleMode()) { + $('#refreshPMFChartsButton').show(); + + refreshPMFCharts(); + } +} + +function refreshPollCharts() { + pollRef.once("value", function (data) { + populatePoll(data.val()); + }); +} + +function populatePoll(model, chartContainer, title) { + var values = {}; + + for (value in model) { + var node = model[value]; + + if (values[node.Question_1]) { + values[node.Question_1].data += 1; + } + else { + values[node.Question_1] = { + name: node.Question_1, + data: 1 + }; + } + } + + var question1 = []; + var question1Counts = []; + + for (key in Object.keys(values)) { + question1.push(values[Object.keys(values)[key]].name); + question1Counts.push(values[Object.keys(values)[key]].data); + } + + $('#question1Chart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Question 1' }, + xAxis: { + categories: question1 + }, + series: [{ + data: question1Counts + }] + }); +} + +function refreshPMFCharts() { + pmfAssessmentRef.once("value", function (data) { + populateChart(data.val()); + }); +} + +function populateChart(model, chartContainer, title) { + var countMap = {}; + var pathMap = {} + + for (value in model) { + var node = model[value]; + + if (countMap[node.currentPhase]) { + countMap[node.currentPhase].data += 1; + } + else { + countMap[node.currentPhase] = { + name: node.currentPhase, + data: 1 + }; + } + + if (pathMap[node.assessmentPath]) { + pathMap[node.assessmentPath].data += 1; + } + else { + pathMap[node.assessmentPath] = { + name: node.assessmentPath, + data: 1 + }; + } + } + + var phases = []; + var phaseCounts = []; + + for (key in Object.keys(countMap)) { + phases.push(countMap[Object.keys(countMap)[key]].name); + phaseCounts.push(countMap[Object.keys(countMap)[key]].data); + } + + var paths = []; + var pathCounts = []; + + for (key in Object.keys(pathMap)) { + paths.push(pathMap[Object.keys(pathMap)[key]].name); + pathCounts.push(pathMap[Object.keys(pathMap)[key]].data); + } + + $('#pmfPhaseChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Current Phase' }, + xAxis: { + categories: phases + }, + series: [{ + data: phaseCounts + }] + }); + + $('#pmfPathChart').highcharts({ + chart: { type: 'column' }, + title: { text: 'Popular Paths' }, + xAxis: { + categories: paths + }, + series: [{ + data: pathCounts + }] + }); +} + +function initParameters() { + firstName = getParameterByName('firstName'); + emailAddress = getParameterByName('attendeeEmail'); + + return firstName != null && emailAddress != null; +} + +function getAttendees() { + emailsRef.once('value', function (emailsSnap) { + console.log(emailsSnap.numChildren()); + }); +} + +function getAttendeeEmails() { + emailsRef.once('value', function (emailsSnap) { + emailsSnap.forEach(function (snapshot) { + console.log(snapshot.val().email); + }); + }); +} + +function getEnrollees() { + enrolledRef.once('value', function (enrolledSnap) { + enrolledSnap.forEach(function (snapshot) { + console.log(snapshot.val().email); + }); + }); +} + +function escapeRegExp(str) { + return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); +} + +function replaceAll(str, find, replace) { + if (str && find && replace) { + return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); + } +} + +function getFeedback() { + feedbackRef.once('value', function (feedbackSnap) { + feedbackSnap.forEach(function (snapshot) { + var feedback = snapshot.val(); + console.log(feedback.nps + ",'" + replaceAll(feedback.favorite, "\r\n", " ") + "','" + replaceAll(feedback.improve, "\r\n", " ") + "'"); + }); + }); +} + +function initUI() { + $('.carousel').carousel({ + interval: 5000 + }); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + $("#newPartner").hide(); + $("#newPartner").click(function () { + leavePartnership(); + }); + + $('.meetYourPartnerMe').on("input", function () { + updateMyInfo($(this)); + }); + + keepTabsOnTabs(); + initEnrollForm(); + setupFeedbackForm(); + //setupInterviewScriptGenerator(); + //setupQuizzes(); + + setupiFrames(); + + if (isWebViewerMode()) { + // load video stream + var youTubeIFrame = $('.youtube-iframe'); + youTubeIFrame.attr("src", youTubeIFrame.attr("data-youtube-src")); + } + else { + // get ride of video holder + $('.left-column .top-row').hide(); + $('.left-column .bottom-row').addClass("full-height").removeClass("bottom-row"); + } + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } +} + +function setupTextEditors() { + + tinymce.init({ + selector: '.text-editor', + menubar: false, + plugins: 'autoresize autosave', + autosave_interval: "2s", + setup: function (ed) { + ed.on('init', function () { + this.getDoc().body.style.fontSize = '16px'; + this.getDoc().body.style.fontName = 'Lato'; + // ed.target.editorCommands.execCommand("fontSize", false, "2"); + // ed.target.editorCommands.execCommand("fontName", false, "Lato"); + }); + } + }); +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + if (!isSimpleMode() || $(this).attr('data-src').indexOf("youtube") == -1) { + $(this).attr('src', $(this).attr('data-src')); + } + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function () { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function () { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + // $('#enrollForm').ajaxChimp({ + // url: 'http://CustomerDevLabs.us6.list-manage.com/subscribe/post?u=7de22f15c9e97df7b49df664f&id=583a7a794d', + // callback: function (resp) { + // $('#enrollSuccessAlert').html(resp.msg); + // $('#enrollSuccessAlert').show(); + // enrolledRef.child(loggedInUserId).set({ email: $('#enrollEmail').val() }); + // } + // }); + + $("#enrollForm").submit(function (event) { + event.preventDefault(); + enrolledRef.child(loggedInUserId).set({ email: $('#enrollEmail').val() }); + $('#enrollSuccessAlert').show(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function isWebViewerMode() { + return !isSimpleMode() && document.URL.indexOf("vip.html") == -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + exercisesRef.child("active").update({ exercise: exerciseName }); + }); + + $(".showTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: true }); + }); + + $(".hideTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({ show: false }); + }); + + $(".soloTabButton").click(function (obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each(function (index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({ exercise: tabName.replace("Tab", '') }); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function (exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each(function (index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.uid).once('value', function (snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function (snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "That's not your name", + validators: { + notEmpty: { + message: 'We need your name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We can do names between 2 and 20 characters' + } + } + }, + attendeeEmail: { + message: "Hmm, something doesn't look right.", + validators: { + notEmpty: { + message: 'Please enter your email address' + }, + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#welcomeForm").submit(function (event) { + firstName = $("#attendeeName").val(); + emailAddress = $("#attendeeEmail").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); +} + +function initPad(url, div, msg) { + // Create CodeMirror (with lineWrapping on). + var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); + + var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, + { richTextToolbar: false, richTextShortcuts: true }); + + firepad.on('ready', function () { + if (firepad.isHistoryEmpty()) { + firepad.setHtml(msg); + } + }); + + return firepad; +} + +function enterRoomAfterUserSessionCreated(chatUI, roomId) { + const RETRY_IN = 500; + + if (chatUI._chat._sessionId == null) { + setTimeout(enterRoomAfterUserSessionCreated, RETRY_IN, chatUI, roomId); + return; + } + + console.log("About to enter room. Room: " + roomId); + chatUI._chat.enterRoom(roomId); +} + +function postAuthConfig(authData, chatUI, roomId, getPartner) { + console.log("Authenticated successfully with payload: ", authData); + + var user = authData; + + loggedInUserId = user.uid; + user.firstName = firstName; + //chatUI.setUser(user.uid, firstName); + //enterRoomAfterUserSessionCreated(chatUI, roomId); + + connectExercisesToFirebase(loggedInUserId); + + emailsRef.child(loggedInUserId).set({ + name: firstName, + email: emailAddress + }); + + setupTextEditors(); + + if (getPartner) { + searchForPartner(user); + } + + authUserName = firstName; + fbid = user.uid; + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestion; + + allQuestionsSnapshot.forEach(function (snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
                                • "); + var divmediabody = $("
                                  "); + var divmedia = $("
                                  "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = + "Top | " + + "Middle | " + + "" + answerText + " | " + + "" + hideText + ""; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 0; + var votesElement = "" + voteLink + ": " + voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
                                  "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
                                  " + userNameElement + "
                                  " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestion = questionElement; + divmediabody2.addClass('bg-warning'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-info'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-primary'); + } + else { + divmediabody2.addClass('this-class-does-not-exist'); + } + + questionList.prepend(questionElement); + } + }); + + questionList.prepend(activeQuestion); + }); +} + +function logInToChat(ref, chatUI, roomId, getPartner) { + var dataFromAuth = ref.getAuth(); + + if (dataFromAuth) { + postAuthConfig(dataFromAuth, chatUI, roomId, getPartner); + return; + } + + ref.authAnonymously(function (error, authData) { + if (error) { + console.log("Login Failed!", error); + return; + } + + postAuthConfig(authData, chatUI, roomId, getPartner); + + }); +} + +// var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { +// if (user) { +// loggedInUserId = user.uid; +// +// user.firstName = firstName; +// chatUI.setUser(user.uid, firstName); +// +// if (roomId != null) { +// setTimeout(function() { +// console.log("About to enter room. User: " + JSON.stringify(user) + ". Room: " + roomId); +// chatUI._chat.enterRoom(roomId); +// }, 500); +// } +// +// if (getPartner) { +// searchForPartner(user); +// } +// +// authUserName = firstName; +// fbid = user.uid; +// +// // simple should see all of the questions, everyone else should only see the unhidden ones +// var startAtNum = isSimpleMode() ? -1000000 : 1; +// +// // Add a callback that is triggered for each chat question. +// questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { +// questionList.empty(); +// +// var activeQuestion; +// +// allQuestionsSnapshot.forEach(function(snapshot) { +// +// //GET DATA +// var questionId = snapshot.key(); +// var data = snapshot.val(); +// var fbid_d = data.fbid; +// var username_d = data.name; +// var question_d = data.text; +// var date_d = data.currentdate; +// var votes_d = data.votes; +// +// divdir = ""; +// +// //CREATE ELEMENTS question & SANITIZE TEXT +// var questionElement = $("
                                • "); +// var divmediabody = $("
                                  "); +// var divmedia = $("
                                  "); +// +// var voteLink; +// var userAskedQuestion = fbid_d == fbid; +// +// if (isSimpleMode()) { +// var answerText = data.isActive ? "Unanswer" : "Answer"; +// var hideText = data.votes <= 0 ? "Show" : "Hide"; +// +// voteLink = "" + answerText + " " + hideText + ""; +// } +// else if (userAskedQuestion) { +// // This user submitted the question +// voteLink = "Delete"; +// } +// else { +// var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; +// voteLink = "" + voteText + ""; +// } +// +// var voteCount = data.votes ? data.votes : 1; +// var votesElement = "" + voteLink + ": "+ voteCount + ""; +// var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; +// var dateElement = " " + date_d + ""; +// +// var divmediabody2 = $("
                                  "); +// questionElement.append(divmediabody); +// divmediabody.append(divmedia); +// //divmedia.append(a); +// //divmedia.append(votesElement); +// divmedia.append(divmediabody2); +// +// var usernamediv = $(""); +// divmediabody2.html(question_d); +// +// divmediabody2.append(usernamediv); +// usernamediv.html("
                                  " + userNameElement + "
                                  " + votesElement); +// +// //ADD question +// if (data.isActive) { +// activeQuestion = questionElement; +// divmediabody2.addClass('bg-danger'); +// } +// else { +// if (userAskedQuestion) { +// divmediabody2.addClass('bg-success'); +// // divmediabody2.css('background', "#476982"); +// // usernamediv.css('color', "#CCC") +// } +// else if (data.votes > 0) { +// // divmediabody2.css('background', "#73B3D7"); +// divmediabody2.addClass('bg-info'); +// } +// else { +// divmediabody2.addClass('bg-warning'); +// } +// +// questionList.prepend(questionElement); +// } +// }); +// +// questionList.prepend(activeQuestion); +// }); +// +// } else { +// simpleLogin.login('anonymous', { +// rememberMe: true +// }); +// } +// }); +// } + +function loadFirepads(user, addDefaultText) { + // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


                                  You'll see what your partner types, as she/he does.


                                  Delete this intro once you and your partner have read it." : ""); + // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


                                  (Delete this too :)" : ""); + + questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                                   
                                  Note: your partner will be able to see your text as you type it.
                                   
                                  Try editing this text!
                                   
                                   
                                  2. Secretly pick a company below to pitch:
                                   

                                  • AirBnB
                                  • Pampers (diapers)
                                  • Twitter
                                  • Facebook
                                  • Subway (sandwiches)
                                  • Instagram
                                  • Disney
                                  • SnapChat
                                  • Angry Birds (Rovio)
                                  • RedBull
                                   
                                  3. Fill out the pitch template for the company you're pitching:
                                   
                                  - Problem:
                                   
                                   
                                   
                                  - Solution:
                                   
                                   
                                   
                                  - Market:
                                   
                                   
                                   
                                  - Business Model:
                                   
                                   
                                   
                                  -------------------------------------------------------
                                   
                                  4. Guess which company your partner is pitching:
                                   
                                   
                                   
                                  5. Which elements of your partner's pitch could be improved? 
                                   
                                   
                                  " : ""); + responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                                   
                                  Note: your partner will be able to see your text as you type it.
                                   
                                  Try editing this text!
                                   
                                   
                                  2. Secretly pick a company below to pitch:
                                   
                                  • AirBnB
                                  • Pampers (diapers)
                                  • Twitter
                                  • Facebook
                                  • Subway (sandwiches)
                                  • Instagram
                                  • Disney
                                  • SnapChat
                                  • Angry Birds (Rovio)
                                  • RedBull
                                   
                                  3. Fill out the pitch template for the company you're pitching:
                                   
                                  - Problem:
                                   
                                   
                                   
                                  - Solution:
                                   
                                   
                                   
                                  - Market:
                                   
                                   
                                   
                                  - Business Model:
                                   
                                   
                                   
                                  -------------------------------------------------------
                                   
                                  4. Guess which company your partner is pitching:
                                   
                                   
                                   
                                  5. Which elements of your partner's pitch could be improved? 
                                   
                                   
                                  " : ""); +} + +function unloadFirepads() { + console.log("unloading firepads"); + + $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); + $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); + + try { + questionPad.dispose(); + } catch (exc) { + console.log("Error disposing question pad: " + exc.message); + } + + try { + responsePad.dispose(); + } catch (exc) { + console.log("Error disposing response pad: " + exc.message); + } + + $('#oldQuestionsPad').remove(); + $('#oldResponsesPad').remove(); +} + +function joinPartnership(user, partnership) { + user.partnership = partnership; + user.lastPartner = partnership.replace(useruser.uid, ""); + + attendeesRef.child(user.uid).update(user); + + leavePrivateChatRooms(); + + // join chat room + partnershipsRef.child(partnership).on('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Partnership is null. Request to be terminated."); + forgetPartnership(false); + $("#partnerName").html("Your partner isn't available. Let's find another for you!"); + + return; + } + else if (part.room != null) { + console.log("Entering our partner chat room: " + part.room); + publicChat._chat.enterRoom(part.room); + + user.partnerChatRoom = part.room; + attendeesRef.child(user.uid).update(user); + } + }); + + soloRef.off('child_changed'); + + // intro partners + $("#partnerName").html("Say hi to your workshop partner, !"); + $('.partnerName').text(user.partnerName); + $("#newPartner").show(); + + getMeetYourPartnerUpdates(user); +} + +function lookingForPartnerUI() { + $("#partnerName").html("Looking for a partner for you..."); + $("#newPartner").hide(); +} + +function joinSoloList(user) { + soloRef.child(user.uid).setWithPriority(user, new Date().getTime()); + console.log("Added myself to the solo list."); + + lookingForPartnerUI(); + + // since I'm the first to the meeting, use my id to key the firepads + // my partner will hook into these pads + user.questionsPad = "q-" + user.uid; + user.responsesPad = "r-" + user.uid; + + // store my pad addresses + attendeesRef.child(user.uid).update(user); + + //loadFirepads(user, true); + + soloRef.on('child_changed', function (soloSnap) { + var solo = soloSnap.val(); + + if (solo.id != user.uid) { + console.log("Someone else's solo changed"); + return; + } + + console.log("Our solo changed..."); + + if (solo.partnership == null) { + console.log("but no one added a partnership. Not sure what's up."); + } + else { + console.log("and we have a new partnership!"); + + soloRef.child(user.uid).remove(function (error) { + if (error) { + console.log("Error removing myself from the solo list", error); + } + else { + console.log("Successfully removed myself from the solo list", error); + } + }); + + user.partnerName = solo.partnerName; + user.partnership = solo.partnership; + + publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function (roomId) { + console.log('Created our partnership chat room'); + partnershipsRef.child(solo.partnership).set({ "room": roomId }); + + user.partnerChatRoom = roomId; + joinPartnership(user, solo.partnership); + }); + } + }); +} + +function searchForNextSolo(user, attemptNum) { + // There were solos available, but we had a conflict trying to partner with one + // Wait a bit and try again + var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; + var attempt = attemptNum == null ? 0 : attemptNum; + + if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { + console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); + + joinSoloList(user); + } + else { + setTimeout(partnerWithFirstSolo(user, ++attempt), 500); + return; + } +} + +function partnerWithFirstSolo(user, attemptNum) { + if (attemptNum != null) { + console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); + } + + var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); + + firstSolo.once('value', function (solosSnap) { + // Are there any solos? + + var solos = solosSnap.val(); + + if (solos == null) { + console.log('There are no available solos.'); + joinSoloList(user); + return; + } + + firstSolo.once('child_added', function (soloSnap) { + // iterate the solos + var solo = soloSnap.val(); + + lastSoloPriority = soloSnap.getPriority(); + + if (solo.id == user.lastPartner) { + console.log("Found potential partner, but I just left a partnership with them. Skipping."); + + searchForNextSolo(user, attemptNum); + return; + } + + soloRef.child(solo.id).transaction(function (currentData) { + if (currentData == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (currentData.partnership == null) { + // let's make a baby! + var partnership; + + if (user.uid.localeCompare(solo.id) < 0) { + partnership = user.uid + solo.id; + } + else { + partnership = solo.id + user.uid; + } + + user.partnership = partnership; + user.partnerName = currentData.firstName; + user.questionsPad = "q-" + solo.id; + user.responsesPad = "r-" + solo.id; + + currentData.partnership = partnership; + currentData.partnerName = user.firstName; + + return currentData; + } + + // user already has a partnership, let's get out of here + // not returning anything so we can retry on the solo list + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("This solo is no longer solo!"); + + searchForNextSolo(user, attemptNum); + } + else { + console.log('Successfully claimed this solo'); + + // Wait for potential partner to confirm our hookup + setTimeout(function () { confirmPartnershipAccepted(user) }, 3000); + } + }, true); + }); + + }); +} + +function confirmPartnershipAccepted(user) { + partnershipsRef.child(user.partnership).once('value', function (partSnap) { + var part = partSnap.val(); + + if (part == null) { + console.log("Potential parternship didn't consummate the partnership."); + + var flakySolo = user.partnership.replace(user.uid, ""); + + clearPartnerFromUser(user); + + console.log("Removing flaky partner from solo list: " + flakySolo); + soloRef.child(flakySolo).remove(function (error) { + if (error) { + console.log('Error removing flaky solo: ' + error); + } else { + console.log('Flaky solo removed. Looking for another partner.'); + searchForSolos(user); + } + }); + + return; + } + + //loadFirepads(user, false); + joinPartnership(user, user.partnership); + }); +} + +function searchForSolos(user) { + // Make sure we're not on the solo list + soloRef.child(user.uid).transaction(function (currentData) { + + // Always return null because we want off this list + return null; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + return; + } + else if (!committed) { + console.log("I wasn't on the solo list. Proceed as planned."); + } + else { + console.log('Successfully removed myself from the solo list'); + } + + lastSoloPriority = 0; + partnerWithFirstSolo(user); + }, true); +} + +function checkAttendeeList(user) { + attendeesRef.child(user.uid).once('value', function (attendeeSnap) { + var attendee = attendeeSnap.val(); + + if (attendee == null) { + console.log("I am not on the attendee list. Let's add me!"); + + attendeesRef.child(user.uid).set(user); + } + else if (attendee.partnership != null) { + console.log("I already have a partnership: " + attendee.partnership); + + partnerFound = true; + loadFirepads(attendee); + joinPartnership(attendee, attendee.partnership); + return; + } + else { + console.log("I am an attendee without a partnership"); + } + + searchForSolos(user); + }); +} + +function searchForPartner(user) { + console.log("My user id is: " + user.uid); + + checkAttendeeList(user); +} + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +function leavePartnership() { + console.log("Request to leave partnership."); + + if (loggedInUserId == null) { + console.log("User isn't logged in."); + return; + } + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + if (user.partnership == null) { + console.log("User doesn't have a partnership to leave. Partner already left."); + searchForSolos(user); + } + else { + console.log("This user is requesting to leave partnership."); + lookingForPartnerUI(); + + var partnership = user.partnership; + + partnershipsRef.child(user.partnership).off('value'); + + partnershipsRef.child(partnership).remove(function (error) { + if (error) { + console.log('Error removing partnership: ' + error); + } else { + console.log('Partnership removed.'); + + forgetPartnership(true); + } + }); + } + }); +} + +function clearPartnerFromUser(user) { + user.partnership = null; + user.partnerName = null; + user.questionsPad = null; + user.responsesPad = null; + user.partnerChatRoom = null; + + clearMeetYourPartner(); +} + +function clearMeetYourPartner() { + $(".partnerData").text(''); +} + +function leavePrivateChatRooms() { + // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition + // having to do with getting new partners. + var rooms = publicChat._chat._rooms; + for (var key in rooms) { + if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { + publicChat._chat.leaveRoom(key); + } + } + // if (user.partnerChatRoom) { + // publicChat._chat.leaveRoom(user.partnerChatRoom); + // } +} + +function forgetPartnership(searchForPartnerImmediately) { + console.log("Forgetting my partnership."); + + attendeesRef.child(loggedInUserId).once('value', function (attendeeSnap) { + var user = attendeeSnap.val(); + + leavePrivateChatRooms(); + clearPartnerFromUser(user); + unloadFirepads(); + + attendeesRef.child(user.uid).update(user); + + if (searchForPartnerImmediately) { + // Need to search for new partner only after we clean up our partner data + // because the partner data is how we determine if we should remove a solo from the solo list + searchForSolos(user); + } + }); +} + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +const DEFAULT_QUESTION_VOTES = 0; +const MIDDLE_OF_LIST_VOTES = 50; +const TOP_OF_LIST_VOTES = 100; + +$(document).ready(function () { + initUI(); +}); + +function toggleQuestionVisibility(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function (question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + if (question.votes == 0) { + question.votes = 1; + } + else { + question.votes = question.votes * -1; + question.isActive = 0; + } + + return question; + }); +} + +function moveQuestionToMiddle(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: MIDDLE_OF_LIST_VOTES }); +} + +function moveQuestionToTop(questionId) { + var elem = $("#q-" + questionId); + + questionsRef.child(questionId).update({ votes: TOP_OF_LIST_VOTES }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + if (lastQuestionAnswered) { + questionsRef.child(lastQuestionAnswered).update({ isActive: false }); + } + + lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false }); + + lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function (confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function (currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null) { + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function (error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: DEFAULT_QUESTION_VOTES }); + + $("#question-txt").val(''); + +} diff --git a/hybrid.html b/hybrid.html new file mode 100644 index 0000000..cb34649 --- /dev/null +++ b/hybrid.html @@ -0,0 +1,448 @@ + + + + + Webshops: Better Online Learning | Customer Development Labs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  +
                                  +
                                  How to Interview Customers with Justin Wilcox
                                  +
                                  + +
                                  +
                                  +
                                  +
                                  + +
                                  +
                                  +
                                  + +
                                  + +
                                  +
                                  + + + + +
                                  +
                                  +
                                  +
                                  +

                                  Bonus #1

                                  +
                                  +
                                  +
                                  +

                                  + $50 Customer Interview Email Course
                                  + FREE +

                                  +
                                  + You'll learn... +
                                    +
                                  • Which customers to ask for interviews
                                  • +
                                  • A cold email script that works to get interviews
                                  • +
                                  • How to analyze your interview answers
                                  • +
                                  +

                                  Plus: Get free Customer Discovery Ninja coupon codes.

                                  +
                                  + +
                                  +
                                  +
                                  +

                                  Bonus #2

                                  +
                                  +
                                  +
                                  +

                                  FOCUS Framework Pre-Order

                                  + +
                                  + +
                                  +
                                  + Step by step instructions on:

                                  + What to test
                                  + When to test
                                  + How to test
                                  + + +
                                  +
                                  +
                                  Use coupon code "FounderInstitute" by March 13th for:
                                  +
                                    +
                                  • 25% off
                                  • +
                                  • Early access to chapters
                                  • +
                                  + Check out the FOCUS Framework. +
                                  + +
                                  + +
                                  +
                                  +
                                  + +
                                  +
                                  + + + + +
                                  +
                                  + +
                                  +
                                  +

                                  How likely would you be to recommend this workshop to a friend?

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

                                  What's one thing we can improve next time?

                                  +
                                  +
                                  + +
                                  +
                                  + +
                                  +
                                  +

                                  What was your favorite part of the workshop?

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

                                  How likely would you be to recommend this workshop to a friend?

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

                                  What's one thing we can improve next time?

                                  +
                                  +
                                  + +
                                  +
                                  + +
                                  +
                                  +

                                  What was your favorite part of the workshop?

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

                                  Live Stream

                                  +
                                  +
                                  + +
                                  +
                                  +
                                  + +
                                  +
                                  +
                                  +

                                  Questions: Ask and up vote.

                                  +
                                  +
                                  +
                                    +
                                    + +
                                    +
                                    + +
                                    + +
                                    + + + + + diff --git a/hybrid.js b/hybrid.js new file mode 100644 index 0000000..b7d3b22 --- /dev/null +++ b/hybrid.js @@ -0,0 +1,1047 @@ +var firebaseRoot = "https://cdlwebshops.firebaseio.com"; + +var publicChatRef = new Firebase(firebaseRoot); +var firepadRef = new Firebase(firebaseRoot + "/firepads"); +var attendeesRef = new Firebase(firebaseRoot + "/attendees"); +var soloRef = new Firebase(firebaseRoot + "/solos"); +var partnershipsRef = new Firebase(firebaseRoot + "/partnerships"); +var questionsRef = new Firebase(firebaseRoot + "/questions"); +var meetPartnerRef = new Firebase(firebaseRoot + "/meetYourPartner"); +var exercisesRef = new Firebase(firebaseRoot + "/exercises"); +var enrolledRef = new Firebase(firebaseRoot + "/enrolled"); +var feedbackRef = new Firebase(firebaseRoot + "/feedback"); + +var loggedInUserId; +var questionPad, responsePad; + +const PUBLIC_CHAT_ROOM_ID = '-JjXjD6_LIzT4f5DS9jP'; +var publicChat; + +var firstName = null; +var studentNum = null; +var studentCampus = null; +var lastSoloPriority = 0; +var lastQuestionAnswered; + +function init() { + firstName = getParameterByName('firstName'); + // studentNum = getParameterByName('studentNum'); + // studentCampus = getParameterByName('studentCampus'); + + $('.carousel').carousel({ + interval: 5000 + }); + + if (firstName == null /*|| studentNum == null || studentCampus == null*/) { + initModal(); + return; + } + + // publicChat = new FirechatUI(publicChatRef, document.getElementById("public-firechat-wrapper")); + // publicChat.maxLengthMessage = 1024; + // + // publicChat.on('room-enter', function() { + // stylizeChatRooms(); + // }); + // + logInToChat(publicChatRef, publicChat, PUBLIC_CHAT_ROOM_ID, true); + + // REGISTER DOM ELEMENTS + questionField = $('#question-txt'); + questionList = $('#example-questions'); + + // LISTEN FOR KEYPRESS EVENT + questionField.keypress(function (e) { + if (e.keyCode == 13) { + pushData(); + return false; + } + }); + + $("#btnSend").click(function () { + pushData(); + }); + + // $("#newPartner").hide(); + // $("#newPartner").click(function () { + // leavePartnership(); + // }); + + // $('.meetYourPartnerMe').on("input", function() { + // updateMyInfo($(this)); + // }); + + initEnrollForm(); + keepTabsOnTabs(); + setupInterviewScriptGenerator(); + setupFeedbackForm(); + setupQuizzes(); + + setupiFrames(); + + if (isSimpleMode()) { + setupSimpleTabButtons(); + } +} + +function setupiFrames() { + $("iframe[data-src*='.']").each(function () { + $(this).attr('src', $(this).attr('data-src')); + }); +} + +function setupQuizzes() { + // personalize each of the google form quizzes to include the student's number + $("iframe[data-src*='[studentNum]']").each(function () { + $(this).attr('data-src', $(this).attr('data-src').replace('[studentNum]', studentNum).replace('[studentCampus]', studentCampus)); + }); +} + +function setupFeedbackForm() { + $('#feedbackTabContent .npsButtons button').click(function (e) { + $(this).addClass('active'); + $(this).siblings().removeClass('active'); + + feedbackRef.child(loggedInUserId).update({ nps: Number($(this).text()) }); + }); + + $('#submitFeedbackButton').click(function (e) { + feedbackRef.child(loggedInUserId).update({ + improve: $('#toImprove').val(), + favorite: $('#favoritePart').val(), + }); + + $('#feedbackSuccessAlert').show(); + }); +} + +function setupInterviewScriptGenerator() { + $("#customerRole").on("input", function() { + $(".insertCustomerRole").text($(this).val()); + }); + + $("#problemContext").on("input", function() { + $(".insertProblemContext").text($(this).val()); + }); +} + +function updateMyInfo(elem) { + updateMeetYourPartner(elem.attr('id'), elem.val()); +} + +function stylizeChatRooms() { + // There's no class that represents this, so each time we create/join a room + // we need to fix these elements + $("#firechat textarea").parent().css("position", "absolute"); + $("#firechat textarea").parent().css("bottom", "5px"); + $("#firechat textarea").parent().css("left", "11px"); + $("#firechat textarea").parent().css("right", "11px"); +} + +function initEnrollForm() { + $('#enrollForm').bootstrapValidator({ + message: 'This value is not valid', + fields: { + enrollEmail: { + message: "Hmm, something doesn't look right.", + validators: { + emailAddress: { + message: 'The value is not a valid email address' + } + } + } + } + }); + + $("#enrollForm").submit(function(event) { + event.preventDefault(); + + enrolledRef.child(loggedInUserId).set({email: $('#enrollEmail').val()}); + $('#enrollSuccessAlert').show(); + }); +} + +function isSimpleMode() { + return document.URL.indexOf("simple.html") != -1; +} + +function getExerciseName(obj) { + return $(obj).parents(".tabContent").attr("id").replace('TabContent', ''); +} + +function setupSimpleTabButtons() { + $(".tabButtonGroup").show(); + + $(".activeTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: true}); + exercisesRef.child("active").update({exercise: exerciseName}); + }); + + $(".showTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: true}); + }); + + $(".hideTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + exercisesRef.child(exerciseName).update({show: false}); + }); + + $(".soloTabButton").click(function(obj) { + var exerciseName = getExerciseName(this); + + spotlightTab(exerciseName + "Tab"); + }); +} + +// Only used to initialize the exercises before a session. Not actively used during a session. +function setupExercisesBeforeSession() { + const DEFAULT_ACTIVE_TAB = "meetYourPartnerTab"; + + spotlightTab(DEFAULT_ACTIVE_TAB); +} + +function spotlightTab(tabName) { + var inactive = { + show: false + } + + var active = { + show: true + } + + // Set all tabs to inactive + $('.exerciseTabs > li > a').each( function(index) { + exercisesRef.child($(this).attr("id").replace("Tab", '')).set(inactive); + }); + + // Turn default tab on + exercisesRef.child(tabName.replace("Tab", '')).set(active); + exercisesRef.child("active").set({exercise: tabName.replace("Tab", '')}); +} + +function keepTabsOnTabs() { + exercisesRef.on('value', function(exercisesSnap) { + var atLeastOneTabShown = false; + var exercises = exercisesSnap.val(); + + for (property in exercises) { + var exercise = $('#' + property + "Tab"); + + $('#' + property + "TabContent").find("button").removeClass('active'); + + if (exercise.length > 0) { + if (exercises[property] && exercises[property].show) { + atLeastOneTabShown = true; + + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".showTabButton").addClass("active"); + } + else { + exercise.show(); + } + } + else { + if (isSimpleMode()) { + $('#' + property + "TabContent").find(".hideTabButton").addClass("active"); + } + else { + exercise.hide(); + } + } + } + } + + if (exercises && exercises.active) { + setActiveExercise(exercises.active.exercise); + } + + if (!isSimpleMode()) { + atLeastOneTabShown ? $('.exercisesPanel').show() : $('.exercisesPanel').hide(); + } + }); + + // If we don't do this, the firepads show up blank, until they are clicked w/n + $('#liveInterviewTab').on('shown.bs.tab', function (e) { + questionPad.codeMirror_.refresh(); + responsePad.codeMirror_.refresh(); + }); +} + +function setActiveExercise(exercise) { + $('.exerciseTabs > li > a').each( function(index) { + $(this).removeClass('currentExercise'); + }); + + var toBeActive = $("#" + exercise + "Tab"); + + if (toBeActive.length > 0) { + toBeActive.addClass('currentExercise'); + + if (!isSimpleMode()) { + toBeActive.tab('show'); + } + } + + if (isSimpleMode()) { + $('#' + exercise + "TabContent").find(".activeTabButton").addClass("active"); + } +} + +function updateMeetYourPartner(field, value) { + var update = {}; + update[field] = value; + + meetPartnerRef.child(loggedInUserId).update(update); +} + +function getMeetYourPartnerUpdates(user) { + meetPartnerRef.child(user.id).once('value', function(snap) { + console.log('updating my own partner details'); + + if (snap == null) { + console.log("I don't have any details yet."); + return; + } + + setPartnerDetails(snap.val(), true); + }); + + meetPartnerRef.child(user.lastPartner).on('value', function(snap) { + console.log('partner updated their details'); + + setPartnerDetails(snap.val(), false); + }); +} + +function setPartnerDetails(details, isMyDetails) { + var idQualifier = isMyDetails ? "" : "Partner"; + + for (property in details) { + var elem = $('#' + property + idQualifier); + + if (elem.is('a')) { + elem.attr("href", "http://" + details[property].replace("http://", '').replace("https://", '')); + elem.text(details[property]); + } + else if (elem.is('input')) { + elem.val(details[property]); + } + else { + elem.text(details[property]); + } + } +} + +function initModal() { + $('#welcomeForm').bootstrapValidator({ + message: 'This value is not valid', + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + firstName: { + message: "That's not your name", + validators: { + notEmpty: { + message: 'We need your name' + }, + stringLength: { + min: 2, + max: 20, + message: 'We can do names between 2 and 20 characters' + } + } + }, + // studentNum: { + // message: "That's not your student number", + // validators: { + // notEmpty: { + // message: 'We need your student number' + // }, + // stringLength: { + // min: 6, + // max: 12, + // message: 'We need a number between 6 and 12 digits' + // } + // } + // }, + // studentCampus: { + // validators: { + // notEmpty: { + // message: 'Please select your campus.' + // } + // } + // } + } + }); + + $( "#welcomeForm" ).submit(function(event) { + firstName = $("#attendeeName").val(); + // studentNum = $("#studentNum").val(); + // studentCampus = $("#studentCampus").val(); + }); + + $('#welcomeModal').modal({ + keyboard: false, + backdrop: 'static' + }); +} + +// function initPad(url, div, msg) { +// // Create CodeMirror (with lineWrapping on). +// var codeMirror = CodeMirror(document.getElementById(div), { lineWrapping: true }); +// +// var firepad = Firepad.fromCodeMirror(firepadRef.child(url), codeMirror, +// { richTextToolbar: false, richTextShortcuts: true }); +// +// firepad.on('ready', function() { +// if (firepad.isHistoryEmpty()) { +// firepad.setHtml(msg); +// } +// }); +// +// return firepad; +// } + +function logInToChat(chatRef, chatUI, roomId, getPartner) { + var simpleLogin = new FirebaseSimpleLogin(chatRef, function(err, user) { + if (user) { + loggedInUserId = user.id; + + user.firstName = firstName; + // chatUI.setUser(user.id, firstName); + // + // if (roomId != null) { + // setTimeout(function() { + // chatUI._chat.enterRoom(roomId); + // }, 500); + // } + // + // if (getPartner) { + // searchForPartner(user); + // } + + authUserName = firstName; + fbid = user.id; + + // simple should see all of the questions, everyone else should only see the unhidden ones + var startAtNum = isSimpleMode() ? -1000000 : 1; + + // Add a callback that is triggered for each chat question. + questionsRef.orderByChild('votes').startAt(startAtNum).on('value', function (allQuestionsSnapshot) { + questionList.empty(); + + var activeQuestion; + + allQuestionsSnapshot.forEach(function(snapshot) { + + //GET DATA + var questionId = snapshot.key(); + var data = snapshot.val(); + var fbid_d = data.fbid; + var username_d = data.name; + var question_d = data.text; + var date_d = data.currentdate; + var votes_d = data.votes; + + divdir = ""; + + //CREATE ELEMENTS question & SANITIZE TEXT + var questionElement = $("
                                  • "); + var divmediabody = $("
                                    "); + var divmedia = $("
                                    "); + + var voteLink; + var userAskedQuestion = fbid_d == fbid; + + if (isSimpleMode()) { + var answerText = data.isActive ? "Unanswer" : "Answer"; + var hideText = data.votes <= 0 ? "Show" : "Hide"; + + voteLink = "" + answerText + " " + hideText + ""; + } + else if (userAskedQuestion) { + // This user submitted the question + voteLink = "Delete"; + } + else { + var voteText = data.voters && data.voters.hasOwnProperty(fbid) ? "Down Vote" : "Up Vote"; + voteLink = "" + voteText + ""; + } + + var voteCount = data.votes ? data.votes : 1; + var votesElement = "" + voteLink + ": "+ voteCount + ""; + var userNameElement = " " + (userAskedQuestion ? "You" : username_d) + ""; + var dateElement = " " + date_d + ""; + + var divmediabody2 = $("
                                    "); + questionElement.append(divmediabody); + divmediabody.append(divmedia); + //divmedia.append(a); + //divmedia.append(votesElement); + divmedia.append(divmediabody2); + + var usernamediv = $(""); + divmediabody2.html(question_d); + + divmediabody2.append(usernamediv); + usernamediv.html("
                                    " + userNameElement + "
                                    " + votesElement); + + //ADD question + if (data.isActive) { + activeQuestion = questionElement; + divmediabody2.addClass('bg-danger'); + } + else { + if (userAskedQuestion) { + divmediabody2.addClass('bg-success'); + // divmediabody2.css('background', "#476982"); + // usernamediv.css('color', "#CCC") + } + else if (data.votes > 0) { + // divmediabody2.css('background', "#73B3D7"); + divmediabody2.addClass('bg-info'); + } + else { + divmediabody2.addClass('bg-warning'); + } + + questionList.prepend(questionElement); + } + }); + + questionList.prepend(activeQuestion); + }); + + } else { + simpleLogin.login('anonymous', { + rememberMe: true + }); + } + }); +} + +// function loadFirepads(user, addDefaultText) { +// // questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "Work with your partner to record the questions Justin asks during the customer interview here!


                                    You'll see what your partner types, as she/he does.


                                    Delete this intro once you and your partner have read it." : ""); +// // responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "Work with your partner to take extensive notes on the customer's resposes.


                                    (Delete this too :)" : ""); +// +// questionPad = initPad(user.questionsPad, 'questionsPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                                     
                                    Note: your partner will be able to see your text as you type it.
                                     
                                    Try editing this text!
                                     
                                     
                                    2. Secretly pick a company below to pitch:
                                     

                                    • AirBnB
                                    • Pampers (diapers)
                                    • Twitter
                                    • Facebook
                                    • Subway (sandwiches)
                                    • Instagram
                                    • Disney
                                    • SnapChat
                                    • Angry Birds (Rovio)
                                    • RedBull
                                     
                                    3. Fill out the pitch template for the company you're pitching:
                                     
                                    - Problem:
                                     
                                     
                                     
                                    - Solution:
                                     
                                     
                                     
                                    - Market:
                                     
                                     
                                     
                                    - Business Model:
                                     
                                     
                                     
                                    -------------------------------------------------------
                                     
                                    4. Guess which company your partner is pitching:
                                     
                                     
                                     
                                    5. Which elements of your partner's pitch could be improved? 
                                     
                                     
                                    " : ""); +// responsePad = initPad(user.responsesPad, 'responsesPad', addDefaultText ? "1. Decide which partner will be on the left, and which will be on the right.
                                     
                                    Note: your partner will be able to see your text as you type it.
                                     
                                    Try editing this text!
                                     
                                     
                                    2. Secretly pick a company below to pitch:
                                     
                                    • AirBnB
                                    • Pampers (diapers)
                                    • Twitter
                                    • Facebook
                                    • Subway (sandwiches)
                                    • Instagram
                                    • Disney
                                    • SnapChat
                                    • Angry Birds (Rovio)
                                    • RedBull
                                     
                                    3. Fill out the pitch template for the company you're pitching:
                                     
                                    - Problem:
                                     
                                     
                                     
                                    - Solution:
                                     
                                     
                                     
                                    - Market:
                                     
                                     
                                     
                                    - Business Model:
                                     
                                     
                                     
                                    -------------------------------------------------------
                                     
                                    4. Guess which company your partner is pitching:
                                     
                                     
                                     
                                    5. Which elements of your partner's pitch could be improved? 
                                     
                                     
                                    " : ""); +// } + +// function unloadFirepads() { +// console.log("unloading firepads"); +// +// $('#responsesPad').hide().attr('id', 'oldResponsesPad').clone().show().attr('id', 'responsesPad').html('').appendTo("#responsesContainer"); +// $('#questionsPad').hide().attr('id', 'oldQuestionsPad').clone().show().attr('id', 'questionsPad').html('').appendTo("#questionsContainer"); +// +// try { +// questionPad.dispose(); +// } catch (exc) { +// console.log("Error disposing question pad: " + exc.message); +// } +// +// try { +// responsePad.dispose(); +// } catch (exc) { +// console.log("Error disposing response pad: " + exc.message); +// } +// +// $('#oldQuestionsPad').remove(); +// $('#oldResponsesPad').remove(); +// } +// +// function joinPartnership(user, partnership) { +// user.partnership = partnership; +// user.lastPartner = partnership.replace(user.id, ""); +// +// attendeesRef.child(user.id).update(user); +// +// leavePrivateChatRooms(); +// +// // join chat room +// partnershipsRef.child(partnership).on('value', function(partSnap) { +// var part = partSnap.val(); +// +// if (part == null) { +// console.log("Partnership is null. Request to be terminated."); +// forgetPartnership(false); +// $("#partnerName").html("Your partner isn't available. Let's find another for you!"); +// +// return; +// } +// else if (part.room != null) { +// console.log("Entering our partner chat room: " + part.room); +// publicChat._chat.enterRoom(part.room); +// +// user.partnerChatRoom = part.room; +// attendeesRef.child(user.id).update(user); +// } +// }); +// +// soloRef.off('child_changed'); +// +// // intro partners +// $("#partnerName").html("Say hi to your workshop partner, !"); +// $('.partnerName').text(user.partnerName); +// $("#newPartner").show(); +// +// getMeetYourPartnerUpdates(user); +// } +// +// function lookingForPartnerUI() { +// $("#partnerName").html("Looking for a partner for you..."); +// $("#newPartner").hide(); +// } +// +// function joinSoloList(user) { +// soloRef.child(user.id).setWithPriority(user, new Date().getTime()); +// console.log("Added myself to the solo list."); +// +// lookingForPartnerUI(); +// +// // since I'm the first to the meeting, use my id to key the firepads +// // my partner will hook into these pads +// user.questionsPad = "q-" + user.id; +// user.responsesPad = "r-" + user.id; +// +// // store my pad addresses +// attendeesRef.child(user.id).update(user); +// +// loadFirepads(user, true); +// +// soloRef.on('child_changed', function(soloSnap) { +// var solo = soloSnap.val(); +// +// if (solo.id != user.id) { +// console.log("Someone else's solo changed"); +// return; +// } +// +// console.log("Our solo changed..."); +// +// if (solo.partnership == null) { +// console.log("but no one added a partnership. Not sure what's up."); +// } +// else { +// console.log("and we have a new partnership!"); +// +// soloRef.child(user.id).remove(function(error) { +// if (error) { +// console.log("Error removing myself from the solo list", error); +// } +// else { +// console.log("Successfully removed myself from the solo list", error); +// } +// }); +// +// user.partnerName = solo.partnerName; +// user.partnership = solo.partnership; +// +// publicChat._chat.createRoom("Private: " + user.firstName + " and " + user.partnerName, 'private', function(roomId) { +// console.log('Created our partnership chat room'); +// partnershipsRef.child(solo.partnership).set({"room": roomId}); +// +// user.partnerChatRoom = roomId; +// joinPartnership(user, solo.partnership); +// }); +// } +// }); +// } +// +// function searchForNextSolo(user, attemptNum) { +// // There were solos available, but we had a conflict trying to partner with one +// // Wait a bit and try again +// var MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO = 100; +// var attempt = attemptNum == null ? 0 : attemptNum; +// +// if (attempt >= MAX_ATTEMPTS_TO_SEARCH_FOR_ANOTHER_SOLO) { +// console.log("Exceeded max # of attempts to find a partner on the solo list. Skipping the solo search"); +// +// joinSoloList(user); +// } +// else { +// setTimeout(partnerWithFirstSolo(user, ++attempt), 500); +// return; +// } +// } +// +// function partnerWithFirstSolo(user, attemptNum) { +// if (attemptNum != null) { +// console.log("This is attempt #" + (attemptNum + 1) + " to find a partner on the solo list."); +// } +// +// var firstSolo = soloRef.startAt(lastSoloPriority + 1).limit(1); +// +// firstSolo.once('value', function(solosSnap) { +// // Are there any solos? +// +// var solos = solosSnap.val(); +// +// if (solos == null) { +// console.log('There are no available solos.'); +// joinSoloList(user); +// return; +// } +// +// firstSolo.once('child_added', function(soloSnap) { +// // iterate the solos +// var solo = soloSnap.val(); +// +// lastSoloPriority = soloSnap.getPriority(); +// +// if (solo.id == user.lastPartner) { +// console.log("Found potential partner, but I just left a partnership with them. Skipping."); +// +// searchForNextSolo(user, attemptNum); +// return; +// } +// +// soloRef.child(solo.id).transaction(function(currentData) { +// if (currentData == null) { +// // This is just an inconsistent state. Keep going. +// return null; +// } +// +// if (currentData.partnership == null) { +// // let's make a baby! +// var partnership; +// +// if (user.id.localeCompare(solo.id) < 0) { +// partnership = user.id + solo.id; +// } +// else { +// partnership = solo.id + user.id; +// } +// +// user.partnership = partnership; +// user.partnerName = currentData.firstName; +// user.questionsPad = "q-" + solo.id; +// user.responsesPad = "r-" + solo.id; +// +// currentData.partnership = partnership; +// currentData.partnerName = user.firstName; +// +// return currentData; +// } +// +// // user already has a partnership, let's get out of here +// // not returning anything so we can retry on the solo list +// }, function(error, committed, snapshot) { +// if (error != null) { +// console.log('Transaction failed abnormally!', error); +// } +// else if (!committed) { +// console.log("This solo is no longer solo!"); +// +// searchForNextSolo(user, attemptNum); +// } +// else { +// console.log('Successfully claimed this solo'); +// +// // Wait for potential partner to confirm our hookup +// setTimeout(function(){confirmPartnershipAccepted(user)}, 3000); +// } +// }, true); +// }); +// +// }); +// } +// +// function confirmPartnershipAccepted(user) { +// partnershipsRef.child(user.partnership).once('value', function(partSnap) { +// var part = partSnap.val(); +// +// if (part == null) { +// console.log("Potential parternship didn't consummate the partnership."); +// +// var flakySolo = user.partnership.replace(user.id, ""); +// +// clearPartnerFromUser(user); +// +// console.log("Removing flaky partner from solo list: " + flakySolo); +// soloRef.child(flakySolo).remove(function(error) { +// if (error) { +// console.log('Error removing flaky solo: ' + error); +// } else { +// console.log('Flaky solo removed. Looking for another partner.'); +// searchForSolos(user); +// } +// }); +// +// return; +// } +// +// loadFirepads(user, false); +// joinPartnership(user, user.partnership); +// }); +// } +// +// function searchForSolos(user) { +// // Make sure we're not on the solo list +// soloRef.child(user.id).transaction(function(currentData) { +// +// // Always return null because we want off this list +// return null; +// +// }, function(error, committed, snapshot) { +// if (error != null) { +// console.log('Transaction failed abnormally!', error); +// return; +// } +// else if (!committed) { +// console.log("I wasn't on the solo list. Proceed as planned."); +// } +// else { +// console.log('Successfully removed myself from the solo list'); +// } +// +// lastSoloPriority = 0; +// partnerWithFirstSolo(user); +// }, true); +// } +// +// function checkAttendeeList(user) { +// attendeesRef.child(user.id).once('value', function(attendeeSnap) { +// var attendee = attendeeSnap.val(); +// +// if (attendee == null) { +// console.log("I am not on the attendee list. Let's add me!"); +// +// attendeesRef.child(user.id).set(user); +// } +// else if (attendee.partnership != null) { +// console.log("I already have a partnership: " + attendee.partnership); +// +// partnerFound = true; +// loadFirepads(attendee); +// joinPartnership(attendee, attendee.partnership); +// return; +// } +// else { +// console.log("I am an attendee without a partnership"); +// } +// +// searchForSolos(user); +// }); +// } +// +// function searchForPartner(user) { +// console.log("My user id is: " + user.id); +// +// checkAttendeeList(user); +// } + +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); +} + +// function leavePartnership() { +// console.log("Request to leave partnership."); +// +// if (loggedInUserId == null) { +// console.log("User isn't logged in."); +// return; +// } +// +// attendeesRef.child(loggedInUserId).once('value', function(attendeeSnap) { +// var user = attendeeSnap.val(); +// +// if (user.partnership == null) { +// console.log("User doesn't have a partnership to leave. Partner already left."); +// searchForSolos(user); +// } +// else { +// console.log("This user is requesting to leave partnership."); +// lookingForPartnerUI(); +// +// var partnership = user.partnership; +// +// partnershipsRef.child(user.partnership).off('value'); +// +// partnershipsRef.child(partnership).remove(function(error) { +// if (error) { +// console.log('Error removing partnership: ' + error); +// } else { +// console.log('Partnership removed.'); +// +// forgetPartnership(true); +// } +// }); +// } +// }); +// } +// +// function clearPartnerFromUser(user) { +// user.partnership = null; +// user.partnerName = null; +// user.questionsPad = null; +// user.responsesPad = null; +// user.partnerChatRoom = null; +// +// clearMeetYourPartner(); +// } +// +// function clearMeetYourPartner() { +// $(".partnerData").text(''); +// } +// +// function leavePrivateChatRooms() { +// // Leave all non-public chat rooms. Sometimes we weren't leaving chat rooms, some sort of race condition +// // having to do with getting new partners. +// var rooms = publicChat._chat._rooms; +// for (var key in rooms) { +// if (rooms.hasOwnProperty(key) && key != PUBLIC_CHAT_ROOM_ID) { +// publicChat._chat.leaveRoom(key); +// } +// } +// // if (user.partnerChatRoom) { +// // publicChat._chat.leaveRoom(user.partnerChatRoom); +// // } +// } +// +// function forgetPartnership(searchForPartnerImmediately) { +// console.log("Forgetting my partnership."); +// +// attendeesRef.child(loggedInUserId).once('value', function(attendeeSnap) { +// var user = attendeeSnap.val(); +// +// leavePrivateChatRooms(); +// clearPartnerFromUser(user); +// unloadFirepads(); +// +// attendeesRef.child(user.id).update(user); +// +// if (searchForPartnerImmediately) { +// // Need to search for new partner only after we clean up our partner data +// // because the partner data is how we determine if we should remove a solo from the solo list +// searchForSolos(user); +// } +// }); +// } + +/* Questions */ +var fbid = ''; +var divdir = ''; +var questionField; +var questionList; +var lastfid = '1'; +var lastdir = 'L'; +var newdir = 'L'; +var authUserName = ''; + +$(document).ready( function() { + init(); +}); + +function hideQuestion(questionId) { + var elem = $("#q-" + questionId + "-hide"); + var amHiding = elem.text().toLowerCase() == "hide"; + + questionsRef.child(questionId).transaction(function(question) { + if (question == null) { + // This is just an inconsistent state. Keep going. + return null; + } + + question.votes = question.votes * -1; + question.isActive = 0; + return question; + }); +} + +function answerQuestion(questionId) { + var elem = $("#q-" + questionId); + var amAnswering = elem.text().toLowerCase() == "answer"; + + if (amAnswering) { + if (lastQuestionAnswered) { + questionsRef.child(lastQuestionAnswered).update({ isActive: false}); + } + + lastQuestionAnswered = questionId; + questionsRef.child(questionId).update({ isActive: true }); + } + else { + questionsRef.child(questionId).update({ isActive: false}); + + lastQuestionAnswered = null; + } +} + +function deleteQuestion(questionId) { + bootbox.confirm("Are you sure?", function(confirmed) { + if (confirmed) { + questionsRef.child(questionId).remove(); + } + }); +} + +function toggleVote(questionId) { + questionsRef.child(questionId).transaction(function(currentData) { + var question = $('#q-' + questionId); + + if (currentData.votes == null) { + currentData.votes = 1; + } + + if (currentData.voters && currentData.voters.hasOwnProperty(fbid)) { + delete currentData.voters[fbid]; + + currentData.votes--; + } + else if (currentData.voters == null){ + var newVoter = {}; + newVoter[fbid] = true; + + currentData.voters = newVoter; + + currentData.votes++; + } + else { + currentData.voters[fbid] = true; + currentData.votes++; + } + + return currentData; + + }, function(error, committed, snapshot) { + if (error != null) { + console.log('Transaction failed abnormally!', error); + } + else if (!committed) { + console.log("Transaction was aborted by us."); + } + else { + console.log('Successfully voted'); + } + }, true); +} + +function pushData() { + + //FIELD VALUES + var username = authUserName; + var question = $("#question-txt").val(); + //Clientside Datetime + var cdate = new Date(); + + //*********************************************************** + //Set current text question direction to push it to firebase. + //*********************************************************** + + var newQ = questionsRef.push({ name: username, text: question, fbid: fbid, currentdate: cdate.toLocaleString(), votes: 1 }); + + $("#question-txt").val(''); + +} diff --git a/img/All-Bookshops.png b/img/All-Bookshops.png new file mode 100644 index 0000000..b00cca4 Binary files /dev/null and b/img/All-Bookshops.png differ diff --git a/img/Inside-workbook-Rendered---800---Transparent.png b/img/Inside-workbook-Rendered---800---Transparent.png new file mode 100644 index 0000000..34630d3 Binary files /dev/null and b/img/Inside-workbook-Rendered---800---Transparent.png differ diff --git a/img/Inside-workbook-Rendered.png b/img/Inside-workbook-Rendered.png new file mode 100644 index 0000000..25433d7 Binary files /dev/null and b/img/Inside-workbook-Rendered.png differ diff --git a/img/Lean-Startup Week_logo1-300.png b/img/Lean-Startup Week_logo1-300.png new file mode 100644 index 0000000..39d5e48 Binary files /dev/null and b/img/Lean-Startup Week_logo1-300.png differ diff --git a/img/all-five.png b/img/all-five.png new file mode 100644 index 0000000..301eac1 Binary files /dev/null and b/img/all-five.png differ diff --git a/img/favicon-16x16.png b/img/favicon-16x16.png new file mode 100644 index 0000000..d64653a Binary files /dev/null and b/img/favicon-16x16.png differ diff --git a/img/favicon-32x32.png b/img/favicon-32x32.png new file mode 100644 index 0000000..98a3769 Binary files /dev/null and b/img/favicon-32x32.png differ diff --git a/img/favicon.png b/img/favicon.png new file mode 100644 index 0000000..01b77a9 Binary files /dev/null and b/img/favicon.png differ diff --git a/img/founder-institute.png b/img/founder-institute.png new file mode 100644 index 0000000..653873e Binary files /dev/null and b/img/founder-institute.png differ diff --git a/img/startup-weekend-logo.png b/img/startup-weekend-logo.png new file mode 100644 index 0000000..96a37e5 Binary files /dev/null and b/img/startup-weekend-logo.png differ diff --git a/index.html b/index.html index 40ccd21..a3dbdea 100644 --- a/index.html +++ b/index.html @@ -1,499 +1,801 @@ - - Bad Ass Customer Interviews...Live! | Customer Development Labs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -