Anonymous avatar Anonymous committed 86f73dc

save work.

Comments (0)

Files changed (4)

_attachments/css/layout.css

 body {
-    background-color: #e7e7e7;
+    background-color: #FFFFFF url(../img/bg.gif) repeat-x scroll center top; 
     color: #000;
 }
 
     position: relative;
     width: 48%;
     float: right;
-    height: 100%;     
+    height: 100%;
+    margin:0;
+   padding: 0; 
     overflow: auto;    
 }
 
-form ol {
-    list-style: none;
-}
-form ol li {
-    padding: 2px 0;
-    /*clear: both;*/
-    margin: 0;
-}
-form li * {
-    vertical-align: middle
+#fedit p {
+    display: block;
+    padding-bottom: 5px;
 }
 form label {
     display: block;

_attachments/js/editor.js

 function Editor() {
     var converter = new Showdown.converter;
     var converter_callback = function(value) {  
-              $('#mdpreview').html(converter.makeHtml(value));  
+              $('#mdpreview')[0].innerHTML = converter.makeHtml(value);  
     }
 
     
     });
 
     var lastRoomleft = 0;
+    var lastPRoomLef = 0;
     var bottomEditHeight = $('#main-footer').offset().top - $('#body').offset().top -
             $("#body").height();
     
     function resizePanes() {
         var roomLeft =  $(window).height() - $('#main-footer').height() 
          - $('#body').offset().top - bottomEditHeight;
+        var proomLeft = $(window).height()
         
         if (roomLeft < 0)
             roomLeft = 0;

_attachments/js/jquery.couchapp.js

               $.cookies.set("login", login, '/'+dbname)
               win && win(login);
             } else {
-              $.cookies.set("login" "", '/'+dbname)
+              $.cookies.set("login", "", '/'+dbname)
               fail && fail(s, e, r);
             }
           }});        

lib/templates/edit.html

 
 <body>
         <header>
+        <div id
         <h1>
             <a rel="me author" href="<%= assets %>/benoitc.html">Benoît Chesneau</a>
         </h1>
             <h2>Nouvel article</h2>
             <form id="fedit" name="fedit" action="new.html"
                 method="post">
-                <p><label for="title">Titre<label><input type="text"
-                        name="title" id="title" value=""></p>
+                    
+                
                         
                 <textarea name="body" id="body" cols="80"
                     rows="20"></textarea>
 
+                <p><label for="title">Titre<label><input type="text"
+                        name="title" id="title" value=""></p>
+
                 <p><label for="labels">Libellés</label><input type="text"
                 name="labels" id="labels" value=""></p>
+                
+                
                 <p><input type="submit" name="save" id="save" value="Save">
-            or <a href="cancel">Cancel</a> <span id="saved" style="display:none;">Saved</span></p>
+                or <a href="<%= index %>">Cancel</a> <span id="saved" style="display:none;">Saved</span></p>
             </form>
             <div id="mdpreview"></div>
         </div>
                             if (doc._id) {
                                 $("#edit h2").html('Édition de ' + B.link_for(doc._id));
                             }
-
                             $('#save').click(function() {
-                                if (!$("#title").val().match(/^['\-\"\/ !?&.,;:@\(\)\w\u00A1-\uFFFF]+$/i)) {
-                                    alert("Titre invalide.");
+                                if (!$('#title').val()) {
+                                    alert('Title invalid');
                                     return false;
                                 }
                             });
-
                         },
                         beforeSave : function(doc) {
-                            doc.html = B.formatBody(doc.body);
+                            if (doc.body)
+                                doc.html = B.formatBody(doc.body);
 
 
                             if (!doc.created_at) {
                                 doc.created_at = new Date().rfc3339();
                             }
 
-                            if (!doc.slug) {
-                                doc.slug = doc.created_at.slice(0, 10) + "_" +
-                                   URLify(doc.title, 255);
+                            if (!doc.slug && doc.title) {
+                                doc.slug = URLify(doc.title, 255) + "_" 
+                                + doc.created_at.slice(0, 10).replace(/\-*/g, '');
                                 doc._id = doc.slug;
                             }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.