Jump to content

Arkaine

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by Arkaine

  1. Just realized you released the new percentage calc. It looks much nicer!
  2. I think I'm going cross-eyed with all this code! It appears to be functioning normally client-side (it's sending the count httppostvar). It must be server-side, where it takes the input and writes it to the bookings.xml file because the count XML attribute isn't showing up there.
  3. Whoops, that wasn't cause and effect. It was sending count as other too...so it does this for both Room and Other.
  4. It is sending the count variable now that I've set the type to room, but now there is no count XML attribute in bookings.xml.
  5. Oh, right, you said "Room." Same result though.
  6. Oh, durr, the log didn't show up because I didn't try that outside the ELSE IF scope. I have a few DOH moments myself.
  7. Oh, it did before the notes feature was added. Which type should I be using? Ah! It wasn't showing up in the Chrome console, I'll try Firefox.
  8. Doesn't work even if I change ELSE IF to just ELSE...odd. else /*if (curres.Quantities.length > 0 && curres.CanShare && parseInt($("#bfquantspin").val()) < parseInt(curres.Quantities[curres.Quantities.length - 1]))*/ {
  9. If I was using an IDE and not Notepad, I would totally do this. As a workaround, I've done this. I don't get anything when it's inside the else if scope, so I added it after. else if (curres.Quantities.length > 0 && curres.CanShare && parseInt($("#bfquantspin").val()) < parseInt(curres.Quantities[curres.Quantities.length - 1])) { d += ', "Count": ' + $("#bfquantspin").val(); } alert(curres.Quantities.length > 0); alert(curres.CanShare); alert(parseInt($("#bfquantspin").val())); alert(parseInt(curres.Quantities[curres.Quantities.length - 1])); alert(parseInt($("#bfquantspin").val()) < parseInt(curres.Quantities[curres.Quantities.length - 1])); When i enter 18 I get: true true 18 18 false When i enter 16 i get: true true 16 18 true Max is 18, by the way.
  10. Ha! Yes, you're quick! It's beautiful! I'm trying to fix a new problem...well, the symptom is the same as an old problem, POST went wonky again. No count.
  11. I'll just change the min-height value in the CSS, but the percentage calculation fix would definitely be nice since it crushes the rows unnecessarily.
  12. I've started to show only relevant resources to users (e.g. high school resources to high school teachers, middle school resources to middle school teachers) but the height of each resource shrinks based on what I believe is the total number of resources in the configuration file. #bookingday .body .col, #bookingday #resources div { height: %; } something like 100 / numberOfResourcesInTheConfigFile would become 100 / numberOfResourcesVisibleToTheLoggedInUser An alternative, which I actually like better is to allow the admin to specify a fixed height in setup or configuration.
  13. Ah ha! That would do it!
  14. Hey, you've been great; there is no rush! I do have it functioning correctly with the two changes I mentioned earlier, and that's good enough to present to librarians and lab monitors. I do have a request from one of my librarians, though. What do you think about allowing the teacher to add notes when booking a resource...like a text area input field for special requests or details (e.g. "group work", "testing," "Johnny should work diligently on X and return to class at Y time," etc.)? The value could be displayed as either hover text or in the "are you sure you want to remove" dialog. There could be some sort of indicator on the grid that there are notes attached to the booking such as an icon, different font/background color, or text decoration (e.g. italic). That way the resource administrators know there is something to read.
  15. That sounds painful. I remember the dial-up days; we used to bond two 56k modems together to double our bandwidth at home, heh.
  16. No rest for the wicked.
  17. ...but if it can be shared, and even if the requested quantity == max quantity, then we still want the count transmitted, unless there is some other server-side logic that interprets null as just "book available quantity," which doesn't seem to be happening. It's interpreting it as "book 0 quantity." Anyway, what we really want is to compare the input to the quantity available for that lesson, not the max quantity. This: $("#bfquantspin").val() < curres.Quantities[curres.Quantities.length - 1] would become: 0 < $("#bfquantspin").val() && $("#bfquantspin").val() <= whateverTheAvailableQuantityIs To prevent overbookings and negative bookings (even though the dropdown input field is capped, a clever user can modify the client-side HTML/JavaScript to get around that), thus input validation should be done server-side before writing to bookings.xml, which prevents garbage records from getting into the database. <xkcd: Exploits of a Mom>
  18. Actually, you'd probably want to set that option per resource.
  19. That would make a great resource control panel option! I'd set it to 0 myself, but maybe some like to keep spares open.
  20. Right, what's causing that condition to return false instead of true?
  21. I've narrowed line 473 down to one condition (the commented one). else if (curres.Quantities.length > 0 && curres.CanShare /*&& $("#bfquantspin").val() < curres.Quantities[curres.Quantities.length - 1]*/) {
  22. Okay, I think I've figured out both problems. Issue 1: HTTP post variable. One of the conditions in Line 473 is the culprit. else if (curres.Quantities.length > 0 && curres.CanShare && $("#bfquantspin").val() < curres.Quantities[curres.Quantities.length - 1]) { else /*if (curres.Quantities.length > 0 && curres.CanShare && $("#bfquantspin").val() < curres.Quantities[curres.Quantities.length - 1])*/ { Issue 2: Rendering. I'm not sure exactly why there is a "+ 3" in lines 202-203. Maybe I'm screwing something else up by removing it, but it seems to make it function correctly. h = '' + h; if (!this.ReadOnly && xy + 3 < this.Quantities[this.Quantities.length - 1]) h = '' + h; if (!this.ReadOnly && xy < this.Quantities[this.Quantities.length - 1])
  23. Do you sleep? I guess I'm not the only one that doesn't!
  24. The sharing feature works, but... (1) Sometimes it's still recording count="0" to Bookings.xml when a second/third user books the same lesson. In this scenario, the client doesn't send the count variable along with the other variables. (2) Sometimes it doesn't render "X FREE" after two users book the same lesson and there are still resources free. I wish I could tell you that there was some sort of pattern! We can do a remote support session if you're interested.
×
×
  • Create New...