diff --git a/css/newbucketList.css b/css/newbucketList.css index 3e101cd..51255b5 100644 --- a/css/newbucketList.css +++ b/css/newbucketList.css @@ -207,8 +207,8 @@ ul, li { } #helpPaper { - height: 250px; - width: 201px; + height: 375px; + width: 300px; background-image: url('../img/helpPaper.gif'); } diff --git a/js/newbucketList.js b/js/newbucketList.js index b2c1660..33dcb6e 100644 --- a/js/newbucketList.js +++ b/js/newbucketList.js @@ -2,6 +2,12 @@ * @author Becky */ $(document).ready(function() { + + var screenWidth = window.innerWidth; + var screenHeight = window.innerHeight; + + $('#enterPaper').css('top', screenHeight/2 - 150); + $('#enterPaper').css('left', screenWidth/2 - 220); $(".draggable").draggable( {containment: "#container"} ); @@ -57,8 +63,23 @@ function login(type) { user.friends = [new Collaborator("Becky Bianco", "renminbi@mit.edu"), new Collaborator("Tamara Fleisher", "tfleish@mit.edu")]; maxZ = 0; // should get this and totalPapers from data from backend totalPapers = 0; - loadLoginData(); + if(type == 'create') { + note = new Task("Buckets are groups of tasks. You can use them to organize tasks and share them with friends.", "z", 1); + user.board.stickies[0] = new Sticky([100, 500], 0, [187, 144], "task", note); + + note = new Task("You can post notes or tasks on your bulletin board by clicking the post-it image.", "z", 2); + user.board.stickies[1] = new Sticky([200, 700], 0, [187, 144], "task", note); + + note = new Note("r", "Collaborators in a Bucket can see all tasks within the Bucket. You can also assign tasks to individual collaborators.", 1, "z"); + user.board.stickies[2] = new Sticky([300, 200], 0, [187, 144], "note", note); + + note = new Note("r", "Its easy to send alerts to other users reminding them about important information - just click the 'alert' button beside the note and check their name!", 2, "z"); + user.board.stickies[3] = new Sticky([50, 900], 0, [187, 144], "note", note); + + } + + loadLoginData(); $('#nameEntry').val(""); $('#usernameEnter').val(""); @@ -98,10 +119,10 @@ function postSticky(sticky) { var id = 'b'+b+'t'+t+'s'; var taskID = '#b'+b+'t'+t; - var note = "
" + var note = "
" +"
"+item.name+"
" +"
" - +"
x
"; + +"
x
"; } else { // Post a note sticky var note = sticky.item; var n = note.index; @@ -110,10 +131,10 @@ function postSticky(sticky) { var id = 'b'+b+'t'+t+'n'+n+'s'; var noteId = '#b'+b+'t'+t+'n'+n; - var note = "
" + var note = "
" +"
"+item.text+"
" +"
" - +"
x
"; + +"
x
"; } $("#container").append(note); moveToFront(id); @@ -552,7 +573,7 @@ function addSticky(index, paperID) { task.openPaper = true; var sticky = new Sticky(pos, maxZ, [96, 75], "task", task); var id='stickyb'+task.bucketNum+"t"+task.index - var html = "
" + var html = "
" +"
"+task.name+"
" +"
" +"
x
"; @@ -562,7 +583,7 @@ function addSticky(index, paperID) { note.openSticky = true; var sticky = new Sticky(pos, maxZ, [96, 75], "note", note) - var html = "
" + var html = "
" +"
"+note.text+"
" +"
" +"
x
"; @@ -571,7 +592,7 @@ function addSticky(index, paperID) { var sticky = new Sticky(pos, maxZ, [96, 75], "task", task); task.openSticky = true; id = 'stickyb'+task.bucketNum+"t"+task.index - var html = "
" + var html = "
" +"
"+task.name+"
" +"
" +"
x
"; @@ -584,7 +605,18 @@ function addSticky(index, paperID) { } function closeSticky(bucketNo, taskNo, noteNo) { - if(noteNo == null) { + if(bucketNo == "z") { + if(noteNo == null) { + var id = '#b'+bucketNo+'t'+taskNo+'s'; + $(id).remove(); + user.board.stickies.splice(taskNo-1, taskNo-1); + } else { + var id = '#b'+bucketNo+'t'+taskNo+'n'+noteNo+'s'; + $(id).remove(); + user.board.stickies.splice(taskNo+1, taskNo+1); + } + } + else if(noteNo == null) { var id = "stickyb"+bucketNo+"t"+taskNo; var item = user.organizer[bucketNo].tasks[taskNo] } else { @@ -691,28 +723,84 @@ function closePaper(id) { function help() { //create new paper, add it to container div var helpTitle = "
How can we help you?
" + var helpTopics = "Buckets
" + +"Post-its
" + +"Collaborators
" + +"Alerts
" var helpPaper = "
" +helpTitle + +helpTopics +"
x
" +"
"; $('#container').append(helpPaper); $(".draggable").draggable( {containment: "#container"} ); } -function logout() { - if($('#nameEntry').val()!="") { - $('#nameButton').attr("value", $('#nameEntry').val()); +function changeHelpFocus(dest) { + if(dest == 'back') { + var helpTitle = "
How can we help you?
" + var helpTopics = "Buckets
" + +"Post-its
" + +"Collaborators
" + +"Alerts
" + var helpPaper = helpTitle + +helpTopics + +"
x
" + $('#helpPaper').html(helpPaper); + } else if(dest == 'buckets') { + var helpTitle = "
Buckets
" + var helpText = "
Buckets are how you organize tasks into categories. You can use them for personal organization or add other users to you Bucket to share all the tasks within the Bucket with them. You can view a list of your Buckets by clicking 'My Buckets'. Clicking on a Bucket name lets you view all tasks within the bucket and a list of collaborators in the Bucket.

" + var backButton = "" + var helpPaper = helpTitle + +helpText + +backButton + +"
x
"; + $('#helpPaper').html(helpPaper); + } else if(dest == 'postits') { + var helpTitle = "
Post-its
" + var helpText = "
To help you organize and remember your important tasks and notes, you can post them on your bulletin board! To do this, simply click the post-it icon beside the task / note. You can move the post-its wherever you want on the board. You can also edit them, either from the post-it itself or from the task / Bucket view. Clicking the 'x' removes the post-it from the Bulletin board, but you can always reopen it later.

" + var backButton = "" + var helpPaper = helpTitle + +helpText + +backButton + +"
x
" + $('#helpPaper').html(helpPaper); + } else if(dest == 'collabs') { + var helpTitle = "
Collaborators
" + var helpText = "
Collaborators on a Bucket can see all tasks within the Bucket. You can also assign specific tasks to individual collaborators. When adding collaborators to Buckets, you can select from any user you have previously communicated with, or type the name or email of a different user. To assign a task, simple select from the collaborators already added to the Bucket.

" + var backButton = "" + var helpPaper = helpTitle + +helpText + +backButton + +"
x
" + $('#helpPaper').html(helpPaper); + } else if(dest == 'alerts') { + var helpTitle = "
Alerts
" + var helpText = "
Alerts make communicating with friends and sending reminders easy. You have a drop-down list with all your alerts (new ones in bold). You automatically receive an alert whenever a due-date is approaching or you are added to a Bucket or assigned a task. You also have the option of alerting collaborators of new notes, by clicking the 'alert' icon beside the note, to make sure they donŐt miss anything important.

" + var backButton = "" + var helpPaper = helpTitle + +helpText + +backButton + +"
x
" + $('#helpPaper').html(helpPaper); } +} + +function logout() { + + $('#enterPaper').removeClass('hidden'); $('#welcomeHolder').removeClass('hidden'); - $('#accountCreate').addClass('hidden'); $('#bottomBar').addClass('hidden'); $('#dropDownBar').addClass('hidden'); - $('#enterScreen').addClass('hidden'); + for(var i = 0; i < user.board.stickies.length; i++) { + user.board.stickies[i].remove(); + } + user.board.stickes = []; - for(i=0; i