Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/107760


Change subject: Add OOjs to jsduck index
......................................................................

Add OOjs to jsduck index

Change-Id: I7ced3673a0a09ea0f37b59729318f02e52fe1340
---
M maintenance/jsduck/MetaTags.rb
M maintenance/jsduck/categories.json
M maintenance/jsduck/config.json
3 files changed, 40 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/60/107760/1

diff --git a/maintenance/jsduck/MetaTags.rb b/maintenance/jsduck/MetaTags.rb
index 83cc088..cde7d3b 100644
--- a/maintenance/jsduck/MetaTags.rb
+++ b/maintenance/jsduck/MetaTags.rb
@@ -1,6 +1,8 @@
+# Custom tags for JSDuck 4.x
 # See also:
 # - https://github.com/senchalabs/jsduck/wiki/Tags
 # - https://github.com/senchalabs/jsduck/wiki/Custom-tags
+# - 
https://github.com/senchalabs/jsduck/wiki/Custom-tags/7f5c32e568eab9edc8e3365e935bcb836cb11f1d
 require 'jsduck/meta_tag'
 
 class SourceTag < JsDuck::MetaTag
@@ -67,3 +69,35 @@
     end
   end
 end
+
+# As of JSDuck 5 this is in core
+class FiresTag < JsDuck::MetaTag
+  def initialize
+    @name = 'fires'
+    @multiline = true
+  end
+
+  # @param tags All matches of this tag on one class.
+  def to_html(tags)
+    doc = []
+    doc << '<h3 class="pa">Fires</h3>'
+    doc << [
+        '<ul>',
+        tags.map {|tag| render_long_event(tag) },
+        '</ul>',
+      ]
+    doc
+  end
+
+  def render_long_event(tag)
+    if tag =~ /\A(\w+)( .*)?\Z/m
+      name = $1
+      doc = $2 ? ': ' + $2 : ''
+      return [
+        '<li>',
+        format("{@link #event-#{name}} #{doc}"),
+        '</li>'
+      ]
+    end
+  end
+end
diff --git a/maintenance/jsduck/categories.json 
b/maintenance/jsduck/categories.json
index c595980..d38ea5b 100644
--- a/maintenance/jsduck/categories.json
+++ b/maintenance/jsduck/categories.json
@@ -52,6 +52,10 @@
                "name": "Upstream",
                "groups": [
                        {
+                               "name": "OOJS",
+                               "classes": ["OO", "OO.*"]
+                       },
+                       {
                                "name": "jQuery",
                                "classes": ["jQuery", "jQuery.Event", 
"jQuery.Callbacks", "jQuery.Promise", "jQuery.Deferred", "jQuery.jqXHR", 
"QUnit"]
                        },
diff --git a/maintenance/jsduck/config.json b/maintenance/jsduck/config.json
index e6e0f65..70b7a9e 100644
--- a/maintenance/jsduck/config.json
+++ b/maintenance/jsduck/config.json
@@ -22,6 +22,7 @@
                "../../resources/mediawiki.page/mediawiki.page.startup.js",
                "../../resources/mediawiki.api",
                "../../resources/jquery/jquery.localize.js",
-               "../../resources/jquery/jquery.spinner.js"
+               "../../resources/jquery/jquery.spinner.js",
+               "../../resources/oojs"
        ]
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/107760
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ced3673a0a09ea0f37b59729318f02e52fe1340
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to