Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / apidoc / main.js
index 51a856a..f4b5d67 100644 (file)
@@ -86,6 +86,11 @@ function init($, _, locale, Handlebars, apiProject, apiData, Prism, sampleReques
     var templateSidenav        = Handlebars.compile( $('#template-sidenav').html() );
 
     //
+    // Default host url used if no sampleUrl is present in config
+    //
+    var baseURL = window.location.origin;
+
+    //
     // apiProject defaults
     //
     if ( ! apiProject.template)
@@ -362,6 +367,14 @@ function init($, _, locale, Handlebars, apiProject, apiData, Prism, sampleReques
                     };
                 }
 
+                if (apiProject.sampleUrl == false) {
+                    fields.article.sampleRequest = [
+                        {
+                            "url": baseURL + fields.article.url
+                        }
+                    ];
+                }
+
                 // add prefix URL for endpoint unless it's already absolute
                 if (apiProject.url) {
                     if (fields.article.url.substr(0, 4).toLowerCase() !== 'http') {