Subtle changes, bugs and feedback

Posted on
Page
of 312
  • Thanks for the details.

    I'd go a little lighter, but less saturated on the background. But then IANA Designer.

  • Pleasing to the eye :)

  • White letters on light blue background would work. As it is, it doesn't work.

  • What about the grey colour margin here>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>?

  • The sidebar is auto-coloured... it's not an option. The colour is derived from an 80% opacity white over the background colour.

  • Cool: The grey actually works with the new blue.

  • Anyhow, enough playing with colours.

    Will revert to the original grey.

    Which is:

    http://www.color-hex.com/color/424143

    And that is the page background that Wayne originally dictated (and is first in the palette above).

  • The blue is very Grandstand c. 1996

  • Personally I prefer the original grey background. I found the other one distracting

  • Yeah, it looks better now.

  • I like the grey, less obvious at work.

  • The green was superb

  • Gone back on it now? The blue wasn't too bad actually.

  • Anyhow, enough playing with colours.

    Will revert to the original grey.

    Which is:

    color-hex.com/color/424143

    And that is the page background that Wayne originally dictated (and is first in the palette above).>

    ^ Quoting is broken btw.

  • Quoting is broken btw

    In what way ;)

  • For me, at the moment, highlighting text and pressing reply results in the '>' being placed at the end of the text i've highlighted (which ever direction i highlight the text). This just adds a '>' to the end of the text in the post without actually quoting it.

    Win 7, Chrome 51

  • I was jesting.

    I know there is a bug: https://www.lfgss.com/comments/12917826/incontext/

    I do not know how to fix it.

    I'm taking time off work to fix a more pressing issue... I need to write my own auth layer as Persona is closing down.

    Unfortunately fixing the quote bug is currently beyond me, and other urgent priorities mean I can't spend the time to write a working alternative.

    I welcome help, have asked for help, none has been forthcoming.

  • Fair enough.

    I know zero about javascript, or keeping up with this thread for that matter.

  • Alright... thinking aloud:

    core/templates/conversation.html has this JS at the bottom:

    	$('#post-a-reply-handle').on('click',function(e){
    		var selectedText = Comments.prototype.getWindowSelectedText();
    		if (selectedText){
    			replyBox.textarea.value = selectedText;
    			replyBox.quote();
    		}
    	});
    

    Which then calls:
    core/static/js/simpleEditor.js

        simpleEditor.prototype.quote = function(){
          this.textarea.value = this.formattedTextWith("> %s");
        };
    

    Which in turn calls (same file):

        simpleEditor.prototype.formattedTextWith = function(tag){
    
          var selection = this.getSelectionDetailsObject();
    
          var newText = selection.start.text +
                        this.applyFormatting(selection.selected.text, tag) +
                        selection.end.text;
    
          return newText;
        };
    

    And applyFormatting looks like:

        simpleEditor.prototype.applyFormatting = function(text, tag){
    
          // splits text into array by newlines and applies tag to each index of array.
          var selectedTextFragments = text.split(/\n/g);
          for(var i=0,j=selectedTextFragments.length;i<j;i++){
              selectedTextFragments[i] = tag.replace(/%s/g, selectedTextFragments[i]);
          }
    
          var formattedText = selectedTextFragments.join('\n');
    
          return formattedText;
        };
    

    I don't understand applyFormatting, and am not sure what this.getSelectionDetailsObject() returns.

    Ah... getSelectionDetailsObject is a local this. reference, so that's in this file too:

        simpleEditor.prototype.getSelectionDetailsObject = function(){
    
    
          var text           = this.textarea.value,
              startPos       = this.textarea.selectionStart,
              endPos         = this.textarea.selectionEnd,
              selectedLength = this.textarea.selectionEnd-this.textarea.selectionStart;
    
          var startText     = text.substr(0,startPos),
              selectedText  = text.substr(startPos,selectedLength),
              endText       = text.substr(endPos,text.length);
    
          var retval = {
            start     : {
              position : startPos,
              text     : startText
            },
            end       : {
              position : endPos,
              text     : endText
            },
            selected  : {
              length   : selectedLength,
              text     : selectedText
            }
          };
    
          return retval;
    
        };
    

    I'll look into whether that does sane things later on.

    As I don't understand applyFormatting in relation to quote I will probably seek to fix by just making another version of quote to be used for new messages as quote seems to work intra-message... and this only really has issues when the selection is outside of the text box.

    Actually... maybe that's the bug... the selection is outside the textbox and so it gets confused as when quote is called there is no set of selection attributes on the textarea, which it looks like getSelectionDetailsObject needs.

    Yeah... that's the bug.

    Cool.

    I'll think of the fix after the meeting and journey home.

  • Pretty sure that's what I've been saying all along.

  • Fantastic.

    If you have the pull request ready I'll merge that instead of looking into it further.

  • Yay to thinking aloud.

    Keep going!

  • **\o/**
    I have no idea what any of it means but joining in with the cheerleading

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Subtle changes, bugs and feedback

Posted by Avatar for Velocio @Velocio

Actions