Coder Social home page Coder Social logo

schenda's People

Contributors

sotch-pr35mac avatar steventhanna avatar

Stargazers

 avatar

Watchers

 avatar  avatar

schenda's Issues

No response to link action

There is no response when <a href="/class/<%= classroom.urlName %>/tasks/<%= tasks[i].tid %>" id="actions" data-target="#taskActions" data-toggle="modal" class="action" style="color: <%= classroom.color %>"><i class="fa fa-ellipsis-v"></i></a> is clicked.

However, when you right click, and Open in New Tab, everything loads as it should.

Very strange.

Textarea on edit note not operating correctly.

For some reason, the browser console throws a null exception error when it tries the following code:

var description = document.getElementById('noteDescription').innerHTML;

I have been able to get around the error, and get the system to execute the rest of the code by doing the following:

try {
  var description = document.getElementById('noteDescription').innerHTML;
  console.log(description);
} catch (e) {
  console.log(e);
}

The console message in the browser is the following:

TypeError: Cannot read property 'innerHTML' of null(…)

Is it possible that I should use .value() instead?

Make controller code more concise

When task information needs to be changed, I no longer have to look up the user, then the classroom, and then project, and finally the task... Instead just look up the user, and then the task. Saves time, and code. Makes things run quicker also.

Description on task.ejs not operating as should

The description div on task.ejs is not operating as it should.

<div class="description">
  <% if (tasks[i].note == "") { %>
      No notes
  <% } else { %>
    <%= tasks[i].note %>
  <% } %>
</div>

For some reason, it spits out No notes each time. That should not be the case.

Correct Remove Method in ClassController

To preserve db data, the method remove should do the following:

  1. Destroy the object.
  2. Remove object id from the array in parent object

Instead of

  1. Remove object id from the array in parent object
  2. Destroy the object.

Conflict WIth Duplicate Notes, or Classes

In order to create pretty URL's for the end user, I use the following routes:

  'GET /class/:className': {
    controller: 'user',
    action: 'classHome'
  },

With className being the regular className, with - instead of spaces.
The flow for looking this up is as follows.

  1. Get name from URL
  2. Check name with URL names listed in DB for that specific user. Get that CID
  3. Send that classroom from the retrieved CID to the page.

The problem lies with the possibility of users attempting to create two identical notes, or two identical classes... This needs to be fixed in the backend...

Pass all Classrooms to the Page

Overview

I am having an issue passing all classrooms to the overview page...
My thought process is the following:

  1. Get the list of CID's from the user. user.classes.
  2. Create a new array called classList.
  3. Iterate through all of the CID's, and look each ID up, using Classroom.findOne.
  4. Pass the classroom looked up into classList
  5. Send classList to the page.
    However, this does not work...
    For some reason, everything comes back undefined, although when I console.log the information gathered, ie classList[i].name, it prints the correct information to the console.... Keep in mind this is still in the for loop... When I console.log outside of the for loop, information is printed undefined.

Implementation

overview: function(req, res) {
    //Lookup the user in the database.
    User.findOne({
      id: req.user.id
    }).exec(function(err, user) {
      //Handle errors looking up the user in the database.
      if (err || user == undefined) {
        console.log("There was an error looking up the user.  Error Code 007");
        //Report a 500
        res.serverError();
      } else {
        var classIdList = user.classes;
        // console.log(classIdList);
        // console.log(classIdList.length);
        var allClasses = [];
        for (var i = 0; i < classIdList.length; i++) {
          Classroom.findOne({
            cid: classIdList[i]
          }).exec(function(err, className) {
            if (err || className == undefined) {
              console.log("There was an error looking up the classes from the CID list");
              res.serverError();
            } else {
              var classroom = {
                cid: className.cid,
                name: className.name,
                urlName: className.urlName,
                tasks: className.tasks,
                projects: className.projects,
                notes: className.notes
              };
              allClasses.push(classroom);
              console.log(className);
              console.log(className.name);
            }
          });
        }
        console.log(allClasses);
        console.log(allClasses.length);
        res.view('dashboard/overview', {
          user: user,
          classes: allClasses
        });
      }
    });
  },

Task Completion Still Having Errors

Its not that it is having an error, but rather it will not change from incomplete to complete. I am just going to rewrite the function in the morning.

Autosave for Notes

Auto-saving for notes.

To reduce the strain on the server, the note should autosave to the local cache continuously. Every x minutes, the page should make a PUT request (per @sotch-pr35mac recommendation) to the server.

Now I just have no clue how to deal with the local cache.

Note preview tab

Create a note preview tab inside the edit note... Should not be too bad?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.