options = {},
params = {},
smartyStub,
+ entityDoc,
fieldTpl = _.template($('#api-param-tpl').html()),
optionsTpl = _.template($('#api-options-tpl').html()),
returnTpl = _.template($('#api-return-tpl').html()),
prettyPrint('#example-result');
});
} else {
- $('#example-result').text($('#example-result').attr('title'));
+ $('#example-result').text($('#example-result').attr('placeholder'));
}
}
CRM.utils.setOptions($('#doc-action').prop('disabled', true).addClass('loading'), []);
$.getJSON(CRM.url('civicrm/ajax/apidoc', {entity: $(this).val()}))
.done(function(result) {
+ entityDoc = result.doc;
CRM.utils.setOptions($('#doc-action').prop('disabled', false).removeClass('loading'), result.actions);
$('#doc-result').html(result.doc);
- prettyPrint();
});
}
prettyPrint('.api-doc-code pre');
});
} else {
- $('#doc-result').html($('#doc-result').attr('title'));
+ $('#doc-result').html(entityDoc);
}
}
font-size: 1.1em;
margin-bottom: .6em;
}
+ pre#api-result {
+ max-height: 50em;
+ }
pre#api-result,
div#doc-result,
pre#example-result {
padding:1em;
- max-height: 50em;
border: 1px solid lightgrey;
margin-top: 1em;
overflow: auto;
<select class="crm-form-select big crm-select2" id="example-action" name="action">
<option value="" selected="selected">{ts}Choose{/ts}...</option>
</select>
-<pre id="example-result" class="linenums lang-php" title="{ts escape='html'}Results are displayed here.{/ts}">
+<pre id="example-result" class="linenums lang-php" placeholder="{ts escape='html'}Results are displayed here.{/ts}">
{ts}Results are displayed here.{/ts}
</pre>
</form>
<select class="crm-form-select big crm-select2" id="doc-action" name="action">
<option value="" selected="selected">{ts}Choose{/ts}...</option>
</select>
- <div id="doc-result" title="{ts escape='html'}Results are displayed here.{/ts}">
+ <div id="doc-result">
{ts}Results are displayed here.{/ts}
</div>
</form>