Anonymous avatar Anonymous committed 361a530

fix validation.

Comments (0)

Files changed (6)

Add a comment to this file

_attachments/css/.benoitc.css.swp

Binary file modified.

_attachments/css/benoitc.css

 
 #mainav a,
 #mainav li {
-	font-size: 80%;
-	line-height: 1;
+	font-size: 90%;
+	line-height: 90%;
 }
-
+#mainav a {
+	text-decoration: none;
+}
 
 
 /* COMMENTS */
 	text-align: right;
 	color: #555;
 }
-ol.comments .commentor {
+ol.comments .author {
 	color:#000;
 	background:#fff;
 }
Add a comment to this file

lib/templates/.post.html.swp

Binary file modified.

lib/templates/edit.html

                         onLoad : function(doc) {
                             if (doc._id) {
                                 $("#edit h2").html('Édition de ' + B.link_for(doc._id));
-                            }
-                            $('#save').click(function() {
-                                if (!$('#title').val()) {
-                                    alert('Title invalid');
-                                    return false;
-                                }
-                            });
+                            } 
                         },
                         beforeSave : function(doc) {
                             if (doc.body)

lib/templates/post.html

                       format : "markdown"
                     },
                     beforeSave : function(doc) {
-                      doc.html = B.formatBody(doc.comment);
+                        if (doc.comment)
+                            doc.html = B.formatBody(doc.comment);
                       doc.created_at = new Date().rfc3339();
                     },
                     success : function(resp, doc) {
                   
                   $("#preview").click(function() {
                     var doc = commentForm.localDoc();
-                    var html = B.formatBody(doc.comment);
-                    $('#comment-preview').html(html);
+                    if (typeof doc.comment != "undefined" && doc.comment) {
+                        var html = B.formatBody(doc.comment);
+                        $('#comment-preview').html(html);
+                    }
                   });
                 });
         });

validate_doc_update.js

 function (newDoc, oldDoc, userCtx) {
-  var doc_type = (oldDoc || newDoc)['type'];
+  var doc_type = (oldDoc || newDoc)['doc_type'];
   var author = (oldDoc || newDoc)['author'];
 
   function forbidden(message) {    
     // comment required fields
     require(newDoc.created_at, "Comments must have a created_at date.");
     require(newDoc.post_id, "Comments require a post_id.");
-    require(newDoc.commenter && newDoc.commenter.name 
-      && newDoc.commenter.email, "Comments must include name and email.");
     require(newDoc.html, "Comments require an html body.");
     require(newDoc.comment, "Comments require a comment field.");
-    require(newDoc.format, "Comments require a format field.");
+    require(newDoc.commenter && newDoc.commenter.name, 'Comments require a name');
     if (newDoc.commenter && newDoc.commenter.url) {*/
       require(newDoc.commenter.url.match(/^https?:\/\/[^.]*\..*/), "Commenter URL is not valid.");      
     }
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.