Skip to content

Commit

Permalink
Merge 9a2ebe1 into 6ef9035
Browse files Browse the repository at this point in the history
  • Loading branch information
paradite committed Mar 17, 2019
2 parents 6ef9035 + 9a2ebe1 commit 8a211a7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
34 changes: 17 additions & 17 deletions lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const safeQuote = string => JSON.stringify(String(string));
const extendsMixIn = wd => {
/**
* Initial browser window.
* @name initWindow
* @function initWindow
* @summary Support: Web(WebView)
* @param {object} browser options.
* @type utility
Expand All @@ -67,7 +67,7 @@ const extendsMixIn = wd => {

/**
* Get webpage from url util the page ready.
* @name getUrl
* @function getUrl
* @summary Support: Web(WebView)
* @param {string} the pointed url.
* @type utility
Expand Down Expand Up @@ -171,7 +171,7 @@ const extendsMixIn = wd => {

/**
* Save screenshots to ./screenshots.
* @name saveScreenshots
* @function saveScreenshots
* @summary Support: Web(WebView)
* @type utility
* @returns {Promise.<boolean>}
Expand All @@ -190,7 +190,7 @@ const extendsMixIn = wd => {

/**
* Generate the coverage reporter.
* @name coverage
* @function coverage
* @summary Support: Web(WebView)
* @type utility
* @returns {Promise.<boolean>}
Expand Down Expand Up @@ -226,7 +226,7 @@ const extendsMixIn = wd => {

/**
* Open all reporters in browser.
* @name openReporter
* @function openReporter
* @summary Support: Web(WebView)
* @param {boolean} if open.
* @type utility
Expand All @@ -253,7 +253,7 @@ const extendsMixIn = wd => {

/**
* Switch scene with DataHub.
* @name switchScene
* @function switchScene
* @summary Support: Web(WebView)
* @param {object} options.
* @type datahub
Expand All @@ -267,7 +267,7 @@ const extendsMixIn = wd => {
});
/**
* Switch multi-scene with DataHub.
* @name switchMultiScenes
* @function switchMultiScenes
* @summary Support: Web(WebView)
* @param {array} the scene list.
* @type datahub
Expand All @@ -285,7 +285,7 @@ const extendsMixIn = wd => {
});
/**
* Switch all scenes with DataHub.
* @name switchAllScenes
* @function switchAllScenes
* @summary Support: Web(WebView)
* @param {object} options.
* @type datahub
Expand All @@ -300,7 +300,7 @@ const extendsMixIn = wd => {

/**
* Type content to input element.
* @name formInput
* @function formInput
* @summary Support: Web(WebView)
* @param {string} content of type.
* @type utility
Expand Down Expand Up @@ -339,7 +339,7 @@ const extendsMixIn = wd => {

/**
* Type content to a contentEditable element.
* @name elementInput
* @function elementInput
* @summary Support: Web(WebView)
* @param {string} content of type.
* @type utility
Expand Down Expand Up @@ -378,10 +378,10 @@ const extendsMixIn = wd => {

/**
* Simulate the dom event.
* @name domEvent
* @function domEvent
* @summary Support: Web(WebView)
* @param {string} eventType of the event.
* @param {object} options of the event.
* @param {string} eventType - type of the event.
* @param {object} options - options of the event.
* @see https://github.com/macacajs/dom-event-simulate#support-events
* @type utility
* @returns {Promise.<boolean>}
Expand All @@ -399,7 +399,7 @@ const extendsMixIn = wd => {

/**
* Check if element has pointed text.
* @name hasText
* @function hasText
* @summary Support: Web(WebView)
* @param {string} text content.
* @type assert
Expand All @@ -413,7 +413,7 @@ const extendsMixIn = wd => {

/**
* Check if element is existed.
* @name hasElementByCss
* @function hasElementByCss
* @summary Support: Web(WebView)
* @param {string} text content.
* @type assert
Expand All @@ -431,7 +431,7 @@ const extendsMixIn = wd => {

/**
* Check if title exists.
* @name assertTitle
* @function assertTitle
* @summary Support: Web(WebView)
* @param {string} title of the web page.
* @type assert
Expand All @@ -447,7 +447,7 @@ const extendsMixIn = wd => {

/**
* Check if element's attribute right.
* @name assertAttribute
* @function assertAttribute
* @summary Support: Web(WebView)
* @param {string} attribute's name.
* @param {string} expected value.
Expand Down
10 changes: 10 additions & 0 deletions theme/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@ function addSignatureReturns(f) {
// jam all the return-type attributes into an array. this could create odd results (for example,
// if there are both nullable and non-nullable return types), but let's assume that most people
// who use multiple @return tags aren't using Closure Compiler type annotations, and vice-versa.

// remove our custom type from returns
if (f.returns.length === 2) {
for (var i = 0; i < f.returns.length; i++) {
if (f.returns[i].type.names[0] === f.type.names[0]) {
f.returns.splice(i, 1);
}
}
}

if (f.returns) {
f.returns.forEach(function(item) {
helper.getAttribs(item).forEach(function(attrib) {
Expand Down
9 changes: 9 additions & 0 deletions theme/tmpl/method.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ name + (data.signature || '') ?></h3>
</ul>
<?js } ?>

<?js if (kind === 'function' && data.type && data.type.names) {?>
<h4>Type:</h4>
<ul>
<li>
<?js= self.partial('type.tmpl', data.type.names) ?>
</li>
</ul>
<?js } ?>

<?js if (data['this']) { ?>
<h4>This:</h4>
<ul><li><?js= this.linkto(data['this'], data['this']) ?></li></ul>
Expand Down
2 changes: 1 addition & 1 deletion theme/tmpl/type.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
var data = obj;
var self = this;
data.forEach(function(name, i) { ?>
<span class="param-type"><?js= self.linkto(name, self.htmlsafe(name)) ?></span>
<span class="param-type"><?js= name ?></span>
<?js if (i < data.length-1) { ?>|<?js } ?>
<?js }); ?>

0 comments on commit 8a211a7

Please sign in to comment.