forked from swagger-api/swagger-editor
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable generating codes from swagger codegen.
- Loading branch information
Showing
4 changed files
with
42 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
|
||
|
||
SwaggerEditor.controller('CrossOriginPromptCtrl', function CrossOriginPromptCtrl($scope, | ||
$uibModalInstance, $rootScope, simpleYaml,YAML) { | ||
YAML.dump(simpleYaml.swagger, function(error, result){ | ||
var yamlBlob = new Blob([result], {type: 'text/plain'}); | ||
$scope.yamlDownloadHref = window.URL.createObjectURL(yamlBlob); | ||
$scope.yamlDownloadUrl = [ | ||
'text/plain', | ||
'swagger.yaml', | ||
$scope.yamlDownloadHref | ||
].join(':'); | ||
|
||
if(error) {$scope.swaggerSpec = "Error"; return;} | ||
{$scope.swaggerSpec = result; return;} | ||
}); | ||
|
||
$scope.copy=function(){ | ||
var copyTextarea = document.querySelector('#prompt-swaggerspec'); | ||
copyTextarea.select(); | ||
|
||
try { | ||
var successful = document.execCommand('copy'); | ||
var msg = successful ? 'successful' : 'unsuccessful'; | ||
console.log('Copying text command was ' + msg); | ||
} catch (err) { | ||
console.log('Oops, unable to copy'); | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters