Loading lib/jsduck/type_parser.rb +3 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,7 @@ module JsDuck key = @input.scan(/[a-zA-Z0-9_]+/) return false unless key @out << key skip_whitespace if @input.scan(/:/) Loading Loading @@ -321,8 +322,10 @@ module JsDuck # All type names besides * can be followed by .<arguments> if name != "*" && @input.scan(/\.</) @out << ".<" return false unless type_arguments return false unless @input.scan(/>/) @out << ">" end true Loading opt/comments-server-side/app.js +5 −2 Original line number Diff line number Diff line Loading @@ -198,6 +198,10 @@ app.get('/auth/:sdk/:version/comments_recent', util.getCommentReads, function(re filter._id = { $nin: req.commentMeta.reads }; } if (req.query.hideCurrentUser) { filter.userId = { $ne: req.session.user.userid }; } Comment.find(filter).sort("createdAt", -1).run(function(err, comments) { var total_rows = comments.length; Loading Loading @@ -252,7 +256,6 @@ app.post('/auth/:sdk/:version/comments', util.requireLoggedInUser, function(req, author: req.session.user.username, userId: req.session.user.userid, content: req.body.comment, action: req.body.action, rating: Number(req.body.rating), contentHtml: util.markdown(req.body.comment), downVotes: [], Loading @@ -268,7 +271,7 @@ app.post('/auth/:sdk/:version/comments', util.requireLoggedInUser, function(req, }); comment.saveNew(req.session.user, function(err) { res.json({ success: true, id: comment._id, action: req.body.action }); res.json({ success: true, id: comment._id }); util.sendEmailUpdates(comment); }); Loading opt/comments-server-side/database.js +0 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ CommentSchema = new mongoose.Schema({ sdk: String, version: String, action: String, author: String, userId: Number, content: String, Loading spec/type_parser_spec.rb +21 −3 Original line number Diff line number Diff line Loading @@ -303,11 +303,29 @@ describe JsDuck::TypeParser do p.out.should == '<a href="String">string</a>' end it "preserves whitespace in output" do def parse_to_output(input) relations = JsDuck::Relations.new([]) p = JsDuck::TypeParser.new(relations) p.parse("( string | number )") p.out.should == '( string | number )' p.parse(input) return p.out end it "preserves whitespace in output" do parse_to_output("( string | number )").should == "( string | number )" end it "converts < and > to HTML entities in output" do parse_to_output("number.<string, *>").should == "number.<string, *>" end it "preserves function notation in output" do input = 'function(this:string, ?number=, !number, ...[number]): boolean' parse_to_output(input).should == input end it "preserves object literal notation in output" do input = '{myNum: number, myObject}' parse_to_output(input).should == input end end Loading template/app/Settings.js +5 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,11 @@ Ext.define("Docs.Settings", { "inherited": true, "accessor": true }, comments: { hideRead: false, hideCurrentUser: false, sortByScore: false }, showPrivateClasses: false, classTreeLogic: "PackageLogic" }, Loading Loading
lib/jsduck/type_parser.rb +3 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,7 @@ module JsDuck key = @input.scan(/[a-zA-Z0-9_]+/) return false unless key @out << key skip_whitespace if @input.scan(/:/) Loading Loading @@ -321,8 +322,10 @@ module JsDuck # All type names besides * can be followed by .<arguments> if name != "*" && @input.scan(/\.</) @out << ".<" return false unless type_arguments return false unless @input.scan(/>/) @out << ">" end true Loading
opt/comments-server-side/app.js +5 −2 Original line number Diff line number Diff line Loading @@ -198,6 +198,10 @@ app.get('/auth/:sdk/:version/comments_recent', util.getCommentReads, function(re filter._id = { $nin: req.commentMeta.reads }; } if (req.query.hideCurrentUser) { filter.userId = { $ne: req.session.user.userid }; } Comment.find(filter).sort("createdAt", -1).run(function(err, comments) { var total_rows = comments.length; Loading Loading @@ -252,7 +256,6 @@ app.post('/auth/:sdk/:version/comments', util.requireLoggedInUser, function(req, author: req.session.user.username, userId: req.session.user.userid, content: req.body.comment, action: req.body.action, rating: Number(req.body.rating), contentHtml: util.markdown(req.body.comment), downVotes: [], Loading @@ -268,7 +271,7 @@ app.post('/auth/:sdk/:version/comments', util.requireLoggedInUser, function(req, }); comment.saveNew(req.session.user, function(err) { res.json({ success: true, id: comment._id, action: req.body.action }); res.json({ success: true, id: comment._id }); util.sendEmailUpdates(comment); }); Loading
opt/comments-server-side/database.js +0 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ CommentSchema = new mongoose.Schema({ sdk: String, version: String, action: String, author: String, userId: Number, content: String, Loading
spec/type_parser_spec.rb +21 −3 Original line number Diff line number Diff line Loading @@ -303,11 +303,29 @@ describe JsDuck::TypeParser do p.out.should == '<a href="String">string</a>' end it "preserves whitespace in output" do def parse_to_output(input) relations = JsDuck::Relations.new([]) p = JsDuck::TypeParser.new(relations) p.parse("( string | number )") p.out.should == '( string | number )' p.parse(input) return p.out end it "preserves whitespace in output" do parse_to_output("( string | number )").should == "( string | number )" end it "converts < and > to HTML entities in output" do parse_to_output("number.<string, *>").should == "number.<string, *>" end it "preserves function notation in output" do input = 'function(this:string, ?number=, !number, ...[number]): boolean' parse_to_output(input).should == input end it "preserves object literal notation in output" do input = '{myNum: number, myObject}' parse_to_output(input).should == input end end Loading
template/app/Settings.js +5 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,11 @@ Ext.define("Docs.Settings", { "inherited": true, "accessor": true }, comments: { hideRead: false, hideCurrentUser: false, sortByScore: false }, showPrivateClasses: false, classTreeLogic: "PackageLogic" }, Loading