From 90c5b26e892a2711949b0fa26ba49c912e3dfb03 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 9 Apr 2013 14:29:55 +0100 Subject: [PATCH] keep integrity on paste and better styling but new lists dont reset counter --- src/static/css/iframe_editor.css | 18 ++++++++++-------- src/static/js/domline.js | 10 ++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/static/css/iframe_editor.css b/src/static/css/iframe_editor.css index 7ae680dc..c2cc1453 100644 --- a/src/static/css/iframe_editor.css +++ b/src/static/css/iframe_editor.css @@ -192,21 +192,23 @@ p { ol { display: list-item; + list-style-type: decimal; } ol > li { + display:list-item; display:inline; } /* Set the indentation */ -ol.list-number1{ text-indent: 20px; } -ol.list-number2{ text-indent: 30px; } -ol.list-number3{ text-indent: 40px; } -ol.list-number4{ text-indent: 50px; } -ol.list-number5{ text-indent: 60px; } -ol.list-number6{ text-indent: 70px; } -ol.list-number7{ text-indent: 80px; } -ol.list-number8{ text-indent: 90px; } +ol.list-number1{ text-indent: 0px; } +ol.list-number2{ text-indent: 10px; } +ol.list-number3{ text-indent: 20px; } +ol.list-number4{ text-indent: 30px; } +ol.list-number5{ text-indent: 40px; } +ol.list-number6{ text-indent: 50px; } +ol.list-number7{ text-indent: 60px; } +ol.list-number8{ text-indent: 70px; } /* Add styling to the first item in a list */ body{ diff --git a/src/static/js/domline.js b/src/static/js/domline.js index 1e700c75..ee558a64 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -114,11 +114,13 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) else { if(start){ // is it a start of a list with more than one item in? - if(start[1] == 1){ // if its the first one - preHtml = '
  1. '; - }else{ // its the second+ item in this list level - preHtml = '
    1. '; + if(start[1] == 1){ // if its the first one at this level? + preHtml = '
      1. '; + }else{ // its not the first item in this list level + preHtml = '
        1. '; } + }else{ + preHtml = '
          1. '; // Handles pasted contents into existing lists } postHtml = '
          '; }