From 1e273640b4e53a6b82253d07cb8ea2727765ac2d Mon Sep 17 00:00:00 2001 From: Karthik Velakur Date: Thu, 16 Apr 2015 13:26:52 -0400 Subject: [PATCH 01/41] Issue #642 - Removing the unnecesary \n added to generated example requests --- .../com/wordnik/swagger/codegen/examples/ExampleGenerator.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/examples/ExampleGenerator.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/examples/ExampleGenerator.java index 80063625440f..4e148ced9e3c 100644 --- a/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/examples/ExampleGenerator.java +++ b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/examples/ExampleGenerator.java @@ -37,7 +37,6 @@ public class ExampleGenerator { String example = Json.pretty(resolvePropertyToExample(mediaType, property, processedModels)); if(example != null) { - example = example.replaceAll("\n", "\\\\n"); kv.put("example", example); output.add(kv); } @@ -45,7 +44,6 @@ public class ExampleGenerator { else if(property != null && mediaType.startsWith("application/xml")) { String example = new XmlExampleGenerator(this.examples).toXml(property); if(example != null) { - example = example.replaceAll("\n", "\\\\n"); kv.put("example", example); output.add(kv); } From 1d175c1c7d5a01619ca4fd7ebc57acee569eee7e Mon Sep 17 00:00:00 2001 From: Denis Yagofarov Date: Sat, 18 Apr 2015 22:41:18 +0300 Subject: [PATCH 02/41] + advices for OS X Users --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index c951c4b9620f..b79648f468cd 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,17 @@ You need the following installed and available in your $PATH: * [Java 7](http://java.oracle.com) * [Apache maven 3.0.3 or greater](http://maven.apache.org/) + +#### OS X Users +Don't forget to install Java 7. You probably have 1.6 or 1.8. + +Export JAVA_HOME in order to user proper Java version: +``` +export JAVA_HOME=`/usr/libexec/java_home -v 1.7` +export PATH=${JAVA_HOME}/bin:$PATH +``` + +#### Building After cloning the project, you can build it from source with this command: From 5fbd0afdc5778e2b9f631510266f589f7110b0da Mon Sep 17 00:00:00 2001 From: maorb Date: Wed, 29 Apr 2015 18:19:16 -0700 Subject: [PATCH 03/41] Added support for Basic Auth --- .../com/wordnik/swagger/codegen/cmd/Generate.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/swagger-codegen-cli/src/main/java/com/wordnik/swagger/codegen/cmd/Generate.java b/modules/swagger-codegen-cli/src/main/java/com/wordnik/swagger/codegen/cmd/Generate.java index 0e88a947b476..55eed8b3c029 100644 --- a/modules/swagger-codegen-cli/src/main/java/com/wordnik/swagger/codegen/cmd/Generate.java +++ b/modules/swagger-codegen-cli/src/main/java/com/wordnik/swagger/codegen/cmd/Generate.java @@ -1,5 +1,6 @@ package com.wordnik.swagger.codegen.cmd; +import com.fasterxml.jackson.dataformat.yaml.snakeyaml.external.biz.base64Coder.Base64Coder; import com.wordnik.swagger.codegen.ClientOptInput; import com.wordnik.swagger.codegen.ClientOpts; import com.wordnik.swagger.codegen.CodegenConfig; @@ -54,6 +55,11 @@ public class Generate implements Runnable { "Pass in a URL-encoded string of name:header with a comma separating multiple values") private String auth; + @Option(name = {"-b", "--basic-auth"}, title = "basic auth", + description = "adds basic auth headers when fetching swagger defenitions remotly and server is user basic auth to authenticate. " + + "Pass in arguments in the following format :") + private String basicAuth; + @Override public void run() { verbosed(verbose); @@ -64,6 +70,11 @@ public class Generate implements Runnable { input.setAuth(auth); } + if (isNotEmpty(basicAuth)) { + String authorization = new String(Base64Coder.encode(basicAuth.getBytes())); + input.setAuth("Authorization:" + "Basic "+ authorization); + } + CodegenConfig config = forName(lang); config.setOutputDir(new File(output).getAbsolutePath()); From cd2e030dc1c9933417e3335fdbab85066b7b232b Mon Sep 17 00:00:00 2001 From: e3 Date: Thu, 30 Apr 2015 11:16:16 -0700 Subject: [PATCH 04/41] Linked to the 2.0.18 tag instead of the no longer existing 2.0.17. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c951c4b9620f..d87aa4f1821e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The Swagger Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | Swagger Spec compatibility | Notes ----------------------- | ------------ | -------------------------- | ----- 2.1.0-M2 | 2015-04-06 | 1.0, 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-codegen) -2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17) +2.0.18 | 2015-02-09 | 1.1, 1.2 | [tag v2.0.18](https://github.com/swagger-api/swagger-codegen/tree/v2.0.18) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) From 9876e792f1a7b27ecae53cab7f7c07637b359f30 Mon Sep 17 00:00:00 2001 From: e3 Date: Thu, 30 Apr 2015 11:22:45 -0700 Subject: [PATCH 05/41] Found the 2.0.17 tag under 2.0.17 instead of v2.0.17. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d87aa4f1821e..086b0ce218ae 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The Swagger Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | Swagger Spec compatibility | Notes ----------------------- | ------------ | -------------------------- | ----- 2.1.0-M2 | 2015-04-06 | 1.0, 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-codegen) -2.0.18 | 2015-02-09 | 1.1, 1.2 | [tag v2.0.18](https://github.com/swagger-api/swagger-codegen/tree/v2.0.18) +2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) From df95114a93196960382d376c1c5643b4f1dc1d60 Mon Sep 17 00:00:00 2001 From: Alex Kras Date: Mon, 4 May 2015 15:07:03 -0700 Subject: [PATCH 06/41] Fixes a bug with Node.js example generating invalid package.json and swagger.json Currently string "... You can find out more about Swagger at http://swagger.io or ... " gets URL encoded, resuling in Node js throwing "Unable to parse" error. Use of {{{ }}} forces mustache to skip URL encoding http://mustache.github.io/mustache.5.html#Partials --- .../swagger-codegen/src/main/resources/nodejs/package.mustache | 2 +- .../swagger-codegen/src/main/resources/nodejs/swagger.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/nodejs/package.mustache b/modules/swagger-codegen/src/main/resources/nodejs/package.mustache index 7add6e813fed..89db4c0b91eb 100644 --- a/modules/swagger-codegen/src/main/resources/nodejs/package.mustache +++ b/modules/swagger-codegen/src/main/resources/nodejs/package.mustache @@ -1,7 +1,7 @@ { "name": "{{projectName}}", "version": "{{appVersion}}", - "description": "{{appDescription}}", + "description": "{{{appDescription}}}", "main": "index.js", "keywords": [ "swagger" diff --git a/modules/swagger-codegen/src/main/resources/nodejs/swagger.mustache b/modules/swagger-codegen/src/main/resources/nodejs/swagger.mustache index 8b4c8d33bdcc..553ca7a81744 100644 --- a/modules/swagger-codegen/src/main/resources/nodejs/swagger.mustache +++ b/modules/swagger-codegen/src/main/resources/nodejs/swagger.mustache @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "{{appName}}", - "description": "{{appDescription}}", + "description": "{{{appDescription}}}", "version": "{{apiVersion}}" }, {{#apiInfo}} From bae40ded74853583e18ac643876eb5beba04a874 Mon Sep 17 00:00:00 2001 From: Lorinda Brandon Date: Thu, 7 May 2015 19:23:49 -0400 Subject: [PATCH 07/41] Update README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 086b0ce218ae..30a1dd019b4f 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,6 @@ ## Overview This is the swagger codegen project, which allows generation of client libraries automatically from a Swagger-compliant server. -## What's Swagger? - -The goal of Swagger™ is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via Swagger, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, Swagger removes the guesswork in calling the service. - - Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more. From 9e382ecf9ac5f199d48d7aad1f66f885a60e97df Mon Sep 17 00:00:00 2001 From: Sebastien Estienne Date: Sat, 16 May 2015 22:05:44 -0700 Subject: [PATCH 08/41] Fix a typo in the README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 30a1dd019b4f..747a086828f1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This is the swagger codegen project, which allows generation of client libraries Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more. -## Compatability +## Compatibility The Swagger Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilies with the swagger specification: Swagger Codegen Version | Release Date | Swagger Spec compatibility | Notes From 89e3bcc4bb0817cbffca45ce8d6b31cafaca4ac6 Mon Sep 17 00:00:00 2001 From: Chakrit Wichian Date: Thu, 21 May 2015 15:22:13 +0700 Subject: [PATCH 09/41] Adds isPrimitiveType flag to CodegenParameter. This is required in some languages like Obj-C where there is no automatic value boxing and handling of primitive types require extra work compared to non-primitive types. Case in point: BOOL type. To assign BOOL into a dictionary, one needs to box it into an (NSValue *) instance, so to build a dictionary for sending form data, for example, you cannot do this in the template: dict["{{paramName}}"] = {{paramName}}; Because if the parameter ends up being of type BOOL, an error about boxing values will be generated: BOOL boolValue = NO; dict["boolValue"] = boolValue; ^---------------- Cannot do the assignment here. The fix is to wrap it in @() like so: BOOL boolValue = NO; dict["boolValue"] = @(boolValue); So a flag is needed in CodegenParameter so we can selectively emit the right boxing or non-boxing assignment in the templates. --- .../java/com/wordnik/swagger/codegen/CodegenParameter.java | 5 ++++- .../java/com/wordnik/swagger/codegen/DefaultCodegen.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenParameter.java index 04cecabad904..874fecbe3696 100644 --- a/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenParameter.java +++ b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenParameter.java @@ -2,7 +2,8 @@ package com.wordnik.swagger.codegen; public class CodegenParameter { public Boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, - isCookieParam, isBodyParam, isFile, notFile, hasMore, isContainer, secondaryParam; + isCookieParam, isBodyParam, isFile, notFile, hasMore, isContainer, secondaryParam, + isPrimitiveType, notPrimitiveType; public String baseName, paramName, dataType, collectionFormat, description, baseType; public String jsonSchema; @@ -34,6 +35,8 @@ public class CodegenParameter { output.isBodyParam = this.isBodyParam; output.required = this.required; output.jsonSchema = this.jsonSchema; + output.isPrimitiveType = this.isPrimitiveType; + output.notPrimitiveType = this.notPrimitiveType; return output; } diff --git a/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java index c8e0ad452830..f3ad2d4f4f97 100644 --- a/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java @@ -928,6 +928,8 @@ public class DefaultCodegen { CodegenProperty model = fromProperty(qp.getName(), property); p.collectionFormat = collectionFormat; p.dataType = model.datatype; + p.isPrimitiveType = languageSpecificPrimitives.contains(p.dataType); + p.notPrimitiveType = !p.isPrimitiveType; p.paramName = toParamName(qp.getName()); if(model.complexType != null) { From 26a22a30a132ab0788d2e48796854aa09911fa24 Mon Sep 17 00:00:00 2001 From: Ron Date: Fri, 29 May 2015 08:52:03 -0400 Subject: [PATCH 10/41] Create LICENSE --- LICENSE | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..542991f95502 --- /dev/null +++ b/LICENSE @@ -0,0 +1,11 @@ +Copyright 2015 SmartBear Software + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. From ca4640585010341946c25c6954e2356ab0ffd688 Mon Sep 17 00:00:00 2001 From: Ron Date: Fri, 29 May 2015 08:53:06 -0400 Subject: [PATCH 11/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1af68ff8915e..f408fb60dbac 100644 --- a/README.md +++ b/README.md @@ -276,7 +276,7 @@ Note! The templates are included in the library generated. If you want to modi License ------- -Copyright 2015 Reverb Technologies, Inc. +Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 0dd8670724e8f7dc74a1f5fb69f28fe2b9572617 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:22:59 +0800 Subject: [PATCH 12/41] rollback python template --- .../src/main/resources/python/README.mustache | 6 +- .../src/main/resources/python/api.mustache | 66 +-- .../main/resources/python/api_client.mustache | 466 +++++++++--------- .../resources/python/configuration.mustache | 52 +- .../src/main/resources/python/model.mustache | 52 +- .../src/main/resources/python/rest.mustache | 380 +++++++------- .../src/main/resources/python/setup.mustache | 22 +- 7 files changed, 522 insertions(+), 522 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/python/README.mustache b/modules/swagger-codegen/src/main/resources/python/README.mustache index f4e99c9fbc90..9c590a9a5088 100644 --- a/modules/swagger-codegen/src/main/resources/python/README.mustache +++ b/modules/swagger-codegen/src/main/resources/python/README.mustache @@ -67,8 +67,8 @@ If you want to run the tests in all the python platforms: ```sh $ make test-all [... tox creates a virtualenv for every platform and runs tests inside of each] -py27: commands succeeded -py34: commands succeeded -congratulations :) + py27: commands succeeded + py34: commands succeeded + congratulations :) ``` diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index fa5e539a2804..867014d5e128 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -5,17 +5,17 @@ {{classname}}.py Copyright 2015 SmartBear Software -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ @@ -31,18 +31,18 @@ from .. import configuration from ..api_client import ApiClient {{#operations}} - class {{classname}}(object): +class {{classname}}(object): def __init__(self, api_client=None): - if api_client: - self.api_client = api_client - else: - if not configuration.api_client: - configuration.api_client = ApiClient('{{basePath}}') - self.api_client = configuration.api_client - + if api_client: + self.api_client = api_client + else: + if not configuration.api_client: + configuration.api_client = ApiClient('{{basePath}}') + self.api_client = configuration.api_client + {{#operation}} - def {{nickname}}(self, {{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}**kwargs): + def {{nickname}}(self, {{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}**kwargs): """ {{{summary}}} {{{notes}}} @@ -52,17 +52,17 @@ from ..api_client import ApiClient :return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} """ {{#allParams}}{{#required}} - # verify the required parameter '{{paramName}}' is set - if {{paramName}} is None: + # verify the required parameter '{{paramName}}' is set + if {{paramName}} is None: raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{nickname}}`") {{/required}}{{/allParams}} all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}] params = locals() for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError("Got an unexpected keyword argument '%s' to method {{nickname}}" % key) - params[key] = val + if key not in all_params: + raise TypeError("Got an unexpected keyword argument '%s' to method {{nickname}}" % key) + params[key] = val del params['kwargs'] resource_path = '{{path}}'.replace('{format}', 'json') @@ -70,34 +70,34 @@ from ..api_client import ApiClient path_params = {} {{#pathParams}} - if '{{paramName}}' in params: - path_params['{{baseName}}'] = params['{{paramName}}'] + if '{{paramName}}' in params: + path_params['{{baseName}}'] = params['{{paramName}}'] {{/pathParams}} query_params = {} {{#queryParams}} - if '{{paramName}}' in params: + if '{{paramName}}' in params: query_params['{{baseName}}'] = params['{{paramName}}'] {{/queryParams}} header_params = {} {{#headerParams}} - if '{{paramName}}' in params: + if '{{paramName}}' in params: header_params['{{baseName}}'] = params['{{paramName}}'] {{/headerParams}} form_params = {} files = {} {{#formParams}} - if '{{paramName}}' in params: + if '{{paramName}}' in params: {{#notFile}}form_params['{{baseName}}'] = params['{{paramName}}']{{/notFile}}{{#isFile}}files['{{baseName}}'] = params['{{paramName}}']{{/isFile}} {{/formParams}} body_params = None {{#bodyParam}} - if '{{paramName}}' in params: + if '{{paramName}}' in params: body_params = params['{{paramName}}'] {{/bodyParam}} # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept([{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) if not header_params['Accept']: - del header_params['Accept'] + del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type([{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) @@ -106,10 +106,10 @@ from ..api_client import ApiClient auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] response = self.api_client.call_api(resource_path, method, path_params, query_params, header_params, - body=body_params, post_params=form_params, files=files, - response={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, auth_settings=auth_settings) + body=body_params, post_params=form_params, files=files, + response={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, auth_settings=auth_settings) {{#returnType}} - return response + return response {{/returnType}}{{/operation}} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index fc0e7c605495..b8cc4cc2a840 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -22,282 +22,282 @@ import random from six import iteritems try: -# for python3 -from urllib.parse import quote + # for python3 + from urllib.parse import quote except ImportError: -# for python2 -from urllib import quote + # for python2 + from urllib import quote from . import configuration class ApiClient(object): -""" -Generic API client for Swagger client library builds + """ + Generic API client for Swagger client library builds -:param host: The base path for the server to call -:param header_name: a header to pass when making calls to the API -:param header_value: a header value to pass when making calls to the API -""" -def __init__(self, host=configuration.host, header_name=None, header_value=None): -self.default_headers = {} -if header_name is not None: -self.default_headers[header_name] = header_value -self.host = host -self.cookie = None -# Set default User-Agent. -self.user_agent = 'Python-Swagger' + :param host: The base path for the server to call + :param header_name: a header to pass when making calls to the API + :param header_value: a header value to pass when making calls to the API + """ + def __init__(self, host=configuration.host, header_name=None, header_value=None): + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.host = host + self.cookie = None + # Set default User-Agent. + self.user_agent = 'Python-Swagger' -@property -def user_agent(self): -return self.default_headers['User-Agent'] + @property + def user_agent(self): + return self.default_headers['User-Agent'] -@user_agent.setter -def user_agent(self, value): -self.default_headers['User-Agent'] = value + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value -def set_default_header(self, header_name, header_value): -self.default_headers[header_name] = header_value + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value -def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, -body=None, post_params=None, files=None, response=None, auth_settings=None): + def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, response=None, auth_settings=None): -# headers parameters -header_params = header_params or {} -header_params.update(self.default_headers) -if self.cookie: -header_params['Cookie'] = self.cookie -if header_params: -header_params = self.sanitize_for_serialization(header_params) + # headers parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) -# path parameters -if path_params: -path_params = self.sanitize_for_serialization(path_params) -for k, v in iteritems(path_params): -replacement = quote(str(self.to_path_value(v))) -resource_path = resource_path.replace('{' + k + '}', replacement) + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + for k, v in iteritems(path_params): + replacement = quote(str(self.to_path_value(v))) + resource_path = resource_path.replace('{' + k + '}', replacement) -# query parameters -if query_params: -query_params = self.sanitize_for_serialization(query_params) -query_params = {k: self.to_path_value(v) for k, v in iteritems(query_params)} + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = {k: self.to_path_value(v) for k, v in iteritems(query_params)} -# post parameters -if post_params: -post_params = self.prepare_post_parameters(post_params, files) -post_params = self.sanitize_for_serialization(post_params) + # post parameters + if post_params: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) -# auth setting -self.update_params_for_auth(header_params, query_params, auth_settings) + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) -# body -if body: -body = self.sanitize_for_serialization(body) + # body + if body: + body = self.sanitize_for_serialization(body) -# request url -url = self.host + resource_path + # request url + url = self.host + resource_path -# perform request and return response -response_data = self.request(method, url, query_params=query_params, headers=header_params, -post_params=post_params, body=body) + # perform request and return response + response_data = self.request(method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body) -# deserialize response data -if response: -return self.deserialize(response_data, response) -else: -return None + # deserialize response data + if response: + return self.deserialize(response_data, response) + else: + return None -def to_path_value(self, obj): -""" -Convert a string or object to a path-friendly value + def to_path_value(self, obj): + """ + Convert a string or object to a path-friendly value -:param obj: object or string value + :param obj: object or string value -:return string: quoted value -""" -if type(obj) == list: -return ','.join(obj) -else: -return str(obj) + :return string: quoted value + """ + if type(obj) == list: + return ','.join(obj) + else: + return str(obj) -def sanitize_for_serialization(self, obj): -""" -Sanitize an object for Request. + def sanitize_for_serialization(self, obj): + """ + Sanitize an object for Request. -If obj is None, return None. -If obj is str, int, float, bool, return directly. -If obj is datetime.datetime, datetime.date convert to string in iso8601 format. -If obj is list, santize each element in the list. -If obj is dict, return the dict. -If obj is swagger model, return the properties dict. -""" -if isinstance(obj, type(None)): -return None -elif isinstance(obj, (str, int, float, bool, tuple)): -return obj -elif isinstance(obj, list): -return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] -elif isinstance(obj, (datetime.datetime, datetime.date)): -return obj.isoformat() -else: -if isinstance(obj, dict): -obj_dict = obj -else: -# Convert model obj to dict except attributes `swagger_types`, `attribute_map` -# and attributes which value is not None. -# Convert attribute name to json key in model definition for request. -obj_dict = {obj.attribute_map[key]: val -for key, val in iteritems(obj.__dict__) -if key != 'swagger_types' and key != 'attribute_map' and val is not None} -return {key: self.sanitize_for_serialization(val) -for key, val in iteritems(obj_dict)} + If obj is None, return None. + If obj is str, int, float, bool, return directly. + If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is list, santize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + """ + if isinstance(obj, type(None)): + return None + elif isinstance(obj, (str, int, float, bool, tuple)): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + else: + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in model definition for request. + obj_dict = {obj.attribute_map[key]: val + for key, val in iteritems(obj.__dict__) + if key != 'swagger_types' and key != 'attribute_map' and val is not None} + return {key: self.sanitize_for_serialization(val) + for key, val in iteritems(obj_dict)} -def deserialize(self, obj, obj_class): -""" -Derialize a JSON string into an object. + def deserialize(self, obj, obj_class): + """ + Derialize a JSON string into an object. -:param obj: string or object to be deserialized -:param obj_class: class literal for deserialzied object, or string of class name + :param obj: string or object to be deserialized + :param obj_class: class literal for deserialzied object, or string of class name -:return object: deserialized object -""" -# Have to accept obj_class as string or actual type. Type could be a -# native Python type, or one of the model classes. -if type(obj_class) == str: -if 'list[' in obj_class: -match = re.match('list\[(.*)\]', obj_class) -sub_class = match.group(1) -return [self.deserialize(sub_obj, sub_class) for sub_obj in obj] + :return object: deserialized object + """ + # Have to accept obj_class as string or actual type. Type could be a + # native Python type, or one of the model classes. + if type(obj_class) == str: + if 'list[' in obj_class: + match = re.match('list\[(.*)\]', obj_class) + sub_class = match.group(1) + return [self.deserialize(sub_obj, sub_class) for sub_obj in obj] -if obj_class in ['int', 'float', 'dict', 'list', 'str', 'bool', 'datetime']: -obj_class = eval(obj_class) -else: # not a native type, must be model class -obj_class = eval('models.' + obj_class) + if obj_class in ['int', 'float', 'dict', 'list', 'str', 'bool', 'datetime']: + obj_class = eval(obj_class) + else: # not a native type, must be model class + obj_class = eval('models.' + obj_class) -if obj_class in [int, float, dict, list, str, bool]: -return obj_class(obj) -elif obj_class == datetime: -return self.__parse_string_to_datetime(obj) + if obj_class in [int, float, dict, list, str, bool]: + return obj_class(obj) + elif obj_class == datetime: + return self.__parse_string_to_datetime(obj) -instance = obj_class() + instance = obj_class() -for attr, attr_type in iteritems(instance.swagger_types): -if obj is not None and instance.attribute_map[attr] in obj and type(obj) in [list, dict]: -value = obj[instance.attribute_map[attr]] -if attr_type in ['str', 'int', 'float', 'bool']: -attr_type = eval(attr_type) -try: -value = attr_type(value) -except UnicodeEncodeError: -value = unicode(value) -except TypeError: -value = value -setattr(instance, attr, value) -elif attr_type == 'datetime': -setattr(instance, attr, self.__parse_string_to_datetime(value)) -elif 'list[' in attr_type: -match = re.match('list\[(.*)\]', attr_type) -sub_class = match.group(1) -sub_values = [] -if not value: -setattr(instance, attr, None) -else: -for sub_value in value: -sub_values.append(self.deserialize(sub_value, sub_class)) -setattr(instance, attr, sub_values) -else: -setattr(instance, attr, self.deserialize(value, attr_type)) + for attr, attr_type in iteritems(instance.swagger_types): + if obj is not None and instance.attribute_map[attr] in obj and type(obj) in [list, dict]: + value = obj[instance.attribute_map[attr]] + if attr_type in ['str', 'int', 'float', 'bool']: + attr_type = eval(attr_type) + try: + value = attr_type(value) + except UnicodeEncodeError: + value = unicode(value) + except TypeError: + value = value + setattr(instance, attr, value) + elif attr_type == 'datetime': + setattr(instance, attr, self.__parse_string_to_datetime(value)) + elif 'list[' in attr_type: + match = re.match('list\[(.*)\]', attr_type) + sub_class = match.group(1) + sub_values = [] + if not value: + setattr(instance, attr, None) + else: + for sub_value in value: + sub_values.append(self.deserialize(sub_value, sub_class)) + setattr(instance, attr, sub_values) + else: + setattr(instance, attr, self.deserialize(value, attr_type)) -return instance + return instance -def __parse_string_to_datetime(self, string): -""" -Parse datetime in string to datetime. + def __parse_string_to_datetime(self, string): + """ + Parse datetime in string to datetime. -The string should be in iso8601 datetime format. -""" -try: -from dateutil.parser import parse -return parse(string) -except ImportError: -return string + The string should be in iso8601 datetime format. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string -def request(self, method, url, query_params=None, headers=None, post_params=None, body=None): -""" -Perform http request using RESTClient. -""" -if method == "GET": -return RESTClient.GET(url, query_params=query_params, headers=headers) -elif method == "HEAD": -return RESTClient.HEAD(url, query_params=query_params, headers=headers) -elif method == "POST": -return RESTClient.POST(url, headers=headers, post_params=post_params, body=body) -elif method == "PUT": -return RESTClient.PUT(url, headers=headers, post_params=post_params, body=body) -elif method == "PATCH": -return RESTClient.PATCH(url, headers=headers, post_params=post_params, body=body) -elif method == "DELETE": -return RESTClient.DELETE(url, query_params=query_params, headers=headers) -else: -raise ValueError("http method must be `GET`, `HEAD`, `POST`, `PATCH`, `PUT` or `DELETE`") + def request(self, method, url, query_params=None, headers=None, post_params=None, body=None): + """ + Perform http request using RESTClient. + """ + if method == "GET": + return RESTClient.GET(url, query_params=query_params, headers=headers) + elif method == "HEAD": + return RESTClient.HEAD(url, query_params=query_params, headers=headers) + elif method == "POST": + return RESTClient.POST(url, headers=headers, post_params=post_params, body=body) + elif method == "PUT": + return RESTClient.PUT(url, headers=headers, post_params=post_params, body=body) + elif method == "PATCH": + return RESTClient.PATCH(url, headers=headers, post_params=post_params, body=body) + elif method == "DELETE": + return RESTClient.DELETE(url, query_params=query_params, headers=headers) + else: + raise ValueError("http method must be `GET`, `HEAD`, `POST`, `PATCH`, `PUT` or `DELETE`") -def prepare_post_parameters(self, post_params=None, files=None): -params = {} + def prepare_post_parameters(self, post_params=None, files=None): + params = {} -if post_params: -params.update(post_params) + if post_params: + params.update(post_params) -if files: -for k, v in iteritems(files): -if v: -with open(v, 'rb') as f: -filename = os.path.basename(f.name) -filedata = f.read() -mimetype = mimetypes.guess_type(filename)[0] or 'application/octet-stream' -params[k] = tuple([filename, filedata, mimetype]) + if files: + for k, v in iteritems(files): + if v: + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = mimetypes.guess_type(filename)[0] or 'application/octet-stream' + params[k] = tuple([filename, filedata, mimetype]) -return params + return params -def select_header_accept(self, accepts): -""" -Return `Accept` based on an array of accepts provided -""" -if not accepts: -return + def select_header_accept(self, accepts): + """ + Return `Accept` based on an array of accepts provided + """ + if not accepts: + return -accepts = list(map(lambda x: x.lower(), accepts)) + accepts = list(map(lambda x: x.lower(), accepts)) -if 'application/json' in accepts: -return 'application/json' -else: -return ', '.join(accepts) + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) -def select_header_content_type(self, content_types): -""" -Return `Content-Type` baseed on an array of content_types provided -""" -if not content_types: -return 'application/json' + def select_header_content_type(self, content_types): + """ + Return `Content-Type` baseed on an array of content_types provided + """ + if not content_types: + return 'application/json' -content_types = list(map(lambda x: x.lower(), content_types)) + content_types = list(map(lambda x: x.lower(), content_types)) -if 'application/json' in content_types: -return 'application/json' -else: -return content_types[0] + if 'application/json' in content_types: + return 'application/json' + else: + return content_types[0] -def update_params_for_auth(self, headers, querys, auth_settings): -""" -Update header and query params based on authentication setting -""" -if not auth_settings: -return - -for auth in auth_settings: -auth_setting = configuration.auth_settings().get(auth) -if auth_setting: -if auth_setting['in'] == 'header': -headers[auth_setting['key']] = auth_setting['value'] -elif auth_setting['in'] == 'query': -querys[auth_setting['key']] = auth_setting['value'] -else: -raise ValueError('Authentication token must be in `query` or `header`') + def update_params_for_auth(self, headers, querys, auth_settings): + """ + Update header and query params based on authentication setting + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = configuration.auth_settings().get(auth) + if auth_setting: + if auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys[auth_setting['key']] = auth_setting['value'] + else: + raise ValueError('Authentication token must be in `query` or `header`') diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index 967fabccd993..d3a7093a02a0 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -3,44 +3,44 @@ import base64 import urllib3 def get_api_key_with_prefix(key): -global api_key -global api_key_prefix + global api_key + global api_key_prefix -if api_key.get(key) and api_key_prefix.get(key): -return api_key_prefix[key] + ' ' + api_key[key] -elif api_key.get(key): -return api_key[key] + if api_key.get(key) and api_key_prefix.get(key): + return api_key_prefix[key] + ' ' + api_key[key] + elif api_key.get(key): + return api_key[key] def get_basic_auth_token(): -global username -global password + global username + global password -return urllib3.util.make_headers(basic_auth=username + ':' + password).get('authorization') + return urllib3.util.make_headers(basic_auth=username + ':' + password).get('authorization') def auth_settings(): -return { {{#authMethods}}{{#isApiKey}} - '{{name}}': { - 'type': 'api_key', - 'in': {{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, - 'key': '{{keyParamName}}', - 'value': get_api_key_with_prefix('{{keyParamName}}') - }, -{{/isApiKey}}{{#isBasic}} - '{{name}}': { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': get_basic_auth_token() - }, -{{/isBasic}}{{/authMethods}} -} + return { {{#authMethods}}{{#isApiKey}} + '{{name}}': { + 'type': 'api_key', + 'in': {{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, + 'key': '{{keyParamName}}', + 'value': get_api_key_with_prefix('{{keyParamName}}') + }, + {{/isApiKey}}{{#isBasic}} + '{{name}}': { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': get_basic_auth_token() + }, + {{/isBasic}}{{/authMethods}} + } # Default Base url host = "{{basePath}}" # Default api client api_client = None - + # Authentication settings api_key = {} diff --git a/modules/swagger-codegen/src/main/resources/python/model.mustache b/modules/swagger-codegen/src/main/resources/python/model.mustache index 629bc0342d3d..429eac33ec59 100644 --- a/modules/swagger-codegen/src/main/resources/python/model.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model.mustache @@ -4,28 +4,28 @@ """ Copyright 2015 SmartBear Software -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. """ {{#models}} - {{#model}} +{{#model}} - class {{classname}}(object): - """ - NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - """ +class {{classname}}(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ - def __init__(self): + def __init__(self): """ Swagger model @@ -33,27 +33,27 @@ limitations under the License. :param dict attributeMap: The key is attribute name and the value is json key in definition. """ self.swagger_types = { - {{#vars}}'{{name}}': '{{{datatype}}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} + {{#vars}}'{{name}}': '{{{datatype}}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} } self.attribute_map = { - {{#vars}}'{{name}}': '{{baseName}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} + {{#vars}}'{{name}}': '{{baseName}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} } {{#vars}} - {{#description}}# {{description}}{{/description}} - self.{{name}} = None # {{{datatype}}} + {{#description}}# {{description}}{{/description}} + self.{{name}} = None # {{{datatype}}} {{/vars}} - def __repr__(self): + def __repr__(self): properties = [] for p in self.__dict__: - if p != 'swaggerTypes' and p != 'attributeMap': - properties.append('{prop}={val!r}'.format(prop=p, val=self.__dict__[p])) + if p != 'swaggerTypes' and p != 'attributeMap': + properties.append('{prop}={val!r}'.format(prop=p, val=self.__dict__[p])) return '<{name} {props}>'.format(name=__name__, props=' '.join(properties)) - {{/model}} +{{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index d5c79d8395af..508f3d6693a3 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -15,239 +15,239 @@ import certifi from six import iteritems try: -import urllib3 + import urllib3 except ImportError: -raise ImportError('Swagger python client requires urllib3.') + raise ImportError('Swagger python client requires urllib3.') try: -# for python3 -from urllib.parse import urlencode + # for python3 + from urllib.parse import urlencode except ImportError: -# for python2 -from urllib import urlencode + # for python2 + from urllib import urlencode class RESTResponse(io.IOBase): -def __init__(self, resp): -self.urllib3_response = resp -self.status = resp.status -self.reason = resp.reason -self.data = resp.data + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data -def getheaders(self): -""" -Returns a dictionary of the response headers. -""" -return self.urllib3_response.getheaders() + def getheaders(self): + """ + Returns a dictionary of the response headers. + """ + return self.urllib3_response.getheaders() -def getheader(self, name, default=None): -""" -Returns a given response header. -""" -return self.urllib3_response.getheader(name, default) + def getheader(self, name, default=None): + """ + Returns a given response header. + """ + return self.urllib3_response.getheader(name, default) class RESTClientObject(object): -def __init__(self, pools_size=4): -# http pool manager -self.pool_manager = urllib3.PoolManager( -num_pools=pools_size -) + def __init__(self, pools_size=4): + # http pool manager + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size + ) -# https pool manager -# certificates validated using Mozilla’s root certificates -self.ssl_pool_manager = urllib3.PoolManager( -num_pools=pools_size, -cert_reqs=ssl.CERT_REQUIRED, -ca_certs=certifi.where() -) + # https pool manager + # certificates validated using Mozilla’s root certificates + self.ssl_pool_manager = urllib3.PoolManager( + num_pools=pools_size, + cert_reqs=ssl.CERT_REQUIRED, + ca_certs=certifi.where() + ) -def agent(self, url): -""" -Return proper pool manager for the http\https schemes. -""" -url = urllib3.util.url.parse_url(url) -scheme = url.scheme -if scheme == 'https': -return self.ssl_pool_manager -else: -return self.pool_manager + def agent(self, url): + """ + Return proper pool manager for the http\https schemes. + """ + url = urllib3.util.url.parse_url(url) + scheme = url.scheme + if scheme == 'https': + return self.ssl_pool_manager + else: + return self.pool_manager -def request(self, method, url, query_params=None, headers=None, -body=None, post_params=None): -""" -:param method: http request method -:param url: http request url -:param query_params: query parameters in the url -:param headers: http request headers -:param body: request json body, for `application/json` -:param post_params: request post parameters, `application/x-www-form-urlencode` -and `multipart/form-data` -""" -method = method.upper() -assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH'] + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None): + """ + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, `application/x-www-form-urlencode` + and `multipart/form-data` + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH'] -if post_params and body: -raise ValueError("body parameter cannot be used with post_params parameter.") + if post_params and body: + raise ValueError("body parameter cannot be used with post_params parameter.") -post_params = post_params or {} -headers = headers or {} + post_params = post_params or {} + headers = headers or {} -if 'Content-Type' not in headers: -headers['Content-Type'] = 'application/json' + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' -# For `POST`, `PUT`, `PATCH` -if method in ['POST', 'PUT', 'PATCH']: -if query_params: -url += '?' + urlencode(query_params) -if headers['Content-Type'] == 'application/json': -r = self.agent(url).request(method, url, -body=json.dumps(body), -headers=headers) -if headers['Content-Type'] == 'application/x-www-form-urlencoded': -r = self.agent(url).request(method, url, -fields=post_params, -encode_multipart=False, -headers=headers) -if headers['Content-Type'] == 'multipart/form-data': -# must del headers['Content-Type'], or the correct Content-Type -# which generated by urllib3 will be overwritten. -del headers['Content-Type'] -r = self.agent(url).request(method, url, -fields=post_params, -encode_multipart=True, -headers=headers) -# For `GET`, `HEAD`, `DELETE` -else: -r = self.agent(url).request(method, url, -fields=query_params, -headers=headers) -r = RESTResponse(r) + # For `POST`, `PUT`, `PATCH` + if method in ['POST', 'PUT', 'PATCH']: + if query_params: + url += '?' + urlencode(query_params) + if headers['Content-Type'] == 'application/json': + r = self.agent(url).request(method, url, + body=json.dumps(body), + headers=headers) + if headers['Content-Type'] == 'application/x-www-form-urlencoded': + r = self.agent(url).request(method, url, + fields=post_params, + encode_multipart=False, + headers=headers) + if headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct Content-Type + # which generated by urllib3 will be overwritten. + del headers['Content-Type'] + r = self.agent(url).request(method, url, + fields=post_params, + encode_multipart=True, + headers=headers) + # For `GET`, `HEAD`, `DELETE` + else: + r = self.agent(url).request(method, url, + fields=query_params, + headers=headers) + r = RESTResponse(r) -if r.status not in range(200, 206): -raise ApiException(r) + if r.status not in range(200, 206): + raise ApiException(r) -return self.process_response(r) + return self.process_response(r) -def process_response(self, response): -# In the python 3, the response.data is bytes. -# we need to decode it to string. -if sys.version_info > (3,): -data = response.data.decode('utf8') -else: -data = response.data -try: -resp = json.loads(data) -except ValueError: -resp = data + def process_response(self, response): + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if sys.version_info > (3,): + data = response.data.decode('utf8') + else: + data = response.data + try: + resp = json.loads(data) + except ValueError: + resp = data -return resp + return resp -def GET(self, url, headers=None, query_params=None): -return self.request("GET", url, headers=headers, query_params=query_params) + def GET(self, url, headers=None, query_params=None): + return self.request("GET", url, headers=headers, query_params=query_params) -def HEAD(self, url, headers=None, query_params=None): -return self.request("HEAD", url, headers=headers, query_params=query_params) + def HEAD(self, url, headers=None, query_params=None): + return self.request("HEAD", url, headers=headers, query_params=query_params) -def DELETE(self, url, headers=None, query_params=None): -return self.request("DELETE", url, headers=headers, query_params=query_params) + def DELETE(self, url, headers=None, query_params=None): + return self.request("DELETE", url, headers=headers, query_params=query_params) -def POST(self, url, headers=None, post_params=None, body=None): -return self.request("POST", url, headers=headers, post_params=post_params, body=body) + def POST(self, url, headers=None, post_params=None, body=None): + return self.request("POST", url, headers=headers, post_params=post_params, body=body) -def PUT(self, url, headers=None, post_params=None, body=None): -return self.request("PUT", url, headers=headers, post_params=post_params, body=body) + def PUT(self, url, headers=None, post_params=None, body=None): + return self.request("PUT", url, headers=headers, post_params=post_params, body=body) -def PATCH(self, url, headers=None, post_params=None, body=None): -return self.request("PATCH", url, headers=headers, post_params=post_params, body=body) + def PATCH(self, url, headers=None, post_params=None, body=None): + return self.request("PATCH", url, headers=headers, post_params=post_params, body=body) class ApiException(Exception): -""" -Non-2xx HTTP response -""" + """ + Non-2xx HTTP response + """ -def __init__(self, http_resp): -self.status = http_resp.status -self.reason = http_resp.reason -self.body = http_resp.data -self.headers = http_resp.getheaders() + def __init__(self, http_resp): + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() -# In the python 3, the self.body is bytes. -# we need to decode it to string. -if sys.version_info > (3,): -data = self.body.decode('utf8') -else: -data = self.body + # In the python 3, the self.body is bytes. + # we need to decode it to string. + if sys.version_info > (3,): + data = self.body.decode('utf8') + else: + data = self.body + + try: + self.body = json.loads(data) + except ValueError: + self.body = data -try: -self.body = json.loads(data) -except ValueError: -self.body = data - -def __str__(self): -""" -Custom error response messages -""" -return "({0})\n"\ -"Reason: {1}\n"\ -"HTTP response headers: {2}\n"\ -"HTTP response body: {3}\n".\ -format(self.status, self.reason, self.headers, self.body) + def __str__(self): + """ + Custom error response messages + """ + return "({0})\n"\ + "Reason: {1}\n"\ + "HTTP response headers: {2}\n"\ + "HTTP response body: {3}\n".\ + format(self.status, self.reason, self.headers, self.body) class RESTClient(object): -""" -A class with all class methods to perform JSON requests. -""" + """ + A class with all class methods to perform JSON requests. + """ -IMPL = RESTClientObject() + IMPL = RESTClientObject() -@classmethod -def request(cls, *n, **kw): -""" -Perform a REST request and parse the response. -""" -return cls.IMPL.request(*n, **kw) + @classmethod + def request(cls, *n, **kw): + """ + Perform a REST request and parse the response. + """ + return cls.IMPL.request(*n, **kw) -@classmethod -def GET(cls, *n, **kw): -""" -Perform a GET request using `RESTClient.request()`. -""" -return cls.IMPL.GET(*n, **kw) + @classmethod + def GET(cls, *n, **kw): + """ + Perform a GET request using `RESTClient.request()`. + """ + return cls.IMPL.GET(*n, **kw) -@classmethod -def HEAD(cls, *n, **kw): -""" -Perform a HEAD request using `RESTClient.request()`. -""" -return cls.IMPL.GET(*n, **kw) + @classmethod + def HEAD(cls, *n, **kw): + """ + Perform a HEAD request using `RESTClient.request()`. + """ + return cls.IMPL.GET(*n, **kw) -@classmethod -def POST(cls, *n, **kw): -""" -Perform a POST request using `RESTClient.request()` -""" -return cls.IMPL.POST(*n, **kw) + @classmethod + def POST(cls, *n, **kw): + """ + Perform a POST request using `RESTClient.request()` + """ + return cls.IMPL.POST(*n, **kw) -@classmethod -def PUT(cls, *n, **kw): -""" -Perform a PUT request using `RESTClient.request()` -""" -return cls.IMPL.PUT(*n, **kw) + @classmethod + def PUT(cls, *n, **kw): + """ + Perform a PUT request using `RESTClient.request()` + """ + return cls.IMPL.PUT(*n, **kw) -@classmethod -def PATCH(cls, *n, **kw): -""" -Perform a PATCH request using `RESTClient.request()` -""" -return cls.IMPL.PATCH(*n, **kw) + @classmethod + def PATCH(cls, *n, **kw): + """ + Perform a PATCH request using `RESTClient.request()` + """ + return cls.IMPL.PATCH(*n, **kw) -@classmethod -def DELETE(cls, *n, **kw): -""" -Perform a DELETE request using `RESTClient.request()` -""" -return cls.IMPL.DELETE(*n, **kw) + @classmethod + def DELETE(cls, *n, **kw): + """ + Perform a DELETE request using `RESTClient.request()` + """ + return cls.IMPL.DELETE(*n, **kw) diff --git a/modules/swagger-codegen/src/main/resources/python/setup.mustache b/modules/swagger-codegen/src/main/resources/python/setup.mustache index 59c8f7f428a0..f1ba52d29301 100644 --- a/modules/swagger-codegen/src/main/resources/python/setup.mustache +++ b/modules/swagger-codegen/src/main/resources/python/setup.mustache @@ -3,18 +3,18 @@ from setuptools import setup, find_packages {{#apiInfo}}{{#apis}}{{^hasMore}} - # To install the library, open a Terminal shell, then run this - # file by typing: - # - # python setup.py install - # - # You need to have the setuptools module installed. - # Try reading the setuptools documentation: - # http://pypi.python.org/pypi/setuptools +# To install the library, open a Terminal shell, then run this +# file by typing: +# +# python setup.py install +# +# You need to have the setuptools module installed. +# Try reading the setuptools documentation: +# http://pypi.python.org/pypi/setuptools - REQUIRES = ["urllib3 >= 1.10", "six >= 1.9", "certifi"] +REQUIRES = ["urllib3 >= 1.10", "six >= 1.9", "certifi"] - setup( +setup( name="{{module}}", version="{{version}}", description="{{appName}}", @@ -27,7 +27,7 @@ from setuptools import setup, find_packages long_description="""\ {{appDescription}} """ - ) +) {{/hasMore}}{{/apis}}{{/apiInfo}} From d5cbbae182507e9ba0284dde15c3ac6f09d61679 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:26:02 +0800 Subject: [PATCH 13/41] rollback ruby swagger template --- .../ruby/swagger/configuration.mustache | 48 +- .../resources/ruby/swagger/request.mustache | 468 +++++++++--------- .../resources/ruby/swagger/response.mustache | 112 ++--- .../resources/ruby/swagger/version.mustache | 6 +- 4 files changed, 317 insertions(+), 317 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/ruby/swagger/configuration.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger/configuration.mustache index a6ad16d376a0..e9a8af9c1628 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/swagger/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/swagger/configuration.mustache @@ -1,29 +1,29 @@ module {{moduleName}} -module Swagger -class Configuration -attr_accessor :format, :api_key, :api_key_prefix, :username, :password, :auth_token, :scheme, :host, :base_path, :user_agent, :logger, :inject_format, :force_ending_format, :camelize_params, :user_agent, :verify_ssl + module Swagger + class Configuration + attr_accessor :format, :api_key, :api_key_prefix, :username, :password, :auth_token, :scheme, :host, :base_path, :user_agent, :logger, :inject_format, :force_ending_format, :camelize_params, :user_agent, :verify_ssl -# Defaults go in here.. -def initialize -@format = 'json' -@scheme = '{{scheme}}' -@host = '{{host}}' -@base_path = '{{contextPath}}' -@user_agent = "ruby-swagger-#{Swagger::VERSION}" -@inject_format = false -@force_ending_format = false -@camelize_params = true + # Defaults go in here.. + def initialize + @format = 'json' + @scheme = '{{scheme}}' + @host = '{{host}}' + @base_path = '{{contextPath}}' + @user_agent = "ruby-swagger-#{Swagger::VERSION}" + @inject_format = false + @force_ending_format = false + @camelize_params = true -# keys for API key authentication (param-name => api-key) -@api_key = {} -# api-key prefix for API key authentication, e.g. "Bearer" (param-name => api-key-prefix) -@api_key_prefix = {} + # keys for API key authentication (param-name => api-key) + @api_key = {} + # api-key prefix for API key authentication, e.g. "Bearer" (param-name => api-key-prefix) + @api_key_prefix = {} -# whether to verify SSL certificate, default to true -# Note: do NOT set it to false in production code, otherwise you would -# face multiple types of cryptographic attacks -@verify_ssl = true -end -end -end + # whether to verify SSL certificate, default to true + # Note: do NOT set it to false in production code, otherwise you would + # face multiple types of cryptographic attacks + @verify_ssl = true + end + end + end end diff --git a/modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache index 2c7d985f1347..99b58d58be85 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache @@ -1,272 +1,272 @@ module {{moduleName}} -module Swagger -class Request -require 'uri' -require 'addressable/uri' -require 'typhoeus' + module Swagger + class Request + require 'uri' + require 'addressable/uri' + require 'typhoeus' -attr_accessor :host, :path, :format, :params, :body, :http_method, :headers, :form_params, :auth_names + attr_accessor :host, :path, :format, :params, :body, :http_method, :headers, :form_params, :auth_names -# All requests must have an HTTP method and a path -# Optionals parameters are :params, :headers, :body, :format, :host -def initialize(http_method, path, attributes={}) -attributes[:format] ||= Swagger.configuration.format -attributes[:params] ||= {} + # All requests must have an HTTP method and a path + # Optionals parameters are :params, :headers, :body, :format, :host + def initialize(http_method, path, attributes={}) + attributes[:format] ||= Swagger.configuration.format + attributes[:params] ||= {} -# Set default headers -default_headers = { -'Content-Type' => "application/#{attributes[:format].downcase}", -'User-Agent' => Swagger.configuration.user_agent -} + # Set default headers + default_headers = { + 'Content-Type' => "application/#{attributes[:format].downcase}", + 'User-Agent' => Swagger.configuration.user_agent + } -# Merge argument headers into defaults -attributes[:headers] = default_headers.merge(attributes[:headers] || {}) + # Merge argument headers into defaults + attributes[:headers] = default_headers.merge(attributes[:headers] || {}) -# Stick in the auth token if there is one -if Swagger.authenticated? -attributes[:headers].merge!({:auth_token => Swagger.configuration.auth_token}) -end + # Stick in the auth token if there is one + if Swagger.authenticated? + attributes[:headers].merge!({:auth_token => Swagger.configuration.auth_token}) + end -self.http_method = http_method.to_sym -self.path = path -attributes.each do |name, value| -send("#{name.to_s.underscore.to_sym}=", value) -end + self.http_method = http_method.to_sym + self.path = path + attributes.each do |name, value| + send("#{name.to_s.underscore.to_sym}=", value) + end -update_params_for_auth! -end + update_params_for_auth! + end -# Update hearder and query params based on authentication settings. -def update_params_for_auth! -(@auth_names || []).each do |auth_name| -case auth_name -{{#authMethods}}when '{{name}}' -{{#isApiKey}}{{#isKeyInHeader}}@headers ||= {} -@headers['{{keyParamName}}'] = get_api_key_with_prefix('{{keyParamName}}'){{/isKeyInHeader}}{{#isKeyInQuery}}@params ||= {} -@params['{{keyParamName}}'] = get_api_key_with_prefix('{{keyParamName}}'){{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}@headers ||= {} -http_auth_header = 'Basic ' + ["#{Swagger.configuration.username}:#{Swagger.configuration.password}"].pack('m').delete("\r\n") -@headers['Authorization'] = http_auth_header{{/isBasic}}{{#isOAuth}}# TODO: support oauth{{/isOAuth}} -{{/authMethods}} -end -end -end + # Update hearder and query params based on authentication settings. + def update_params_for_auth! + (@auth_names || []).each do |auth_name| + case auth_name + {{#authMethods}}when '{{name}}' + {{#isApiKey}}{{#isKeyInHeader}}@headers ||= {} + @headers['{{keyParamName}}'] = get_api_key_with_prefix('{{keyParamName}}'){{/isKeyInHeader}}{{#isKeyInQuery}}@params ||= {} + @params['{{keyParamName}}'] = get_api_key_with_prefix('{{keyParamName}}'){{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}@headers ||= {} + http_auth_header = 'Basic ' + ["#{Swagger.configuration.username}:#{Swagger.configuration.password}"].pack('m').delete("\r\n") + @headers['Authorization'] = http_auth_header{{/isBasic}}{{#isOAuth}}# TODO: support oauth{{/isOAuth}} + {{/authMethods}} + end + end + end -# Get API key (with prefix if set). -# @param [String] param_name the parameter name of API key auth -def get_api_key_with_prefix(param_name) -if Swagger.configuration.api_key_prefix[param_name].present? -"#{Swagger.configuration.api_key_prefix[param_name]} #{Swagger.configuration.api_key[param_name]}" -else -Swagger.configuration.api_key[param_name] -end -end + # Get API key (with prefix if set). + # @param [String] param_name the parameter name of API key auth + def get_api_key_with_prefix(param_name) + if Swagger.configuration.api_key_prefix[param_name].present? + "#{Swagger.configuration.api_key_prefix[param_name]} #{Swagger.configuration.api_key[param_name]}" + else + Swagger.configuration.api_key[param_name] + end + end -# Construct a base URL -def url(options = {}) -u = Addressable::URI.new( -:scheme => Swagger.configuration.scheme, -:host => Swagger.configuration.host, -:path => self.interpreted_path, -:query => self.query_string.sub(/\?/, '') -).to_s + # Construct a base URL + def url(options = {}) + u = Addressable::URI.new( + :scheme => Swagger.configuration.scheme, + :host => Swagger.configuration.host, + :path => self.interpreted_path, + :query => self.query_string.sub(/\?/, '') + ).to_s -# Drop trailing question mark, if present -u.sub! /\?$/, '' + # Drop trailing question mark, if present + u.sub! /\?$/, '' -u -end + u + end -# Iterate over the params hash, injecting any path values into the path string -# e.g. /word.{format}/{word}/entries => /word.json/cat/entries -def interpreted_path -p = self.path.dup + # Iterate over the params hash, injecting any path values into the path string + # e.g. /word.{format}/{word}/entries => /word.json/cat/entries + def interpreted_path + p = self.path.dup -# Stick a .{format} placeholder into the path if there isn't -# one already or an actual format like json or xml -# e.g. /words/blah => /words.{format}/blah -if Swagger.configuration.inject_format -unless ['.json', '.xml', '{format}'].any? {|s| p.downcase.include? s } -p = p.sub(/^(\/?\w+)/, "\\1.#{format}") -end -end + # Stick a .{format} placeholder into the path if there isn't + # one already or an actual format like json or xml + # e.g. /words/blah => /words.{format}/blah + if Swagger.configuration.inject_format + unless ['.json', '.xml', '{format}'].any? {|s| p.downcase.include? s } + p = p.sub(/^(\/?\w+)/, "\\1.#{format}") + end + end -# Stick a .{format} placeholder on the end of the path if there isn't -# one already or an actual format like json or xml -# e.g. /words/blah => /words/blah.{format} -if Swagger.configuration.force_ending_format -unless ['.json', '.xml', '{format}'].any? {|s| p.downcase.include? s } -p = "#{p}.#{format}" -end -end + # Stick a .{format} placeholder on the end of the path if there isn't + # one already or an actual format like json or xml + # e.g. /words/blah => /words/blah.{format} + if Swagger.configuration.force_ending_format + unless ['.json', '.xml', '{format}'].any? {|s| p.downcase.include? s } + p = "#{p}.#{format}" + end + end -p = p.sub("{format}", self.format.to_s) + p = p.sub("{format}", self.format.to_s) -URI.encode [Swagger.configuration.base_path, p].join("/").gsub(/\/+/, '/') -end + URI.encode [Swagger.configuration.base_path, p].join("/").gsub(/\/+/, '/') + end -# Massage the request body into a state of readiness -# If body is a hash, camelize all keys then convert to a json string -def body=(value) -if value.is_a?(Hash) -value = value.inject({}) do |memo, (k,v)| -memo[k.to_s.camelize(:lower).to_sym] = v -memo -end -end -@body = value -end + # Massage the request body into a state of readiness + # If body is a hash, camelize all keys then convert to a json string + def body=(value) + if value.is_a?(Hash) + value = value.inject({}) do |memo, (k,v)| + memo[k.to_s.camelize(:lower).to_sym] = v + memo + end + end + @body = value + end -# If body is an object, JSONify it before making the actual request. -# For form parameters, remove empty value -def outgoing_body -# http form -if headers['Content-Type'] == 'application/x-www-form-urlencoded' -data = form_params.dup -data.each do |key, value| -data[key] = value.to_s if value && !value.is_a?(File) # remove emtpy form parameter -end -data -elsif @body # http body is JSON -@body.is_a?(String) ? @body : @body.to_json -else -nil -end -end + # If body is an object, JSONify it before making the actual request. + # For form parameters, remove empty value + def outgoing_body + # http form + if headers['Content-Type'] == 'application/x-www-form-urlencoded' + data = form_params.dup + data.each do |key, value| + data[key] = value.to_s if value && !value.is_a?(File) # remove emtpy form parameter + end + data + elsif @body # http body is JSON + @body.is_a?(String) ? @body : @body.to_json + else + nil + end + end -# Construct a query string from the query-string-type params -def query_string -# Iterate over all params, -# .. removing the ones that are part of the path itself. -# .. stringifying values so Addressable doesn't blow up. -query_values = {} -self.params.each_pair do |key, value| -next if self.path.include? "{#{key}}" # skip path params -next if value.blank? && value.class != FalseClass # skip empties -if Swagger.configuration.camelize_params -key = key.to_s.camelize(:lower).to_sym -end -query_values[key] = value.to_s -end + # Construct a query string from the query-string-type params + def query_string + # Iterate over all params, + # .. removing the ones that are part of the path itself. + # .. stringifying values so Addressable doesn't blow up. + query_values = {} + self.params.each_pair do |key, value| + next if self.path.include? "{#{key}}" # skip path params + next if value.blank? && value.class != FalseClass # skip empties + if Swagger.configuration.camelize_params + key = key.to_s.camelize(:lower).to_sym + end + query_values[key] = value.to_s + end -# We don't want to end up with '?' as our query string -# if there aren't really any params -return "" if query_values.blank? + # We don't want to end up with '?' as our query string + # if there aren't really any params + return "" if query_values.blank? -# Addressable requires query_values to be set after initialization.. -qs = Addressable::URI.new -qs.query_values = query_values -qs.to_s -end + # Addressable requires query_values to be set after initialization.. + qs = Addressable::URI.new + qs.query_values = query_values + qs.to_s + end -def make -#TODO use configuration setting to determine if debugging -#logger = Logger.new STDOUT -#logger.debug self.url + def make + #TODO use configuration setting to determine if debugging + #logger = Logger.new STDOUT + #logger.debug self.url -request_options = { -:ssl_verifypeer => Swagger.configuration.verify_ssl, -:headers => self.headers.stringify_keys -} -response = case self.http_method.to_sym -when :get,:GET -Typhoeus::Request.get( -self.url, -request_options -) + request_options = { + :ssl_verifypeer => Swagger.configuration.verify_ssl, + :headers => self.headers.stringify_keys + } + response = case self.http_method.to_sym + when :get,:GET + Typhoeus::Request.get( + self.url, + request_options + ) -when :post,:POST -Typhoeus::Request.post( -self.url, -request_options.merge(:body => self.outgoing_body) -) + when :post,:POST + Typhoeus::Request.post( + self.url, + request_options.merge(:body => self.outgoing_body) + ) -when :patch,:PATCH -Typhoeus::Request.patch( -self.url, -request_options.merge(:body => self.outgoing_body) -) + when :patch,:PATCH + Typhoeus::Request.patch( + self.url, + request_options.merge(:body => self.outgoing_body) + ) -when :put,:PUT -Typhoeus::Request.put( -self.url, -request_options.merge(:body => self.outgoing_body) -) + when :put,:PUT + Typhoeus::Request.put( + self.url, + request_options.merge(:body => self.outgoing_body) + ) -when :delete,:DELETE -Typhoeus::Request.delete( -self.url, -request_options.merge(:body => self.outgoing_body) -) -end -Response.new(response) -end + when :delete,:DELETE + Typhoeus::Request.delete( + self.url, + request_options.merge(:body => self.outgoing_body) + ) + end + Response.new(response) + end -def response -self.make -end + def response + self.make + end -def response_code_pretty -return unless @response.present? -@response.code.to_s -end + def response_code_pretty + return unless @response.present? + @response.code.to_s + end -def response_headers_pretty -return unless @response.present? -# JSON.pretty_generate(@response.headers).gsub(/\n/, '
') # <- This was for RestClient -@response.headers.gsub(/\n/, '
') # <- This is for Typhoeus -end + def response_headers_pretty + return unless @response.present? + # JSON.pretty_generate(@response.headers).gsub(/\n/, '
') # <- This was for RestClient + @response.headers.gsub(/\n/, '
') # <- This is for Typhoeus + end -# return 'Accept' based on an array of accept provided -# @param [Array] header_accept_array Array fo 'Accept' -# @return String Accept (e.g. application/json) -def self.select_header_accept header_accept_array -if header_accept_array.empty? -return -elsif header_accept_array.any?{ |s| s.casecmp('application/json')==0 } -'application/json' # look for json data by default -else -header_accept_array.join(',') -end -end + # return 'Accept' based on an array of accept provided + # @param [Array] header_accept_array Array fo 'Accept' + # @return String Accept (e.g. application/json) + def self.select_header_accept header_accept_array + if header_accept_array.empty? + return + elsif header_accept_array.any?{ |s| s.casecmp('application/json')==0 } + 'application/json' # look for json data by default + else + header_accept_array.join(',') + end + end -# return the content type based on an array of content-type provided -# @param [Array] content_type_array Array fo content-type -# @return String Content-Type (e.g. application/json) -def self.select_header_content_type content_type_array -if content_type_array.empty? -'application/json' # use application/json by default -elsif content_type_array.any?{ |s| s.casecmp('application/json')==0 } -'application/json' # use application/json if it's included -else -content_type_array[0]; # otherwise, use the first one -end -end + # return the content type based on an array of content-type provided + # @param [Array] content_type_array Array fo content-type + # @return String Content-Type (e.g. application/json) + def self.select_header_content_type content_type_array + if content_type_array.empty? + 'application/json' # use application/json by default + elsif content_type_array.any?{ |s| s.casecmp('application/json')==0 } + 'application/json' # use application/json if it's included + else + content_type_array[0]; # otherwise, use the first one + end + end -# static method to convert object (array, hash, object, etc) to JSON string -# @param model object to be converted into JSON string -# @return string JSON string representation of the object -def self.object_to_http_body model -return if model.nil? -_body = nil -if model.is_a?(Array) -_body = model.map{|m| object_to_hash(m) } -else -_body = object_to_hash(model) -end -_body.to_json -end + # static method to convert object (array, hash, object, etc) to JSON string + # @param model object to be converted into JSON string + # @return string JSON string representation of the object + def self.object_to_http_body model + return if model.nil? + _body = nil + if model.is_a?(Array) + _body = model.map{|m| object_to_hash(m) } + else + _body = object_to_hash(model) + end + _body.to_json + end -# static method to convert object(non-array) to hash -# @param obj object to be converted into JSON string -# @return string JSON string representation of the object -def self.object_to_hash obj -if obj.respond_to?(:to_hash) -obj.to_hash -else -obj -end -end + # static method to convert object(non-array) to hash + # @param obj object to be converted into JSON string + # @return string JSON string representation of the object + def self.object_to_hash obj + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end -end -end + end + end end diff --git a/modules/swagger-codegen/src/main/resources/ruby/swagger/response.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger/response.mustache index 7f9ad4f32810..e7bb482fb663 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/swagger/response.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/swagger/response.mustache @@ -1,70 +1,70 @@ module {{moduleName}} -module Swagger -class Response -require 'json' + module Swagger + class Response + require 'json' -attr_accessor :raw + attr_accessor :raw -def initialize(raw) -self.raw = raw + def initialize(raw) + self.raw = raw -case self.code -when 500..510 then raise(ServerError, self.error_message) -when 299..426 then raise(ClientError, self.error_message) -end -end + case self.code + when 500..510 then raise(ServerError, self.error_message) + when 299..426 then raise(ClientError, self.error_message) + end + end -def code -raw.code -end + def code + raw.code + end -# Account for error messages that take different forms... -def error_message -body['message'] -rescue -body -end + # Account for error messages that take different forms... + def error_message + body['message'] + rescue + body + end -# If body is JSON, parse it -# Otherwise return raw string -def body -JSON.parse(raw.body, :symbolize_names => true) -rescue -raw.body -end + # If body is JSON, parse it + # Otherwise return raw string + def body + JSON.parse(raw.body, :symbolize_names => true) + rescue + raw.body + end -# `headers_hash` is a Typhoeus-specific extension of Hash, -# so simplify it back into a regular old Hash. -def headers -h = {} -raw.headers_hash.each {|k,v| h[k] = v } -h -end + # `headers_hash` is a Typhoeus-specific extension of Hash, + # so simplify it back into a regular old Hash. + def headers + h = {} + raw.headers_hash.each {|k,v| h[k] = v } + h + end -# Extract the response format from the header hash -# e.g. {'Content-Type' => 'application/json'} -def format -headers['Content-Type'].split("/").last.downcase -end + # Extract the response format from the header hash + # e.g. {'Content-Type' => 'application/json'} + def format + headers['Content-Type'].split("/").last.downcase + end -def json? -format == 'json' -end + def json? + format == 'json' + end -def xml? -format == 'xml' -end + def xml? + format == 'xml' + end -def pretty_body -return unless body.present? -case format -when 'json' then JSON.pretty_generate(body).gsub(/\n/, '
') -end -end + def pretty_body + return unless body.present? + case format + when 'json' then JSON.pretty_generate(body).gsub(/\n/, '
') + end + end -def pretty_headers -JSON.pretty_generate(headers).gsub(/\n/, '
') -end -end -end + def pretty_headers + JSON.pretty_generate(headers).gsub(/\n/, '
') + end + end + end end diff --git a/modules/swagger-codegen/src/main/resources/ruby/swagger/version.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger/version.mustache index a3c42972c3d9..332a5e66f45f 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/swagger/version.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/swagger/version.mustache @@ -1,5 +1,5 @@ module {{moduleName}} -module Swagger -VERSION = "{{appVersion}}" -end + module Swagger + VERSION = "{{appVersion}}" + end end From 5f6622c70d1a9729da9299698a17da52de173c5c Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:33:30 +0800 Subject: [PATCH 14/41] rollback ruby template --- .../src/main/resources/ruby/api.mustache | 88 +++++----- .../main/resources/ruby/base_object.mustache | 148 ++++++++-------- .../src/main/resources/ruby/model.mustache | 66 ++++---- .../src/main/resources/ruby/monkey.mustache | 158 +++++++++--------- .../src/main/resources/ruby/swagger.mustache | 132 +++++++-------- .../ruby/swagger_client.gemspec.mustache | 46 ++--- .../resources/ruby/swagger_client.mustache | 12 +- 7 files changed, 325 insertions(+), 325 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/ruby/api.mustache b/modules/swagger-codegen/src/main/resources/ruby/api.mustache index 88c6f4b676a0..3e1ac14014ef 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api.mustache @@ -2,60 +2,60 @@ require "uri" module {{moduleName}} {{#operations}} - class {{classname}} + class {{classname}} basePath = "{{basePath}}" # apiInvoker = APIInvoker - {{#operation}} - {{newline}} - # {{summary}} - # {{notes}} - {{#allParams}}{{#required}} # @param {{paramName}} {{description}} - {{/required}}{{/allParams}} # @param [Hash] opts the optional parameters - {{#allParams}}{{^required}} # @option opts [{{dataType}}] :{{paramName}} {{description}} - {{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}] - def self.{{nickname}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {}) - {{#allParams}}{{#required}} - # verify the required parameter '{{paramName}}' is set - raise "Missing the required parameter '{{paramName}}' when calling {{nickname}}" if {{{paramName}}}.nil? - {{/required}}{{/allParams}} +{{#operation}} +{{newline}} + # {{summary}} + # {{notes}} +{{#allParams}}{{#required}} # @param {{paramName}} {{description}} +{{/required}}{{/allParams}} # @param [Hash] opts the optional parameters +{{#allParams}}{{^required}} # @option opts [{{dataType}}] :{{paramName}} {{description}} +{{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}] + def self.{{nickname}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {}) + {{#allParams}}{{#required}} + # verify the required parameter '{{paramName}}' is set + raise "Missing the required parameter '{{paramName}}' when calling {{nickname}}" if {{{paramName}}}.nil? + {{/required}}{{/allParams}} - # resource path - path = "{{path}}".sub('{format}','json'){{#pathParams}}.sub('{' + '{{baseName}}' + '}', {{paramName}}.to_s){{/pathParams}} + # resource path + path = "{{path}}".sub('{format}','json'){{#pathParams}}.sub('{' + '{{baseName}}' + '}', {{paramName}}.to_s){{/pathParams}} - # query parameters - query_params = {}{{#queryParams}}{{#required}} - query_params[:'{{{baseName}}}'] = {{{paramName}}}{{/required}}{{/queryParams}}{{#queryParams}}{{^required}} - query_params[:'{{{baseName}}}'] = opts[:'{{{paramName}}}'] if opts[:'{{{paramName}}}']{{/required}}{{/queryParams}} + # query parameters + query_params = {}{{#queryParams}}{{#required}} + query_params[:'{{{baseName}}}'] = {{{paramName}}}{{/required}}{{/queryParams}}{{#queryParams}}{{^required}} + query_params[:'{{{baseName}}}'] = opts[:'{{{paramName}}}'] if opts[:'{{{paramName}}}']{{/required}}{{/queryParams}} - # header parameters - header_params = {} + # header parameters + header_params = {} - # HTTP header 'Accept' (if needed) - _header_accept = [{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}] - _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result + # HTTP header 'Accept' (if needed) + _header_accept = [{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}] + _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result - # HTTP header 'Content-Type' - _header_content_type = [{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}] - header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type){{#headerParams}}{{#required}} - header_params[:'{{{baseName}}}'] = {{{paramName}}}{{/required}}{{/headerParams}}{{#headerParams}}{{^required}} - header_params[:'{{{baseName}}}'] = opts[:'{{{paramName}}}'] if opts[:'{{{paramName}}}']{{/required}}{{/headerParams}} + # HTTP header 'Content-Type' + _header_content_type = [{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}] + header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type){{#headerParams}}{{#required}} + header_params[:'{{{baseName}}}'] = {{{paramName}}}{{/required}}{{/headerParams}}{{#headerParams}}{{^required}} + header_params[:'{{{baseName}}}'] = opts[:'{{{paramName}}}'] if opts[:'{{{paramName}}}']{{/required}}{{/headerParams}} - # form parameters - form_params = {}{{#formParams}}{{#required}} - form_params["{{baseName}}"] = {{paramName}}{{/required}}{{/formParams}}{{#formParams}}{{^required}} - form_params["{{baseName}}"] = opts[:'{{paramName}}'] if opts[:'{{paramName}}']{{/required}}{{/formParams}} + # form parameters + form_params = {}{{#formParams}}{{#required}} + form_params["{{baseName}}"] = {{paramName}}{{/required}}{{/formParams}}{{#formParams}}{{^required}} + form_params["{{baseName}}"] = opts[:'{{paramName}}'] if opts[:'{{paramName}}']{{/required}}{{/formParams}} - # http body (model) - {{^bodyParam}}post_body = nil - {{/bodyParam}}{{#bodyParam}}post_body = Swagger::Request.object_to_http_body({{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}) - {{/bodyParam}} + # http body (model) + {{^bodyParam}}post_body = nil + {{/bodyParam}}{{#bodyParam}}post_body = Swagger::Request.object_to_http_body({{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}) + {{/bodyParam}} - auth_names = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] - {{#returnType}}response = Swagger::Request.new(:{{httpMethod}}, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body - {{#returnContainer}}response.map {|response| {{/returnContainer}}obj = {{returnBaseType}}.new() and obj.build_from_hash(response){{#returnContainer}} }{{/returnContainer}}{{/returnType}}{{^returnType}}Swagger::Request.new(:{{httpMethod}}, path, {:params => query_params,:headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make - nil{{/returnType}} - end - {{/operation}} + auth_names = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] + {{#returnType}}response = Swagger::Request.new(:{{httpMethod}}, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body + {{#returnContainer}}response.map {|response| {{/returnContainer}}obj = {{returnBaseType}}.new() and obj.build_from_hash(response){{#returnContainer}} }{{/returnContainer}}{{/returnType}}{{^returnType}}Swagger::Request.new(:{{httpMethod}}, path, {:params => query_params,:headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make + nil{{/returnType}} end +{{/operation}} + end {{/operations}} end diff --git a/modules/swagger-codegen/src/main/resources/ruby/base_object.mustache b/modules/swagger-codegen/src/main/resources/ruby/base_object.mustache index 70c7afdb8897..c0e563a0bb72 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/base_object.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/base_object.mustache @@ -1,83 +1,83 @@ module {{moduleName}} -# base class containing fundamental method such as to_hash, build_from_hash and more -class BaseObject + # base class containing fundamental method such as to_hash, build_from_hash and more + class BaseObject -# return the object in the form of hash -def to_body -body = {} -self.class.attribute_map.each_pair do |key, value| -body[value] = self.send(key) unless self.send(key).nil? -end -body -end + # return the object in the form of hash + def to_body + body = {} + self.class.attribute_map.each_pair do |key, value| + body[value] = self.send(key) unless self.send(key).nil? + end + body + end -# build the object from hash -def build_from_hash(attributes) -return nil unless attributes.is_a?(Hash) -self.class.swagger_types.each_pair do |key, type| -if type =~ /^array\[(.*)\]/i -if attributes[self.class.attribute_map[key]].is_a?(Array) -self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) -else -#TODO show warning in debug mode -end -elsif !attributes[self.class.attribute_map[key]].nil? -self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) -else -# data not found in attributes(hash), not an issue as the data can be optional -end -end + # build the object from hash + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /^array\[(.*)\]/i + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + else + #TODO show warning in debug mode + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + else + # data not found in attributes(hash), not an issue as the data can be optional + end + end -self -end + self + end -def _deserialize(type, value) -case type.to_sym -when :DateTime -DateTime.parse(value) -when :string -value.to_s -when :int -value.to_i -when :double -value.to_f -when :boolean -if value =~ /^(true|t|yes|y|1)$/i -true -else -false -end -else # model -_model = {{moduleName}}.const_get(type).new -_model.build_from_hash(value) -end -end + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :string + value.to_s + when :int + value.to_i + when :double + value.to_f + when :boolean + if value =~ /^(true|t|yes|y|1)$/i + true + else + false + end + else # model + _model = {{moduleName}}.const_get(type).new + _model.build_from_hash(value) + end + end -# to_body is an alias to to_body (backward compatibility) -def to_hash -hash = {} -self.class.attribute_map.each_pair do |key, value| -if self.send(key).is_a?(Array) -next if self.send(key).empty? -hash[value] = self.send(key).select{|v| !v.nil?}.map{ |v| _to_hash v} unless self.send(key).nil? -else -unless (_tmp_value = _to_hash self.send(key)).nil? -hash[value] = _tmp_value -end -end -end -hash -end + # to_body is an alias to to_body (backward compatibility) + def to_hash + hash = {} + self.class.attribute_map.each_pair do |key, value| + if self.send(key).is_a?(Array) + next if self.send(key).empty? + hash[value] = self.send(key).select{|v| !v.nil?}.map{ |v| _to_hash v} unless self.send(key).nil? + else + unless (_tmp_value = _to_hash self.send(key)).nil? + hash[value] = _tmp_value + end + end + end + hash + end -# Method to output non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -def _to_hash(value) -if value.respond_to? :to_hash -value.to_hash -else -value -end -end + # Method to output non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + def _to_hash(value) + if value.respond_to? :to_hash + value.to_hash + else + value + end + end -end + end end diff --git a/modules/swagger-codegen/src/main/resources/ruby/model.mustache b/modules/swagger-codegen/src/main/resources/ruby/model.mustache index ca817247130c..d0d4e7877564 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/model.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/model.mustache @@ -1,40 +1,40 @@ module {{moduleName}} {{#models}} # {{description}} {{#model}} class {{classname}} < BaseObject -attr_accessor {{#vars}}:{{{name}}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{newline}} -# attribute mapping from ruby-style variable name to JSON key -def self.attribute_map -{ -{{#vars}} - # {{description}} - :'{{{name}}}' => :'{{{baseName}}}'{{#hasMore}},{{/hasMore}} -{{/vars}} -} -end - -# attribute type -def self.swagger_types -{ -{{#vars}}:'{{{name}}}' => :'{{{datatype}}}'{{#hasMore}},{{/hasMore}} -{{/vars}} -} -end - -def initialize(attributes = {}) -return if !attributes.is_a?(Hash) || attributes.empty? - -# convert string to symbol for hash key -attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} - -{{#vars}} - if attributes[:'{{{baseName}}}'] - {{#isContainer}}if (value = attributes[:'{{{baseName}}}']).is_a?(Array) - @{{{name}}} = value - end{{/isContainer}}{{^isContainer}}@{{{name}}} = attributes[:'{{{baseName}}}']{{/isContainer}} + attr_accessor {{#vars}}:{{{name}}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{newline}} + # attribute mapping from ruby-style variable name to JSON key + def self.attribute_map + { + {{#vars}} + # {{description}} + :'{{{name}}}' => :'{{{baseName}}}'{{#hasMore}},{{/hasMore}} + {{/vars}} + } end -{{/vars}} -end -end + + # attribute type + def self.swagger_types + { + {{#vars}}:'{{{name}}}' => :'{{{datatype}}}'{{#hasMore}},{{/hasMore}} + {{/vars}} + } + end + + def initialize(attributes = {}) + return if !attributes.is_a?(Hash) || attributes.empty? + + # convert string to symbol for hash key + attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} + + {{#vars}} + if attributes[:'{{{baseName}}}'] + {{#isContainer}}if (value = attributes[:'{{{baseName}}}']).is_a?(Array) + @{{{name}}} = value + end{{/isContainer}}{{^isContainer}}@{{{name}}} = attributes[:'{{{baseName}}}']{{/isContainer}} + end + {{/vars}} + end + end {{/model}} {{/models}} end diff --git a/modules/swagger-codegen/src/main/resources/ruby/monkey.mustache b/modules/swagger-codegen/src/main/resources/ruby/monkey.mustache index f400813974f9..28932890af95 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/monkey.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/monkey.mustache @@ -1,90 +1,90 @@ # module Swagger -class Object + class Object + + unless Object.method_defined? :blank? + def blank? + respond_to?(:empty?) ? empty? : !self + end + end + + unless Object.method_defined? :present? + def present? + !blank? + end + end -unless Object.method_defined? :blank? -def blank? -respond_to?(:empty?) ? empty? : !self -end -end + end -unless Object.method_defined? :present? -def present? -!blank? -end -end + class String -end + unless String.method_defined? :underscore + def underscore + self.gsub(/::/, '/'). + gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). + gsub(/([a-z\d])([A-Z])/,'\1_\2'). + tr("-", "_"). + downcase + end + end + + unless String.method_defined? :camelize + def camelize(first_letter_in_uppercase = true) + if first_letter_in_uppercase != :lower + self.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase } + else + self.to_s[0].chr.downcase + camelize(self)[1..-1] + end + end + end -class String + end -unless String.method_defined? :underscore -def underscore -self.gsub(/::/, '/'). -gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). -gsub(/([a-z\d])([A-Z])/,'\1_\2'). -tr("-", "_"). -downcase -end -end + class Hash -unless String.method_defined? :camelize -def camelize(first_letter_in_uppercase = true) -if first_letter_in_uppercase != :lower -self.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase } -else -self.to_s[0].chr.downcase + camelize(self)[1..-1] -end -end -end + unless Hash.method_defined? :stringify_keys + def stringify_keys + inject({}) do |options, (key, value)| + options[key.to_s] = value + options + end + end + end + + unless Hash.method_defined? :stringify_keys! + def stringify_keys! + self.replace(self.stringify_keys) + end + end -end + unless Hash.method_defined? :symbolize_keys + def symbolize_keys + inject({}) do |options, (key, value)| + options[(key.to_sym rescue key) || key] = value + options + end + end + end + + unless Hash.method_defined? :symbolize_keys! + def symbolize_keys! + self.replace(self.symbolize_keys) + end + end -class Hash + unless Hash.method_defined? :symbolize_and_underscore_keys + def symbolize_and_underscore_keys + inject({}) do |options, (key, value)| + options[(key.to_s.underscore.to_sym rescue key) || key] = value + options + end + end + end -unless Hash.method_defined? :stringify_keys -def stringify_keys -inject({}) do |options, (key, value)| -options[key.to_s] = value -options -end -end -end - -unless Hash.method_defined? :stringify_keys! -def stringify_keys! -self.replace(self.stringify_keys) -end -end - -unless Hash.method_defined? :symbolize_keys -def symbolize_keys -inject({}) do |options, (key, value)| -options[(key.to_sym rescue key) || key] = value -options -end -end -end - -unless Hash.method_defined? :symbolize_keys! -def symbolize_keys! -self.replace(self.symbolize_keys) -end -end - -unless Hash.method_defined? :symbolize_and_underscore_keys -def symbolize_and_underscore_keys -inject({}) do |options, (key, value)| -options[(key.to_s.underscore.to_sym rescue key) || key] = value -options -end -end -end - -unless Hash.method_defined? :symbolize_and_underscore_keys! -def symbolize_and_underscore_keys! -self.replace(self.symbolize_and_underscore_keys) -end -end - -end + unless Hash.method_defined? :symbolize_and_underscore_keys! + def symbolize_and_underscore_keys! + self.replace(self.symbolize_and_underscore_keys) + end + end + + end # end \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ruby/swagger.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger.mustache index 829ecbe0b1e9..dd2f630a8c95 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/swagger.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/swagger.mustache @@ -2,77 +2,77 @@ require 'logger' require 'json' module {{moduleName}} -module Swagger -class << self -attr_accessor :logger + module Swagger + class << self + attr_accessor :logger -# A Swagger configuration object. Must act like a hash and return sensible -# values for all Swagger configuration options. See Swagger::Configuration. -attr_accessor :configuration + # A Swagger configuration object. Must act like a hash and return sensible + # values for all Swagger configuration options. See Swagger::Configuration. + attr_accessor :configuration -attr_accessor :resources + attr_accessor :resources -# Call this method to modify defaults in your initializers. -# -# @example -# Swagger.configure do |config| -# config.api_key['api_key'] = '1234567890abcdef' # api key authentication -# config.username = 'wordlover' # http basic authentication -# config.password = 'i<3words' # http basic authentication -# config.format = 'json' # optional, defaults to 'json' -# end -# -def configure -yield(configuration) if block_given? + # Call this method to modify defaults in your initializers. + # + # @example + # Swagger.configure do |config| + # config.api_key['api_key'] = '1234567890abcdef' # api key authentication + # config.username = 'wordlover' # http basic authentication + # config.password = 'i<3words' # http basic authentication + # config.format = 'json' # optional, defaults to 'json' + # end + # + def configure + yield(configuration) if block_given? -# Configure logger. Default to use Rails -self.logger ||= configuration.logger || (defined?(Rails) ? Rails.logger : Logger.new(STDOUT)) + # Configure logger. Default to use Rails + self.logger ||= configuration.logger || (defined?(Rails) ? Rails.logger : Logger.new(STDOUT)) -# remove :// from scheme -configuration.scheme.sub!(/:\/\//, '') + # remove :// from scheme + configuration.scheme.sub!(/:\/\//, '') -# remove http(s):// and anything after a slash -configuration.host.sub!(/https?:\/\//, '') -configuration.host = configuration.host.split('/').first + # remove http(s):// and anything after a slash + configuration.host.sub!(/https?:\/\//, '') + configuration.host = configuration.host.split('/').first -# Add leading and trailing slashes to base_path -configuration.base_path = "/#{configuration.base_path}".gsub(/\/+/, '/') -configuration.base_path = "" if configuration.base_path == "/" -end - -def authenticated? -Swagger.configuration.auth_token.present? -end - -def de_authenticate -Swagger.configuration.auth_token = nil -end - -def authenticate -return if Swagger.authenticated? - -if Swagger.configuration.username.blank? || Swagger.configuration.password.blank? -raise ClientError, "Username and password are required to authenticate." -end - -request = Swagger::Request.new( -:get, -"account/authenticate/{username}", -:params => { -:username => Swagger.configuration.username, -:password => Swagger.configuration.password -} -) - -response_body = request.response.body -Swagger.configuration.auth_token = response_body['token'] -end -end -end - -class ServerError < StandardError -end - -class ClientError < StandardError -end + # Add leading and trailing slashes to base_path + configuration.base_path = "/#{configuration.base_path}".gsub(/\/+/, '/') + configuration.base_path = "" if configuration.base_path == "/" + end + + def authenticated? + Swagger.configuration.auth_token.present? + end + + def de_authenticate + Swagger.configuration.auth_token = nil + end + + def authenticate + return if Swagger.authenticated? + + if Swagger.configuration.username.blank? || Swagger.configuration.password.blank? + raise ClientError, "Username and password are required to authenticate." + end + + request = Swagger::Request.new( + :get, + "account/authenticate/{username}", + :params => { + :username => Swagger.configuration.username, + :password => Swagger.configuration.password + } + ) + + response_body = request.response.body + Swagger.configuration.auth_token = response_body['token'] + end + end + end + + class ServerError < StandardError + end + + class ClientError < StandardError + end end diff --git a/modules/swagger-codegen/src/main/resources/ruby/swagger_client.gemspec.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger_client.gemspec.mustache index 26b0a040cbdd..8ae4bfa1a492 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/swagger_client.gemspec.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/swagger_client.gemspec.mustache @@ -3,30 +3,30 @@ $:.push File.expand_path("../lib", __FILE__) require "{{gemName}}/swagger/version" Gem::Specification.new do |s| -s.name = "{{gemName}}" -s.version = {{moduleName}}::Swagger::VERSION -s.platform = Gem::Platform::RUBY -s.authors = ["Zeke Sikelianos", "Tony Tam"] -s.email = ["zeke@wordnik.com", "fehguy@gmail.com"] -s.homepage = "http://swagger.io" -s.summary = %q{A ruby wrapper for the swagger APIs} -s.description = %q{This gem maps to a swagger API} -s.license = "Apache-2.0" + s.name = "{{gemName}}" + s.version = {{moduleName}}::Swagger::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Zeke Sikelianos", "Tony Tam"] + s.email = ["zeke@wordnik.com", "fehguy@gmail.com"] + s.homepage = "http://swagger.io" + s.summary = %q{A ruby wrapper for the swagger APIs} + s.description = %q{This gem maps to a swagger API} + s.license = "Apache-2.0" -s.add_runtime_dependency 'typhoeus', '~> 0.2', '>= 0.2.1' -s.add_runtime_dependency 'addressable', '~> 2.2', '>= 2.2.4' -s.add_runtime_dependency 'json', '~> 1.4', '>= 1.4.6' + s.add_runtime_dependency 'typhoeus', '~> 0.2', '>= 0.2.1' + s.add_runtime_dependency 'addressable', '~> 2.2', '>= 2.2.4' + s.add_runtime_dependency 'json', '~> 1.4', '>= 1.4.6' -s.add_development_dependency 'rspec', '~> 3.2', '>= 3.2.0' -s.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.3' -s.add_development_dependency 'webmock', '~> 1.6', '>= 1.6.2' -s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' -s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' -s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' -s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.10' + s.add_development_dependency 'rspec', '~> 3.2', '>= 3.2.0' + s.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.3' + s.add_development_dependency 'webmock', '~> 1.6', '>= 1.6.2' + s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' + s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' + s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' + s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.10' -s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? } -s.test_files = `find spec/*`.split("\n") -s.executables = [] -s.require_paths = ["lib"] + s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? } + s.test_files = `find spec/*`.split("\n") + s.executables = [] + s.require_paths = ["lib"] end diff --git a/modules/swagger-codegen/src/main/resources/ruby/swagger_client.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger_client.mustache index 5268a42657f5..df675ddf26ea 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/swagger_client.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/swagger_client.mustache @@ -9,17 +9,17 @@ require '{{gemName}}/swagger/version' # Models require '{{modelPackage}}/base_object' {{#models}} - require '{{importPath}}' +require '{{importPath}}' {{/models}} # APIs {{#apiInfo}} - {{#apis}} - require '{{importPath}}' - {{/apis}} +{{#apis}} +require '{{importPath}}' +{{/apis}} {{/apiInfo}} module {{moduleName}} -# Initialize the default configuration -Swagger.configuration ||= Swagger::Configuration.new + # Initialize the default configuration + Swagger.configuration ||= Swagger::Configuration.new end From 2e12ac59573a5386e1bd093fac2663315a933173 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:34:38 +0800 Subject: [PATCH 15/41] rollback perl template --- .../main/resources/perl/ApiClient.mustache | 304 +++++++++--------- .../main/resources/perl/BaseObject.mustache | 78 ++--- .../src/main/resources/perl/api.mustache | 146 ++++----- .../src/main/resources/perl/object.mustache | 88 ++--- 4 files changed, 308 insertions(+), 308 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/perl/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/perl/ApiClient.mustache index f216d6bc3bc6..2bcdd6da6906 100644 --- a/modules/swagger-codegen/src/main/resources/perl/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/ApiClient.mustache @@ -22,14 +22,14 @@ use WWW::{{invokerPackage}}::Configuration; sub new { -my $class = shift; -my (%args) = ( -'ua' => LWP::UserAgent->new, -'base_url' => '{{basePath}}', -@_ -); + my $class = shift; + my (%args) = ( + 'ua' => LWP::UserAgent->new, + 'base_url' => '{{basePath}}', + @_ + ); -return bless \%args, $class; + return bless \%args, $class; } # Set the user agent of the API client @@ -37,20 +37,20 @@ return bless \%args, $class; # @param string $user_agent The user agent of the API client # sub set_user_agent { -my ($self, $user_agent) = @_; -$self->{http_user_agent}= $user_agent; + my ($self, $user_agent) = @_; + $self->{http_user_agent}= $user_agent; } # Set timeout # # @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] -# +# sub set_timeout { -my ($self, $seconds) = @_; -if (!looks_like_number($seconds)) { -croak('Timeout variable must be numeric.'); -} -$self->{http_timeout} = $seconds; + my ($self, $seconds) = @_; + if (!looks_like_number($seconds)) { + croak('Timeout variable must be numeric.'); + } + $self->{http_timeout} = $seconds; } # make the HTTP request @@ -61,70 +61,70 @@ $self->{http_timeout} = $seconds; # @param array $headerParams parameters to be place in request header # @return mixed sub call_api { -my $self = shift; -my ($resource_path, $method, $query_params, $post_params, $header_params, $body_data, $auth_settings) = @_; + my $self = shift; + my ($resource_path, $method, $query_params, $post_params, $header_params, $body_data, $auth_settings) = @_; -# update parameters based on authentication settings -$self->update_params_for_auth($header_params, $query_params, $auth_settings); + # update parameters based on authentication settings + $self->update_params_for_auth($header_params, $query_params, $auth_settings); -my $_url = $self->{base_url} . $resource_path; + my $_url = $self->{base_url} . $resource_path; -# build query -if (%$query_params) { -$_url = ($_url . '?' . eval { URI::Query->new($query_params)->stringify }); -} + # build query + if (%$query_params) { + $_url = ($_url . '?' . eval { URI::Query->new($query_params)->stringify }); + } -# body data -$body_data = to_json($body_data->to_hash) if defined $body_data && $body_data->can('to_hash'); # model to json string -my $_body_data = %$post_params ? $post_params : $body_data; + # body data + $body_data = to_json($body_data->to_hash) if defined $body_data && $body_data->can('to_hash'); # model to json string + my $_body_data = %$post_params ? $post_params : $body_data; -# Make the HTTP request -my $_request; -if ($method eq 'POST') { -# multipart -$header_params->{'Content-Type'} = lc $header_params->{'Content-Type'} eq 'multipart/form' ? -'form-data' : $header_params->{'Content-Type'}; + # Make the HTTP request + my $_request; + if ($method eq 'POST') { + # multipart + $header_params->{'Content-Type'} = lc $header_params->{'Content-Type'} eq 'multipart/form' ? + 'form-data' : $header_params->{'Content-Type'}; + + $_request = POST($_url, %$header_params, Content => $_body_data); -$_request = POST($_url, %$header_params, Content => $_body_data); + } + elsif ($method eq 'PUT') { + # multipart + $header_params->{'Content-Type'} = lc $header_params->{'Content-Type'} eq 'multipart/form' ? + 'form-data' : $header_params->{'Content-Type'}; -} -elsif ($method eq 'PUT') { -# multipart -$header_params->{'Content-Type'} = lc $header_params->{'Content-Type'} eq 'multipart/form' ? -'form-data' : $header_params->{'Content-Type'}; + $_request = PUT($_url, %$header_params, Content => $_body_data); -$_request = PUT($_url, %$header_params, Content => $_body_data); + } + elsif ($method eq 'GET') { + my $headers = HTTP::Headers->new(%$header_params); + $_request = GET($_url, %$header_params); + } + elsif ($method eq 'HEAD') { + my $headers = HTTP::Headers->new(%$header_params); + $_request = HEAD($_url,%$header_params); + } + elsif ($method eq 'DELETE') { #TODO support form data + my $headers = HTTP::Headers->new(%$header_params); + $_request = DELETE($_url, %$headers); + } + elsif ($method eq 'PATCH') { #TODO + } + else { + } + + $self->{ua}->timeout($self->{http_timeout} || $WWW::{{invokerPackage}}::Configuration::http_timeout); + $self->{ua}->agent($self->{http_user_agent} || $WWW::{{invokerPackage}}::Configuration::http_user_agent); + + my $_response = $self->{ua}->request($_request); -} -elsif ($method eq 'GET') { -my $headers = HTTP::Headers->new(%$header_params); -$_request = GET($_url, %$header_params); -} -elsif ($method eq 'HEAD') { -my $headers = HTTP::Headers->new(%$header_params); -$_request = HEAD($_url,%$header_params); -} -elsif ($method eq 'DELETE') { #TODO support form data -my $headers = HTTP::Headers->new(%$header_params); -$_request = DELETE($_url, %$headers); -} -elsif ($method eq 'PATCH') { #TODO -} -else { -} - -$self->{ua}->timeout($self->{http_timeout} || $WWW::{{invokerPackage}}::Configuration::http_timeout); -$self->{ua}->agent($self->{http_user_agent} || $WWW::{{invokerPackage}}::Configuration::http_user_agent); - -my $_response = $self->{ua}->request($_request); - -unless ($_response->is_success) { -croak("API Exception(".$_response->code."): ".$_response->message); -} - -return $_response->content; + unless ($_response->is_success) { + croak("API Exception(".$_response->code."): ".$_response->message); + } + + return $_response->content; } @@ -133,8 +133,8 @@ return $_response->content; # @param string $value a string which will be part of the path # @return string the serialized object sub to_path_value { -my ($self, $value) = @_; -return uri_escape($self->to_string($value)); + my ($self, $value) = @_; + return uri_escape($self->to_string($value)); } @@ -145,12 +145,12 @@ return uri_escape($self->to_string($value)); # @param object $object an object to be serialized to a string # @return string the serialized object sub to_query_value { -my ($self, $object) = @_; -if (is_array($object)) { -return implode(',', $object); -} else { -return $self->to_string($object); -} + my ($self, $object) = @_; + if (is_array($object)) { + return implode(',', $object); + } else { + return $self->to_string($object); + } } @@ -160,8 +160,8 @@ return $self->to_string($object); # @param string $value a string which will be part of the header # @return string the header string sub to_header_value { -my ($self, $value) = @_; -return $self->to_string($value); + my ($self, $value) = @_; + return $self->to_string($value); } # Take value and turn it into a string suitable for inclusion in @@ -170,8 +170,8 @@ return $self->to_string($value); # @param string $value the value of the form parameter # @return string the form string sub to_form_value { -my ($self, $value) = @_; -return $self->to_string($value); + my ($self, $value) = @_; + return $self->to_string($value); } # Take value and turn it into a string suitable for inclusion in @@ -180,50 +180,50 @@ return $self->to_string($value); # @param string $value the value of the parameter # @return string the header string sub to_string { -my ($self, $value) = @_; -if (ref($value) eq "DateTime") { # datetime in ISO8601 format -return $value->datetime(); -} -else { -return $value; -} + my ($self, $value) = @_; + if (ref($value) eq "DateTime") { # datetime in ISO8601 format + return $value->datetime(); + } + else { + return $value; + } } # Deserialize a JSON string into an object -# +# # @param string $class class name is passed as a string # @param string $data data of the body # @return object an instance of $class sub deserialize { -my ($self, $class, $data) = @_; -$log->debugf("deserializing %s for %s", $data, $class); -my $_result; + my ($self, $class, $data) = @_; + $log->debugf("deserializing %s for %s", $data, $class); + my $_result; -if (not defined $data) { -return undef; -} elsif ( lc(substr($class, 0, 4)) eq 'map[') { #hash -$_result = \(json_decode $data); -} elsif ( lc(substr($class, 0, 6)) eq 'array[' ) { # array of data -return $data if $data eq '[]'; # return if empty array + if (not defined $data) { + return undef; + } elsif ( lc(substr($class, 0, 4)) eq 'map[') { #hash + $_result = \(json_decode $data); + } elsif ( lc(substr($class, 0, 6)) eq 'array[' ) { # array of data + return $data if $data eq '[]'; # return if empty array -my $_sub_class = substr($class, 6, -1); -my @_json_data = json_decode $data; -my @_values = (); -foreach my $_value (@_json_data) { -push @_values, $self->deserialize($_sub_class, $_value); -} -$_result = \@_values; -} elsif ($class eq 'DateTime') { -$_result = DateTime->from_epoch(epoch => str2time($data)); -} elsif (grep /^$class$/, ('string', 'int', 'float', 'bool', 'object')) { #TODO revise the primitive type -$_result= $data; -} else { # model -my $_instance = use_module("WWW::{{invokerPackage}}::Object::$class")->new; -$_result = $_instance->from_hash(decode_json $data); -} + my $_sub_class = substr($class, 6, -1); + my @_json_data = json_decode $data; + my @_values = (); + foreach my $_value (@_json_data) { + push @_values, $self->deserialize($_sub_class, $_value); + } + $_result = \@_values; + } elsif ($class eq 'DateTime') { + $_result = DateTime->from_epoch(epoch => str2time($data)); + } elsif (grep /^$class$/, ('string', 'int', 'float', 'bool', 'object')) { #TODO revise the primitive type + $_result= $data; + } else { # model + my $_instance = use_module("WWW::{{invokerPackage}}::Object::$class")->new; + $_result = $_instance->from_hash(decode_json $data); + } -return $_result; + return $_result; } @@ -232,15 +232,15 @@ return $_result; # @return String Accept (e.g. application/json) sub select_header_accept { -my ($self, @header) = @_; + my ($self, @header) = @_; -if (@header == 0 || (@header == 1 && $header[0] eq '')) { -return undef; -} elsif (grep(/^application\/json$/i, @header)) { -return 'application/json'; -} else { -return join(',', @header); -} + if (@header == 0 || (@header == 1 && $header[0] eq '')) { + return undef; + } elsif (grep(/^application\/json$/i, @header)) { + return 'application/json'; + } else { + return join(',', @header); + } } @@ -249,15 +249,15 @@ return join(',', @header); # @return String Content-Type (e.g. application/json) sub select_header_content_type { -my ($self, @header) = @_; + my ($self, @header) = @_; -if (@header == 0 || (@header == 1 && $header[0] eq '')) { -return 'application/json'; # default to application/json -} elsif (grep(/^application\/json$/i, @header)) { -return 'application/json'; -} else { -return join(',', @header); -} + if (@header == 0 || (@header == 1 && $header[0] eq '')) { + return 'application/json'; # default to application/json + } elsif (grep(/^application\/json$/i, @header)) { + return 'application/json'; + } else { + return join(',', @header); + } } @@ -266,38 +266,38 @@ return join(',', @header); # @return string API key with the prefix sub get_api_key_with_prefix { -my ($self, $api_key) = @_; -if ($WWW::{{invokerPackage}}::Configuration::api_key_prefix->{$api_key}) { -return $WWW::{{invokerPackage}}::Configuration::api_key_prefix->{$api_key}." ".$WWW::{{invokerPackage}}::Configuration::api_key->{$api_key}; -} else { -return $WWW::{{invokerPackage}}::Configuration::api_key->{$api_key}; -} + my ($self, $api_key) = @_; + if ($WWW::{{invokerPackage}}::Configuration::api_key_prefix->{$api_key}) { + return $WWW::{{invokerPackage}}::Configuration::api_key_prefix->{$api_key}." ".$WWW::{{invokerPackage}}::Configuration::api_key->{$api_key}; + } else { + return $WWW::{{invokerPackage}}::Configuration::api_key->{$api_key}; + } } # update hearder and query param based on authentication setting -# +# # @param array $headerParams header parameters (by ref) # @param array $queryParams query parameters (by ref) # @param array $authSettings array of authentication scheme (e.g ['api_key']) sub update_params_for_auth { -my ($self, $header_params, $query_params, $auth_settings) = @_; + my ($self, $header_params, $query_params, $auth_settings) = @_; -return if (!defined($auth_settings) || scalar(@$auth_settings) == 0); + return if (!defined($auth_settings) || scalar(@$auth_settings) == 0); -# one endpoint can have more than 1 auth settings -foreach my $auth (@$auth_settings) { -# determine which one to use -if (!defined($auth)) { -} -{{#authMethods}}elsif ($auth eq '{{name}}') { -{{#isApiKey}}{{#isKeyInHeader}}$header_params->{'{{keyParamName}}'} = $self->get_api_key_with_prefix('{{keyParamName}}');{{/isKeyInHeader}}{{#isKeyInQuery}}$query_params->{'{{keyParamName}}'} = $self->get_api_key_with_prefix('{{keyParamName}}');{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}$header_params->{'Authorization'} = 'Basic '.encode_base64($WWW::{{invokerPackage}}::Configuration::username.":".$WWW::{{invokerPackage}}::Configuration::password);{{/isBasic}} -{{#isOAuth}}# TODO support oauth{{/isOAuth}} -} -{{/authMethods}} -else { -# TODO show warning about security definition not found -} -} + # one endpoint can have more than 1 auth settings + foreach my $auth (@$auth_settings) { + # determine which one to use + if (!defined($auth)) { + } + {{#authMethods}}elsif ($auth eq '{{name}}') { + {{#isApiKey}}{{#isKeyInHeader}}$header_params->{'{{keyParamName}}'} = $self->get_api_key_with_prefix('{{keyParamName}}');{{/isKeyInHeader}}{{#isKeyInQuery}}$query_params->{'{{keyParamName}}'} = $self->get_api_key_with_prefix('{{keyParamName}}');{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}$header_params->{'Authorization'} = 'Basic '.encode_base64($WWW::{{invokerPackage}}::Configuration::username.":".$WWW::{{invokerPackage}}::Configuration::password);{{/isBasic}} + {{#isOAuth}}# TODO support oauth{{/isOAuth}} + } + {{/authMethods}} + else { + # TODO show warning about security definition not found + } + } } diff --git a/modules/swagger-codegen/src/main/resources/perl/BaseObject.mustache b/modules/swagger-codegen/src/main/resources/perl/BaseObject.mustache index 47c8052d0334..b4a7885a7987 100644 --- a/modules/swagger-codegen/src/main/resources/perl/BaseObject.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/BaseObject.mustache @@ -21,56 +21,56 @@ use DateTime; # return json string sub to_hash { -return decode_json(JSON->new->convert_blessed->encode( shift )); + return decode_json(JSON->new->convert_blessed->encode( shift )); } # used by JSON for serialization -sub TO_JSON { -my $self = shift; -my $_data = {}; -foreach my $_key (keys $self->get_attribute_map) { -if (defined $self->{$_key}) { -$_data->{$self->get_attribute_map->{$_key}} = $self->{$_key}; -} -} -return $_data; +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys $self->get_attribute_map) { + if (defined $self->{$_key}) { + $_data->{$self->get_attribute_map->{$_key}} = $self->{$_key}; + } + } + return $_data; } # from json string sub from_hash { -my ($self, $hash) = @_; -# loop through attributes and use swagger_types to deserialize the data -while ( my ($_key, $_type) = each $self->get_swagger_types ) { -if ($_type =~ /^array\[/i) { # array -my $_subclass = substr($_type, 6, -1); -my @_array = (); -foreach my $_element (@{$hash->{$self->get_attribute_map->{$_key}}}) { -push @_array, $self->_deserialize($_subclass, $_element); -} -$self->{$_key} = \@_array; -} elsif (defined $hash->{$_key}) { #hash(model), primitive, datetime -$self->{$_key} = $self->_deserialize($_type, $hash->{$_key}); -} else { -$log->debugf("warning: %s not defined\n", $_key); -} -} + my ($self, $hash) = @_; + # loop through attributes and use swagger_types to deserialize the data + while ( my ($_key, $_type) = each $self->get_swagger_types ) { + if ($_type =~ /^array\[/i) { # array + my $_subclass = substr($_type, 6, -1); + my @_array = (); + foreach my $_element (@{$hash->{$self->get_attribute_map->{$_key}}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif (defined $hash->{$_key}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_key}); + } else { + $log->debugf("warning: %s not defined\n", $_key); + } + } -return $self; + return $self; } - + # deserialize non-array data sub _deserialize { -my ($self, $type, $data) = @_; -$log->debugf("deserializing %s with %s",Dumper($data), $type); - -if ($type eq 'DateTime') { -return DateTime->from_epoch(epoch => str2time($data)); -} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { -return $data; -} else { # hash(model) -my $_instance = eval "WWW::{{invokerPackage}}::Object::$type->new()"; -return $_instance->from_hash($data); -} + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if ($type eq 'DateTime') { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { + return $data; + } else { # hash(model) + my $_instance = eval "WWW::{{invokerPackage}}::Object::$type->new()"; + return $_instance->from_hash($data); + } } 1; diff --git a/modules/swagger-codegen/src/main/resources/perl/api.mustache b/modules/swagger-codegen/src/main/resources/perl/api.mustache index c92aea5d4a60..c67139ee33db 100644 --- a/modules/swagger-codegen/src/main/resources/perl/api.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/api.mustache @@ -14,7 +14,7 @@ # limitations under the License. # # -# NOTE: This class is auto generated by the swagger code generator program. +# NOTE: This class is auto generated by the swagger code generator program. # Do not edit the class manually. # package WWW::{{invokerPackage}}::{{classname}}; @@ -22,7 +22,7 @@ package WWW::{{invokerPackage}}::{{classname}}; require 5.6.0; use strict; use warnings; -use utf8; +use utf8; use Exporter; use Carp qw( croak ); use Log::Any qw($log); @@ -31,111 +31,111 @@ use WWW::{{invokerPackage}}::ApiClient; use WWW::{{invokerPackage}}::Configuration; {{#operations}} - our @EXPORT_OK = qw( - {{#operation}}{{{nickname}}} - {{/operation}} - ); +our @EXPORT_OK = qw( + {{#operation}}{{{nickname}}} + {{/operation}} +); - sub new { +sub new { my $class = shift; my $default_api_client = $WWW::{{invokerPackage}}::Configuration::api_client ? $WWW::{{invokerPackage}}::Configuration::api_client : WWW::{{invokerPackage}}::ApiClient->new; my (%self) = ( - 'api_client' => $default_api_client, - @_ + 'api_client' => $default_api_client, + @_ ); #my $self = { # #api_client => $options->{api_client} # api_client => $default_api_client - #}; + #}; bless \%self, $class; - } +} {{#operation}} - # - # {{{nickname}}} - # - # {{{summary}}} - # - {{#allParams}} # @param {{dataType}} ${{paramName}} {{description}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}} - {{/allParams}} # @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} - # - sub {{nickname}} { - my ($self, %args) = @_; + # + # {{{nickname}}} + # + # {{{summary}}} + # + {{#allParams}} # @param {{dataType}} ${{paramName}} {{description}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}} + {{/allParams}} # @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + # + sub {{nickname}} { + my ($self, %args) = @_; - {{#allParams}}{{#required}} - # verify the required parameter '{{paramName}}' is set - unless (exists $args{'{{paramName}}'}) { - croak("Missing the required parameter '{{paramName}}' when calling {{nickname}}"); - } - {{/required}}{{/allParams}} + {{#allParams}}{{#required}} + # verify the required parameter '{{paramName}}' is set + unless (exists $args{'{{paramName}}'}) { + croak("Missing the required parameter '{{paramName}}' when calling {{nickname}}"); + } + {{/required}}{{/allParams}} - # parse inputs - my $_resource_path = '{{path}}'; - $_resource_path =~ s/{format}/json/; # default format to json + # parse inputs + my $_resource_path = '{{path}}'; + $_resource_path =~ s/{format}/json/; # default format to json - my $_method = '{{httpMethod}}'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; + my $_method = '{{httpMethod}}'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}); - if ($_header_accept) { + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}); + if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type({{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}); + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type({{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}); - {{#queryParams}}# query params - if ( exists $args{'{{paramName}}'}) { + {{#queryParams}}# query params + if ( exists $args{'{{paramName}}'}) { $query_params->{'{{baseName}}'} = $self->{api_client}->to_query_value($args{'{{paramName}}'}); - }{{/queryParams}} - {{#headerParams}}# header params - if ( exists $args{'{{paramName}}'}) { + }{{/queryParams}} + {{#headerParams}}# header params + if ( exists $args{'{{paramName}}'}) { $header_params->{'{{baseName}}'} = $self->{api_client}->to_header_value($args{'{{paramName}}'}); - }{{/headerParams}} - {{#pathParams}}# path params - if ( exists $args{'{{paramName}}'}) { + }{{/headerParams}} + {{#pathParams}}# path params + if ( exists $args{'{{paramName}}'}) { my $_base_variable = "{" . "{{baseName}}" . "}"; my $_base_value = $self->{api_client}->to_path_value($args{'{{paramName}}'}); $_resource_path =~ s/$_base_variable/$_base_value/g; - }{{/pathParams}} - {{#formParams}}# form params - if ( exists $args{'{{paramName}}'} ) { + }{{/pathParams}} + {{#formParams}}# form params + if ( exists $args{'{{paramName}}'} ) { {{#isFile}}$form_params->{'{{baseName}}'} = [] unless defined $form_params->{'{{baseName}}'}; push $form_params->{'{{baseName}}'}, $args{'{{paramName}}'}; {{/isFile}} {{^isFile}}$form_params->{'{{baseName}}'} = $self->{api_client}->to_form_value($args{'{{paramName}}'}); {{/isFile}} - }{{/formParams}} - my $_body_data; - {{#bodyParams}}# body params - if ( exists $args{'{{paramName}}'}) { + }{{/formParams}} + my $_body_data; + {{#bodyParams}}# body params + if ( exists $args{'{{paramName}}'}) { $_body_data = $args{'{{paramName}}'}; - }{{/bodyParams}} + }{{/bodyParams}} - # authentication setting, if any - my $auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}]; + # authentication setting, if any + my $auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}]; - # make the API Call - {{#returnType}}my $response = $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - if (!$response) { + # make the API Call + {{#returnType}}my $response = $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + if (!$response) { return; - } - my $_response_object = $self->{api_client}->deserialize('{{returnType}}', $response); - return $_response_object;{{/returnType}} - {{^returnType}}$self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - return; - {{/returnType}} - } - {{/operation}} - {{newline}} + } + my $_response_object = $self->{api_client}->deserialize('{{returnType}}', $response); + return $_response_object;{{/returnType}} + {{^returnType}}$self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; + {{/returnType}} + } + {{/operation}} +{{newline}} {{/operations}} 1; diff --git a/modules/swagger-codegen/src/main/resources/perl/object.mustache b/modules/swagger-codegen/src/main/resources/perl/object.mustache index 2e76edc87b4a..c527957a9b10 100644 --- a/modules/swagger-codegen/src/main/resources/perl/object.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/object.mustache @@ -1,58 +1,58 @@ {{#models}} - {{#model}} - package WWW::{{invokerPackage}}::Object::{{classname}}; +{{#model}} +package WWW::{{invokerPackage}}::Object::{{classname}}; - require 5.6.0; - use strict; - use warnings; - use utf8; - use JSON qw(decode_json); - use Data::Dumper; - use Module::Runtime qw(use_module); - use Log::Any qw($log); - use Date::Parse; - use DateTime; +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; - use base "WWW::{{invokerPackage}}::Object::BaseObject"; +use base "WWW::{{invokerPackage}}::Object::BaseObject"; - # - #{{description}} - # - #NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. - # +# +#{{description}} +# +#NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. +# - my $swagger_types = { - {{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} - }; +my $swagger_types = { + {{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} +}; - my $attribute_map = { - {{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} - }; +my $attribute_map = { + {{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} +}; - # new object - sub new { - my ($class, %args) = @_; - my $self = { +# new object +sub new { + my ($class, %args) = @_; + my $self = { {{#vars}}#{{#description}}{{{description}}}{{/description}} - '{{name}}' => $args{'{{baseName}}'}{{#hasMore}}, + '{{name}}' => $args{'{{baseName}}'}{{#hasMore}}, {{/hasMore}}{{/vars}} - }; + }; - return bless $self, $class; - } + return bless $self, $class; +} - # get swagger type of the attribute - sub get_swagger_types { - return $swagger_types; - } +# get swagger type of the attribute +sub get_swagger_types { + return $swagger_types; +} - # get attribute mappping - sub get_attribute_map { - return $attribute_map; - } +# get attribute mappping +sub get_attribute_map { + return $attribute_map; +} - 1; - {{/model}} +1; +{{/model}} {{/models}} From 50ae9659ad189d3577378c3c94f3b70412dc5612 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:37:30 +0800 Subject: [PATCH 16/41] rollback php template --- .../src/main/resources/php/APIClient.mustache | 718 +++++++++--------- .../main/resources/php/ApiException.mustache | 36 +- .../src/main/resources/php/api.mustache | 180 ++--- .../src/main/resources/php/composer.mustache | 60 +- .../src/main/resources/php/model.mustache | 48 +- 5 files changed, 521 insertions(+), 521 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/APIClient.mustache b/modules/swagger-codegen/src/main/resources/php/APIClient.mustache index f9a80ca07cad..6356143f9141 100644 --- a/modules/swagger-codegen/src/main/resources/php/APIClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/APIClient.mustache @@ -43,407 +43,407 @@ class ApiClient { function __construct($host = null) { if ($host === null) { $this->host = '{{basePath}}'; -} else { -$this->host = $host; -} -} + } else { + $this->host = $host; + } + } -/** -* add default header -* -* @param string $header_name header name (e.g. Token) -* @param string $header_value header value (e.g. 1z8wp3) -*/ -public function addDefaultHeader($header_name, $header_value) { -if (!is_string($header_name)) -throw new \InvalidArgumentException('Header name must be a string.'); + /** + * add default header + * + * @param string $header_name header name (e.g. Token) + * @param string $header_value header value (e.g. 1z8wp3) + */ + public function addDefaultHeader($header_name, $header_value) { + if (!is_string($header_name)) + throw new \InvalidArgumentException('Header name must be a string.'); -self::$default_header[$header_name] = $header_value; -} + self::$default_header[$header_name] = $header_value; + } -/** -* get the default header -* -* @return array default header -*/ -public function getDefaultHeader() { -return self::$default_header; -} + /** + * get the default header + * + * @return array default header + */ + public function getDefaultHeader() { + return self::$default_header; + } -/** -* delete the default header based on header name -* -* @param string $header_name header name (e.g. Token) -*/ -public function deleteDefaultHeader($header_name) { -unset(self::$default_header[$header_name]); -} + /** + * delete the default header based on header name + * + * @param string $header_name header name (e.g. Token) + */ + public function deleteDefaultHeader($header_name) { + unset(self::$default_header[$header_name]); + } -/** -* set the user agent of the api client -* -* @param string $user_agent the user agent of the api client -*/ -public function setUserAgent($user_agent) { -if (!is_string($user_agent)) -throw new \InvalidArgumentException('User-agent must be a string.'); + /** + * set the user agent of the api client + * + * @param string $user_agent the user agent of the api client + */ + public function setUserAgent($user_agent) { + if (!is_string($user_agent)) + throw new \InvalidArgumentException('User-agent must be a string.'); -$this->user_agent= $user_agent; -} + $this->user_agent= $user_agent; + } -/** -* get the user agent of the api client -* -* @return string user agent -*/ -public function getUserAgent($user_agent) { -return $this->user_agent; -} + /** + * get the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent($user_agent) { + return $this->user_agent; + } -/** -* set the HTTP timeout value -* -* @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] -*/ -public function setTimeout($seconds) { -if (!is_numeric($seconds) || $seconds < 0) -throw new \InvalidArgumentException('Timeout value must be numeric and a non-negative number.'); + /** + * set the HTTP timeout value + * + * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] + */ + public function setTimeout($seconds) { + if (!is_numeric($seconds) || $seconds < 0) + throw new \InvalidArgumentException('Timeout value must be numeric and a non-negative number.'); -$this->curl_timeout = $seconds; -} + $this->curl_timeout = $seconds; + } -/** -* get the HTTP timeout value -* -* @return string HTTP timeout value -*/ -public function getTimeout() { -return $this->curl_timeout; -} + /** + * get the HTTP timeout value + * + * @return string HTTP timeout value + */ + public function getTimeout() { + return $this->curl_timeout; + } -/** -* Get API key (with prefix if set) -* @param string key name -* @return string API key with the prefix -*/ -public function getApiKeyWithPrefix($apiKey) { -if (isset(Configuration::$apiKeyPrefix[$apiKey])) { -return Configuration::$apiKeyPrefix[$apiKey]." ".Configuration::$apiKey[$apiKey]; -} else if (isset(Configuration::$apiKey[$apiKey])) { -return Configuration::$apiKey[$apiKey]; -} else { -return; -} -} + /** + * Get API key (with prefix if set) + * @param string key name + * @return string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKey) { + if (isset(Configuration::$apiKeyPrefix[$apiKey])) { + return Configuration::$apiKeyPrefix[$apiKey]." ".Configuration::$apiKey[$apiKey]; + } else if (isset(Configuration::$apiKey[$apiKey])) { + return Configuration::$apiKey[$apiKey]; + } else { + return; + } + } -/** -* update hearder and query param based on authentication setting -* -* @param array $headerParams header parameters (by ref) -* @param array $queryParams query parameters (by ref) -* @param array $authSettings array of authentication scheme (e.g ['api_key']) -*/ -public function updateParamsForAuth(&$headerParams, &$queryParams, $authSettings) -{ -if (count($authSettings) == 0) -return; + /** + * update hearder and query param based on authentication setting + * + * @param array $headerParams header parameters (by ref) + * @param array $queryParams query parameters (by ref) + * @param array $authSettings array of authentication scheme (e.g ['api_key']) + */ + public function updateParamsForAuth(&$headerParams, &$queryParams, $authSettings) + { + if (count($authSettings) == 0) + return; -// one endpoint can have more than 1 auth settings -foreach($authSettings as $auth) { -// determine which one to use -switch($auth) { -{{#authMethods}} - case '{{name}}': - {{#isApiKey}}{{#isKeyInHeader}}$headerParams['{{keyParamName}}'] = $this->getApiKeyWithPrefix('{{keyParamName}}');{{/isKeyInHeader}}{{#isKeyInQuery}}$queryParams['{{keyParamName}}'] = $this->getApiKeyWithPrefix('{{keyParamName}}');{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}$headerParams['Authorization'] = 'Basic '.base64_encode(Configuration::$username.":".Configuration::$password);{{/isBasic}} - {{#isOAuth}}//TODO support oauth{{/isOAuth}} - break; -{{/authMethods}} -default: -//TODO show warning about security definition not found -} -} -} + // one endpoint can have more than 1 auth settings + foreach($authSettings as $auth) { + // determine which one to use + switch($auth) { + {{#authMethods}} + case '{{name}}': + {{#isApiKey}}{{#isKeyInHeader}}$headerParams['{{keyParamName}}'] = $this->getApiKeyWithPrefix('{{keyParamName}}');{{/isKeyInHeader}}{{#isKeyInQuery}}$queryParams['{{keyParamName}}'] = $this->getApiKeyWithPrefix('{{keyParamName}}');{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}$headerParams['Authorization'] = 'Basic '.base64_encode(Configuration::$username.":".Configuration::$password);{{/isBasic}} + {{#isOAuth}}//TODO support oauth{{/isOAuth}} + break; + {{/authMethods}} + default: + //TODO show warning about security definition not found + } + } + } + + /** + * @param string $resourcePath path to method endpoint + * @param string $method method to call + * @param array $queryParams parameters to be place in query URL + * @param array $postData parameters to be placed in POST body + * @param array $headerParams parameters to be place in request header + * @return mixed + */ + public function callApi($resourcePath, $method, $queryParams, $postData, + $headerParams, $authSettings) { -/** -* @param string $resourcePath path to method endpoint -* @param string $method method to call -* @param array $queryParams parameters to be place in query URL -* @param array $postData parameters to be placed in POST body -* @param array $headerParams parameters to be place in request header -* @return mixed -*/ -public function callApi($resourcePath, $method, $queryParams, $postData, -$headerParams, $authSettings) { + $headers = array(); -$headers = array(); + # determine authentication setting + $this->updateParamsForAuth($headerParams, $queryParams, $authSettings); -# determine authentication setting -$this->updateParamsForAuth($headerParams, $queryParams, $authSettings); + # construct the http header + $headerParams = array_merge((array)self::$default_header, (array)$headerParams); -# construct the http header -$headerParams = array_merge((array)self::$default_header, (array)$headerParams); + foreach ($headerParams as $key => $val) { + $headers[] = "$key: $val"; + } -foreach ($headerParams as $key => $val) { -$headers[] = "$key: $val"; -} + // form data + if ($postData and in_array('Content-Type: application/x-www-form-urlencoded', $headers)) { + $postData = http_build_query($postData); + } + else if ((is_object($postData) or is_array($postData)) and !in_array('Content-Type: multipart/form-data', $headers)) { // json model + $postData = json_encode($this->sanitizeForSerialization($postData)); + } -// form data -if ($postData and in_array('Content-Type: application/x-www-form-urlencoded', $headers)) { -$postData = http_build_query($postData); -} -else if ((is_object($postData) or is_array($postData)) and !in_array('Content-Type: multipart/form-data', $headers)) { // json model -$postData = json_encode($this->sanitizeForSerialization($postData)); -} + $url = $this->host . $resourcePath; -$url = $this->host . $resourcePath; + $curl = curl_init(); + // set timeout, if needed + if ($this->curl_timeout != 0) { + curl_setopt($curl, CURLOPT_TIMEOUT, $this->curl_timeout); + } + // return the result on success, rather than just TRUE + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); -$curl = curl_init(); -// set timeout, if needed -if ($this->curl_timeout != 0) { -curl_setopt($curl, CURLOPT_TIMEOUT, $this->curl_timeout); -} -// return the result on success, rather than just TRUE -curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); -curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + if (! empty($queryParams)) { + $url = ($url . '?' . http_build_query($queryParams)); + } -if (! empty($queryParams)) { -$url = ($url . '?' . http_build_query($queryParams)); -} + if ($method == self::$POST) { + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } else if ($method == self::$PATCH) { + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH"); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } else if ($method == self::$PUT) { + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } else if ($method == self::$DELETE) { + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE"); + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } else if ($method != self::$GET) { + throw new ApiException('Method ' . $method . ' is not recognized.'); + } + curl_setopt($curl, CURLOPT_URL, $url); -if ($method == self::$POST) { -curl_setopt($curl, CURLOPT_POST, true); -curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); -} else if ($method == self::$PATCH) { -curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH"); -curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); -} else if ($method == self::$PUT) { -curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); -curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); -} else if ($method == self::$DELETE) { -curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE"); -curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); -} else if ($method != self::$GET) { -throw new ApiException('Method ' . $method . ' is not recognized.'); -} -curl_setopt($curl, CURLOPT_URL, $url); + // Set user agent + curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent); -// Set user agent -curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent); + // debugging for curl + if (Configuration::$debug) { + error_log("[DEBUG] HTTP Request body ~BEGIN~\n".print_r($postData, true)."\n~END~\n", 3, Configuration::$debug_file); -// debugging for curl -if (Configuration::$debug) { -error_log("[DEBUG] HTTP Request body ~BEGIN~\n".print_r($postData, true)."\n~END~\n", 3, Configuration::$debug_file); + curl_setopt($curl, CURLOPT_VERBOSE, 1); + curl_setopt($curl, CURLOPT_STDERR, fopen(Configuration::$debug_file, 'a')); + } else { + curl_setopt($curl, CURLOPT_VERBOSE, 0); + } -curl_setopt($curl, CURLOPT_VERBOSE, 1); -curl_setopt($curl, CURLOPT_STDERR, fopen(Configuration::$debug_file, 'a')); -} else { -curl_setopt($curl, CURLOPT_VERBOSE, 0); -} + // obtain the HTTP response headers + curl_setopt($curl, CURLOPT_HEADER, 1); -// obtain the HTTP response headers -curl_setopt($curl, CURLOPT_HEADER, 1); + // Make the request + $response = curl_exec($curl); + $http_header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); + $http_header = substr($response, 0, $http_header_size); + $http_body = substr($response, $http_header_size); + $response_info = curl_getinfo($curl); -// Make the request -$response = curl_exec($curl); -$http_header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); -$http_header = substr($response, 0, $http_header_size); -$http_body = substr($response, $http_header_size); -$response_info = curl_getinfo($curl); + // debug HTTP response body + if (Configuration::$debug) { + error_log("[DEBUG] HTTP Response body ~BEGIN~\n".print_r($http_body, true)."\n~END~\n", 3, Configuration::$debug_file); + } -// debug HTTP response body -if (Configuration::$debug) { -error_log("[DEBUG] HTTP Response body ~BEGIN~\n".print_r($http_body, true)."\n~END~\n", 3, Configuration::$debug_file); -} + // Handle the response + if ($response_info['http_code'] == 0) { + throw new ApiException("API call to $url timed out: ".serialize($response_info), 0, null, null); + } else if ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299 ) { + $data = json_decode($http_body); + if (json_last_error() > 0) { // if response is a string + $data = $http_body; + } + } else { + throw new ApiException("[".$response_info['http_code']."] Error connecting to the API ($url)", + $response_info['http_code'], $http_header, $http_body); + } + return $data; + } -// Handle the response -if ($response_info['http_code'] == 0) { -throw new ApiException("API call to $url timed out: ".serialize($response_info), 0, null, null); -} else if ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299 ) { -$data = json_decode($http_body); -if (json_last_error() > 0) { // if response is a string -$data = $http_body; -} -} else { -throw new ApiException("[".$response_info['http_code']."] Error connecting to the API ($url)", -$response_info['http_code'], $http_header, $http_body); -} -return $data; -} + /** + * Build a JSON POST object + */ + protected function sanitizeForSerialization($data) + { + if (is_scalar($data) || null === $data) { + $sanitized = $data; + } else if ($data instanceof \DateTime) { + $sanitized = $data->format(\DateTime::ISO8601); + } else if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = $this->sanitizeForSerialization($value); + } + $sanitized = $data; + } else if (is_object($data)) { + $values = array(); + foreach (array_keys($data::$swaggerTypes) as $property) { + if ($data->$property !== null) { + $values[$data::$attributeMap[$property]] = $this->sanitizeForSerialization($data->$property); + } + } + $sanitized = $values; + } else { + $sanitized = (string)$data; + } -/** -* Build a JSON POST object -*/ -protected function sanitizeForSerialization($data) -{ -if (is_scalar($data) || null === $data) { -$sanitized = $data; -} else if ($data instanceof \DateTime) { -$sanitized = $data->format(\DateTime::ISO8601); -} else if (is_array($data)) { -foreach ($data as $property => $value) { -$data[$property] = $this->sanitizeForSerialization($value); -} -$sanitized = $data; -} else if (is_object($data)) { -$values = array(); -foreach (array_keys($data::$swaggerTypes) as $property) { -if ($data->$property !== null) { -$values[$data::$attributeMap[$property]] = $this->sanitizeForSerialization($data->$property); -} -} -$sanitized = $values; -} else { -$sanitized = (string)$data; -} + return $sanitized; + } -return $sanitized; -} + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * @param string $value a string which will be part of the path + * @return string the serialized object + */ + public static function toPathValue($value) { + return rawurlencode(self::toString($value)); + } -/** -* Take value and turn it into a string suitable for inclusion in -* the path, by url-encoding. -* @param string $value a string which will be part of the path -* @return string the serialized object -*/ -public static function toPathValue($value) { -return rawurlencode(self::toString($value)); -} + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * @param object $object an object to be serialized to a string + * @return string the serialized object + */ + public static function toQueryValue($object) { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object); + } + } -/** -* Take value and turn it into a string suitable for inclusion in -* the query, by imploding comma-separated if it's an object. -* If it's a string, pass through unchanged. It will be url-encoded -* later. -* @param object $object an object to be serialized to a string -* @return string the serialized object -*/ -public static function toQueryValue($object) { -if (is_array($object)) { -return implode(',', $object); -} else { -return self::toString($object); -} -} + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * @param string $value a string which will be part of the header + * @return string the header string + */ + public static function toHeaderValue($value) { + return self::toString($value); + } -/** -* Take value and turn it into a string suitable for inclusion in -* the header. If it's a string, pass through unchanged -* If it's a datetime object, format it in ISO8601 -* @param string $value a string which will be part of the header -* @return string the header string -*/ -public static function toHeaderValue($value) { -return self::toString($value); -} + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * @param string $value the value of the form parameter + * @return string the form string + */ + public static function toFormValue($value) { + return self::toString($value); + } -/** -* Take value and turn it into a string suitable for inclusion in -* the http body (form parameter). If it's a string, pass through unchanged -* If it's a datetime object, format it in ISO8601 -* @param string $value the value of the form parameter -* @return string the form string -*/ -public static function toFormValue($value) { -return self::toString($value); -} + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * @param string $value the value of the parameter + * @return string the header string + */ + public static function toString($value) { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(\DateTime::ISO8601); + } + else { + return $value; + } + } -/** -* Take value and turn it into a string suitable for inclusion in -* the parameter. If it's a string, pass through unchanged -* If it's a datetime object, format it in ISO8601 -* @param string $value the value of the parameter -* @return string the header string -*/ -public static function toString($value) { -if ($value instanceof \DateTime) { // datetime in ISO8601 format -return $value->format(\DateTime::ISO8601); -} -else { -return $value; -} -} + /** + * Deserialize a JSON string into an object + * + * @param object $object object or primitive to be deserialized + * @param string $class class name is passed as a string + * @return object an instance of $class + */ + public static function deserialize($data, $class) + { + if (null === $data) { + $deserialized = null; + } elseif (substr($class, 0, 4) == 'map[') { # for associative array e.g. map[string,int] + $inner = substr($class, 4, -1); + $deserialized = array(); + if(strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass); + } + } + } elseif (strcasecmp(substr($class, 0, 6),'array[') == 0) { + $subClass = substr($class, 6, -1); + $values = array(); + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass); + } + $deserialized = $values; + } elseif ($class == 'DateTime') { + $deserialized = new \DateTime($data); + } elseif (in_array($class, array('string', 'int', 'float', 'double', 'bool', 'object'))) { + settype($data, $class); + $deserialized = $data; + } else { + $class = "{{invokerPackage}}\\models\\".$class; + $instance = new $class(); + foreach ($instance::$swaggerTypes as $property => $type) { + $original_property_name = $instance::$attributeMap[$property]; + if (isset($original_property_name) && isset($data->$original_property_name)) { + $instance->$property = self::deserialize($data->$original_property_name, $type); + } + } + $deserialized = $instance; + } -/** -* Deserialize a JSON string into an object -* -* @param object $object object or primitive to be deserialized -* @param string $class class name is passed as a string -* @return object an instance of $class -*/ -public static function deserialize($data, $class) -{ -if (null === $data) { -$deserialized = null; -} elseif (substr($class, 0, 4) == 'map[') { # for associative array e.g. map[string,int] -$inner = substr($class, 4, -1); -$deserialized = array(); -if(strrpos($inner, ",") !== false) { -$subClass_array = explode(',', $inner, 2); -$subClass = $subClass_array[1]; -foreach ($data as $key => $value) { -$deserialized[$key] = self::deserialize($value, $subClass); -} -} -} elseif (strcasecmp(substr($class, 0, 6),'array[') == 0) { -$subClass = substr($class, 6, -1); -$values = array(); -foreach ($data as $key => $value) { -$values[] = self::deserialize($value, $subClass); -} -$deserialized = $values; -} elseif ($class == 'DateTime') { -$deserialized = new \DateTime($data); -} elseif (in_array($class, array('string', 'int', 'float', 'double', 'bool', 'object'))) { -settype($data, $class); -$deserialized = $data; -} else { -$class = "{{invokerPackage}}\\models\\".$class; -$instance = new $class(); -foreach ($instance::$swaggerTypes as $property => $type) { -$original_property_name = $instance::$attributeMap[$property]; -if (isset($original_property_name) && isset($data->$original_property_name)) { -$instance->$property = self::deserialize($data->$original_property_name, $type); -} -} -$deserialized = $instance; -} + return $deserialized; + } -return $deserialized; -} + /* + * return the header 'Accept' based on an array of Accept provided + * + * @param array[string] $accept Array of header + * @return string Accept (e.g. application/json) + */ + public static function selectHeaderAccept($accept) { + if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { + return NULL; + } elseif (preg_grep("/application\/json/i", $accept)) { + return 'application/json'; + } else { + return implode(',', $accept); + } + } -/* -* return the header 'Accept' based on an array of Accept provided -* -* @param array[string] $accept Array of header -* @return string Accept (e.g. application/json) -*/ -public static function selectHeaderAccept($accept) { -if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { -return NULL; -} elseif (preg_grep("/application\/json/i", $accept)) { -return 'application/json'; -} else { -return implode(',', $accept); -} -} - -/* -* return the content type based on an array of content-type provided -* -* @param array[string] content_type_array Array fo content-type -* @return string Content-Type (e.g. application/json) -*/ -public static function selectHeaderContentType($content_type) { -if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { -return 'application/json'; -} elseif (preg_grep("/application\/json/i", $content_type)) { -return 'application/json'; -} else { -return implode(',', $content_type); -} -} + /* + * return the content type based on an array of content-type provided + * + * @param array[string] content_type_array Array fo content-type + * @return string Content-Type (e.g. application/json) + */ + public static function selectHeaderContentType($content_type) { + if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $content_type)) { + return 'application/json'; + } else { + return implode(',', $content_type); + } + } } diff --git a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache index 6ee6efc0805e..b66c3a51eb74 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache @@ -34,25 +34,25 @@ class ApiException extends Exception { public function __construct($message="", $code=0, $responseHeaders=null, $responseBody=null) { parent::__construct($message, $code); $this->response_headers = $responseHeaders; -$this->response_body = $responseBody; -} + $this->response_body = $responseBody; + } -/** -* Get the HTTP response header -* -* @return string HTTP response header -*/ -public function getResponseHeaders() { -return $this->response_headers; -} + /** + * Get the HTTP response header + * + * @return string HTTP response header + */ + public function getResponseHeaders() { + return $this->response_headers; + } -/** -* Get the HTTP response body -* -* @return string HTTP response body -*/ -public function getResponseBody() { -return $this->response_body; -} + /** + * Get the HTTP response body + * + * @return string HTTP response body + */ + public function getResponseBody() { + return $this->response_body; + } } diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index ced857098d9a..12d2eb807449 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -30,108 +30,108 @@ class {{classname}} { if (Configuration::$apiClient === null) { Configuration::$apiClient = new ApiClient(); // create a new API client if not present $this->apiClient = Configuration::$apiClient; -} -else -$this->apiClient = Configuration::$apiClient; // use the default one -} else { -$this->apiClient = $apiClient; // use the one provided by the user -} -} + } + else + $this->apiClient = Configuration::$apiClient; // use the default one + } else { + $this->apiClient = $apiClient; // use the one provided by the user + } + } -private $apiClient; // instance of the ApiClient + private $apiClient; // instance of the ApiClient -/** -* get the API client -*/ -public function getApiClient() { -return $this->apiClient; -} + /** + * get the API client + */ + public function getApiClient() { + return $this->apiClient; + } -/** -* set the API client -*/ -public function setApiClient($apiClient) { -$this->apiClient = $apiClient; -} + /** + * set the API client + */ + public function setApiClient($apiClient) { + $this->apiClient = $apiClient; + } -{{#operation}} - /** - * {{{nickname}}} - * - * {{{summary}}} - * - {{#allParams}} * @param {{dataType}} ${{paramName}} {{description}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}} - {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} - */ - public function {{nickname}}({{#allParams}}${{paramName}}{{#optional}}=null{{/optional}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set - if (${{paramName}} === null) { + {{#operation}} + /** + * {{{nickname}}} + * + * {{{summary}}} + * +{{#allParams}} * @param {{dataType}} ${{paramName}} {{description}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}} +{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + */ + public function {{nickname}}({{#allParams}}${{paramName}}{{#optional}}=null{{/optional}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { + {{#allParams}}{{#required}} + // verify the required parameter '{{paramName}}' is set + if (${{paramName}} === null) { throw new \InvalidArgumentException('Missing the required parameter ${{paramName}} when calling {{nickname}}'); - } - {{/required}}{{/allParams}} + } + {{/required}}{{/allParams}} - // parse inputs - $resourcePath = "{{path}}"; - $resourcePath = str_replace("{format}", "json", $resourcePath); - $method = "{{httpMethod}}"; - $httpBody = ''; - $queryParams = array(); - $headerParams = array(); - $formParams = array(); - $_header_accept = $this->apiClient->selectHeaderAccept(array({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}})); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}})); + // parse inputs + $resourcePath = "{{path}}"; + $resourcePath = str_replace("{format}", "json", $resourcePath); + $method = "{{httpMethod}}"; + $httpBody = ''; + $queryParams = array(); + $headerParams = array(); + $formParams = array(); + $_header_accept = $this->apiClient->selectHeaderAccept(array({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}})); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}})); - {{#queryParams}}// query params - if(${{paramName}} !== null) { - $queryParams['{{baseName}}'] = $this->apiClient->toQueryValue(${{paramName}}); - }{{/queryParams}} - {{#headerParams}}// header params - if(${{paramName}} !== null) { - $headerParams['{{baseName}}'] = $this->apiClient->toHeaderValue(${{paramName}}); - }{{/headerParams}} - {{#pathParams}}// path params - if(${{paramName}} !== null) { - $resourcePath = str_replace("{" . "{{baseName}}" . "}", - $this->apiClient->toPathValue(${{paramName}}), $resourcePath); - }{{/pathParams}} - {{#formParams}}// form params - if (${{paramName}} !== null) { - $formParams['{{baseName}}'] = {{#isFile}}'@' . {{/isFile}}$this->apiClient->toFormValue(${{paramName}}); - }{{/formParams}} - {{#bodyParams}}// body params - $_tempBody = null; - if (isset(${{paramName}})) { - $_tempBody = ${{paramName}}; - }{{/bodyParams}} + {{#queryParams}}// query params + if(${{paramName}} !== null) { + $queryParams['{{baseName}}'] = $this->apiClient->toQueryValue(${{paramName}}); + }{{/queryParams}} + {{#headerParams}}// header params + if(${{paramName}} !== null) { + $headerParams['{{baseName}}'] = $this->apiClient->toHeaderValue(${{paramName}}); + }{{/headerParams}} + {{#pathParams}}// path params + if(${{paramName}} !== null) { + $resourcePath = str_replace("{" . "{{baseName}}" . "}", + $this->apiClient->toPathValue(${{paramName}}), $resourcePath); + }{{/pathParams}} + {{#formParams}}// form params + if (${{paramName}} !== null) { + $formParams['{{baseName}}'] = {{#isFile}}'@' . {{/isFile}}$this->apiClient->toFormValue(${{paramName}}); + }{{/formParams}} + {{#bodyParams}}// body params + $_tempBody = null; + if (isset(${{paramName}})) { + $_tempBody = ${{paramName}}; + }{{/bodyParams}} - // for model (json/xml) - if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - } else if (count($formParams) > 0) { - // for HTTP post (form) - $httpBody = $formParams; - } + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } else if (count($formParams) > 0) { + // for HTTP post (form) + $httpBody = $formParams; + } - // authentication setting, if any - $authSettings = array({{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}); + // authentication setting, if any + $authSettings = array({{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}); - // make the API Call - $response = $this->apiClient->callAPI($resourcePath, $method, - $queryParams, $httpBody, - $headerParams, $authSettings); + // make the API Call + $response = $this->apiClient->callAPI($resourcePath, $method, + $queryParams, $httpBody, + $headerParams, $authSettings); - {{#returnType}}if(! $response) { - return null; - } + {{#returnType}}if(! $response) { + return null; + } - $responseObject = $this->apiClient->deserialize($response,'{{returnType}}'); - return $responseObject;{{/returnType}} - } -{{/operation}} + $responseObject = $this->apiClient->deserialize($response,'{{returnType}}'); + return $responseObject;{{/returnType}} + } + {{/operation}} {{newline}} {{/operations}} } diff --git a/modules/swagger-codegen/src/main/resources/php/composer.mustache b/modules/swagger-codegen/src/main/resources/php/composer.mustache index 07d94b861066..fb47a8658340 100644 --- a/modules/swagger-codegen/src/main/resources/php/composer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/composer.mustache @@ -1,32 +1,32 @@ { -"name": "{{invokerPackage}}/{{invokerPackage}}-php", -"description": "{{description}}", -"keywords": [ -"swagger", -"php", -"sdk", -"api" -], -"homepage": "http://swagger.io", -"license": "Apache v2", -"authors": [ -{ -"name": "Swagger and contributors", -"homepage": "https://github.com/swagger-api/swagger-codegen" -} -], -"require": { -"php": ">=5.3.3", -"ext-curl": "*", -"ext-json": "*", -"ext-mbstring": "*" -}, -"require-dev": { -"phpunit/phpunit": "~4.0", -"satooshi/php-coveralls": "~0.6.1", -"squizlabs/php_codesniffer": "~2.0" -}, -"autoload": { -"psr-4": { "{{invokerPackage}}\\" : "lib/" } -} + "name": "{{invokerPackage}}/{{invokerPackage}}-php", + "description": "{{description}}", + "keywords": [ + "swagger", + "php", + "sdk", + "api" + ], + "homepage": "http://swagger.io", + "license": "Apache v2", + "authors": [ + { + "name": "Swagger and contributors", + "homepage": "https://github.com/swagger-api/swagger-codegen" + } + ], + "require": { + "php": ">=5.3.3", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "~0.6.1", + "squizlabs/php_codesniffer": "~2.0" + }, + "autoload": { + "psr-4": { "{{invokerPackage}}\\" : "lib/" } + } } diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index f93bc3c50166..9ce348ad1311 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -16,7 +16,7 @@ */ {{#models}} - {{#model}} +{{#model}} /** * {{description}} * @@ -31,40 +31,40 @@ use \ArrayAccess; class {{classname}} implements ArrayAccess { static $swaggerTypes = array( {{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} - ); + {{/hasMore}}{{/vars}} + ); - static $attributeMap = array( - {{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} - ); + static $attributeMap = array( + {{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + ); - {{#vars}}{{#description}} - /** - * {{{description}}} - */{{/description}} - public ${{name}}; /* {{{datatype}}} */{{/vars}} + {{#vars}}{{#description}} + /** + * {{{description}}} + */{{/description}} + public ${{name}}; /* {{{datatype}}} */{{/vars}} - public function __construct(array $data = null) { + public function __construct(array $data = null) { {{#vars}}$this->{{name}} = $data["{{name}}"];{{#hasMore}} {{/hasMore}}{{/vars}} - } + } - public function offsetExists($offset) { + public function offsetExists($offset) { return isset($this->$offset); - } + } - public function offsetGet($offset) { + public function offsetGet($offset) { return $this->$offset; - } + } - public function offsetSet($offset, $value) { + public function offsetSet($offset, $value) { $this->$offset = $value; - } + } - public function offsetUnset($offset) { + public function offsetUnset($offset) { unset($this->$offset); - } - } - {{/model}} + } +} +{{/model}} {{/models}} From 263b4080ee3897f225444a710c50be222459ec6d Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:40:45 +0800 Subject: [PATCH 17/41] rollback python3 template --- .../main/resources/python3/__init__.mustache | 4 +- .../src/main/resources/python3/api.mustache | 52 +-- .../src/main/resources/python3/model.mustache | 40 +- .../main/resources/python3/swagger.mustache | 342 +++++++++--------- 4 files changed, 219 insertions(+), 219 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/python3/__init__.mustache b/modules/swagger-codegen/src/main/resources/python3/__init__.mustache index 1ca7f06ecf2f..4b41ee706c70 100644 --- a/modules/swagger-codegen/src/main/resources/python3/__init__.mustache +++ b/modules/swagger-codegen/src/main/resources/python3/__init__.mustache @@ -5,5 +5,5 @@ import os __all__ = [] for module in os.listdir(os.path.dirname(__file__)): -if module != '__init__.py' and module[-3:] == '.py': -__all__.append(module[:-3]) + if module != '__init__.py' and module[-3:] == '.py': + __all__.append(module[:-3]) diff --git a/modules/swagger-codegen/src/main/resources/python3/api.mustache b/modules/swagger-codegen/src/main/resources/python3/api.mustache index a40574ca3c20..015158bccec7 100644 --- a/modules/swagger-codegen/src/main/resources/python3/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python3/api.mustache @@ -3,17 +3,17 @@ {{classname}}.py Copyright 2015 SmartBear Software -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ @@ -24,20 +24,20 @@ from .models import * {{#operations}} - class {{classname}}(object): +class {{classname}}(object): def __init__(self, apiClient): - self.apiClient = apiClient + self.apiClient = apiClient {{newline}} {{#operation}} - def {{nickname}}(self, {{#requiredParams}}{{paramName}}{{#defaultValue}} = None{{/defaultValue}}, {{/requiredParams}}**kwargs): + def {{nickname}}(self, {{#requiredParams}}{{paramName}}{{#defaultValue}} = None{{/defaultValue}}, {{/requiredParams}}**kwargs): """{{{summary}}} {{{notes}}} Args: - {{#allParams}}{{paramName}}, {{dataType}}: {{{description}}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}} - {{/allParams}} + {{#allParams}}{{paramName}}, {{dataType}}: {{{description}}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}} + {{/allParams}} Returns: {{returnType}} """ @@ -46,9 +46,9 @@ from .models import * params = locals() for (key, val) in params['kwargs'].items(): - if key not in allParams: - raise TypeError("Got an unexpected keyword argument '%s' to method {{nickname}}" % key) - params[key] = val + if key not in allParams: + raise TypeError("Got an unexpected keyword argument '%s' to method {{nickname}}" % key) + params[key] = val del params['kwargs'] resourcePath = '{{path}}' @@ -59,37 +59,37 @@ from .models import * headerParams = {} {{#queryParams}} - if ('{{paramName}}' in params): + if ('{{paramName}}' in params): queryParams['{{paramName}}'] = self.apiClient.toPathValue(params['{{paramName}}']) {{/queryParams}} {{#headerParams}} - if ('{{paramName}}' in params): + if ('{{paramName}}' in params): headerParams['{{paramName}}'] = params['{{paramName}}'] {{/headerParams}} {{#pathParams}} - if ('{{paramName}}' in params): + if ('{{paramName}}' in params): replacement = str(self.apiClient.toPathValue(params['{{paramName}}'])) resourcePath = resourcePath.replace('{' + '{{baseName}}' + '}', - replacement) + replacement) {{/pathParams}} postData = (params['body'] if 'body' in params else None) response = self.apiClient.callAPI(resourcePath, method, queryParams, - postData, headerParams) + postData, headerParams) {{#returnType}} - if not response: + if not response: return None - responseObject = self.apiClient.deserialize(response, '{{returnType}}') - return responseObject + responseObject = self.apiClient.deserialize(response, '{{returnType}}') + return responseObject {{/returnType}} {{newline}} {{newline}} {{/operation}} - {{newline}} +{{newline}} {{/operations}} {{newline}} diff --git a/modules/swagger-codegen/src/main/resources/python3/model.mustache b/modules/swagger-codegen/src/main/resources/python3/model.mustache index 63d2bedc3da5..ef3841a34b96 100644 --- a/modules/swagger-codegen/src/main/resources/python3/model.mustache +++ b/modules/swagger-codegen/src/main/resources/python3/model.mustache @@ -2,39 +2,39 @@ """ Copyright 2015 SmartBear Software -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. """ {{#models}} - {{#model}} +{{#model}} - class {{classname}}: - """NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually.""" +class {{classname}}: + """NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually.""" - def __init__(self): + def __init__(self): self.swaggerTypes = { - {{#vars}} + {{#vars}} '{{name}}': '{{{datatype}}}'{{#hasMore}}, {{/hasMore}} - {{/vars}}{{newline}} + {{/vars}}{{newline}} } {{#vars}} - {{#description}}#{{description}} - {{/description}} - self.{{name}} = None # {{{datatype}}} + {{#description}}#{{description}} + {{/description}} + self.{{name}} = None # {{{datatype}}} {{/vars}} - {{/model}} +{{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/python3/swagger.mustache b/modules/swagger-codegen/src/main/resources/python3/swagger.mustache index 55834b3fd3a8..f99f0d4d250d 100644 --- a/modules/swagger-codegen/src/main/resources/python3/swagger.mustache +++ b/modules/swagger-codegen/src/main/resources/python3/swagger.mustache @@ -16,215 +16,215 @@ from .models import * class ApiClient: -"""Generic API client for Swagger client library builds""" + """Generic API client for Swagger client library builds""" -def __init__(self, apiKey=None, apiServer=None): -if apiKey == None: -raise Exception('You must pass an apiKey when instantiating the ' -'APIClient') -self.apiKey = apiKey -self.apiServer = apiServer -self.cookie = None + def __init__(self, apiKey=None, apiServer=None): + if apiKey == None: + raise Exception('You must pass an apiKey when instantiating the ' + 'APIClient') + self.apiKey = apiKey + self.apiServer = apiServer + self.cookie = None -def callAPI(self, resourcePath, method, queryParams, postData, -headerParams=None): + def callAPI(self, resourcePath, method, queryParams, postData, + headerParams=None): -url = self.apiServer + resourcePath -headers = {} -if headerParams: -for param, value in headerParams.items(): -headers[param] = value + url = self.apiServer + resourcePath + headers = {} + if headerParams: + for param, value in headerParams.items(): + headers[param] = value -#headers['Content-type'] = 'application/json' -headers['api_key'] = self.apiKey + #headers['Content-type'] = 'application/json' + headers['api_key'] = self.apiKey -if self.cookie: -headers['Cookie'] = self.cookie + if self.cookie: + headers['Cookie'] = self.cookie -data = None + data = None -if queryParams: -# Need to remove None values, these should not be sent -sentQueryParams = {} -for param, value in queryParams.items(): -if value != None: -sentQueryParams[param] = value -url = url + '?' + urllib.parse.urlencode(sentQueryParams) + if queryParams: + # Need to remove None values, these should not be sent + sentQueryParams = {} + for param, value in queryParams.items(): + if value != None: + sentQueryParams[param] = value + url = url + '?' + urllib.parse.urlencode(sentQueryParams) -if method in ['GET']: + if method in ['GET']: -#Options to add statements later on and for compatibility -pass + #Options to add statements later on and for compatibility + pass -elif method in ['PATCH', 'POST', 'PUT', 'DELETE']: + elif method in ['PATCH', 'POST', 'PUT', 'DELETE']: -if postData: -headers['Content-type'] = 'application/json' -data = self.sanitizeForSerialization(postData) -data = json.dumps(data) + if postData: + headers['Content-type'] = 'application/json' + data = self.sanitizeForSerialization(postData) + data = json.dumps(data) -else: -raise Exception('Method ' + method + ' is not recognized.') + else: + raise Exception('Method ' + method + ' is not recognized.') -if data: -data = data.encode('utf-8') + if data: + data = data.encode('utf-8') -requestParams = MethodRequest(method=method, url=url, -headers=headers, data=data) + requestParams = MethodRequest(method=method, url=url, + headers=headers, data=data) -# Make the request -request = urllib.request.urlopen(requestParams) -encoding = request.headers.get_content_charset() -if not encoding: -encoding = 'iso-8859-1' -response = request.read().decode(encoding) + # Make the request + request = urllib.request.urlopen(requestParams) + encoding = request.headers.get_content_charset() + if not encoding: + encoding = 'iso-8859-1' + response = request.read().decode(encoding) -try: -data = json.loads(response) -except ValueError: # PUT requests don't return anything -data = None + try: + data = json.loads(response) + except ValueError: # PUT requests don't return anything + data = None -return data + return data -def toPathValue(self, obj): -"""Convert a string or object to a path-friendly value -Args: -obj -- object or string value -Returns: -string -- quoted value -""" -if type(obj) == list: -return urllib.parse.quote(','.join(obj)) -else: -return urllib.parse.quote(str(obj)) + def toPathValue(self, obj): + """Convert a string or object to a path-friendly value + Args: + obj -- object or string value + Returns: + string -- quoted value + """ + if type(obj) == list: + return urllib.parse.quote(','.join(obj)) + else: + return urllib.parse.quote(str(obj)) -def sanitizeForSerialization(self, obj): -"""Dump an object into JSON for POSTing.""" + def sanitizeForSerialization(self, obj): + """Dump an object into JSON for POSTing.""" -if type(obj) == type(None): -return None -elif type(obj) in [str, int, float, bool]: -return obj -elif type(obj) == list: -return [self.sanitizeForSerialization(subObj) for subObj in obj] -elif type(obj) == datetime.datetime: -return obj.isoformat() -else: -if type(obj) == dict: -objDict = obj -else: -objDict = obj.__dict__ -return {key: self.sanitizeForSerialization(val) -for (key, val) in objDict.items() -if key != 'swaggerTypes'} + if type(obj) == type(None): + return None + elif type(obj) in [str, int, float, bool]: + return obj + elif type(obj) == list: + return [self.sanitizeForSerialization(subObj) for subObj in obj] + elif type(obj) == datetime.datetime: + return obj.isoformat() + else: + if type(obj) == dict: + objDict = obj + else: + objDict = obj.__dict__ + return {key: self.sanitizeForSerialization(val) + for (key, val) in objDict.items() + if key != 'swaggerTypes'} -def _iso8601Format(self, timesep, microsecond, offset, zulu): -"""Format for parsing a datetime string with given properties. + def _iso8601Format(self, timesep, microsecond, offset, zulu): + """Format for parsing a datetime string with given properties. -Args: -timesep -- string separating time from date ('T' or 't') -microsecond -- microsecond portion of time ('.XXX') -offset -- time offset (+/-XX:XX) or None -zulu -- 'Z' or 'z' for UTC, or None for time offset (+/-XX:XX) + Args: + timesep -- string separating time from date ('T' or 't') + microsecond -- microsecond portion of time ('.XXX') + offset -- time offset (+/-XX:XX) or None + zulu -- 'Z' or 'z' for UTC, or None for time offset (+/-XX:XX) -Returns: -str - format string for datetime.strptime""" + Returns: + str - format string for datetime.strptime""" -return '%Y-%m-%d{}%H:%M:%S{}{}'.format( -timesep, -'.%f' if microsecond else '', -zulu or ('%z' if offset else '')) + return '%Y-%m-%d{}%H:%M:%S{}{}'.format( + timesep, + '.%f' if microsecond else '', + zulu or ('%z' if offset else '')) -# http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14 -_iso8601Regex = re.compile( -r'^\d\d\d\d-\d\d-\d\d([Tt])\d\d:\d\d:\d\d(\.\d+)?(([Zz])|(\+|-)\d\d:?\d\d)?$') + # http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14 + _iso8601Regex = re.compile( + r'^\d\d\d\d-\d\d-\d\d([Tt])\d\d:\d\d:\d\d(\.\d+)?(([Zz])|(\+|-)\d\d:?\d\d)?$') -def _parseDatetime(self, d): -if d is None: -return None -m = ApiClient._iso8601Regex.match(d) -if not m: -raise Exception('datetime regex match failed "%s"' % d) -timesep, microsecond, offset, zulu, plusminus = m.groups() -format = self._iso8601Format(timesep, microsecond, offset, zulu) -if offset and not zulu: -d = d.rsplit(sep=plusminus, maxsplit=1)[0] + offset.replace(':', '') -return datetime.datetime.strptime(d, format) + def _parseDatetime(self, d): + if d is None: + return None + m = ApiClient._iso8601Regex.match(d) + if not m: + raise Exception('datetime regex match failed "%s"' % d) + timesep, microsecond, offset, zulu, plusminus = m.groups() + format = self._iso8601Format(timesep, microsecond, offset, zulu) + if offset and not zulu: + d = d.rsplit(sep=plusminus, maxsplit=1)[0] + offset.replace(':', '') + return datetime.datetime.strptime(d, format) -def deserialize(self, obj, objClass): -"""Derialize a JSON string into an object. + def deserialize(self, obj, objClass): + """Derialize a JSON string into an object. -Args: -obj -- string or object to be deserialized -objClass -- class literal for deserialzied object, or string -of class name -Returns: -object -- deserialized object""" + Args: + obj -- string or object to be deserialized + objClass -- class literal for deserialzied object, or string + of class name + Returns: + object -- deserialized object""" -# Have to accept objClass as string or actual type. Type could be a -# native Python type, or one of the model classes. -if type(objClass) == str: -if 'list[' in objClass: -match = re.match('list\[(.*)\]', objClass) -subClass = match.group(1) -return [self.deserialize(subObj, subClass) for subObj in obj] + # Have to accept objClass as string or actual type. Type could be a + # native Python type, or one of the model classes. + if type(objClass) == str: + if 'list[' in objClass: + match = re.match('list\[(.*)\]', objClass) + subClass = match.group(1) + return [self.deserialize(subObj, subClass) for subObj in obj] -if (objClass in ['int', 'float', 'dict', 'list', 'str', 'bool', 'datetime']): -objClass = eval(objClass) -else: # not a native type, must be model class -objClass = eval(objClass + '.' + objClass) + if (objClass in ['int', 'float', 'dict', 'list', 'str', 'bool', 'datetime']): + objClass = eval(objClass) + else: # not a native type, must be model class + objClass = eval(objClass + '.' + objClass) -if objClass in [int, float, dict, list, str, bool]: -return objClass(obj) -elif objClass == datetime: -return self._parseDatetime(obj) + if objClass in [int, float, dict, list, str, bool]: + return objClass(obj) + elif objClass == datetime: + return self._parseDatetime(obj) -instance = objClass() + instance = objClass() -for attr, attrType in instance.swaggerTypes.items(): + for attr, attrType in instance.swaggerTypes.items(): -if attr in obj: -value = obj[attr] -if attrType in ['str', 'int', 'float', 'bool']: -attrType = eval(attrType) -try: -value = attrType(value) -except UnicodeEncodeError: -value = unicode(value) -except TypeError: -value = value -setattr(instance, attr, value) -elif (attrType == 'datetime'): -setattr(instance, attr, self._parseDatetime(value)) -elif 'list[' in attrType: -match = re.match('list\[(.*)\]', attrType) -subClass = match.group(1) -subValues = [] -if not value: -setattr(instance, attr, None) -else: -for subValue in value: -subValues.append(self.deserialize(subValue, -subClass)) -setattr(instance, attr, subValues) -else: -setattr(instance, attr, self.deserialize(value, -attrType)) + if attr in obj: + value = obj[attr] + if attrType in ['str', 'int', 'float', 'bool']: + attrType = eval(attrType) + try: + value = attrType(value) + except UnicodeEncodeError: + value = unicode(value) + except TypeError: + value = value + setattr(instance, attr, value) + elif (attrType == 'datetime'): + setattr(instance, attr, self._parseDatetime(value)) + elif 'list[' in attrType: + match = re.match('list\[(.*)\]', attrType) + subClass = match.group(1) + subValues = [] + if not value: + setattr(instance, attr, None) + else: + for subValue in value: + subValues.append(self.deserialize(subValue, + subClass)) + setattr(instance, attr, subValues) + else: + setattr(instance, attr, self.deserialize(value, + attrType)) -return instance + return instance class MethodRequest(urllib.request.Request): -def __init__(self, *args, **kwargs): -"""Construct a MethodRequest. Usage is the same as for -`urllib.Request` except it also takes an optional `method` -keyword argument. If supplied, `method` will be used instead of -the default.""" + def __init__(self, *args, **kwargs): + """Construct a MethodRequest. Usage is the same as for + `urllib.Request` except it also takes an optional `method` + keyword argument. If supplied, `method` will be used instead of + the default.""" -if 'method' in kwargs: -self.method = kwargs.pop('method') -return urllib.request.Request.__init__(self, *args, **kwargs) + if 'method' in kwargs: + self.method = kwargs.pop('method') + return urllib.request.Request.__init__(self, *args, **kwargs) -def get_method(self): -return getattr(self, 'method', urllib.request.Request.get_method(self)) + def get_method(self): + return getattr(self, 'method', urllib.request.Request.get_method(self)) From 6253bbff3dd3cccd893fc8ddb236e7cf6fc371d3 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:42:07 +0800 Subject: [PATCH 18/41] roll back qt5cpp template --- .../main/resources/qt5cpp/api-body.mustache | 314 +++++++++--------- .../main/resources/qt5cpp/api-header.mustache | 22 +- .../resources/qt5cpp/helpers-body.mustache | 305 ++++++++--------- .../resources/qt5cpp/helpers-header.mustache | 13 +- .../main/resources/qt5cpp/model-body.mustache | 155 +++++---- .../resources/qt5cpp/model-header.mustache | 41 ++- .../src/main/resources/qt5cpp/model.mustache | 56 ++-- .../resources/qt5cpp/modelFactory.mustache | 39 ++- .../src/main/resources/qt5cpp/object.mustache | 21 +- 9 files changed, 454 insertions(+), 512 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache index 88d1bce35638..b63411041881 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache @@ -2,186 +2,180 @@ #include "{{prefix}}Helpers.h" #include "{{prefix}}ModelFactory.h" -#include - - #include - +#include +#include - namespace Swagger { - {{classname}}::{{classname}}() {} +namespace Swagger { +{{classname}}::{{classname}}() {} - {{classname}}::~{{classname}}() {} +{{classname}}::~{{classname}}() {} - {{classname}}::{{classname}}(QString host, QString basePath) { - this->host = host; - this->basePath = basePath; +{{classname}}::{{classname}}(QString host, QString basePath) { + this->host = host; + this->basePath = basePath; +} + +{{#operations}} +{{#operation}} +void +{{classname}}::{{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("{{path}}"); + + {{#pathParams}} + QString {{paramName}}PathParam("{"); {{paramName}}PathParam.append("{{paramName}}").append("}"); + fullPath.replace({{paramName}}PathParam, stringValue({{paramName}})); + {{/pathParams}} + + {{#queryParams}} + {{^collectionFormat}} + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append(QUrl::toPercentEncoding("{{paramName}}")) + .append("=") + .append(QUrl::toPercentEncoding(stringValue({{paramName}}))); + {{/collectionFormat}} + + {{#collectionFormat}} + + if({{{paramName}}}->size() > 0) { + if(QString("{{collectionFormat}}").indexOf("multi") == 0) { + foreach({{{baseType}}} t, *{{paramName}}) { + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append("{{{paramName}}}=").append(stringValue(t)); } + } + else if (QString("{{collectionFormat}}").indexOf("ssv") == 0) { + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append("{{paramName}}="); + qint32 count = 0; + foreach({{{baseType}}} t, *{{paramName}}) { + if(count > 0) { + fullPath.append(" "); + } + fullPath.append(stringValue(t)); + } + } + else if (QString("{{collectionFormat}}").indexOf("tsv") == 0) { + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append("{{paramName}}="); + qint32 count = 0; + foreach({{{baseType}}} t, *{{paramName}}) { + if(count > 0) { + fullPath.append("\t"); + } + fullPath.append(stringValue(t)); + } + } + } - {{#operations}} - {{#operation}} - void - {{classname}}::{{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}} - , {{/hasMore}}{{/allParams}}) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("{{path}}"); + {{/collectionFormat}} + {{/queryParams}} - {{#pathParams}} - QString {{paramName}}PathParam("{"); {{paramName}}PathParam.append("{{paramName}}").append("}"); - fullPath.replace({{paramName}}PathParam, stringValue({{paramName}})); - {{/pathParams}} + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "{{httpMethod}}"); - {{#queryParams}} - {{^collectionFormat}} - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append(QUrl::toPercentEncoding("{{paramName}}")) - .append("=") - .append(QUrl::toPercentEncoding(stringValue({{paramName}}))); - {{/collectionFormat}} + {{#formParams}}{{^isFile}} + if({{paramName}} != NULL) { + input.add_var("{{paramName}}", *{{paramName}}); + } + {{/isFile}}{{/formParams}} - {{#collectionFormat}} + {{#bodyParams}} + {{#isContainer}} + QJsonArray* {{paramName}}Array = new QJsonArray(); + toJsonArray((QList*){{paramName}}, {{paramName}}Array, QString("body"), QString("SWGUser*")); - if({{{paramName}}}->size() > 0) { - if(QString("{{collectionFormat}}").indexOf("multi") == 0) { - foreach({{{baseType}}} t, *{{paramName}}) { - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("{{{paramName}}}=").append(stringValue(t)); - } - } - else if (QString("{{collectionFormat}}").indexOf("ssv") == 0) { - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("{{paramName}}="); - qint32 count = 0; - foreach({{{baseType}}} t, *{{paramName}}) { - if(count > 0) { - fullPath.append(" "); - } - fullPath.append(stringValue(t)); - } - } - else if (QString("{{collectionFormat}}").indexOf("tsv") == 0) { - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("{{paramName}}="); - qint32 count = 0; - foreach({{{baseType}}} t, *{{paramName}}) { - if(count > 0) { - fullPath.append("\t"); - } - fullPath.append(stringValue(t)); - } - } - } + QJsonDocument doc(*{{paramName}}Array); + QByteArray bytes = doc.toJson(); - {{/collectionFormat}} - {{/queryParams}} + input.request_body.append(bytes); + {{/isContainer}} + {{^isContainer}} + QString output = {{paramName}}.asJson(); + input.request_body.append(output); + {{/isContainer}}{{/bodyParams}} - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "{{httpMethod}}"); + {{#headerParams}} + // TODO: add header support + {{/headerParams}} - {{#formParams}}{{^isFile}} - if({{paramName}} != NULL) { - input.add_var("{{paramName}}", *{{paramName}}); - } - {{/isFile}}{{/formParams}} + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &{{classname}}::{{nickname}}Callback); - {{#bodyParams}} - {{#isContainer}} - QJsonArray* {{paramName}}Array = new QJsonArray(); - toJsonArray((QList - *){{paramName}}, {{paramName}}Array, QString("body"), QString("SWGUser*")); + worker->execute(&input); +} - QJsonDocument doc(*{{paramName}}Array); - QByteArray bytes = doc.toJson(); +void +{{classname}}::{{nickname}}Callback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } - input.request_body.append(bytes); - {{/isContainer}} - {{^isContainer}} - QString output = {{paramName}}.asJson(); - input.request_body.append(output); - {{/isContainer}}{{/bodyParams}} + {{#returnType}}{{#isListContainer}} + {{{returnType}}} output = {{{defaultResponse}}}; + QString json(worker->response); + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonArray jsonArray = doc.array(); - {{#headerParams}} - // TODO: add header support - {{/headerParams}} + foreach(QJsonValue obj, jsonArray) { + {{{returnBaseType}}}* o = new {{returnBaseType}}(); + QJsonObject jv = obj.toObject(); + QJsonObject * ptr = (QJsonObject*)&jv; + o->fromJsonObject(*ptr); + output->append(o); + } + {{/isListContainer}} - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &{{classname}}::{{nickname}}Callback); + {{^isListContainer}}{{#returnTypeIsPrimitive}} + {{{returnType}}} output; // TODO add primitive output support + {{/returnTypeIsPrimitive}} + {{#isMapContainer}} + {{{returnType}}} output = {{{defaultResponse}}}; - worker->execute(&input); - } + QString json(worker->response); + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject obj = doc.object(); - void - {{classname}}::{{nickname}}Callback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - {{#returnType}}{{#isListContainer}} - {{{returnType}}} output = {{{defaultResponse}}}; - QString json(worker->response); - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonArray jsonArray = doc.array(); - - foreach(QJsonValue obj, jsonArray) { - {{{returnBaseType}}}* o = new {{returnBaseType}}(); - QJsonObject jv = obj.toObject(); - QJsonObject * ptr = (QJsonObject*)&jv; - o->fromJsonObject(*ptr); - output->append(o); - } - {{/isListContainer}} - - {{^isListContainer}}{{#returnTypeIsPrimitive}} - {{{returnType}}} output; // TODO add primitive output support - {{/returnTypeIsPrimitive}} - {{#isMapContainer}} - {{{returnType}}} output = {{{defaultResponse}}}; - - QString json(worker->response); - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject obj = doc.object(); - - foreach(QString key, obj.keys()) { - qint32* val; - setValue(&val, obj[key], "{{returnBaseType}}", ""); - output->insert(key, *val); - } + foreach(QString key, obj.keys()) { + qint32* val; + setValue(&val, obj[key], "{{returnBaseType}}", ""); + output->insert(key, *val); + } - {{/isMapContainer}} - {{^isMapContainer}} - {{^returnTypeIsPrimitive}}QString json(worker->response); - {{{returnType}}} output = static_cast<{{{returnType}}}>(create(json, - QString("{{{returnBaseType}}}"))); - {{/returnTypeIsPrimitive}} - {{/isMapContainer}} - {{/isListContainer}}{{/returnType}} + {{/isMapContainer}} + {{^isMapContainer}} + {{^returnTypeIsPrimitive}}QString json(worker->response); + {{{returnType}}} output = static_cast<{{{returnType}}}>(create(json, QString("{{{returnBaseType}}}"))); + {{/returnTypeIsPrimitive}} + {{/isMapContainer}} + {{/isListContainer}}{{/returnType}} - worker->deleteLater(); + worker->deleteLater(); - {{#returnType}}emit {{nickname}}Signal(output);{{/returnType}} - {{^returnType}}emit {{nickname}}Signal();{{/returnType}} - } - {{/operation}} - {{/operations}} - } /* namespace Swagger */ + {{#returnType}}emit {{nickname}}Signal(output);{{/returnType}} + {{^returnType}}emit {{nickname}}Signal();{{/returnType}} +} +{{/operation}} +{{/operations}} +} /* namespace Swagger */ diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache index ffee582a4fcc..4260ba6ff865 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache @@ -6,15 +6,14 @@ {{#imports}}{{{import}}} {{/imports}} -#include - +#include - namespace Swagger { +namespace Swagger { - class {{classname}}: public QObject { +class {{classname}}: public QObject { Q_OBJECT - public: +public: {{classname}}(); {{classname}}(QString host, QString basePath); ~{{classname}}(); @@ -22,15 +21,14 @@ QString host; QString basePath; - {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}} - , {{/hasMore}}{{/allParams}}); + {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}}{{/operations}} - private: +private: {{#operations}}{{#operation}}void {{nickname}}Callback (HttpRequestWorker * worker); {{/operation}}{{/operations}} - signals: +signals: {{#operations}}{{#operation}}void {{nickname}}Signal({{#returnType}}{{{returnType}}} summary{{/returnType}}); {{/operation}}{{/operations}} - }; - } - #endif \ No newline at end of file +}; +} +#endif \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache index 0cc60d91b90e..7f4d748c2dce 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache @@ -1,201 +1,166 @@ #include "SWGHelpers.h" #include "SWGModelFactory.h" #include "SWGObject.h" -#import - - #import - - #import - +#import +#import +#import - namespace Swagger { +namespace Swagger { - void - setValue(void* value, QJsonValue obj, QString type, QString complexType) { - if(value == NULL) { - // can't set value with a null pointer - return; - } - if(QStringLiteral("bool").compare(type) == 0) { - bool * val = static_cast - (value); - *val = obj.toBool(); - } - else if(QStringLiteral("qint32").compare(type) == 0) { - qint32 *val = static_cast - (value); - *val = obj.toInt(); - } - else if(QStringLiteral("qint64").compare(type) == 0) { - qint64 *val = static_cast - (value); - *val = obj.toVariant().toLongLong(); - } - else if (QStringLiteral("QString").compare(type) == 0) { - QString **val = static_cast - (value); +void +setValue(void* value, QJsonValue obj, QString type, QString complexType) { + if(value == NULL) { + // can't set value with a null pointer + return; + } + if(QStringLiteral("bool").compare(type) == 0) { + bool * val = static_cast(value); + *val = obj.toBool(); + } + else if(QStringLiteral("qint32").compare(type) == 0) { + qint32 *val = static_cast(value); + *val = obj.toInt(); + } + else if(QStringLiteral("qint64").compare(type) == 0) { + qint64 *val = static_cast(value); + *val = obj.toVariant().toLongLong(); + } + else if (QStringLiteral("QString").compare(type) == 0) { + QString **val = static_cast(value); - if(val != NULL) { + if(val != NULL) { if(!obj.isNull()) { - // create a new value and return - delete *val; - *val = new QString(obj.toString()); - return; + // create a new value and return + delete *val; + *val = new QString(obj.toString()); + return; } else { - // set target to NULL - delete *val; - *val = NULL; + // set target to NULL + delete *val; + *val = NULL; } - } - else { + } + else { qDebug() << "Can't set value because the target pointer is NULL"; - } - } - else if(type.startsWith("SWG") && obj.isObject()) { - // complex type - QJsonObject jsonObj = obj.toObject(); - SWGObject * so = (SWGObject*)Swagger::create(type); - if(so != NULL) { + } + } + else if(type.startsWith("SWG") && obj.isObject()) { + // complex type + QJsonObject jsonObj = obj.toObject(); + SWGObject * so = (SWGObject*)Swagger::create(type); + if(so != NULL) { so->fromJsonObject(jsonObj); - SWGObject **val = static_cast - (value); + SWGObject **val = static_cast(value); delete *val; *val = so; - } - } - else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) { - // list of values - QList - * output = new QList - (); - QJsonArray arr = obj.toArray(); - foreach (const QJsonValue & jval, arr) { + } + } + else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) { + // list of values + QList* output = new QList(); + QJsonArray arr = obj.toArray(); + foreach (const QJsonValue & jval, arr) { if(complexType.startsWith("SWG")) { - // it's an object - SWGObject * val = (SWGObject*)create(complexType); - QJsonObject t = jval.toObject(); + // it's an object + SWGObject * val = (SWGObject*)create(complexType); + QJsonObject t = jval.toObject(); - val->fromJsonObject(t); - output->append(val); + val->fromJsonObject(t); + output->append(val); } else { - // primitives - if(QStringLiteral("qint32").compare(complexType) == 0) { - qint32 val; - setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); - output->append((void*)&val); - } - else if(QStringLiteral("qint64").compare(complexType) == 0) { - qint64 val; - setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); - output->append((void*)&val); - } - else if(QStringLiteral("bool").compare(complexType) == 0) { - bool val; - setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); - output->append((void*)&val); - } - } - } - QList - **val = static_cast - **>(value); - delete *val; - *val = output; - } + // primitives + if(QStringLiteral("qint32").compare(complexType) == 0) { + qint32 val; + setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); + output->append((void*)&val); + } + else if(QStringLiteral("qint64").compare(complexType) == 0) { + qint64 val; + setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); + output->append((void*)&val); + } + else if(QStringLiteral("bool").compare(complexType) == 0) { + bool val; + setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); + output->append((void*)&val); + } } + } + QList **val = static_cast**>(value); + delete *val; + *val = output; + } +} - void - toJsonValue(QString name, void* value, QJsonObject* output, QString type) { - if(value == NULL) { - return; - } - if(type.startsWith("SWG")) { - SWGObject *swgObject = reinterpret_cast - (value); - if(swgObject != NULL) { - QJsonObject* o = (*swgObject).asJsonObject(); - if(name != NULL) { +void +toJsonValue(QString name, void* value, QJsonObject* output, QString type) { + if(value == NULL) { + return; + } + if(type.startsWith("SWG")) { + SWGObject *swgObject = reinterpret_cast(value); + if(swgObject != NULL) { + QJsonObject* o = (*swgObject).asJsonObject(); + if(name != NULL) { output->insert(name, *o); delete o; - } - else { + } + else { output->empty(); foreach(QString key, o->keys()) { - output->insert(key, o->value(key)); - } - } - } - } - else if(QStringLiteral("QString").compare(type) == 0) { - QString* str = static_cast - (value); - output->insert(name, QJsonValue(*str)); - } - else if(QStringLiteral("qint32").compare(type) == 0) { - qint32* str = static_cast - (value); - output->insert(name, QJsonValue(*str)); - } - else if(QStringLiteral("qint64").compare(type) == 0) { - qint64* str = static_cast - (value); - output->insert(name, QJsonValue(*str)); - } - else if(QStringLiteral("bool").compare(type) == 0) { - bool* str = static_cast - (value); - output->insert(name, QJsonValue(*str)); - } + output->insert(key, o->value(key)); } + } + } + } + else if(QStringLiteral("QString").compare(type) == 0) { + QString* str = static_cast(value); + output->insert(name, QJsonValue(*str)); + } + else if(QStringLiteral("qint32").compare(type) == 0) { + qint32* str = static_cast(value); + output->insert(name, QJsonValue(*str)); + } + else if(QStringLiteral("qint64").compare(type) == 0) { + qint64* str = static_cast(value); + output->insert(name, QJsonValue(*str)); + } + else if(QStringLiteral("bool").compare(type) == 0) { + bool* str = static_cast(value); + output->insert(name, QJsonValue(*str)); + } +} - void - toJsonArray(QList - * value, QJsonArray* output, QString innerName, QString innerType) { - foreach(void* obj, *value) { - QJsonObject element; +void +toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType) { + foreach(void* obj, *value) { + QJsonObject element; - toJsonValue(NULL, obj, &element, innerType); - output->append(element); - } - } + toJsonValue(NULL, obj, &element, innerType); + output->append(element); + } +} - QString - stringValue(QString* value) { - QString* str = static_cast - (value); - return QString(*str); - } +QString +stringValue(QString* value) { + QString* str = static_cast(value); + return QString(*str); +} - QString - stringValue(qint32 value) { - return QString::number(value); - } +QString +stringValue(qint32 value) { + return QString::number(value); +} - QString - stringValue(qint64 value) { - return QString::number(value); - } +QString +stringValue(qint64 value) { + return QString::number(value); +} - QString - stringValue(bool value) { - return QString(value ? "true" : "false"); - } - } /* namespace Swagger */ +QString +stringValue(bool value) { + return QString(value ? "true" : "false"); +} +} /* namespace Swagger */ diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache index 52bba0455bc4..3a02c0952d55 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache @@ -1,20 +1,17 @@ #ifndef SWGHELPERS_H #define SWGHELPERS_H -#include - +#include - namespace Swagger { +namespace Swagger { void setValue(void* value, QJsonValue obj, QString type, QString complexType); - void toJsonArray(QList - * value, QJsonArray* output, QString innerName, QString innerType); + void toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType); void toJsonValue(QString name, void* value, QJsonObject* output, QString type); bool isCompatibleJsonValue(QString type); QString stringValue(QString* value); QString stringValue(qint32 value); QString stringValue(qint64 value); QString stringValue(bool value); - } +} - #endif // SWGHELPERS_H +#endif // SWGHELPERS_H diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache index 641457082c34..705cb8521086 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache @@ -1,114 +1,109 @@ {{#models}}{{#model}} - #include "{{classname}}.h" +#include "{{classname}}.h" - #include "SWGHelpers.h" +#include "SWGHelpers.h" - #include - - #include - - #include - - #include - +#include +#include +#include +#include - namespace Swagger { +namespace Swagger { - {{classname}}::{{classname}}(QString* json) { - init(); - this->fromJson(*json); - } +{{classname}}::{{classname}}(QString* json) { + init(); + this->fromJson(*json); +} - {{classname}}::{{classname}}() { - init(); - } +{{classname}}::{{classname}}() { + init(); +} - {{classname}}::~{{classname}}() { - this->cleanup(); - } +{{classname}}::~{{classname}}() { + this->cleanup(); +} - void - {{classname}}::init() { +void +{{classname}}::init() { {{#vars}}{{name}} = {{{defaultValue}}}; {{/vars}} - } +} - void - {{classname}}::cleanup() { +void +{{classname}}::cleanup() { {{#vars}}{{#complexType}}if({{name}} != NULL) { - {{#isContainer}}QList<{{complexType}}*>* arr = {{name}}; + {{#isContainer}}QList<{{complexType}}*>* arr = {{name}}; foreach({{complexType}}* o, *arr) { - delete o; + delete o; } - {{/isContainer}}delete {{name}}; - }{{/complexType}} + {{/isContainer}}delete {{name}}; + }{{/complexType}} {{/vars}} - } +} - {{classname}}* - {{classname}}::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; - } +{{classname}}* +{{classname}}::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} - void - {{classname}}::fromJsonObject(QJsonObject &pJson) { +void +{{classname}}::fromJsonObject(QJsonObject &pJson) { {{#vars}}setValue(&{{name}}, pJson["{{name}}"], "{{baseType}}", "{{complexType}}"); {{/vars}} - } +} - QString - {{classname}}::asJson () - { - QJsonObject* obj = this->asJsonObject(); +QString +{{classname}}::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); - } - - QJsonObject* - {{classname}}::asJsonObject() { - QJsonObject* obj = new QJsonObject(); +QJsonObject* +{{classname}}::asJsonObject() { + QJsonObject* obj = new QJsonObject(); {{#vars}}{{#complexType}} - {{^isContainer}}{{#complexType}} - toJsonValue(QString("{{name}}"), {{name}}, obj, QString("{{complexType}}")); - {{/complexType}}{{^complexType}} - else if({{name}} != NULL && *{{name}} != NULL) { - obj->insert("{{name}}", QJsonValue(*{{name}})); - }{{/complexType}} - {{/isContainer}}{{#isContainer}} - QList<{{complexType}}*>* {{name}}List = {{name}}; - QJsonArray {{name}}JsonArray; - toJsonArray((QList - *){{name}}, &{{name}}JsonArray, "{{name}}", "{{complexType}}"); + {{^isContainer}}{{#complexType}} + toJsonValue(QString("{{name}}"), {{name}}, obj, QString("{{complexType}}")); + {{/complexType}}{{^complexType}} + else if({{name}} != NULL && *{{name}} != NULL) { + obj->insert("{{name}}", QJsonValue(*{{name}})); + }{{/complexType}} + {{/isContainer}}{{#isContainer}} + QList<{{complexType}}*>* {{name}}List = {{name}}; + QJsonArray {{name}}JsonArray; + toJsonArray((QList*){{name}}, &{{name}}JsonArray, "{{name}}", "{{complexType}}"); - obj->insert("{{name}}", {{name}}JsonArray); - {{/isContainer}} + obj->insert("{{name}}", {{name}}JsonArray); + {{/isContainer}} {{/complexType}}{{^complexType}}obj->insert("{{name}}", QJsonValue({{name}}));{{/complexType}} {{/vars}} - return obj; - } + return obj; +} - {{#vars}} - {{{datatype}}} - {{classname}}::{{getter}}() { - return {{name}}; - } - void - {{classname}}::{{setter}}({{{datatype}}} {{name}}) { - this->{{name}} = {{name}}; - } +{{#vars}} +{{{datatype}}} +{{classname}}::{{getter}}() { + return {{name}}; +} +void +{{classname}}::{{setter}}({{{datatype}}} {{name}}) { + this->{{name}} = {{name}}; +} - {{/vars}} +{{/vars}} - } /* namespace Swagger */ +} /* namespace Swagger */ {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/model-header.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/model-header.mustache index 7a63ce9564a0..7b0b6cdcc1b1 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/model-header.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/model-header.mustache @@ -1,48 +1,47 @@ {{#models}}{{#model}}/* -* {{classname}}.h -* -* {{description}} -*/ + * {{classname}}.h + * + * {{description}} + */ #ifndef {{classname}}_H_ #define {{classname}}_H_ -#include - +#include {{/model}}{{/models}} {{#imports}}{{{import}}} {{/imports}} - #include "SWGObject.h" +#include "SWGObject.h" {{#models}}{{#model}} - namespace Swagger { +namespace Swagger { - class {{classname}}: public SWGObject { - public: +class {{classname}}: public SWGObject { +public: {{classname}}(); {{classname}}(QString* json); - virtual ~{{classname}}(); - void init(); - void cleanup(); + virtual ~{{classname}}(); + void init(); + void cleanup(); - QString asJson (); - QJsonObject* asJsonObject(); - void fromJsonObject(QJsonObject &json); + QString asJson (); + QJsonObject* asJsonObject(); + void fromJsonObject(QJsonObject &json); {{classname}}* fromJson(QString &jsonString); {{#vars}}{{{datatype}}} {{getter}}(); - void {{setter}}({{{datatype}}} {{name}}); + void {{setter}}({{{datatype}}} {{name}}); {{/vars}} - private: +private: {{#vars}}{{{datatype}}} {{name}}; {{/vars}} - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* {{classname}}_H_ */ +#endif /* {{classname}}_H_ */ {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/model.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/model.mustache index de2eb05066a4..1a2a831f5ac2 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/model.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/model.mustache @@ -1,62 +1,58 @@ {{#models}}{{#model}}/* -* {{classname}}.h -* -* {{description}} -*/ + * {{classname}}.h + * + * {{description}} + */ #ifndef {{classname}}_H_ #define {{classname}}_H_ -#include - - #include - - #include - - #include - - #include "{{prefix}}Helpers.h" - #include "{{prefix}}Object.h" +#include +#include +#include +#include +#include "{{prefix}}Helpers.h" +#include "{{prefix}}Object.h" - using namespace Tizen::Web::Json; +using namespace Tizen::Web::Json; {{/model}}{{/models}} {{#imports}}{{{import}}} {{/imports}} {{#models}}{{#model}} - namespace Swagger { +namespace Swagger { - class {{classname}}: public {{prefix}}Object { - public: +class {{classname}}: public {{prefix}}Object { +public: {{classname}}(); {{classname}}(String* json); - virtual ~{{classname}}(); + virtual ~{{classname}}(); - void init(); + void init(); - void cleanup(); + void cleanup(); - String asJson (); + String asJson (); - JsonObject* asJsonObject(); + JsonObject* asJsonObject(); - void fromJsonObject(IJsonValue* json); + void fromJsonObject(IJsonValue* json); {{classname}}* fromJson(String* obj); {{#vars}} - {{datatype}} {{getter}}(); - void {{setter}}({{datatype}} {{name}}); + {{datatype}} {{getter}}(); + void {{setter}}({{datatype}} {{name}}); {{/vars}} - private: +private: {{#vars}}{{datatype}} {{name}}; {{/vars}} - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* {{classname}}_H_ */ +#endif /* {{classname}}_H_ */ {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/modelFactory.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/modelFactory.mustache index 3a29a7ad1f5d..4ec9e6f74113 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/modelFactory.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/modelFactory.mustache @@ -2,29 +2,28 @@ #define ModelFactory_H_ {{#models}}{{#model}} - #include "{{classname}}.h"{{/model}}{{/models}} +#include "{{classname}}.h"{{/model}}{{/models}} namespace Swagger { -inline void* create(QString type) { -{{#models}}{{#model}}if(QString("{{classname}}").compare(type) == 0) { -return new {{classname}}(); -} -{{/model}}{{/models}} -return NULL; -} + inline void* create(QString type) { + {{#models}}{{#model}}if(QString("{{classname}}").compare(type) == 0) { + return new {{classname}}(); + } + {{/model}}{{/models}} + return NULL; + } -inline void* create(QString json, QString type) { -void* val = create(type); -if(val != NULL) { -SWGObject* obj = static_cast -(val); -return obj->fromJson(json); -} -if(type.startsWith("QString")) { -return new QString(); -} -return NULL; -} + inline void* create(QString json, QString type) { + void* val = create(type); + if(val != NULL) { + SWGObject* obj = static_cast(val); + return obj->fromJson(json); + } + if(type.startsWith("QString")) { + return new QString(); + } + return NULL; + } } /* namespace Swagger */ #endif /* ModelFactory_H_ */ diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/object.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/object.mustache index f4194b685787..62914cb51626 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/object.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/object.mustache @@ -1,25 +1,24 @@ #ifndef _{{prefix}}_OBJECT_H_ #define _{{prefix}}_OBJECT_H_ -#include - +#include - class {{prefix}}Object { - public: +class {{prefix}}Object { + public: virtual QJsonObject* asJsonObject() { - return NULL; + return NULL; } virtual ~SWGObject() {} virtual SWGObject* fromJson(QString &jsonString) { - Q_UNUSED(jsonString); - return NULL; + Q_UNUSED(jsonString); + return NULL; } virtual void fromJsonObject(QJsonObject &json) { - Q_UNUSED(json); + Q_UNUSED(json); } virtual QString asJson() { - return QString(""); + return QString(""); } - }; +}; - #endif /* _{{prefix}}_OBJECT_H_ */ +#endif /* _{{prefix}}_OBJECT_H_ */ From eee86858473abbb73dccf25f98595c6a16a8e587 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:47:18 +0800 Subject: [PATCH 19/41] rollback flash template --- .../resources/flash/AirExecutorApp-app.xml | 208 +++++------ .../main/resources/flash/ApiClientEvent.as | 17 +- .../src/main/resources/flash/ApiError.as | 15 +- .../src/main/resources/flash/ApiErrorCodes.as | 64 ++-- .../src/main/resources/flash/ApiInvoker.as | 340 ++++++++++-------- .../src/main/resources/flash/ApiUrlHelper.as | 12 +- .../resources/flash/ApiUserCredentials.as | 66 ++-- .../src/main/resources/flash/ListWrapper.as | 14 +- .../src/main/resources/flash/Response.as | 65 ++-- .../src/main/resources/flash/SwaggerApi.as | 134 +++---- .../src/main/resources/flash/XMLWriter.as | 50 +-- .../src/main/resources/flash/api.mustache | 32 +- .../src/main/resources/flash/facetValue.as | 8 +- .../src/main/resources/flash/model.mustache | 48 +-- .../main/resources/flash/modelList.mustache | 14 +- 15 files changed, 579 insertions(+), 508 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/flash/AirExecutorApp-app.xml b/modules/swagger-codegen/src/main/resources/flash/AirExecutorApp-app.xml index 1eb5e43c7d70..1dbaf98e6443 100644 --- a/modules/swagger-codegen/src/main/resources/flash/AirExecutorApp-app.xml +++ b/modules/swagger-codegen/src/main/resources/flash/AirExecutorApp-app.xml @@ -1,87 +1,87 @@ - - minimumPatchLevel - The minimum patch level of the AIR runtime required to run - the application. Optional. - --> + + AirExecutorApp - - AirExecutorApp + + AirExecutorApp - - AirExecutorApp + + AirExecutorApp - - AirExecutorApp + + v1 - - v1 + + - - + + - - + + - - + + + + + AirExecutorApp.swf + + + - - - - - AirExecutorApp.swf + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - + + + @@ -90,57 +90,57 @@ - - + + - - + + - - + + - - + + + + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/modules/swagger-codegen/src/main/resources/flash/ApiClientEvent.as b/modules/swagger-codegen/src/main/resources/flash/ApiClientEvent.as index f25f4563c074..d64cd304d49c 100644 --- a/modules/swagger-codegen/src/main/resources/flash/ApiClientEvent.as +++ b/modules/swagger-codegen/src/main/resources/flash/ApiClientEvent.as @@ -1,10 +1,14 @@ package io.swagger.event { +import io.swagger.event.Response; + +import flash.events.Event; + /** * Event dispatched by the SDK to communicate success events and failure events. * If a custom dispatcher has been assigned by the consumer on the generated client then the dispatcher dispatches * the ApiClientEvent to indicate success or failure of the invocation using the Response */ -public class ApiClientEvent extends Event { +public class ApiClientEvent extends Event{ /** * Event type to indicate a unsuccessful invocation @@ -15,17 +19,18 @@ public class ApiClientEvent extends Event { * Event type to indicate a successful invocation */ public static const SUCCESS_EVENT:String = "successfulInvocation"; - - public function ApiClientEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false) { - super(type, bubbles, cancelable); - } + /** * The Response object which contains response info */ - public var response:Response; + public var response: Response; /** * Any additional info */ public var message:String; + + public function ApiClientEvent(type:String,bubbles:Boolean = false,cancelable:Boolean = false) { + super(type, bubbles, cancelable); + } } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flash/ApiError.as b/modules/swagger-codegen/src/main/resources/flash/ApiError.as index 7734d7f99799..c8ac95a5c59c 100644 --- a/modules/swagger-codegen/src/main/resources/flash/ApiError.as +++ b/modules/swagger-codegen/src/main/resources/flash/ApiError.as @@ -1,7 +1,10 @@ -package io.swagger.exception { -public class ApiError extends Error { - public function ApiError(id:* = 0, message:* = "") { - super(message, id); - } -} +package io.swagger.exception +{ + public class ApiError extends Error + { + public function ApiError(id:*=0, message:*="") + { + super(message,id); + } + } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flash/ApiErrorCodes.as b/modules/swagger-codegen/src/main/resources/flash/ApiErrorCodes.as index 9236e40acbcc..e5ea46480aa5 100644 --- a/modules/swagger-codegen/src/main/resources/flash/ApiErrorCodes.as +++ b/modules/swagger-codegen/src/main/resources/flash/ApiErrorCodes.as @@ -1,32 +1,34 @@ -package io.swagger.exception { -public class ApiErrorCodes { - /** - * System exception. - */ - public static const SYSTEM_EXCEPTION:Number = 0; - - /** - * With Arguments as current key. - */ - public static const API_KEY_NOT_VALID:Number = 1000; - /** - * With arguments as current token value - */ - public static const AUTH_TOKEN_NOT_VALID:Number = 1001; - /** - * With arguments as input JSON and output class anme - */ - public static const ERROR_CONVERTING_JSON_TO_JAVA:Number = 1002; - /** - * With arguments as JAVA class name - */ - public static const ERROR_CONVERTING_JAVA_TO_JSON:Number = 1003; - - public static const ERROR_FROM_WEBSERVICE_CALL:Number = 1004; - /** - * With arguments as current API server name - */ - public static const API_SERVER_NOT_VALID:Number = 1005; - -} +package io.swagger.exception +{ + public class ApiErrorCodes + { + /** + * System exception. + */ + public static const SYSTEM_EXCEPTION: Number = 0; + + /** + * With Arguments as current key. + */ + public static const API_KEY_NOT_VALID: Number = 1000; + /** + * With arguments as current token value + */ + public static const AUTH_TOKEN_NOT_VALID: Number = 1001; + /** + * With arguments as input JSON and output class anme + */ + public static const ERROR_CONVERTING_JSON_TO_JAVA: Number = 1002; + /** + * With arguments as JAVA class name + */ + public static const ERROR_CONVERTING_JAVA_TO_JSON: Number = 1003; + + public static const ERROR_FROM_WEBSERVICE_CALL: Number = 1004; + /** + * With arguments as current API server name + */ + public static const API_SERVER_NOT_VALID: Number = 1005; + + } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flash/ApiInvoker.as b/modules/swagger-codegen/src/main/resources/flash/ApiInvoker.as index 98d94052ec43..897b95a4f6e3 100644 --- a/modules/swagger-codegen/src/main/resources/flash/ApiInvoker.as +++ b/modules/swagger-codegen/src/main/resources/flash/ApiInvoker.as @@ -1,17 +1,50 @@ -package io.swagger.common { +package io.swagger.common +{ +import asaxb.xml.bind.ASAXBContext; +import asaxb.xml.bind.Unmarshaller; + import io.swagger.event.ApiClientEvent; import io.swagger.event.Response; +import io.swagger.common.ApiUserCredentials; -public class ApiInvoker extends EventDispatcher { +import flash.events.EventDispatcher; +import flash.utils.Dictionary; +import flash.utils.describeType; +import flash.xml.XMLDocument; +import flash.xml.XMLNode; + +import mx.messaging.ChannelSet; +import mx.messaging.channels.HTTPChannel; +import mx.messaging.messages.HTTPRequestMessage; +import mx.rpc.AsyncToken; +import mx.rpc.events.FaultEvent; +import mx.rpc.events.ResultEvent; +import mx.rpc.http.HTTPService; +import mx.rpc.xml.SimpleXMLEncoder; +import mx.utils.ObjectUtil; + + +public class ApiInvoker extends EventDispatcher +{ + + private var _apiUsageCredentials:ApiUserCredentials; + internal var _apiProxyServerUrl:String = ""; + private var _baseUrl: String = ""; + internal var _useProxyServer: Boolean = true; + private var _proxyHostName:String = ""; + private var _apiPath: String = ""; + private var _proxyPath: String = ""; + + public var _apiEventNotifier:EventDispatcher; private static const DELETE_DATA_DUMMY:String = "dummyDataRequiredForDeleteOverride"; private static const X_HTTP_OVERRIDE_KEY:String = "X-HTTP-Method-Override"; private static const CONTENT_TYPE_HEADER_KEY:String = "Content-Type"; - public function ApiInvoker(apiUsageCredentials:ApiUserCredentials, eventNotifier:EventDispatcher, useProxy:Boolean = true) { + public function ApiInvoker(apiUsageCredentials: ApiUserCredentials, eventNotifier: EventDispatcher, useProxy: Boolean = true) { _apiUsageCredentials = apiUsageCredentials; _useProxyServer = useProxy; - if (_apiUsageCredentials.hostName != null) { + if(_apiUsageCredentials.hostName != null){ _proxyHostName = _apiUsageCredentials.hostName; } _apiPath = _apiUsageCredentials.apiPath; @@ -19,33 +52,25 @@ public class ApiInvoker extends EventDispatcher { _apiProxyServerUrl = _apiUsageCredentials.apiProxyServerUrl; _apiEventNotifier = eventNotifier; } - public var _apiEventNotifier:EventDispatcher; - internal var _apiProxyServerUrl:String = ""; - internal var _useProxyServer:Boolean = true; - private var _apiUsageCredentials:ApiUserCredentials; - private var _baseUrl:String = ""; - private var _proxyHostName:String = ""; - private var _apiPath:String = ""; - private var _proxyPath:String = ""; - public function invokeAPI(resourceURL:String, method:String, queryParams:Dictionary, postObject:Object, headerParams:Dictionary):AsyncToken { + public function invokeAPI(resourceURL: String, method: String, queryParams: Dictionary, postObject: Object, headerParams: Dictionary): AsyncToken { //make the communication - if (_useProxyServer) { + if(_useProxyServer) { resourceURL = _apiProxyServerUrl + resourceURL; } - else { - resourceURL = "http://" + _proxyHostName + _apiPath + resourceURL; + else{ + resourceURL = "http://"+ _proxyHostName + _apiPath + resourceURL; } - var counter:int = 0; - var symbol:String = "&"; - var paramValue:Object; + var counter: int = 0; + var symbol: String = "&"; + var paramValue: Object; for (var paramName:String in queryParams) { paramValue = queryParams[paramName]; //var key:String = paramName; // do stuff symbol = "&"; - if (counter == 0) { + if(counter == 0){ symbol = "?"; } resourceURL = resourceURL + symbol + paramName + "=" + paramValue.toString(); @@ -55,8 +80,8 @@ public class ApiInvoker extends EventDispatcher { // trace(resourceURL); //create a httpservice and invoke the rest url waiting for response var requestHeader:Object = new Object(); - if (headerParams != null) { - for (var key:String in headerParams) { + if(headerParams != null) { + for(var key: String in headerParams) { requestHeader[key] = headerParams[key]; } } @@ -70,18 +95,131 @@ public class ApiInvoker extends EventDispatcher { } + private function doRestCall( url : String, resultFunction : Function, faultFunction : Function = null, + restMethod : String = "GET", + bodyData : Object = null, headers: Object = null, contentType:String = "application/xml" ) : AsyncToken + { + var httpService : HTTPService = new HTTPService( ); + + if(headers == null){ + headers = new Object(); + } + httpService.method = restMethod; + + if ( restMethod.toUpperCase() != HTTPRequestMessage.GET_METHOD ) + { + //httpService.method = HTTPRequestMessage.POST_METHOD; - not required as we're using the proxy + if( bodyData == null ) + { + bodyData = new Object(); + } + + if(restMethod == HTTPRequestMessage.DELETE_METHOD){ + headers[X_HTTP_OVERRIDE_KEY]= HTTPRequestMessage.DELETE_METHOD; + bodyData = DELETE_DATA_DUMMY; + } + else if(restMethod == HTTPRequestMessage.PUT_METHOD){ + headers[X_HTTP_OVERRIDE_KEY]= HTTPRequestMessage.PUT_METHOD; + } + else{ + headers[CONTENT_TYPE_HEADER_KEY]= contentType; + } + } + else + { + //if the request type is GET and content type is xml then the Flex HTTPService converts it to a POST ... yeah + contentType = null; + } + + httpService.url = url; + httpService.contentType = contentType; + httpService.resultFormat = "e4x"; + httpService.headers = headers; + httpService.addEventListener( ResultEvent.RESULT, resultFunction ); + if( faultFunction != null ) + { + httpService.addEventListener( FaultEvent.FAULT, faultFunction ); + } + if(_useProxyServer){ + httpService.useProxy = true; + + var channelSet: ChannelSet = new ChannelSet(); + var httpChannel: HTTPChannel = new HTTPChannel(); + httpChannel.uri = ApiUrlHelper.getProxyUrl(_proxyHostName, _proxyPath); + channelSet.addChannel(httpChannel); + httpService.channelSet = channelSet; + } + + return httpService.send( bodyData ); + } + + private function onApiRequestResult(event:ResultEvent):void + { + var completionListener: Function = event.token.completionListener; + var result: Object = event.result; + var resultType: Class = event.token.returnType; + var resultObject:Object; + if(resultType != null) { + var context:ASAXBContext = ASAXBContext.newInstance(resultType); + var unmarshaller:Unmarshaller = context.createUnmarshaller(); + var resultXML: XML = new XML(event.result); + try{ + resultObject = unmarshaller.unmarshal(resultXML); + } + catch(error: TypeError){ + var errorResponse: Response = new Response(false, null, "Could not unmarshall response"); + if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher + var failureEvent: ApiClientEvent = new ApiClientEvent(event.token.completionEventType); + failureEvent.response = errorResponse; + _apiEventNotifier.dispatchEvent(failureEvent); + } + } + + if(resultObject is ListWrapper){ + resultObject = ListWrapper(resultObject).getList(); + } + } + + var response : Response = new Response(true, resultObject); + response.requestId = event.token.requestId; + var successEventType: String = event.token.completionEventType != null ? event.token.completionEventType : ApiClientEvent.SUCCESS_EVENT; + + if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher + var successEvent: ApiClientEvent = new ApiClientEvent(successEventType); + successEvent.response = response; + _apiEventNotifier.dispatchEvent(successEvent); + } + } + + private function onApiRequestFault(event:FaultEvent):void + { + var completionListener: Function = event.token.completionListener; + if(completionListener != null){ + completionListener.call( null, new Response( false, null, event.fault.faultString) ); + } + + var failureEventType: String = event.token.completionEventType != null ? event.token.completionEventType : ApiClientEvent.FAILURE_EVENT; + + if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher + var failureEvent: ApiClientEvent = new ApiClientEvent(failureEventType); + failureEvent.response = new Response( false, null, event.fault.faultString); + _apiEventNotifier.dispatchEvent(failureEvent); + } + } + + public function marshal(source:Object):Object { // trace("marshal got - " + source) - if (source is String) { + if(source is String) { return source; - } else if (source is Array && source.length > 0) { - var writer:XMLWriter = new XMLWriter(); - var sourceArray:Array = source as Array; - var arrayEnclosure:String = getArrayEnclosure(sourceArray); + } else if(source is Array && source.length > 0) { + var writer:XMLWriter=new XMLWriter(); + var sourceArray: Array = source as Array; + var arrayEnclosure: String = getArrayEnclosure(sourceArray); writer.xml.setName(arrayEnclosure); for (var i:int = 0; i < sourceArray.length; i++) { - var o:Object = sourceArray[i]; + var o: Object = sourceArray[i]; writer.xml.appendChild(marshal(o)); } return writer.xml; @@ -89,23 +227,24 @@ public class ApiInvoker extends EventDispatcher { return marshalObject(source); } - public function marshalObject(source:Object):XML { - var writer:XMLWriter = new XMLWriter(); - var objDescriptor:XML = describeType(source); + public function marshalObject(source:Object):XML + { + var writer:XMLWriter=new XMLWriter(); + var objDescriptor:XML=describeType(source); var property:XML; var propertyType:String; var propertyValue:Object; - var qualifiedClassName:String = objDescriptor.@name; - qualifiedClassName = qualifiedClassName.replace("::", "."); - var className:String = qualifiedClassName.substring(qualifiedClassName.lastIndexOf(".") + 1); + var qualifiedClassName:String=objDescriptor.@name; + qualifiedClassName=qualifiedClassName.replace("::","."); + var className: String = qualifiedClassName.substring(qualifiedClassName.lastIndexOf(".") + 1); className = className().toLowerCase() + className.substring(1); writer.xml.setName(className); - for each(property in objDescriptor.elements("variable")) { - propertyValue = source[property.@name]; - if (propertyValue != null) { - if (ObjectUtil.isSimple(propertyValue)) { + for each(property in objDescriptor.elements("variable")){ + propertyValue=source[property.@name]; + if (propertyValue!=null){ + if (ObjectUtil.isSimple(propertyValue)){ writer.addProperty(property.@name, propertyValue.toString()); } else { @@ -113,13 +252,13 @@ public class ApiInvoker extends EventDispatcher { } } } - for each(property in objDescriptor.elements("accessor")) { - if (property.@access == "readonly") { + for each(property in objDescriptor.elements("accessor")){ + if (property.@access=="readonly"){ continue; } - propertyValue = source[property.@name]; - if (source[property.@name] != null) { - if (ObjectUtil.isSimple(propertyValue)) { + propertyValue=source[property.@name]; + if (source[property.@name]!=null){ + if (ObjectUtil.isSimple(propertyValue)){ writer.addProperty(property.@name, propertyValue.toString()); } else { @@ -130,119 +269,14 @@ public class ApiInvoker extends EventDispatcher { return writer.xml; } - public function escapeString(str:String):String { + public function escapeString(str: String): String { return str; } - private function doRestCall(url:String, resultFunction:Function, faultFunction:Function = null, - restMethod:String = "GET", - bodyData:Object = null, headers:Object = null, contentType:String = "application/xml"):AsyncToken { - var httpService:HTTPService = new HTTPService(); - - if (headers == null) { - headers = new Object(); - } - httpService.method = restMethod; - - if (restMethod.toUpperCase() != HTTPRequestMessage.GET_METHOD) { - //httpService.method = HTTPRequestMessage.POST_METHOD; - not required as we're using the proxy - if (bodyData == null) { - bodyData = new Object(); - } - - if (restMethod == HTTPRequestMessage.DELETE_METHOD) { - headers[X_HTTP_OVERRIDE_KEY] = HTTPRequestMessage.DELETE_METHOD; - bodyData = DELETE_DATA_DUMMY; - } - else if (restMethod == HTTPRequestMessage.PUT_METHOD) { - headers[X_HTTP_OVERRIDE_KEY] = HTTPRequestMessage.PUT_METHOD; - } - else { - headers[CONTENT_TYPE_HEADER_KEY] = contentType; - } - } - else { - //if the request type is GET and content type is xml then the Flex HTTPService converts it to a POST ... yeah - contentType = null; - } - - httpService.url = url; - httpService.contentType = contentType; - httpService.resultFormat = "e4x"; - httpService.headers = headers; - httpService.addEventListener(ResultEvent.RESULT, resultFunction); - if (faultFunction != null) { - httpService.addEventListener(FaultEvent.FAULT, faultFunction); - } - if (_useProxyServer) { - httpService.useProxy = true; - - var channelSet:ChannelSet = new ChannelSet(); - var httpChannel:HTTPChannel = new HTTPChannel(); - httpChannel.uri = ApiUrlHelper.getProxyUrl(_proxyHostName, _proxyPath); - channelSet.addChannel(httpChannel); - httpService.channelSet = channelSet; - } - - return httpService.send(bodyData); - } - - private function onApiRequestResult(event:ResultEvent):void { - var completionListener:Function = event.token.completionListener; - var result:Object = event.result; - var resultType:Class = event.token.returnType; - var resultObject:Object; - if (resultType != null) { - var context:ASAXBContext = ASAXBContext.newInstance(resultType); - var unmarshaller:Unmarshaller = context.createUnmarshaller(); - var resultXML:XML = new XML(event.result); - try { - resultObject = unmarshaller.unmarshal(resultXML); - } - catch (error:TypeError) { - var errorResponse:Response = new Response(false, null, "Could not unmarshall response"); - if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher - var failureEvent:ApiClientEvent = new ApiClientEvent(event.token.completionEventType); - failureEvent.response = errorResponse; - _apiEventNotifier.dispatchEvent(failureEvent); - } - } - - if (resultObject is ListWrapper) { - resultObject = ListWrapper(resultObject).getList(); - } - } - - var response:Response = new Response(true, resultObject); - response.requestId = event.token.requestId; - var successEventType:String = event.token.completionEventType != null ? event.token.completionEventType : ApiClientEvent.SUCCESS_EVENT; - - if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher - var successEvent:ApiClientEvent = new ApiClientEvent(successEventType); - successEvent.response = response; - _apiEventNotifier.dispatchEvent(successEvent); - } - } - - private function onApiRequestFault(event:FaultEvent):void { - var completionListener:Function = event.token.completionListener; - if (completionListener != null) { - completionListener.call(null, new Response(false, null, event.fault.faultString)); - } - - var failureEventType:String = event.token.completionEventType != null ? event.token.completionEventType : ApiClientEvent.FAILURE_EVENT; - - if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher - var failureEvent:ApiClientEvent = new ApiClientEvent(failureEventType); - failureEvent.response = new Response(false, null, event.fault.faultString); - _apiEventNotifier.dispatchEvent(failureEvent); - } - } - - private function getArrayEnclosure(arr:Array):String { - if (arr != null && arr.length > 0) { - var className:String = flash.utils.getQualifiedClassName(arr[0]) - if (className.indexOf("::") > 0) + private function getArrayEnclosure(arr: Array) : String { + if(arr != null && arr.length > 0) { + var className: String = flash.utils.getQualifiedClassName(arr[0]) + if(className.indexOf("::") > 0) className = className.substr(className.indexOf("::") + 2, className.length) return className.substring(0, 1).toLowerCase() + className.substring(1, className.length) + "s"; diff --git a/modules/swagger-codegen/src/main/resources/flash/ApiUrlHelper.as b/modules/swagger-codegen/src/main/resources/flash/ApiUrlHelper.as index 57c5bc00819a..4333c6c7e4ca 100644 --- a/modules/swagger-codegen/src/main/resources/flash/ApiUrlHelper.as +++ b/modules/swagger-codegen/src/main/resources/flash/ApiUrlHelper.as @@ -1,4 +1,6 @@ package io.swagger.common { +import io.swagger.common.ApiUserCredentials; + /** * @private * Internal class for the Rest client @@ -10,17 +12,17 @@ internal class ApiUrlHelper { private static const HTTP_URL_PREFIX:String = "http://"; - internal static function appendTokenInfo(restUrl:String, requestHeader:Object, credentials:ApiUserCredentials):String { + internal static function appendTokenInfo(restUrl:String, requestHeader: Object, credentials: ApiUserCredentials): String { //checks for the presence api credentials on client initialization and not repeated here - if (restUrl.indexOf("?") == -1) { + if(restUrl.indexOf("?") == -1){ restUrl += ( "?" + API_URL_KEY + "=" + credentials.apiToken ); } - else { + else{ restUrl += ( "&" + API_URL_KEY + "=" + credentials.apiToken ); } requestHeader.api_key = credentials.apiToken; - if (credentials.authToken != null && credentials.authToken != "") { + if(credentials.authToken != null && credentials.authToken != ""){ restUrl += ( "&" + AUTH_TOKEN_URL_KEY + "=" + credentials.authToken ); requestHeader.auth_token = credentials.authToken; } @@ -28,7 +30,7 @@ internal class ApiUrlHelper { return restUrl; } - internal static function getProxyUrl(hostName:String, proxyPath:String):String { + internal static function getProxyUrl(hostName: String, proxyPath: String): String{ if (hostName(hostName.length - 1) == "/") //remove trailing slash { hostName = hostName.substring(0, hostName.length - 1); diff --git a/modules/swagger-codegen/src/main/resources/flash/ApiUserCredentials.as b/modules/swagger-codegen/src/main/resources/flash/ApiUserCredentials.as index 8e03c99a17f0..118d917a2470 100644 --- a/modules/swagger-codegen/src/main/resources/flash/ApiUserCredentials.as +++ b/modules/swagger-codegen/src/main/resources/flash/ApiUserCredentials.as @@ -5,24 +5,6 @@ package io.swagger.common { * */ public class ApiUserCredentials { - /** - * Constructor of ApiUserCredentials - * @param apiToken An apitoken that is passed along with the requests - * @param authToken A valid auth_token which could necessary for certain operations - * @param hostName The host name for the Rest API eg. api.companyName.com - * @param userId The userId which is required for certain operations - currently, get user lists - */ - public function ApiUserCredentials(hostName:String, apiPath:String, apiToken:String, - authToken:String = null, userId:Number = -1, apiProxyServerUrl:String = "", - proxyPath:String = null) { - this.hostName = hostName; - this.apiToken = apiToken; - this.authToken = authToken; - this.userId = userId; - this.apiPath = apiPath; - this.apiProxyServerUrl = apiProxyServerUrl; - this.proxyPath = proxyPath; - } /** * An apitoken that is passed along with the requests */ @@ -39,21 +21,43 @@ public class ApiUserCredentials { * The host name for the Rest API eg. api.companyName.com */ public var hostName:String; + + /** + * The base path to the api resources - used along with the hostname + * eg. /v4 + */ + public var apiPath: String; + + /** + * The base path to the blazeds proxy + * eg. /v4/messagebroker/restproxy + */ + public var proxyPath: String; + + /** + * If a proxy server has been set up for the services specify the URL here. This value is used when the Api is invoked with + * the value useProxy as true + */ + public var apiProxyServerUrl: String; + /** - * The base path to the api resources - used along with the hostname - * eg. /v4 + * Constructor of ApiUserCredentials + * @param apiToken An apitoken that is passed along with the requests + * @param authToken A valid auth_token which could necessary for certain operations + * @param hostName The host name for the Rest API eg. api.companyName.com + * @param userId The userId which is required for certain operations - currently, get user lists */ - public var apiPath:String; - /** - * The base path to the blazeds proxy - * eg. /v4/messagebroker/restproxy - */ - public var proxyPath:String; - /** - * If a proxy server has been set up for the services specify the URL here. This value is used when the Api is invoked with - * the value useProxy as true - */ - public var apiProxyServerUrl:String; + public function ApiUserCredentials(hostName: String, apiPath: String, apiToken: String, + authToken: String = null, userId: Number = -1, apiProxyServerUrl: String="", + proxyPath: String = null) { + this.hostName = hostName; + this.apiToken = apiToken; + this.authToken = authToken; + this.userId = userId; + this.apiPath = apiPath; + this.apiProxyServerUrl = apiProxyServerUrl; + this.proxyPath = proxyPath; + } } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flash/ListWrapper.as b/modules/swagger-codegen/src/main/resources/flash/ListWrapper.as index 20ac7cb555f7..b22890ad1d1d 100644 --- a/modules/swagger-codegen/src/main/resources/flash/ListWrapper.as +++ b/modules/swagger-codegen/src/main/resources/flash/ListWrapper.as @@ -1,7 +1,9 @@ -package io.swagger.common { -public interface ListWrapper { - - function getList():Array; - -} +package io.swagger.common +{ + public interface ListWrapper + { + + function getList(): Array; + + } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flash/Response.as b/modules/swagger-codegen/src/main/resources/flash/Response.as index b225ab9b6ce9..a43b7980a38b 100644 --- a/modules/swagger-codegen/src/main/resources/flash/Response.as +++ b/modules/swagger-codegen/src/main/resources/flash/Response.as @@ -6,47 +6,50 @@ package io.swagger.event { */ public class Response { + /** + * Indicates whether the invoked operation failed or succeeded + */ + public var isSuccess:Boolean; + + /** + * The payload of the succesful operation eg. a Word in a WordRequest + */ + public var payload:Object; + + /** + * Error message in case of failure + */ + public var errorMessage:String; + + /** + * A request Id that was passed in by the user as a param when invoking the operation + */ + public var requestId:String; private static const API_ERROR_MSG:String = "Api error response: "; - private static function getFriendlyMessage(errorMessage:String):String { - var result:String = errorMessage; - if (errorMessage == null) + public function Response(isSuccessful: Boolean, payload: Object = null, errorMessage: String = null, requestId: String = null) { + this.isSuccess = isSuccessful; + this.payload = payload; + this.errorMessage = getFriendlyMessage(errorMessage); + } + + private static function getFriendlyMessage(errorMessage: String): String{ + var result: String = errorMessage; + if(errorMessage == null) return null; - var errorCode:String; - var errorCodeArray:Array = errorMessage.match(/(?<=HTTP\/1.1 )[0-9][0-9][0-9]/); - if (errorCodeArray != null && errorCodeArray.length == 1) { + var errorCode: String; + var errorCodeArray: Array = errorMessage.match(/(?<=HTTP\/1.1 )[0-9][0-9][0-9]/); + if(errorCodeArray != null && errorCodeArray.length == 1){ errorCode = String(errorCodeArray[0]); } - var msgArray:Array = errorMessage.match(/(?<=HTTP\/1.1 [0-9][0-9][0-9] )[^]*/); - if (msgArray != null && msgArray.length == 1) { + var msgArray: Array = errorMessage.match(/(?<=HTTP\/1.1 [0-9][0-9][0-9] )[^]*/); + if(msgArray != null && msgArray.length == 1){ result = API_ERROR_MSG + String(msgArray[0]); } return result; } - public function Response(isSuccessful:Boolean, payload:Object = null, errorMessage:String = null, requestId:String = null) { - this.isSuccess = isSuccessful; - this.payload = payload; - this.errorMessage = getFriendlyMessage(errorMessage); - } - /** - * Indicates whether the invoked operation failed or succeeded - */ - public var isSuccess:Boolean; - /** - * The payload of the succesful operation eg. a Word in a WordRequest - */ - public var payload:Object; - /** - * Error message in case of failure - */ - public var errorMessage:String; - /** - * A request Id that was passed in by the user as a param when invoking the operation - */ - public var requestId:String; - - public function toString():String { + public function toString(): String { return "Response (requestId:" + requestId + "; isSuccess:" + isSuccess + "; errorMessage:" + errorMessage + "; payload:" + payload + ")"; } } diff --git a/modules/swagger-codegen/src/main/resources/flash/SwaggerApi.as b/modules/swagger-codegen/src/main/resources/flash/SwaggerApi.as index 23b96ec17f27..059de642a748 100644 --- a/modules/swagger-codegen/src/main/resources/flash/SwaggerApi.as +++ b/modules/swagger-codegen/src/main/resources/flash/SwaggerApi.as @@ -1,63 +1,75 @@ -package io.swagger.common { -public class SwaggerApi extends EventDispatcher { +package io.swagger.common +{ + import io.swagger.common.ApiUserCredentials; + + import flash.events.EventDispatcher; + import flash.events.IEventDispatcher; + + import mx.utils.UIDUtil; + + public class SwaggerApi extends EventDispatcher + { + + protected var _apiUsageCredentials:ApiUserCredentials; + protected var _apiEventNotifier:EventDispatcher; + protected var _apiInvoker: ApiInvoker; + + protected var _useProxyServer: Boolean = false; - /** - * Method for returning the path value - * For a string value an empty value is returned if the value is null - * @param value - * @return - */ - protected static function toPathValue(value:Object):String { - if (value is Array) { - return arrayToPathValue(value as Array); - } - return value == null ? "" : value.toString(); - } - - /** - * Method for returning a path value - * For a list of objects a comma separated string is returned - * @param objects - * @return - */ - protected static function arrayToPathValue(objects:Array):String { - var out:String = ""; - - return objects.join(","); - } - - /** - * Constructor for the api client - * @param apiCredentials Wrapper object for tokens and hostName required towards authentication - * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response - */ - public function SwaggerApi(apiCredentials:ApiUserCredentials, eventDispatcher:EventDispatcher = null) { - super(); - _apiUsageCredentials = apiCredentials; - _apiEventNotifier = eventDispatcher; - } - protected var _apiUsageCredentials:ApiUserCredentials; - protected var _apiEventNotifier:EventDispatcher; - protected var _apiInvoker:ApiInvoker; - protected var _useProxyServer:Boolean = false; - - public function useProxyServer(value:Boolean, proxyServerUrl:String = null):void { - _useProxyServer = value; - } - - protected function getApiInvoker():ApiInvoker { - if (_apiInvoker == null) { - if (_apiEventNotifier == null) { - _apiEventNotifier = this; - } - _apiInvoker = new ApiInvoker(_apiUsageCredentials, _apiEventNotifier, _useProxyServer); - } - return _apiInvoker; - } - - protected function getUniqueId():String { - return UIDUtil.createUID(); - } - -} + + /** + * Constructor for the api client + * @param apiCredentials Wrapper object for tokens and hostName required towards authentication + * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response + */ + public function SwaggerApi(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { + super(); + _apiUsageCredentials = apiCredentials; + _apiEventNotifier = eventDispatcher; + } + + public function useProxyServer(value:Boolean, proxyServerUrl: String = null):void { + _useProxyServer = value; + } + + protected function getApiInvoker():ApiInvoker { + if(_apiInvoker == null){ + if(_apiEventNotifier == null){ + _apiEventNotifier = this; + } + _apiInvoker = new ApiInvoker(_apiUsageCredentials, _apiEventNotifier, _useProxyServer); + } + return _apiInvoker; + } + + protected function getUniqueId():String { + return UIDUtil.createUID(); + } + + /** + * Method for returning the path value + * For a string value an empty value is returned if the value is null + * @param value + * @return + */ + protected static function toPathValue(value: Object): String { + if(value is Array){ + return arrayToPathValue(value as Array); + } + return value == null ? "" : value.toString(); + } + + /** + * Method for returning a path value + * For a list of objects a comma separated string is returned + * @param objects + * @return + */ + protected static function arrayToPathValue(objects: Array): String { + var out: String = ""; + + return objects.join(","); + } + + } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flash/XMLWriter.as b/modules/swagger-codegen/src/main/resources/flash/XMLWriter.as index ec4ab73455b1..0b08066775b9 100644 --- a/modules/swagger-codegen/src/main/resources/flash/XMLWriter.as +++ b/modules/swagger-codegen/src/main/resources/flash/XMLWriter.as @@ -1,24 +1,28 @@ -package io.swagger.common { -public class XMLWriter { - public function XMLWriter() { - xml = ; - } - public var xml:XML; - - public function reset():void { - xml = new XML(); - } - - public function addProperty(propertyName:String, propertyValue:String):XML { - var xmlProperty:XML = - xmlProperty.setName(propertyName); - xmlProperty.appendChild(propertyValue); - xml.appendChild(xmlProperty); - return xmlProperty; - } - - public function addAttribute(propertyName:String, attribute:String, attributeValue:String):void { - xml.elements(propertyName)[0].@[attribute] = attributeValue; - } -} +package io.swagger.common +{ + public class XMLWriter + { + public var xml:XML; + + public function XMLWriter() + { + xml=; + } + + public function reset():void { + xml=new XML(); + } + + public function addProperty(propertyName:String, propertyValue:String):XML { + var xmlProperty:XML= + xmlProperty.setName(propertyName); + xmlProperty.appendChild(propertyValue); + xml.appendChild(xmlProperty); + return xmlProperty; + } + + public function addAttribute(propertyName:String, attribute:String, attributeValue:String):void { + xml.elements(propertyName)[0].@[attribute]=attributeValue; + } + } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flash/api.mustache b/modules/swagger-codegen/src/main/resources/flash/api.mustache index b00f2ee2c8a8..b1f11e92438b 100644 --- a/modules/swagger-codegen/src/main/resources/flash/api.mustache +++ b/modules/swagger-codegen/src/main/resources/flash/api.mustache @@ -15,26 +15,26 @@ import flash.utils.Dictionary; import flash.events.EventDispatcher; {{#operations}} - public class {{classname}} extends SwaggerApi { +public class {{classname}} extends SwaggerApi { /** * Constructor for the {{classname}} api client * @param apiCredentials Wrapper object for tokens and hostName required towards authentication * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response */ public function {{classname}}(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) { - super(apiCredentials, eventDispatcher); + super(apiCredentials, eventDispatcher); } - {{#operation}} +{{#operation}} public static const event_{{nickname}}: String = "{{nickname}}"; - {{/operation}} +{{/operation}} - {{#operation}} +{{#operation}} - /* - * Returns {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} - */ - public function {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): String { + /* + * Returns {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} + */ + public function {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): String { // create path and map variables var path: String = "{{path}}".replace(/{format}/g,"xml"){{#pathParams}}.replace("{" + "{{paramName}}" + "}", getApiInvoker().escapeString({{{paramName}}})){{/pathParams}}; @@ -43,14 +43,14 @@ import flash.events.EventDispatcher; var headerParams: Dictionary = new Dictionary(); {{#requiredParamCount}} - // verify required params are set - if({{/requiredParamCount}}{{#requiredParams}} {{paramName}} == null {{#hasMore}}|| {{/hasMore}}{{/requiredParams}}{{#requiredParamCount}}) { - throw new ApiError(400, "missing required params"); + // verify required params are set + if({{/requiredParamCount}}{{#requiredParams}} {{paramName}} == null {{#hasMore}}|| {{/hasMore}}{{/requiredParams}}{{#requiredParamCount}}) { + throw new ApiError(400, "missing required params"); } {{/requiredParamCount}} {{#queryParams}}if("null" != String({{paramName}})) - queryParams["{{paramName}}"] = toPathValue({{paramName}}); + queryParams["{{paramName}}"] = toPathValue({{paramName}}); {{/queryParams}} {{#headerParams}}headerParams["{{paramName}}"] = toPathValue({{paramName}}); @@ -66,8 +66,8 @@ import flash.events.EventDispatcher; token.returnType = {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}null {{/returnType}}; return requestId; - } - {{/operation}} } -{{/operations}} + {{/operation}} +} + {{/operations}} } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flash/facetValue.as b/modules/swagger-codegen/src/main/resources/flash/facetValue.as index e421c0498dca..c6bfa1f27d19 100644 --- a/modules/swagger-codegen/src/main/resources/flash/facetValue.as +++ b/modules/swagger-codegen/src/main/resources/flash/facetValue.as @@ -1,8 +1,8 @@ package com.wordnik.client.model { -public class FacetValue { - public var value:String = null; - public var count:Number = 0; -} + public class FacetValue { + public var value: String = null; + public var count: Number = 0; + } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flash/model.mustache b/modules/swagger-codegen/src/main/resources/flash/model.mustache index 8f81853fb6d5..c3369514e80e 100644 --- a/modules/swagger-codegen/src/main/resources/flash/model.mustache +++ b/modules/swagger-codegen/src/main/resources/flash/model.mustache @@ -4,37 +4,37 @@ package {{package}} { {{/imports}} {{#models}} - {{#model}} - [XmlRootNode(name="{{classname}}")] - public class {{classname}} { - {{#vars}} +{{#model}} + [XmlRootNode(name="{{classname}}")] + public class {{classname}} { + {{#vars}} - {{#description}}/* {{description}} */ - {{/description}} + {{#description}}/* {{description}} */ + {{/description}} - {{#isList}} - // This declaration below of _{{name}}_obj_class is to force flash compiler to include this class - private var _{{name}}_obj_class: {{baseType}} = null; - [XmlElementWrapper(name="{{name}}")] - [XmlElements(name="{{nameSingular}}", type="{{baseType}}")] - {{/isList}} - {{#isNotContainer}}[XmlElement(name="{{name}}")] - {{/isNotContainer}} - public var {{name}}: {{{datatype}}} = {{{defaultValue}}}; + {{#isList}} + // This declaration below of _{{name}}_obj_class is to force flash compiler to include this class + private var _{{name}}_obj_class: {{baseType}} = null; + [XmlElementWrapper(name="{{name}}")] + [XmlElements(name="{{nameSingular}}", type="{{baseType}}")] + {{/isList}} + {{#isNotContainer}}[XmlElement(name="{{name}}")] + {{/isNotContainer}} + public var {{name}}: {{{datatype}}} = {{{defaultValue}}}; - {{/vars}} + {{/vars}} public function toString(): String { - var str: String = "{{classname}}: "; - {{#vars}} + var str: String = "{{classname}}: "; + {{#vars}} str += " ({{name}}: " + {{name}} + ")"; - {{/vars}} - return str; + {{/vars}} + return str; } - } - {{/model}} -{{/models}} - +} +{{/model}} + {{/models}} + } diff --git a/modules/swagger-codegen/src/main/resources/flash/modelList.mustache b/modules/swagger-codegen/src/main/resources/flash/modelList.mustache index 423aaf8d9615..7741902bcaa8 100644 --- a/modules/swagger-codegen/src/main/resources/flash/modelList.mustache +++ b/modules/swagger-codegen/src/main/resources/flash/modelList.mustache @@ -5,19 +5,19 @@ import io.swagger.common.ListWrapper; {{/imports}} {{#models}} - {{#model}} - public class {{classname}}List implements ListWrapper { +{{#model}} + public class {{classname}}List implements ListWrapper { // This declaration below of _{{name}}_obj_class is to force flash compiler to include this class private var _{{classVarName}}_obj_class: {{package}}.{{classname}} = null; [XmlElements(name="{{classVarName}}", type="{{package}}.{{classname}}")] public var {{classVarName}}: Array = new Array(); public function getList(): Array{ - return {{classVarName}}; + return {{classVarName}}; } - } - {{/model}} -{{/models}} - +} +{{/model}} + {{/models}} + } From eede02a6ab4c9b416ec944d0660a14e0839b018a Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:51:52 +0800 Subject: [PATCH 20/41] rollback nodejs and htmldocs template --- .../resources/htmlDocs/bodyParam.mustache | 6 +- .../resources/htmlDocs/formParam.mustache | 6 +- .../resources/htmlDocs/headerParam.mustache | 6 +- .../main/resources/htmlDocs/index.mustache | 123 +++++++--------- .../resources/htmlDocs/pathParam.mustache | 6 +- .../resources/htmlDocs/queryParam.mustache | 6 +- .../resources/htmlDocs/style.css.mustache | 138 +++++++++--------- .../main/resources/nodejs/controller.mustache | 28 ++-- .../src/main/resources/nodejs/index.mustache | 32 ++-- .../main/resources/nodejs/package.mustache | 26 ++-- .../main/resources/nodejs/service.mustache | 24 +-- .../main/resources/nodejs/swagger.mustache | 76 +++++----- 12 files changed, 226 insertions(+), 251 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache index b9adf4d8d921..2fd81183a5ba 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache @@ -1,5 +1,3 @@ -{{#isBodyParam}} -
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+{{#isBodyParam}}
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Body Parameter — {{description}} {{#defaultValue}} - default: {{{defaultValue}}}{{/defaultValue}}
{{/isBodyParam}} \ No newline at end of file +
Body Parameter — {{description}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/isBodyParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/formParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/formParam.mustache index 66770da842ec..97f342e60d70 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/formParam.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/formParam.mustache @@ -1,5 +1,3 @@ -{{#isFormParam}} -
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+{{#isFormParam}}
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Form Parameter — {{description}} {{#defaultValue}} - default: {{{defaultValue}}}{{/defaultValue}}
{{/isFormParam}} \ No newline at end of file +
Form Parameter — {{description}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/headerParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/headerParam.mustache index 709b79e37385..903713493be5 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/headerParam.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/headerParam.mustache @@ -1,5 +1,3 @@ -{{#isHeaderParam}} -
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+{{#isHeaderParam}}
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Header Parameter — {{description}} {{#defaultValue}} - default: {{{defaultValue}}}{{/defaultValue}}
{{/isHeaderParam}} \ No newline at end of file +
Header Parameter — {{description}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache index 092482730101..ce881084bc2f 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache @@ -1,76 +1,61 @@ - - + + API Reference - - -

{{{appName}}}

+ + +

{{{appName}}}

+
{{{appDescription}}} for {{partner}}
+ {{#infoUrl}}
More information: {{{infoUrl}}}
{{/infoUrl}} + {{#infoEmail}}
Contact Info: {{{infoEmail}}}
{{/infoEmail}} + {{#version}}
Version: {{{version}}}
{{/version}} +
{{{licenseInfo}}}
+
{{{licenseUrl}}}
+

Access

+
Customize this message as you see fit!
+

Methods

+ {{#apiInfo}} + {{#apis}} + {{#operations}}{{#operation}} +
+
{{httpMethod}}: {{path}}
+
{{#tags}}{{this}}{{/tags}}
+
{{nickname}} {{summary}}
+
{{notes}}
-
{{{appDescription}}} for {{partner}}
-{{#infoUrl}} -
More information: {{{infoUrl}}}
{{/infoUrl}} -{{#infoEmail}} -
Contact Info: {{{infoEmail}}}
{{/infoEmail}} -{{#version}} -
Version: {{{version}}}
{{/version}} -
{{{licenseInfo}}}
-
{{{licenseUrl}}}
-

Access

+

Parameters

+
+ {{#allParams}}{{>queryParam}}{{>pathParam}}{{>bodyParam}}{{>headerParam}}{{>formParam}} + {{/allParams}} +
+

Return type

-
Customize this message as you see fit!
-

Methods

-{{#apiInfo}} - {{#apis}} - {{#operations}}{{#operation}} -
-
-
{{httpMethod}}: {{path}}
-
-
{{#tags}}{{this}}{{/tags}}
-
{{nickname}} {{summary}}
-
{{notes}}
+ -

Parameters

+ {{#examples}} +

Example data

+
Content-Type: {{{contentType}}}
+
{{example}}
+ {{/examples}} +
+
+ {{/operation}}{{/operations}} + {{/apis}}{{/apiInfo}} -
- {{#allParams}}{{>queryParam}}{{>pathParam}}{{>bodyParam}}{{>headerParam}}{{>formParam}} - {{/allParams}} -
- -

Return type

- - - - {{#examples}} -

Example data

- -
Content-Type: {{{contentType}}}
-
{{example}}
- {{/examples}} -
- -
- {{/operation}}{{/operations}} - {{/apis}}{{/apiInfo}} - -

Models

-{{#models}} - {{#model}} -
-

{{classname}}

- -
- {{#vars}} -
{{name}} {{#isNotRequired}}(optional){{/isNotRequired}}
-
{{datatype}} {{description}}
- {{/vars}} -
- -
- {{/model}} -{{/models}} - - +

Models

+ {{#models}} + {{#model}} +
+

{{classname}}

+
+ {{#vars}}
{{name}} {{#isNotRequired}}(optional){{/isNotRequired}}
{{datatype}} {{description}}
+ {{/vars}} +
+
+ {{/model}} + {{/models}} + + \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/pathParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/pathParam.mustache index 6270f601c8a6..b47805a4f04a 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/pathParam.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/pathParam.mustache @@ -1,5 +1,3 @@ -{{#isPathParam}} -
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+{{#isPathParam}}
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Path Parameter — {{description}} {{#defaultValue}} - default: {{{defaultValue}}}{{/defaultValue}}
{{/isPathParam}} \ No newline at end of file +
Path Parameter — {{description}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/queryParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/queryParam.mustache index 323ace6a27eb..52147fbd7188 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/queryParam.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/queryParam.mustache @@ -1,5 +1,3 @@ -{{#isQueryParam}} -
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+{{#isQueryParam}}
{{paramName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Query Parameter — {{description}} {{#defaultValue}} - default: {{{defaultValue}}}{{/defaultValue}}
{{/isQueryParam}} \ No newline at end of file +
Query Parameter — {{description}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/isQueryParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache index d628ff11ff88..14ab06a7f7e5 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache @@ -1,151 +1,151 @@ -body { -font-family: Trebuchet MS, sans-serif; -font-size: 15px; -color: #444; -margin-right: 24px; +body { + font-family: Trebuchet MS, sans-serif; + font-size: 15px; + color: #444; + margin-right: 24px; } -h1 { -font-size: 25px; +h1 { + font-size: 25px; } -h2 { -font-size: 20px; +h2 { + font-size: 20px; } -h3 { -font-size: 16px; -font-weight: bold; +h3 { + font-size: 16px; + font-weight: bold; } -hr { -height: 1px; -border: 0; -color: #ddd; -background-color: #ddd; -display: none; +hr { + height: 1px; + border: 0; + color: #ddd; + background-color: #ddd; + display: none; } .app-desc { -clear: both; -margin-left: 20px; + clear: both; + margin-left: 20px; } .param-name { -width: 100%; + width: 100%; } .license-info { -margin-left: 20px; + margin-left: 20px; } .license-url { -margin-left: 20px; + margin-left: 20px; } .model { -margin: 0 0 0px 20px; + margin: 0 0 0px 20px; } .method { -margin-left: 20px; + margin-left: 20px; } -.method-notes { -margin: 10px 0 20px 0; -font-size: 90%; -color: #555; +.method-notes { + margin: 10px 0 20px 0; + font-size: 90%; + color: #555; } pre { -padding: 10px; -margin-bottom: 2px; + padding: 10px; + margin-bottom: 2px; } pre.get { -background-color: #0f6ab4; + background-color: #0f6ab4; } pre.post { -background-color: #10a54a; + background-color: #10a54a; } pre.put { -background-color: #c5862b; + background-color: #c5862b; } pre.delete { -background-color: #a41e22; + background-color: #a41e22; } -.huge { -color: #fff; +.huge { + color: #fff; } pre.example { -background-color: #f3f3f3; -padding: 10px; -border: 1px solid #ddd; + background-color: #f3f3f3; + padding: 10px; + border: 1px solid #ddd; } code { -white-space: pre; + white-space: pre; } .nickname { -font-weight: bold; + font-weight: bold; } .method-path { -font-size: 1.5em; -background-color: #0f6ab4; + font-size: 1.5em; + background-color: #0f6ab4; } .parameter { -width: 500px; + width: 500px; } .param { -width: 500px; -padding: 10px 0 0 20px; -font-weight: bold; + width: 500px; + padding: 10px 0 0 20px; + font-weight: bold; } .param-desc { -width: 700px; -padding: 0 0 0 20px; -color: #777; + width: 700px; + padding: 0 0 0 20px; + color: #777; } .param-type { -font-style: italic; + font-style: italic; } .field-label { -padding: 0; -margin: 0; -clear: both; + padding: 0; + margin: 0; + clear: both; } -.field-items { -padding: 0 0 15px 0; -margin-bottom: 15px; +.field-items { + padding: 0 0 15px 0; + margin-bottom: 15px; } .return-type { -clear: both; -padding-bottom: 10px; + clear: both; + padding-bottom: 10px; } .param-header { -font-weight: bold; + font-weight: bold; } .method-tags { -text-align: right; + text-align: right; } .method-tag { -background: none repeat scroll 0% 0% #24A600; -border-radius: 3px; -padding: 2px 10px; -margin: 2px; -color: #FFF; -display: inline-block; -text-decoration: none; + background: none repeat scroll 0% 0% #24A600; + border-radius: 3px; + padding: 2px 10px; + margin: 2px; + color: #FFF; + display: inline-block; + text-decoration: none; } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/nodejs/controller.mustache b/modules/swagger-codegen/src/main/resources/nodejs/controller.mustache index f0300e956561..85d1f3211a13 100644 --- a/modules/swagger-codegen/src/main/resources/nodejs/controller.mustache +++ b/modules/swagger-codegen/src/main/resources/nodejs/controller.mustache @@ -4,22 +4,22 @@ var url = require('url'); {{#operations}} - var {{classname}} = require('./{{classname}}Service'); +var {{classname}} = require('./{{classname}}Service'); - {{#operation}} +{{#operation}} - module.exports.{{nickname}} = function {{nickname}} (req, res, next) { - {{#allParams}}var {{paramName}} = req.swagger.params['{{baseName}}'].value; - {{/allParams}} +module.exports.{{nickname}} = function {{nickname}} (req, res, next) { + {{#allParams}}var {{paramName}} = req.swagger.params['{{baseName}}'].value; + {{/allParams}} - var result = {{classname}}.{{nickname}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + var result = {{classname}}.{{nickname}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - if(typeof result !== 'undefined') { - res.setHeader('Content-Type', 'application/json'); - res.end(JSON.stringify(result || {}, null, 2)); - } - else - res.end(); - }; - {{/operation}} + if(typeof result !== 'undefined') { + res.setHeader('Content-Type', 'application/json'); + res.end(JSON.stringify(result || {}, null, 2)); + } + else + res.end(); +}; +{{/operation}} {{/operations}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/nodejs/index.mustache b/modules/swagger-codegen/src/main/resources/nodejs/index.mustache index 57d0ff040c94..0562c2f0c376 100644 --- a/modules/swagger-codegen/src/main/resources/nodejs/index.mustache +++ b/modules/swagger-codegen/src/main/resources/nodejs/index.mustache @@ -8,9 +8,9 @@ var serverPort = {{serverPort}}; // swaggerRouter configuration var options = { -swaggerUi: '/swagger.json', -controllers: './controllers', -useStubs: process.env.NODE_ENV === 'development' ? true : false // Conditionally turn on stubs (mock mode) + swaggerUi: '/swagger.json', + controllers: './controllers', + useStubs: process.env.NODE_ENV === 'development' ? true : false // Conditionally turn on stubs (mock mode) }; // The Swagger document (require it, build it programmatically, fetch it from a URL, ...) @@ -18,21 +18,21 @@ var swaggerDoc = require('./api/swagger.json'); // Initialize the Swagger middleware swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) { -// Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain -app.use(middleware.swaggerMetadata()); + // Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain + app.use(middleware.swaggerMetadata()); -// Validate Swagger requests -app.use(middleware.swaggerValidator()); + // Validate Swagger requests + app.use(middleware.swaggerValidator()); -// Route validated requests to appropriate controller -app.use(middleware.swaggerRouter(options)); + // Route validated requests to appropriate controller + app.use(middleware.swaggerRouter(options)); -// Serve the Swagger documents and Swagger UI -app.use(middleware.swaggerUi()); + // Serve the Swagger documents and Swagger UI + app.use(middleware.swaggerUi()); -// Start the server -http.createServer(app).listen({{serverPort}}, function () { -console.log('Your server is listening on port %d (http://localhost:%d)', {{serverPort}}, {{serverPort}}); -console.log('Swagger-ui is available on http://localhost:%d/docs', {{serverPort}}); -}); + // Start the server + http.createServer(app).listen({{serverPort}}, function () { + console.log('Your server is listening on port %d (http://localhost:%d)', {{serverPort}}, {{serverPort}}); + console.log('Swagger-ui is available on http://localhost:%d/docs', {{serverPort}}); + }); }); \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/nodejs/package.mustache b/modules/swagger-codegen/src/main/resources/nodejs/package.mustache index ace5125d47a3..7add6e813fed 100644 --- a/modules/swagger-codegen/src/main/resources/nodejs/package.mustache +++ b/modules/swagger-codegen/src/main/resources/nodejs/package.mustache @@ -1,15 +1,15 @@ { -"name": "{{projectName}}", -"version": "{{appVersion}}", -"description": "{{appDescription}}", -"main": "index.js", -"keywords": [ -"swagger" -], -"license": "MIT", -"private": true, -"dependencies": { -"connect": "^3.2.0", -"swagger-tools": "0.8.*" -} + "name": "{{projectName}}", + "version": "{{appVersion}}", + "description": "{{appDescription}}", + "main": "index.js", + "keywords": [ + "swagger" + ], + "license": "MIT", + "private": true, + "dependencies": { + "connect": "^3.2.0", + "swagger-tools": "0.8.*" + } } diff --git a/modules/swagger-codegen/src/main/resources/nodejs/service.mustache b/modules/swagger-codegen/src/main/resources/nodejs/service.mustache index 76d582a03561..d7c2ade5079c 100644 --- a/modules/swagger-codegen/src/main/resources/nodejs/service.mustache +++ b/modules/swagger-codegen/src/main/resources/nodejs/service.mustache @@ -1,18 +1,18 @@ 'use strict'; {{#operations}} - {{#operation}} - exports.{{nickname}} = function({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { +{{#operation}} +exports.{{nickname}} = function({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - var examples = {}; - {{#examples}} - examples['{{contentType}}'] = {{{example}}}; - {{/examples}} + var examples = {}; + {{#examples}} + examples['{{contentType}}'] = {{{example}}}; + {{/examples}} - {{#returnType}} - if(Object.keys(examples).length > 0) - return examples[Object.keys(examples)[0]]; - {{/returnType}} - } - {{/operation}} + {{#returnType}} + if(Object.keys(examples).length > 0) + return examples[Object.keys(examples)[0]]; + {{/returnType}} +} +{{/operation}} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/nodejs/swagger.mustache b/modules/swagger-codegen/src/main/resources/nodejs/swagger.mustache index ed6a91567adc..8b4c8d33bdcc 100644 --- a/modules/swagger-codegen/src/main/resources/nodejs/swagger.mustache +++ b/modules/swagger-codegen/src/main/resources/nodejs/swagger.mustache @@ -1,42 +1,42 @@ { -"swagger": "2.0", -"info": { -"title": "{{appName}}", -"description": "{{appDescription}}", -"version": "{{apiVersion}}" -}, + "swagger": "2.0", + "info": { + "title": "{{appName}}", + "description": "{{appDescription}}", + "version": "{{apiVersion}}" + }, {{#apiInfo}} - "produces": ["application/json"], - "host": "localhost:{{serverPort}}", - "basePath": "{{contextPath}}", - "paths": { - {{#apis}} - {{#operations}} - {{#operation}} - "{{{path}}}": { - "{{httpMethod}}": { - "x-swagger-router-controller": "{{classname}}", - "tags": ["{{baseName}}"], - "operationId": "{{operationId}}",{{#hasParams}} - "parameters": [ - {{#allParams}} - {{{jsonSchema}}}{{#hasMore}},{{/hasMore}} - {{/allParams}} - ],{{/hasParams}} - "responses": { - {{#responses}} - "{{code}}": {{{jsonSchema}}} - {{#hasMore}},{{/hasMore}} - {{/responses}} - } - } - } {{#hasMore}},{{/hasMore}} - {{/operation}} - {{#hasMore}},{{/hasMore}} - {{/operations}} - {{/apis}} + "produces": ["application/json"], + "host": "localhost:{{serverPort}}", + "basePath": "{{contextPath}}", + "paths": { +{{#apis}} +{{#operations}} + {{#operation}} + "{{{path}}}": { + "{{httpMethod}}": { + "x-swagger-router-controller": "{{classname}}", + "tags": ["{{baseName}}"], + "operationId": "{{operationId}}",{{#hasParams}} + "parameters": [ + {{#allParams}} + {{{jsonSchema}}}{{#hasMore}},{{/hasMore}} + {{/allParams}} + ],{{/hasParams}} + "responses": { + {{#responses}} + "{{code}}": {{{jsonSchema}}} + {{#hasMore}},{{/hasMore}} + {{/responses}} + } + } + } {{#hasMore}},{{/hasMore}} + {{/operation}} + {{#hasMore}},{{/hasMore}} +{{/operations}} +{{/apis}} {{/apiInfo}} -}, "definitions": { -{{#models}}{{#model}}"{{classVarName}}": {{{modelJson}}}{{#hasMoreModels}},{{/hasMoreModels}}{{/model}}{{/models}} -} + }, "definitions": { + {{#models}}{{#model}}"{{classVarName}}": {{{modelJson}}}{{#hasMoreModels}},{{/hasMoreModels}}{{/model}}{{/models}} + } } From b1f5c0314e8ac78e570e3ef1b5f82420e2e0fc90 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:53:33 +0800 Subject: [PATCH 21/41] rollback objc templates --- .../objc/SWGConfiguration-body.mustache | 96 +++--- .../objc/SWGConfiguration-header.mustache | 47 ++- .../src/main/resources/objc/api-body.mustache | 320 +++++++++--------- .../main/resources/objc/api-header.mustache | 51 ++- .../apiBodyResponseWithContainer.mustache | 74 ++-- .../objc/apiNonPrimitiveResponse.mustache | 44 +-- .../objc/apiPrimitiveResponse.mustache | 68 ++-- .../main/resources/objc/model-body.mustache | 40 +-- .../main/resources/objc/model-header.mustache | 27 +- .../main/resources/objc/voidResponse.mustache | 30 +- 10 files changed, 397 insertions(+), 400 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/objc/SWGConfiguration-body.mustache b/modules/swagger-codegen/src/main/resources/objc/SWGConfiguration-body.mustache index 86ef0c702af0..1e5e7135574b 100644 --- a/modules/swagger-codegen/src/main/resources/objc/SWGConfiguration-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/SWGConfiguration-body.mustache @@ -12,88 +12,88 @@ #pragma mark - Singletion Methods + (instancetype) sharedConfig { -static SWGConfiguration *shardConfig = nil; -static dispatch_once_t onceToken; -dispatch_once(&onceToken, ^{ -shardConfig = [[self alloc] init]; -}); -return shardConfig; + static SWGConfiguration *shardConfig = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardConfig = [[self alloc] init]; + }); + return shardConfig; } #pragma mark - Initialize Methods - (instancetype) init { -self = [super init]; -if (self) { -self.username = @""; -self.password = @""; -self.mutableApiKey = [NSMutableDictionary dictionary]; -self.mutableApiKeyPrefix = [NSMutableDictionary dictionary]; -} -return self; + self = [super init]; + if (self) { + self.username = @""; + self.password = @""; + self.mutableApiKey = [NSMutableDictionary dictionary]; + self.mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + } + return self; } #pragma mark - Instance Methods - (NSString *) getApiKeyWithPrefix:(NSString *)key { -if ([self.apiKeyPrefix objectForKey:key] && [self.apiKey objectForKey:key]) { -return [NSString stringWithFormat:@"%@ %@", [self.apiKeyPrefix objectForKey:key], [self.apiKey objectForKey:key]]; -} -else if ([self.apiKey objectForKey:key]) { -return [NSString stringWithFormat:@"%@", [self.apiKey objectForKey:key]]; -} -else { -return @""; -} + if ([self.apiKeyPrefix objectForKey:key] && [self.apiKey objectForKey:key]) { + return [NSString stringWithFormat:@"%@ %@", [self.apiKeyPrefix objectForKey:key], [self.apiKey objectForKey:key]]; + } + else if ([self.apiKey objectForKey:key]) { + return [NSString stringWithFormat:@"%@", [self.apiKey objectForKey:key]]; + } + else { + return @""; + } } - (NSString *) getBasicAuthToken { -NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password]; -NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; -basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; - -return basicAuthCredentials; + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; } #pragma mark - Setter Methods - (void) setValue:(NSString *)value forApiKeyField:(NSString *)field { -[self.mutableApiKey setValue:value forKey:field]; + [self.mutableApiKey setValue:value forKey:field]; } - (void) setValue:(NSString *)value forApiKeyPrefixField:(NSString *)field { -[self.mutableApiKeyPrefix setValue:value forKey:field]; + [self.mutableApiKeyPrefix setValue:value forKey:field]; } #pragma mark - Getter Methods - (NSDictionary *) apiKey { -return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; + return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; } - (NSDictionary *) apiKeyPrefix { -return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; + return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; } #pragma mark - - (NSDictionary *) authSettings { -return @{ {{#authMethods}}{{#isApiKey}} - @"{{name}}": @{ - @"type": @"api_key", - @"in": {{#isKeyInHeader}}@"header"{{/isKeyInHeader}}{{#isKeyInQuery}}@"query"{{/isKeyInQuery}}, - @"key": @"{{keyParamName}}", - @"value": [self getApiKeyWithPrefix:@"{{keyParamName}}"] - }, -{{/isApiKey}}{{#isBasic}} - @"{{name}}": @{ - @"type": @"basic", - @"in": @"header", - @"key": @"Authorization", - @"value": [self getBasicAuthToken] - }, -{{/isBasic}}{{/authMethods}} -}; + return @{ {{#authMethods}}{{#isApiKey}} + @"{{name}}": @{ + @"type": @"api_key", + @"in": {{#isKeyInHeader}}@"header"{{/isKeyInHeader}}{{#isKeyInQuery}}@"query"{{/isKeyInQuery}}, + @"key": @"{{keyParamName}}", + @"value": [self getApiKeyWithPrefix:@"{{keyParamName}}"] + }, + {{/isApiKey}}{{#isBasic}} + @"{{name}}": @{ + @"type": @"basic", + @"in": @"header", + @"key": @"Authorization", + @"value": [self getBasicAuthToken] + }, + {{/isBasic}}{{/authMethods}} + }; } @end diff --git a/modules/swagger-codegen/src/main/resources/objc/SWGConfiguration-header.mustache b/modules/swagger-codegen/src/main/resources/objc/SWGConfiguration-header.mustache index 529e07aa81cb..33023ca3c6fb 100644 --- a/modules/swagger-codegen/src/main/resources/objc/SWGConfiguration-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/SWGConfiguration-header.mustache @@ -1,57 +1,56 @@ -#import - +#import @interface SWGConfiguration : NSObject /** -* Api key values for Api Key type Authentication -* -* To add or remove api key, use `setValue:forApiKeyField:`. -*/ + * Api key values for Api Key type Authentication + * + * To add or remove api key, use `setValue:forApiKeyField:`. + */ @property (readonly, nonatomic, strong) NSDictionary *apiKey; /** -* Api key prefix values to be prepend to the respective api key -* -* To add or remove prefix, use `setValue:forApiKeyPrefixField:`. -*/ + * Api key prefix values to be prepend to the respective api key + * + * To add or remove prefix, use `setValue:forApiKeyPrefixField:`. + */ @property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; /** -* Usename and Password for Basic type Authentication -*/ + * Usename and Password for Basic type Authentication + */ @property (nonatomic) NSString *username; @property (nonatomic) NSString *password; /** -* Get configuration singleton instance -*/ + * Get configuration singleton instance + */ + (instancetype) sharedConfig; /** -* Sets field in `apiKey` -*/ + * Sets field in `apiKey` + */ - (void) setValue:(NSString *)value forApiKeyField:(NSString*)field; /** -* Sets field in `apiKeyPrefix` -*/ + * Sets field in `apiKeyPrefix` + */ - (void) setValue:(NSString *)value forApiKeyPrefixField:(NSString *)field; /** -* Get API key (with prefix if set) -*/ + * Get API key (with prefix if set) + */ - (NSString *) getApiKeyWithPrefix:(NSString *) key; /** -* Get Basic Auth token -*/ + * Get Basic Auth token + */ - (NSString *) getBasicAuthToken; /** -* Get Authentication Setings -*/ + * Get Authentication Setings + */ - (NSDictionary *) authSettings; @end diff --git a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache index b01f59a6857b..40d75bd806b2 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache @@ -1,226 +1,226 @@ {{#operations}} - #import "{{classname}}.h" - #import "SWGFile.h" - #import "SWGQueryParamCollection.h" - {{#imports}}#import "{{import}}.h" - {{/imports}} - {{newline}} +#import "{{classname}}.h" +#import "SWGFile.h" +#import "SWGQueryParamCollection.h" +{{#imports}}#import "{{import}}.h" +{{/imports}} +{{newline}} - @interface {{classname}} () +@interface {{classname}} () @property (readwrite, nonatomic, strong) NSMutableDictionary *defaultHeaders; - @end +@end - @implementation {{classname}} +@implementation {{classname}} - static NSString * basePath = @"{{basePath}}"; +static NSString * basePath = @"{{basePath}}"; - #pragma mark - Initialize methods +#pragma mark - Initialize methods - - (id) init { +- (id) init { self = [super init]; if (self) { - self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; - self.defaultHeaders = [NSMutableDictionary dictionary]; + self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; + self.defaultHeaders = [NSMutableDictionary dictionary]; } return self; - } +} - - (id) initWithApiClient:(SWGApiClient *)apiClient { +- (id) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { - if (apiClient) { - self.apiClient = apiClient; - } - else { - self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; - } - self.defaultHeaders = [NSMutableDictionary dictionary]; + if (apiClient) { + self.apiClient = apiClient; + } + else { + self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; + } + self.defaultHeaders = [NSMutableDictionary dictionary]; } return self; - } +} - #pragma mark - +#pragma mark - - +({{classname}}*) apiWithHeader:(NSString*)headerValue key:(NSString*)key { ++({{classname}}*) apiWithHeader:(NSString*)headerValue key:(NSString*)key { static {{classname}}* singletonAPI = nil; if (singletonAPI == nil) { - singletonAPI = [[{{classname}} alloc] init]; - [singletonAPI addHeader:headerValue forKey:key]; + singletonAPI = [[{{classname}} alloc] init]; + [singletonAPI addHeader:headerValue forKey:key]; } return singletonAPI; - } +} - +(void) setBasePath:(NSString*)path { ++(void) setBasePath:(NSString*)path { basePath = path; - } +} - +(NSString*) getBasePath { ++(NSString*) getBasePath { return basePath; - } +} - -(void) addHeader:(NSString*)value forKey:(NSString*)key { +-(void) addHeader:(NSString*)value forKey:(NSString*)key { [self.defaultHeaders setValue:value forKey:key]; - } +} - -(void) setHeaderValue:(NSString*) value - forKey:(NSString*)key { +-(void) setHeaderValue:(NSString*) value + forKey:(NSString*)key { [self.defaultHeaders setValue:value forKey:key]; - } +} - -(unsigned long) requestQueueSize { +-(unsigned long) requestQueueSize { return [SWGApiClient requestQueueSize]; - } +} - {{#operation}} - /*! - * {{{summary}}} - * {{{notes}}} - {{#allParams}} * \param {{paramName}} {{{description}}} - {{/allParams}} * \returns {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} - */ - -(NSNumber*) {{nickname}}WithCompletionBlock{{^allParams}}: {{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}} +{{#operation}} +/*! + * {{{summary}}} + * {{{notes}}} +{{#allParams}} * \param {{paramName}} {{{description}}} +{{/allParams}} * \returns {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + */ +-(NSNumber*) {{nickname}}WithCompletionBlock{{^allParams}}: {{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}: ({{{dataType}}}) {{paramName}} {{/allParams}} {{#returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock{{/returnBaseType}} {{^returnBaseType}}{{#hasParams}}completionHandler: {{/hasParams}}(void (^)(NSError* error))completionBlock{{/returnBaseType}} { - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set - NSAssert({{paramName}} != nil, @"Missing the required parameter `{{paramName}}` when calling {{nickname}}"); - {{/required}}{{/allParams}} + {{#allParams}}{{#required}} + // verify the required parameter '{{paramName}}' is set + NSAssert({{paramName}} != nil, @"Missing the required parameter `{{paramName}}` when calling {{nickname}}"); + {{/required}}{{/allParams}} - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@{{path}}", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@{{path}}", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - {{#pathParams}}[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"{{baseName}}", @"}"]] withString: [SWGApiClient escape:{{paramName}}]]; - {{/pathParams}} + {{#pathParams}}[requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"{{baseName}}", @"}"]] withString: [SWGApiClient escape:{{paramName}}]]; + {{/pathParams}} - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - {{#queryParams}}if({{paramName}} != nil) { + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + {{#queryParams}}if({{paramName}} != nil) { {{#collectionFormat}} - queryParams[@"{{baseName}}"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: {{baseName}} format: @"{{collectionFormat}}"]; + queryParams[@"{{baseName}}"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: {{baseName}} format: @"{{collectionFormat}}"]; {{/collectionFormat}} {{^collectionFormat}}queryParams[@"{{baseName}}"] = {{paramName}};{{/collectionFormat}} - } - {{/queryParams}} - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + } + {{/queryParams}} + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - {{#headerParams}}if({{paramName}} != nil) + {{#headerParams}}if({{paramName}} != nil) headerParams[@"{{baseName}}"] = {{paramName}}; - {{/headerParams}} - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]]; - if ([headerParams[@"Accept"] length] == 0) { + {{/headerParams}} + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[{{#produces}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[{{#consumes}}@"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}]]; - // Authentication setting - NSArray *authSettings = @[{{#authMethods}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}]; + // Authentication setting + NSArray *authSettings = @[{{#authMethods}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}]; + + id bodyDictionary = nil; + {{#bodyParam}} + id __body = {{paramName}}; - id bodyDictionary = nil; - {{#bodyParam}} - id __body = {{paramName}}; - - if(__body != nil && [__body isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] init]; - for (id dict in (NSArray*)__body) { + if(__body != nil && [__body isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] init]; + for (id dict in (NSArray*)__body) { if([dict respondsToSelector:@selector(toDictionary)]) { - [objs addObject:[(SWGObject*)dict toDictionary]]; + [objs addObject:[(SWGObject*)dict toDictionary]]; } else{ - [objs addObject:dict]; + [objs addObject:dict]; } - } - bodyDictionary = objs; - } - else if([__body respondsToSelector:@selector(toDictionary)]) { - bodyDictionary = [(SWGObject*)__body toDictionary]; - } - else if([__body isKindOfClass:[NSString class]]) { - // convert it to a dictionary - NSError * error; - NSString * str = (NSString*)__body; - NSDictionary *JSON = - [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] - options: NSJSONReadingMutableContainers - error: &error]; - bodyDictionary = JSON; - } - {{/bodyParam}} - {{^bodyParam}} - - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - - {{#formParams}} - {{#notFile}} - formParams[@"{{paramName}}"] = {{paramName}}; - {{/notFile}}{{#isFile}} - requestContentType = @"multipart/form-data"; - if(bodyDictionary == nil) { - bodyDictionary = [[NSMutableArray alloc] init]; - } - if({{paramName}} != nil) { - [bodyDictionary addObject:{{paramName}}]; - {{paramName}}.paramName = @"{{baseName}}"; - } - {{/isFile}} - if(bodyDictionary == nil) { - bodyDictionary = [[NSMutableArray alloc] init]; - } - [bodyDictionary addObject:formParams]; - {{/formParams}} - {{/bodyParam}} - - {{#requiredParamCount}} - {{#requiredParams}} - if({{paramName}} == nil) { - // error - } - {{/requiredParams}} - {{/requiredParamCount}} - - {{#returnContainer}} - // response is in a container - {{>apiBodyResponseWithContainer}}{{/returnContainer}} - - {{#returnSimpleType}} - // non container response - - {{#returnTypeIsPrimitive}} - // primitive response - {{>apiPrimitiveResponse}}{{/returnTypeIsPrimitive}} - - {{#returnBaseType}} - // complex response - {{>apiNonPrimitiveResponse}}{{/returnBaseType}} - {{/returnSimpleType}} - - {{^returnSimpleType}}{{^returnContainer}} - // it's void - {{>voidResponse}} - {{/returnContainer}}{{/returnSimpleType}} } + bodyDictionary = objs; + } + else if([__body respondsToSelector:@selector(toDictionary)]) { + bodyDictionary = [(SWGObject*)__body toDictionary]; + } + else if([__body isKindOfClass:[NSString class]]) { + // convert it to a dictionary + NSError * error; + NSString * str = (NSString*)__body; + NSDictionary *JSON = + [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] + options: NSJSONReadingMutableContainers + error: &error]; + bodyDictionary = JSON; + } + {{/bodyParam}} + {{^bodyParam}} - {{/operation}} + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - {{newline}} + {{#formParams}} + {{#notFile}} + formParams[@"{{paramName}}"] = {{paramName}}; + {{/notFile}}{{#isFile}} + requestContentType = @"multipart/form-data"; + if(bodyDictionary == nil) { + bodyDictionary = [[NSMutableArray alloc] init]; + } + if({{paramName}} != nil) { + [bodyDictionary addObject:{{paramName}}]; + {{paramName}}.paramName = @"{{baseName}}"; + } + {{/isFile}} + if(bodyDictionary == nil) { + bodyDictionary = [[NSMutableArray alloc] init]; + } + [bodyDictionary addObject:formParams]; + {{/formParams}} + {{/bodyParam}} + + {{#requiredParamCount}} + {{#requiredParams}} + if({{paramName}} == nil) { + // error + } + {{/requiredParams}} + {{/requiredParamCount}} + + {{#returnContainer}} + // response is in a container + {{>apiBodyResponseWithContainer}}{{/returnContainer}} + + {{#returnSimpleType}} + // non container response + + {{#returnTypeIsPrimitive}} + // primitive response + {{>apiPrimitiveResponse}}{{/returnTypeIsPrimitive}} + + {{#returnBaseType}} + // complex response + {{>apiNonPrimitiveResponse}}{{/returnBaseType}} + {{/returnSimpleType}} + + {{^returnSimpleType}}{{^returnContainer}} + // it's void + {{>voidResponse}} + {{/returnContainer}}{{/returnSimpleType}} +} + +{{/operation}} + +{{newline}} {{/operations}} @end diff --git a/modules/swagger-codegen/src/main/resources/objc/api-header.mustache b/modules/swagger-codegen/src/main/resources/objc/api-header.mustache index 74c55d3ffa41..65f4c39e0b36 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-header.mustache @@ -1,5 +1,4 @@ -#import - +#import {{#imports}}#import "{{import}}.h" {{/imports}} #import "SWGObject.h" @@ -7,36 +6,36 @@ {{newline}} {{#operations}} - @interface {{classname}}: NSObject +@interface {{classname}}: NSObject - @property(nonatomic, assign)SWGApiClient *apiClient; +@property(nonatomic, assign)SWGApiClient *apiClient; - -(instancetype) initWithApiClient:(SWGApiClient *)apiClient; - -(void) addHeader:(NSString*)value forKey:(NSString*)key; - -(unsigned long) requestQueueSize; - +({{classname}}*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; - +(void) setBasePath:(NSString*)basePath; - +(NSString*) getBasePath; - {{#operation}} - /** +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; +-(void) addHeader:(NSString*)value forKey:(NSString*)key; +-(unsigned long) requestQueueSize; ++({{classname}}*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; ++(void) setBasePath:(NSString*)basePath; ++(NSString*) getBasePath; +{{#operation}} +/** - {{{summary}}} - {{#notes}}{{{notes}}}{{/notes}} + {{{summary}}} + {{#notes}}{{{notes}}}{{/notes}} - {{#allParams}}@param {{paramName}} {{description}} - {{/allParams}} + {{#allParams}}@param {{paramName}} {{description}} + {{/allParams}} - return type: {{{returnType}}} - */ - -(NSNumber*) {{nickname}}WithCompletionBlock {{^allParams}}:{{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}:({{{dataType}}}) {{paramName}} {{#hasMore}} - {{/hasMore}}{{/allParams}} - {{#returnBaseType}}{{#hasParams}} - completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock;{{/returnBaseType}} - {{^returnBaseType}}{{#hasParams}} - completionHandler: {{/hasParams}}(void (^)(NSError* error))completionBlock;{{/returnBaseType}} + return type: {{{returnType}}} + */ +-(NSNumber*) {{nickname}}WithCompletionBlock {{^allParams}}:{{/allParams}}{{#allParams}}{{#secondaryParam}} {{paramName}}{{/secondaryParam}}:({{{dataType}}}) {{paramName}} {{#hasMore}} +{{/hasMore}}{{/allParams}} + {{#returnBaseType}}{{#hasParams}} + completionHandler: {{/hasParams}}(void (^)({{{returnType}}} output, NSError* error))completionBlock;{{/returnBaseType}} + {{^returnBaseType}}{{#hasParams}} + completionHandler: {{/hasParams}}(void (^)(NSError* error))completionBlock;{{/returnBaseType}} - {{newline}} - {{/operation}} +{{newline}} +{{/operation}} {{/operations}} @end diff --git a/modules/swagger-codegen/src/main/resources/objc/apiBodyResponseWithContainer.mustache b/modules/swagger-codegen/src/main/resources/objc/apiBodyResponseWithContainer.mustache index 48d49a2f1ca0..acaeaf2ddf5b 100644 --- a/modules/swagger-codegen/src/main/resources/objc/apiBodyResponseWithContainer.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/apiBodyResponseWithContainer.mustache @@ -1,38 +1,38 @@ -// {{returnContainer}} container response type -return [self.apiClient dictionary: requestUrl -method: @"{{httpMethod}}" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSDictionary *data, NSError *error) { -if (error) { -{{#returnBaseType}}completionBlock(nil, error);{{/returnBaseType}}{{^returnBaseType}}completionBlock(error);{{/returnBaseType}} -return; -} -{{#isMapContainer}} - NSDictionary *result = nil; - if (data) { - result = [[NSDictionary alloc]initWithDictionary: data]; - } - completionBlock(data, nil); -{{/isMapContainer}}{{#isListContainer}} - {{#returnBaseType}}if([data isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] initWithCapacity:[data count]]; - for (NSDictionary* dict in (NSArray*)data) { - {{#returnTypeIsPrimitive}} - {{returnBaseType}}* d = [[{{{returnBaseType}}} alloc]initWithString: dict]; - {{/returnTypeIsPrimitive}} - {{^returnTypeIsPrimitive}} - {{{returnBaseType}}}* d = [[{{{returnBaseType}}} alloc] initWithDictionary:dict error:nil]; - {{/returnTypeIsPrimitive}} - [objs addObject:d]; - } - completionBlock(({{{returnType}}})objs, nil); - } - {{/returnBaseType}} -{{/isListContainer}} -}]; + // {{returnContainer}} container response type + return [self.apiClient dictionary: requestUrl + method: @"{{httpMethod}}" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSDictionary *data, NSError *error) { + if (error) { + {{#returnBaseType}}completionBlock(nil, error);{{/returnBaseType}}{{^returnBaseType}}completionBlock(error);{{/returnBaseType}} + return; + } + {{#isMapContainer}} + NSDictionary *result = nil; + if (data) { + result = [[NSDictionary alloc]initWithDictionary: data]; + } + completionBlock(data, nil); + {{/isMapContainer}}{{#isListContainer}} + {{#returnBaseType}}if([data isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] initWithCapacity:[data count]]; + for (NSDictionary* dict in (NSArray*)data) { + {{#returnTypeIsPrimitive}} + {{returnBaseType}}* d = [[{{{returnBaseType}}} alloc]initWithString: dict]; + {{/returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} + {{{returnBaseType}}}* d = [[{{{returnBaseType}}} alloc] initWithDictionary:dict error:nil]; + {{/returnTypeIsPrimitive}} + [objs addObject:d]; + } + completionBlock(({{{returnType}}})objs, nil); + } + {{/returnBaseType}} + {{/isListContainer}} + }]; diff --git a/modules/swagger-codegen/src/main/resources/objc/apiNonPrimitiveResponse.mustache b/modules/swagger-codegen/src/main/resources/objc/apiNonPrimitiveResponse.mustache index d240c9f2f309..da8ea063bfb4 100644 --- a/modules/swagger-codegen/src/main/resources/objc/apiNonPrimitiveResponse.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/apiNonPrimitiveResponse.mustache @@ -1,24 +1,24 @@ -{{^returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} // comples response type return [self.apiClient dictionary: requestUrl - method: @"{{httpMethod}}" - queryParams: queryParams - body: bodyDictionary - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - completionBlock: ^(NSDictionary *data, NSError *error) { - if (error) { - {{#returnBaseType}}completionBlock(nil, error);{{/returnBaseType}} - {{^returnBaseType}}completionBlock(error);{{/returnBaseType}} - return; - } - {{#returnType}}{{returnType}} result = nil; - if (data) { - result = [[{{#instantiationType}}NSClassFromString(@"{{{instantiationType}}}") {{/instantiationType}}{{^instantiationType}}{{{returnBaseType}}} {{/instantiationType}} alloc] {{#returnContainer}}{{#isMapContainer}}initWithDictionary{{/isMapContainer}}{{#isListContainer}} initWithDictionary{{/isListContainer}}{{/returnContainer}}{{^returnContainer}} initWithDictionary{{/returnContainer}}:data error:nil]; - } - {{#returnType}}completionBlock(result , nil);{{/returnType}} - {{/returnType}} - }]; -{{/returnTypeIsPrimitive}} + method: @"{{httpMethod}}" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSDictionary *data, NSError *error) { + if (error) { + {{#returnBaseType}}completionBlock(nil, error);{{/returnBaseType}} + {{^returnBaseType}}completionBlock(error);{{/returnBaseType}} + return; + } + {{#returnType}}{{returnType}} result = nil; + if (data) { + result = [[{{#instantiationType}}NSClassFromString(@"{{{instantiationType}}}") {{/instantiationType}}{{^instantiationType}}{{{returnBaseType}}} {{/instantiationType}} alloc] {{#returnContainer}}{{#isMapContainer}}initWithDictionary{{/isMapContainer}}{{#isListContainer}} initWithDictionary{{/isListContainer}}{{/returnContainer}}{{^returnContainer}} initWithDictionary{{/returnContainer}}:data error:nil]; + } + {{#returnType}}completionBlock(result , nil);{{/returnType}} + {{/returnType}} + }]; + {{/returnTypeIsPrimitive}} diff --git a/modules/swagger-codegen/src/main/resources/objc/apiPrimitiveResponse.mustache b/modules/swagger-codegen/src/main/resources/objc/apiPrimitiveResponse.mustache index b60b4b54bbcc..d44d356526df 100644 --- a/modules/swagger-codegen/src/main/resources/objc/apiPrimitiveResponse.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/apiPrimitiveResponse.mustache @@ -1,36 +1,36 @@ -// primitive response type -{{#returnBaseType}}return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"{{httpMethod}}" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(nil, error); -return; -} -{{returnBaseType}} *result = data ? [[{{#instantiationType}}NSClassFromString(@"{{{instantiationType}}}") {{/instantiationType}}{{^instantiationType}}{{{returnBaseType}}} {{/instantiationType}} alloc]initWithString: data] : nil; -completionBlock(result, nil); -}]; -{{/returnBaseType}} -{{^returnBaseType}} + // primitive response type + {{#returnBaseType}}return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"{{httpMethod}}" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(nil, error); + return; + } + {{returnBaseType}} *result = data ? [[{{#instantiationType}}NSClassFromString(@"{{{instantiationType}}}") {{/instantiationType}}{{^instantiationType}}{{{returnBaseType}}} {{/instantiationType}} alloc]initWithString: data] : nil; + completionBlock(result, nil); + }]; + {{/returnBaseType}} + {{^returnBaseType}} // no return base type - return [self.apiClient stringWithCompletionBlock: requestUrl - method: @"{{httpMethod}}" - queryParams: queryParams - body: bodyDictionary - headerParams: headerParams - requestContentType: requestContentType - responseContentType: responseContentType - completionBlock: ^(NSString *data, NSError *error) { - if (error) { - completionBlock(error); - return; - } - completionBlock(nil); - }]; -{{/returnBaseType}} + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"{{httpMethod}}" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + {{/returnBaseType}} diff --git a/modules/swagger-codegen/src/main/resources/objc/model-body.mustache b/modules/swagger-codegen/src/main/resources/objc/model-body.mustache index 00c6297b71ac..b728e6bb06cd 100644 --- a/modules/swagger-codegen/src/main/resources/objc/model-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/model-body.mustache @@ -1,26 +1,26 @@ {{#models}} - {{#model}} - #import "{{classname}}.h" +{{#model}} +#import "{{classname}}.h" - @implementation {{classname}} +@implementation {{classname}} + ++ (JSONKeyMapper *)keyMapper +{ + return [[JSONKeyMapper alloc] initWithDictionary:@{ {{#vars}}@"{{baseName}}": @"{{name}}"{{#hasMore}}, {{/hasMore}}{{/vars}} }]; +} - + (JSONKeyMapper *)keyMapper - { - return [[JSONKeyMapper alloc] initWithDictionary:@{ {{#vars}}@"{{baseName}}": @"{{name}}"{{#hasMore}}, {{/hasMore}}{{/vars}} }]; - } ++ (BOOL)propertyIsOptional:(NSString *)propertyName +{ + NSArray *optionalProperties = @[{{#vars}}{{^required}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/required}}{{/vars}}]; - + (BOOL)propertyIsOptional:(NSString *)propertyName - { - NSArray *optionalProperties = @[{{#vars}}{{^required}}@"{{name}}"{{#hasMore}}, {{/hasMore}}{{/required}}{{/vars}}]; + if ([optionalProperties containsObject:propertyName]) { + return YES; + } + else { + return NO; + } +} - if ([optionalProperties containsObject:propertyName]) { - return YES; - } - else { - return NO; - } - } - - {{/model}} - @end +{{/model}} +@end {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/objc/model-header.mustache b/modules/swagger-codegen/src/main/resources/objc/model-header.mustache index 12cb782a7319..81ac19a0b734 100644 --- a/modules/swagger-codegen/src/main/resources/objc/model-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/model-header.mustache @@ -1,23 +1,22 @@ -#import - +#import #import "SWGObject.h" {{#imports}}#import "{{import}}.h" {{/imports}} {{newline}} {{#models}} - {{#model}} +{{#model}} - @protocol {{classname}} - @end +@protocol {{classname}} +@end + +@interface {{classname}} : SWGObject - @interface {{classname}} : SWGObject +{{#vars}} +{{#description}}/* {{{description}}} {{^required}}[optional]{{/required}} + */{{/description}} +@property(nonatomic) {{{ datatype }}} {{name}}; +{{/vars}} - {{#vars}} - {{#description}}/* {{{description}}} {{^required}}[optional]{{/required}} - */{{/description}} - @property(nonatomic) {{{ datatype }}} {{name}}; - {{/vars}} - - @end - {{/model}} +@end +{{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/objc/voidResponse.mustache b/modules/swagger-codegen/src/main/resources/objc/voidResponse.mustache index 602bbcb807f7..7bbbc14c066a 100644 --- a/modules/swagger-codegen/src/main/resources/objc/voidResponse.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/voidResponse.mustache @@ -1,15 +1,15 @@ -return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"{{httpMethod}}" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"{{httpMethod}}" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; From 7d6fdf96c05b8e2097829ff0ab8055233e3247dc Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:54:48 +0800 Subject: [PATCH 22/41] rollback retroit template --- .../src/main/resources/retrofit/api.mustache | 32 +- .../main/resources/retrofit/model.mustache | 58 ++-- .../src/main/resources/retrofit/pom.mustache | 277 +++++++++--------- .../main/resources/retrofit/service.mustache | 20 +- 4 files changed, 192 insertions(+), 195 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/retrofit/api.mustache b/modules/swagger-codegen/src/main/resources/retrofit/api.mustache index 38d436fe7351..a916f363ff55 100644 --- a/modules/swagger-codegen/src/main/resources/retrofit/api.mustache +++ b/modules/swagger-codegen/src/main/resources/retrofit/api.mustache @@ -10,20 +10,20 @@ import java.util.*; {{/imports}} {{#operations}} - public interface {{classname}} { - {{#operation}} - /** - * {{summary}} - * {{notes}} - {{#allParams}} * @param {{paramName}} {{description}} - {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} - */ - {{#formParams}}{{#-first}} - {{#isMultipart}}@Multipart{{/isMultipart}}{{^isMultipart}}@FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{path}}") - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}} {{nickname}}({{^allParams}});{{/allParams}} - {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{^hasMore}} - );{{/hasMore}}{{/allParams}} - {{/operation}} - } +public interface {{classname}} { + {{#operation}} + /** + * {{summary}} + * {{notes}} +{{#allParams}} * @param {{paramName}} {{description}} +{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + */ + {{#formParams}}{{#-first}} + {{#isMultipart}}@Multipart{{/isMultipart}}{{^isMultipart}}@FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} + @{{httpMethod}}("{{path}}") + {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}} {{nickname}}({{^allParams}});{{/allParams}} + {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{^hasMore}} + );{{/hasMore}}{{/allParams}} + {{/operation}} +} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/retrofit/model.mustache b/modules/swagger-codegen/src/main/resources/retrofit/model.mustache index 8764e59fdeb7..85213ed4c957 100644 --- a/modules/swagger-codegen/src/main/resources/retrofit/model.mustache +++ b/modules/swagger-codegen/src/main/resources/retrofit/model.mustache @@ -7,44 +7,44 @@ import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; {{#models}} - {{#model}}{{#description}} - /** - * {{description}} - **/{{/description}} - @ApiModel(description = "{{{description}}}") - public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { +{{#model}}{{#description}} +/** + * {{description}} + **/{{/description}} +@ApiModel(description = "{{{description}}}") +public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { {{#vars}}{{#isEnum}} - public enum {{datatypeWithEnum}} { + public enum {{datatypeWithEnum}} { {{#allowableValues}}{{#values}} {{.}}, {{/values}}{{/allowableValues}} - };{{/isEnum}} + };{{/isEnum}} /**{{#description}} - * {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} - **/ - @ApiModelProperty({{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") - @SerializedName("{{baseName}}"){{#isEnum}} - private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{^isEnum}} - private {{{datatype}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{/vars}} + * {{{description}}}{{/description}}{{#minimum}} + * minimum: {{minimum}}{{/minimum}}{{#maximum}} + * maximum: {{maximum}}{{/maximum}} + **/ + @ApiModelProperty({{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @SerializedName("{{baseName}}"){{#isEnum}} + private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{^isEnum}} + private {{{datatype}}} {{name}} = {{{defaultValue}}};{{/isEnum}}{{/vars}} - {{#vars}} - public {{{datatypeWithEnum}}} {{getter}}() { + {{#vars}} + public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; - } - public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + } + public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; - } + } {{/vars}} @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class {{classname}} {\n"); - {{#parent}}sb.append(" " + super.toString()).append("\n");{{/parent}} - {{#vars}}sb.append(" {{name}}: ").append({{name}}).append("\n"); - {{/vars}}sb.append("}\n"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" " + super.toString()).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append({{name}}).append("\n"); + {{/vars}}sb.append("}\n"); + return sb.toString(); } - } - {{/model}} +} +{{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/retrofit/pom.mustache b/modules/swagger-codegen/src/main/resources/retrofit/pom.mustache index 24307d971527..7d999db86caf 100644 --- a/modules/swagger-codegen/src/main/resources/retrofit/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/retrofit/pom.mustache @@ -1,146 +1,143 @@ - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} - - scm:git:git@github.com:swagger-api/swagger-mustache.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + + scm:git:git@github.com:swagger-api/swagger-mustache.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + 2.2.0 + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - - 1.6 - 1.6 - - - - - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - com.google.code.gson - gson - ${gson-version} - compile - - - com.squareup.retrofit - retrofit - ${retrofit-version} - compile - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + com.google.code.gson + gson + ${gson-version} + compile + + + com.squareup.retrofit + retrofit + ${retrofit-version} + compile + - - - junit - junit - ${junit-version} - test - - - - 1.5.0 - 2.3.1 - 1.9.0 - 1.0.0 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + 1.5.0 + 2.3.1 + 1.9.0 + 1.0.0 + 4.12 + diff --git a/modules/swagger-codegen/src/main/resources/retrofit/service.mustache b/modules/swagger-codegen/src/main/resources/retrofit/service.mustache index 3350f79ed48b..218a9304071a 100644 --- a/modules/swagger-codegen/src/main/resources/retrofit/service.mustache +++ b/modules/swagger-codegen/src/main/resources/retrofit/service.mustache @@ -6,18 +6,18 @@ import retrofit.RestAdapter; import retrofit.converter.GsonConverter; public class ServiceGenerator { -// No need to instantiate this class. -private ServiceGenerator() { } + // No need to instantiate this class. + private ServiceGenerator() { } -public static S createService(Class serviceClass) { + public static S createService(Class serviceClass) { Gson gson = new GsonBuilder() - .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .create(); + .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") + .create(); RestAdapter adapter = new RestAdapter.Builder() - .setEndpoint("{{basePath}}") - .setConverter(new GsonConverter(gson)) - .build(); + .setEndpoint("{{basePath}}") + .setConverter(new GsonConverter(gson)) + .build(); return adapter.create(serviceClass); - } - } + } +} From b636d2a2c9e6963f7322e5e71a57caebcdb3794f Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:56:26 +0800 Subject: [PATCH 23/41] rollback scala template --- .../src/main/resources/scala/api.mustache | 132 +++--- .../main/resources/scala/apiInvoker.mustache | 314 ++++++------- .../src/main/resources/scala/model.mustache | 12 +- .../src/main/resources/scala/pom.mustache | 431 +++++++++--------- 4 files changed, 443 insertions(+), 446 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/scala/api.mustache b/modules/swagger-codegen/src/main/resources/scala/api.mustache index de96bb528f4b..87b04b5900f7 100644 --- a/modules/swagger-codegen/src/main/resources/scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/api.mustache @@ -16,77 +16,77 @@ import java.util.Date import scala.collection.mutable.HashMap {{#operations}} - class {{classname}}(val defBasePath: String = "{{basePath}}", - defApiInvoker: ApiInvoker = ApiInvoker) { - var basePath = defBasePath - var apiInvoker = defApiInvoker +class {{classname}}(val defBasePath: String = "{{basePath}}", + defApiInvoker: ApiInvoker = ApiInvoker) { + var basePath = defBasePath + var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value - {{#operation}} - /** - * {{summary}} - * {{notes}} - {{#allParams}} * @param {{paramName}} {{description}} - {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} - */ - def {{nickname}} ({{#allParams}}{{paramName}}: {{dataType}}{{#defaultValue}} /* = {{{defaultValue}}} */{{/defaultValue}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {{#returnType}}: Option[{{returnType}}]{{/returnType}} = { - // create path and map variables - val path = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",apiInvoker.escape({{paramName}})) + {{#operation}} + /** + * {{summary}} + * {{notes}} +{{#allParams}} * @param {{paramName}} {{description}} +{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + */ + def {{nickname}} ({{#allParams}}{{paramName}}: {{dataType}}{{#defaultValue}} /* = {{{defaultValue}}} */{{/defaultValue}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {{#returnType}}: Option[{{returnType}}]{{/returnType}} = { + // create path and map variables + val path = "{{path}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",apiInvoker.escape({{paramName}})) - {{/pathParams}} + {{/pathParams}} - val contentTypes = List({{#consumes}}"{{mediaType}}", {{/consumes}}"application/json") - val contentType = contentTypes(0) + val contentTypes = List({{#consumes}}"{{mediaType}}", {{/consumes}}"application/json") + val contentType = contentTypes(0) - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] - {{#requiredParamCount}} - // verify required params are set - (List({{/requiredParamCount}}{{#requiredParams}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#requiredParamCount}}).filter(_ != null)).size match { - case {{requiredParamCount}} => // all required values set - case _ => throw new Exception("missing required params") - } - {{/requiredParamCount}} - - {{#queryParams}}if(String.valueOf({{paramName}}) != "null") queryParams += "{{baseName}}" -> {{paramName}}.toString - {{/queryParams}} - - {{#headerParams}}headerParams += "{{baseName}}" -> {{paramName}} - {{/headerParams}} - - var postBody: AnyRef = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}} - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - {{#formParams}}{{#notFile}} - mp.field("{{baseName}}", {{paramName}}.toString(), MediaType.MULTIPART_FORM_DATA_TYPE) - {{/notFile}}{{#isFile}} - mp.field("{{baseName}}", file.getName) - mp.bodyPart(new FileDataBodyPart("{{baseName}}", {{paramName}}, MediaType.MULTIPART_FORM_DATA_TYPE)) - {{/isFile}}{{/formParams}} - postBody = mp - } - else { - {{#formParams}}{{#notFile}}formParams += "{{baseName}}" -> {{paramName}}.toString(){{/notFile}} - {{/formParams}} - } - - try { - apiInvoker.invokeApi(basePath, path, "{{httpMethod}}", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - {{#returnType}} Some(ApiInvoker.deserialize(s, "{{returnContainer}}", classOf[{{returnBaseType}}]).asInstanceOf[{{returnType}}]) - {{/returnType}} - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - {{/operation}} + {{#requiredParamCount}} + // verify required params are set + (List({{/requiredParamCount}}{{#requiredParams}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#requiredParamCount}}).filter(_ != null)).size match { + case {{requiredParamCount}} => // all required values set + case _ => throw new Exception("missing required params") } + {{/requiredParamCount}} + + {{#queryParams}}if(String.valueOf({{paramName}}) != "null") queryParams += "{{baseName}}" -> {{paramName}}.toString + {{/queryParams}} + + {{#headerParams}}headerParams += "{{baseName}}" -> {{paramName}} + {{/headerParams}} + + var postBody: AnyRef = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}} + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + {{#formParams}}{{#notFile}} + mp.field("{{baseName}}", {{paramName}}.toString(), MediaType.MULTIPART_FORM_DATA_TYPE) + {{/notFile}}{{#isFile}} + mp.field("{{baseName}}", file.getName) + mp.bodyPart(new FileDataBodyPart("{{baseName}}", {{paramName}}, MediaType.MULTIPART_FORM_DATA_TYPE)) + {{/isFile}}{{/formParams}} + postBody = mp + } + else { + {{#formParams}}{{#notFile}}formParams += "{{baseName}}" -> {{paramName}}.toString(){{/notFile}} + {{/formParams}} + } + + try { + apiInvoker.invokeApi(basePath, path, "{{httpMethod}}", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + {{#returnType}} Some(ApiInvoker.deserialize(s, "{{returnContainer}}", classOf[{{returnBaseType}}]).asInstanceOf[{{returnType}}]) + {{/returnType}} + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + {{/operation}} +} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache index d1ac430f6ad1..f432c2dc59e4 100644 --- a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache @@ -25,179 +25,179 @@ import com.fasterxml.jackson.annotation._ import com.fasterxml.jackson.databind.annotation.JsonSerialize object ScalaJsonUtil { -def getJsonMapper = { -val mapper = new ObjectMapper() -mapper.registerModule(new DefaultScalaModule()) -mapper.registerModule(new JodaModule()); -mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); -mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT) -mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) -mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) -mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY) -mapper -} + def getJsonMapper = { + val mapper = new ObjectMapper() + mapper.registerModule(new DefaultScalaModule()) + mapper.registerModule(new JodaModule()); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT) + mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY) + mapper + } } class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, -httpHeaders: HashMap[String, String] = HashMap(), -hostMap: HashMap[String, Client] = HashMap(), -asyncHttpClient: Boolean = false, -authScheme: String = "", -authPreemptive: Boolean = false) { + httpHeaders: HashMap[String, String] = HashMap(), + hostMap: HashMap[String, Client] = HashMap(), + asyncHttpClient: Boolean = false, + authScheme: String = "", + authPreemptive: Boolean = false) { -var defaultHeaders: HashMap[String, String] = httpHeaders + var defaultHeaders: HashMap[String, String] = httpHeaders -def escape(value: String): String = { -URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") -} + def escape(value: String): String = { + URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + } -def escape(value: Long): String = value.toString -def escape(value: Double): String = value.toString -def escape(value: Float): String = value.toString + def escape(value: Long): String = value.toString + def escape(value: Double): String = value.toString + def escape(value: Float): String = value.toString -def deserialize(json: String, containerType: String, cls: Class[_]) = { -if (cls == classOf[String]) { -json match { -case s: String => { -if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 2) -else s -} -case _ => null -} -} else { -containerType.toLowerCase match { -case "array" => { -val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) -val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] -response.asScala.toList -} -case "list" => { -val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) -val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] -response.asScala.toList -} -case _ => { -json match { -case e: String if ("\"\"" == e) => null -case _ => mapper.readValue(json, cls) -} -} -} -} -} + def deserialize(json: String, containerType: String, cls: Class[_]) = { + if (cls == classOf[String]) { + json match { + case s: String => { + if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 2) + else s + } + case _ => null + } + } else { + containerType.toLowerCase match { + case "array" => { + val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] + response.asScala.toList + } + case "list" => { + val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] + response.asScala.toList + } + case _ => { + json match { + case e: String if ("\"\"" == e) => null + case _ => mapper.readValue(json, cls) + } + } + } + } + } -def serialize(obj: AnyRef): String = { -if (obj != null) { -obj match { -case e: List[_] => mapper.writeValueAsString(obj.asInstanceOf[List[_]].asJava) -case _ => mapper.writeValueAsString(obj) -} -} else null -} + def serialize(obj: AnyRef): String = { + if (obj != null) { + obj match { + case e: List[_] => mapper.writeValueAsString(obj.asInstanceOf[List[_]].asJava) + case _ => mapper.writeValueAsString(obj) + } + } else null + } -def invokeApi(host: String, path: String, method: String, queryParams: Map[String, String], formParams: Map[String, String], body: AnyRef, headerParams: Map[String, String], contentType: String): String = { -val client = getClient(host) + def invokeApi(host: String, path: String, method: String, queryParams: Map[String, String], formParams: Map[String, String], body: AnyRef, headerParams: Map[String, String], contentType: String): String = { + val client = getClient(host) -val querystring = queryParams.filter(k => k._2 != null).map(k => (escape(k._1) + "=" + escape(k._2))).mkString("?", "&", "") -val builder = client.resource(host + path + querystring).accept(contentType) -headerParams.map(p => builder.header(p._1, p._2)) -defaultHeaders.map(p => { -headerParams.contains(p._1) match { -case true => // override default with supplied header -case false => if (p._2 != null) builder.header(p._1, p._2) -} -}) -var formData: MultivaluedMapImpl = null -if(contentType == "application/x-www-form-urlencoded") { -formData = new MultivaluedMapImpl() -formParams.map(p => formData.add(p._1, p._2)) -} + val querystring = queryParams.filter(k => k._2 != null).map(k => (escape(k._1) + "=" + escape(k._2))).mkString("?", "&", "") + val builder = client.resource(host + path + querystring).accept(contentType) + headerParams.map(p => builder.header(p._1, p._2)) + defaultHeaders.map(p => { + headerParams.contains(p._1) match { + case true => // override default with supplied header + case false => if (p._2 != null) builder.header(p._1, p._2) + } + }) + var formData: MultivaluedMapImpl = null + if(contentType == "application/x-www-form-urlencoded") { + formData = new MultivaluedMapImpl() + formParams.map(p => formData.add(p._1, p._2)) + } -val response: ClientResponse = method match { -case "GET" => { -builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] -} -case "POST" => { -if(formData != null) builder.post(classOf[ClientResponse], formData) -else if(body != null && body.isInstanceOf[File]) { -val file = body.asInstanceOf[File] -val form = new FormDataMultiPart() -form.field("filename", file.getName()) -form.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) -builder.post(classOf[ClientResponse], form) -} -else { -if(body == null) builder.post(classOf[ClientResponse], serialize(body)) -else builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) -} -} -case "PUT" => { -if(formData != null) builder.post(classOf[ClientResponse], formData) -else if(body == null) builder.put(classOf[ClientResponse], null) -else builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) -} -case "DELETE" => { -builder.delete(classOf[ClientResponse]) -} -case _ => null -} -response.getClientResponseStatus().getStatusCode() match { -case 204 => "" -case code: Int if (Range(200, 299).contains(code)) => { -response.hasEntity() match { -case true => response.getEntity(classOf[String]) -case false => "" -} -} -case _ => { -val entity = response.hasEntity() match { -case true => response.getEntity(classOf[String]) -case false => "no data" -} -throw new ApiException( -response.getClientResponseStatus().getStatusCode(), -entity) -} -} -} + val response: ClientResponse = method match { + case "GET" => { + builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] + } + case "POST" => { + if(formData != null) builder.post(classOf[ClientResponse], formData) + else if(body != null && body.isInstanceOf[File]) { + val file = body.asInstanceOf[File] + val form = new FormDataMultiPart() + form.field("filename", file.getName()) + form.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) + builder.post(classOf[ClientResponse], form) + } + else { + if(body == null) builder.post(classOf[ClientResponse], serialize(body)) + else builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) + } + } + case "PUT" => { + if(formData != null) builder.post(classOf[ClientResponse], formData) + else if(body == null) builder.put(classOf[ClientResponse], null) + else builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) + } + case "DELETE" => { + builder.delete(classOf[ClientResponse]) + } + case _ => null + } + response.getClientResponseStatus().getStatusCode() match { + case 204 => "" + case code: Int if (Range(200, 299).contains(code)) => { + response.hasEntity() match { + case true => response.getEntity(classOf[String]) + case false => "" + } + } + case _ => { + val entity = response.hasEntity() match { + case true => response.getEntity(classOf[String]) + case false => "no data" + } + throw new ApiException( + response.getClientResponseStatus().getStatusCode(), + entity) + } + } + } -def getClient(host: String): Client = { -hostMap.contains(host) match { -case true => hostMap(host) -case false => { -val client = newClient(host) -// client.addFilter(new LoggingFilter()) -hostMap += host -> client -client -} -} -} + def getClient(host: String): Client = { + hostMap.contains(host) match { + case true => hostMap(host) + case false => { + val client = newClient(host) + // client.addFilter(new LoggingFilter()) + hostMap += host -> client + client + } + } + } + + def newClient(host: String): Client = asyncHttpClient match { + case true => { + import org.sonatype.spice.jersey.client.ahc.config.DefaultAhcConfig + import org.sonatype.spice.jersey.client.ahc.AhcHttpClient + import com.ning.http.client.Realm -def newClient(host: String): Client = asyncHttpClient match { -case true => { -import org.sonatype.spice.jersey.client.ahc.config.DefaultAhcConfig -import org.sonatype.spice.jersey.client.ahc.AhcHttpClient -import com.ning.http.client.Realm - -val config: DefaultAhcConfig = new DefaultAhcConfig() -if (!authScheme.isEmpty) { -val authSchemeEnum = Realm.AuthScheme.valueOf(authScheme) -config.getAsyncHttpClientConfigBuilder -.setRealm(new Realm.RealmBuilder().setScheme(authSchemeEnum) -.setUsePreemptiveAuth(authPreemptive).build) -} -AhcHttpClient.create(config) -} -case _ => Client.create() -} + val config: DefaultAhcConfig = new DefaultAhcConfig() + if (!authScheme.isEmpty) { + val authSchemeEnum = Realm.AuthScheme.valueOf(authScheme) + config.getAsyncHttpClientConfigBuilder + .setRealm(new Realm.RealmBuilder().setScheme(authSchemeEnum) + .setUsePreemptiveAuth(authPreemptive).build) + } + AhcHttpClient.create(config) + } + case _ => Client.create() + } } object ApiInvoker extends ApiInvoker(mapper = ScalaJsonUtil.getJsonMapper, -httpHeaders = HashMap(), -hostMap = HashMap(), -asyncHttpClient = {{asyncHttpClient}}, -authScheme = "{{authScheme}}", -authPreemptive = {{authPreemptive}}) + httpHeaders = HashMap(), + hostMap = HashMap(), + asyncHttpClient = {{asyncHttpClient}}, + authScheme = "{{authScheme}}", + authPreemptive = {{authPreemptive}}) class ApiException(val code: Int, msg: String) extends RuntimeException(msg) diff --git a/modules/swagger-codegen/src/main/resources/scala/model.mustache b/modules/swagger-codegen/src/main/resources/scala/model.mustache index cff9a993a848..a45b71a8f8e9 100644 --- a/modules/swagger-codegen/src/main/resources/scala/model.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/model.mustache @@ -5,11 +5,11 @@ package {{package}} {{#models}} - {{#model}} +{{#model}} - case class {{classname}} ( - {{#vars}}{{#description}}/* {{{description}}} */ - {{/description}}{{name}}: {{{datatype}}}{{#hasMore}},{{/hasMore}}{{^hasMore}}){{/hasMore}} - {{/vars}} - {{/model}} +case class {{classname}} ( + {{#vars}}{{#description}}/* {{{description}}} */ + {{/description}}{{name}}: {{{datatype}}}{{#hasMore}},{{/hasMore}}{{^hasMore}}){{/hasMore}} + {{/vars}} +{{/model}} {{/models}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache index 417bf20feee5..2d8a1257eb4f 100644 --- a/modules/swagger-codegen/src/main/resources/scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/pom.mustache @@ -1,224 +1,221 @@ - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} - - 2.2.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + + 2.2.0 + - - - maven-mongodb-plugin-repo - maven mongodb plugin repository - http://maven-mongodb-plugin.googlecode.com/svn/maven/repo - default - - + + + maven-mongodb-plugin-repo + maven mongodb plugin repository + http://maven-mongodb-plugin.googlecode.com/svn/maven/repo + default + + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - - 1.6 - 1.6 - - - - net.alchim31.maven - scala-maven-plugin - ${scala-maven-plugin-version} - - - scala-compile-first - process-resources - - add-source - compile - - - - scala-test-compile - process-test-resources - - testCompile - - - - - - -Xms128m - -Xmx1500m - - - - - - - - - org.scala-tools - maven-scala-plugin - - ${scala-version} - - - - - - - com.fasterxml.jackson.module - jackson-module-scala_2.10 - ${jackson-version} - - - com.sun.jersey - jersey-client - ${jersey-version} - - - com.sun.jersey.contribs - jersey-multipart - ${jersey-version} - - - org.jfarcand - jersey-ahc-client - ${jersey-async-version} - compile - - - org.scala-lang - scala-library - ${scala-version} - - - io.swagger - swagger-core - ${swagger-core-version} - - - org.scalatest - scalatest_2.10 - ${scala-test-version} - test - - - junit - junit - ${junit-version} - test - - - joda-time - joda-time - ${joda-time-version} - - - org.joda - joda-convert - ${joda-version} - - - - 2.10.4 - 1.2 - 2.2 - 1.7 - 1.5.0 - 1.0.5 - 1.0.0 - 2.4.2 + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin-version} + + + scala-compile-first + process-resources + + add-source + compile + + + + scala-test-compile + process-test-resources + + testCompile + + + + + + -Xms128m + -Xmx1500m + + + + + + + + + org.scala-tools + maven-scala-plugin + + ${scala-version} + + + + + + + com.fasterxml.jackson.module + jackson-module-scala_2.10 + ${jackson-version} + + + com.sun.jersey + jersey-client + ${jersey-version} + + + com.sun.jersey.contribs + jersey-multipart + ${jersey-version} + + + org.jfarcand + jersey-ahc-client + ${jersey-async-version} + compile + + + org.scala-lang + scala-library + ${scala-version} + + + io.swagger + swagger-core + ${swagger-core-version} + + + org.scalatest + scalatest_2.10 + ${scala-test-version} + test + + + junit + junit + ${junit-version} + test + + + joda-time + joda-time + ${joda-time-version} + + + org.joda + joda-convert + ${joda-version} + + + + 2.10.4 + 1.2 + 2.2 + 1.7 + 1.5.0 + 1.0.5 + 1.0.0 + 2.4.2 - 4.8.1 - 3.1.5 - 2.1.3 - + 4.8.1 + 3.1.5 + 2.1.3 + From f2ee63da3b7526d7b7a3a2aa2bd14fbae5c2e087 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:57:31 +0800 Subject: [PATCH 24/41] rollback scalatra template --- .../resources/scalatra/Bootstrap.mustache | 22 ++-- .../main/resources/scalatra/JettyMain.scala | 20 ++-- .../main/resources/scalatra/JsonUtil.scala | 2 + .../main/resources/scalatra/README.mustache | 2 +- .../resources/scalatra/ServletApp.mustache | 44 +++---- .../src/main/resources/scalatra/api.mustache | 112 +++++++++--------- .../src/main/resources/scalatra/build.sbt | 50 ++++---- .../main/resources/scalatra/model.mustache | 14 +-- .../src/main/resources/scalatra/web.xml | 28 ++--- 9 files changed, 148 insertions(+), 146 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache b/modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache index 08cc829bd809..5121079424fb 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache @@ -5,16 +5,16 @@ import javax.servlet.ServletContext import org.scalatra.LifeCycle class ScalatraBootstrap extends LifeCycle { -implicit val swagger = new SwaggerApp + implicit val swagger = new SwaggerApp -override def init(context: ServletContext) { -implicit val system = ActorSystem("appActorSystem") -try { -{{#apiInfo}}{{#apis}}context mount (new {{classname}}, "/{{baseName}}/*") -{{/apis}}{{/apiInfo}} -context mount (new ResourcesApp, "/api-docs/*") -} catch { -case e: Throwable => e.printStackTrace() -} -} + override def init(context: ServletContext) { + implicit val system = ActorSystem("appActorSystem") + try { + {{#apiInfo}}{{#apis}}context mount (new {{classname}}, "/{{baseName}}/*") + {{/apis}}{{/apiInfo}} + context mount (new ResourcesApp, "/api-docs/*") + } catch { + case e: Throwable => e.printStackTrace() + } + } } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/scalatra/JettyMain.scala b/modules/swagger-codegen/src/main/resources/scalatra/JettyMain.scala index 69ca43c0e1f8..e25f16ba3929 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/JettyMain.scala +++ b/modules/swagger-codegen/src/main/resources/scalatra/JettyMain.scala @@ -1,7 +1,17 @@ - +import org.eclipse.jetty.server._ +import org.eclipse.jetty.webapp.WebAppContext +import org.scalatra.servlet.ScalatraListener object JettyMain { + object conf { + val port = sys.env.get("PORT") map (_.toInt) getOrElse (8080) + val stopTimeout = sys.env.get("STOP_TIMEOUT") map (_.toInt) getOrElse (5000) + val connectorIdleTimeout = sys.env.get("CONNECTOR_IDLE_TIMEOUT") map (_.toInt) getOrElse (90000) + val webapp = sys.env.get("PUBLIC") getOrElse "webapp" + val contextPath = sys.env.get("CONTEXT_PATH") getOrElse "/" + } + def main(args: Array[String]) = { val server: Server = new Server println("starting jetty") @@ -30,12 +40,4 @@ object JettyMain { server.start() } - - object conf { - val port = sys.env.get("PORT") map (_.toInt) getOrElse (8080) - val stopTimeout = sys.env.get("STOP_TIMEOUT") map (_.toInt) getOrElse (5000) - val connectorIdleTimeout = sys.env.get("CONNECTOR_IDLE_TIMEOUT") map (_.toInt) getOrElse (90000) - val webapp = sys.env.get("PUBLIC") getOrElse "webapp" - val contextPath = sys.env.get("CONTEXT_PATH") getOrElse "/" - } } diff --git a/modules/swagger-codegen/src/main/resources/scalatra/JsonUtil.scala b/modules/swagger-codegen/src/main/resources/scalatra/JsonUtil.scala index 1502e1092be1..691a82f563b7 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/JsonUtil.scala +++ b/modules/swagger-codegen/src/main/resources/scalatra/JsonUtil.scala @@ -1,5 +1,7 @@ package json +import com.fasterxml.jackson.module.scala.DefaultScalaModule +import com.fasterxml.jackson.core.JsonGenerator.Feature import com.fasterxml.jackson.databind._ object JsonUtil { diff --git a/modules/swagger-codegen/src/main/resources/scalatra/README.mustache b/modules/swagger-codegen/src/main/resources/scalatra/README.mustache index 4a80e8480a7d..3ffa01fb2571 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/README.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/README.mustache @@ -1,7 +1,7 @@ # Swagger generated server ## Overview -This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This is an example of building a swagger-enabled scalatra server. diff --git a/modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache b/modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache index bae9c83a77ff..423b86447127 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache @@ -8,32 +8,32 @@ import org.scalatra.ScalatraServlet import org.json4s.{DefaultFormats, Formats} class ResourcesApp(implicit protected val system: ActorSystem, val swagger: SwaggerApp) -extends ScalatraServlet with JacksonSwaggerBase { -before() { -response.headers += ("Access-Control-Allow-Origin" -> "*") -} + extends ScalatraServlet with JacksonSwaggerBase { + before() { + response.headers += ("Access-Control-Allow-Origin" -> "*") + } -protected def buildFullUrl(path: String) = if (path.startsWith("http")) path else { -val port = request.getServerPort -val h = request.getServerName -val prot = if (port == 443) "https" else "http" -val (proto, host) = if (port != 80 && port != 443) ("http", h+":"+port.toString) else (prot, h) -"%s://%s%s%s".format( -proto, -host, -request.getContextPath, -path) -} + protected def buildFullUrl(path: String) = if (path.startsWith("http")) path else { + val port = request.getServerPort + val h = request.getServerName + val prot = if (port == 443) "https" else "http" + val (proto, host) = if (port != 80 && port != 443) ("http", h+":"+port.toString) else (prot, h) + "%s://%s%s%s".format( + proto, + host, + request.getContextPath, + path) + } } class SwaggerApp extends Swagger(apiInfo = ApiSwagger.apiInfo, apiVersion = "1.0", swaggerVersion = "1.2") object ApiSwagger { -val apiInfo = ApiInfo( -"""{{{appName}}}""", -"""{{{appDescription}}}""", -"""{{{infoUrl}}}""", -"""{{{infoEmail}}}""", -"""{{{licenseInfo}}}""", -"""{{{licenseUrl}}}""") + val apiInfo = ApiInfo( + """{{{appName}}}""", + """{{{appDescription}}}""", + """{{{infoUrl}}}""", + """{{{infoEmail}}}""", + """{{{licenseInfo}}}""", + """{{{licenseUrl}}}""") } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/scalatra/api.mustache b/modules/swagger-codegen/src/main/resources/scalatra/api.mustache index bb559a6b1b32..54710361fe9a 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/api.mustache @@ -14,26 +14,26 @@ import org.scalatra.servlet.{FileUploadSupport, MultipartConfig, SizeConstraintE import scala.collection.JavaConverters._ -class {{classname}} (implicit val swagger: Swagger) extends ScalatraServlet -with FileUploadSupport -with JacksonJsonSupport -with SwaggerSupport { -protected implicit val jsonFormats: Formats = DefaultFormats +class {{classname}} (implicit val swagger: Swagger) extends ScalatraServlet + with FileUploadSupport + with JacksonJsonSupport + with SwaggerSupport { + protected implicit val jsonFormats: Formats = DefaultFormats -protected val applicationDescription: String = "{{classname}}" -override protected val applicationName: Option[String] = Some("{{baseName}}") + protected val applicationDescription: String = "{{classname}}" + override protected val applicationName: Option[String] = Some("{{baseName}}") -before() { -contentType = formats("json") -response.headers += ("Access-Control-Allow-Origin" -> "*") -} + before() { + contentType = formats("json") + response.headers += ("Access-Control-Allow-Origin" -> "*") + } {{#operations}} - {{#operation}} - {{newline}} +{{#operation}} + {{newline}} - val {{nickname}}Operation = (apiOperation[{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]("{{nickname}}") - summary "{{{summary}}}" - parameters( + val {{nickname}}Operation = (apiOperation[{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]("{{nickname}}") + summary "{{{summary}}}" + parameters( {{#allParams}}{{#isQueryParam}}queryParam[{{dataType}}]("{{paramName}}").description(""){{^required}}.optional{{/required}}{{#defaultValue}}.defaultValue({{{defaultValue}}}){{/defaultValue}} {{/isQueryParam}} {{#isPathParam}}pathParam[{{dataType}}]("{{paramName}}").description(""){{#defaultValue}}.defaultValue({{{defaultValue}}}){{/defaultValue}} @@ -46,49 +46,49 @@ response.headers += ("Access-Control-Allow-Origin" -> "*") {{/isFormParam}} {{#hasMore}},{{/hasMore}} {{/allParams}}) - ) + ) - {{httpMethod}}("{{path}}",operation({{nickname}}Operation)) { - {{#allParams}} - {{#isFile}} - val {{paramName}} = fileParams("{{paramName}}") - {{/isFile}} - {{^isFile}} - {{#isPathParam}} - val {{paramName}} = params.getOrElse("{{paramName}}", halt(400)) - {{/isPathParam}} + {{httpMethod}}("{{path}}",operation({{nickname}}Operation)) { + {{#allParams}} + {{#isFile}} + val {{paramName}} = fileParams("{{paramName}}") + {{/isFile}} + {{^isFile}} + {{#isPathParam}} + val {{paramName}} = params.getOrElse("{{paramName}}", halt(400)) + {{/isPathParam}} - {{#isQueryParam}} - {{#collectionFormat}}val {{paramName}}String = params.getAs[String]("{{paramName}}") - val {{paramName}} = if("{{collectionFormat}}".equals("default")) { - {{paramName}}String match { - case Some(str) => str.split(",") - case None => List() - } - } - else - List() - {{/collectionFormat}} - {{^collectionFormat}}val {{paramName}} = params.getAs[{{dataType}}]("{{paramName}}"){{/collectionFormat}} - - {{/isQueryParam}} - - {{#isHeaderParam}} - val {{paramName}} = request.getHeader("{{paramName}}") - {{/isHeaderParam}} - - {{#isFormParam}} - val {{paramName}} = params.getAs[{{dataType}}]("{{paramName}}") - {{/isFormParam}} - - {{#isBodyParam}} - val {{paramName}} = parsedBody.extract[{{dataType}}] - {{/isBodyParam}} - {{/isFile}} - println("{{paramName}}: " + {{paramName}}) - {{/allParams}} + {{#isQueryParam}} + {{#collectionFormat}}val {{paramName}}String = params.getAs[String]("{{paramName}}") + val {{paramName}} = if("{{collectionFormat}}".equals("default")) { + {{paramName}}String match { + case Some(str) => str.split(",") + case None => List() } + } + else + List() + {{/collectionFormat}} + {{^collectionFormat}}val {{paramName}} = params.getAs[{{dataType}}]("{{paramName}}"){{/collectionFormat}} + + {{/isQueryParam}} - {{/operation}} + {{#isHeaderParam}} + val {{paramName}} = request.getHeader("{{paramName}}") + {{/isHeaderParam}} + + {{#isFormParam}} + val {{paramName}} = params.getAs[{{dataType}}]("{{paramName}}") + {{/isFormParam}} + + {{#isBodyParam}} + val {{paramName}} = parsedBody.extract[{{dataType}}] + {{/isBodyParam}} + {{/isFile}} + println("{{paramName}}: " + {{paramName}}) + {{/allParams}} + } + +{{/operation}} {{/operations}} } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/scalatra/build.sbt b/modules/swagger-codegen/src/main/resources/scalatra/build.sbt index 23af47dada0b..00575312d853 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/build.sbt +++ b/modules/swagger-codegen/src/main/resources/scalatra/build.sbt @@ -1,6 +1,4 @@ - - -// put this at the top of the file +import AssemblyKeys._ // put this at the top of the file import NativePackagerKeys._ @@ -12,7 +10,7 @@ scalariformSettings organization := "io.swagger" -seq(webSettings: _*) +seq(webSettings :_*) mainClass in assembly := Some("JettyMain") @@ -25,40 +23,40 @@ scalaVersion := "2.11.2" scalacOptions += "-language:postfixOps" libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "2.2.1" % "test", - "org.scalatra" %% "scalatra" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-scalate" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-json" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-swagger" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-swagger-ext" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-slf4j" % "2.3.0.RC3", - "org.json4s" %% "json4s-jackson" % "3.2.10", - "org.json4s" %% "json4s-ext" % "3.2.10", - "commons-codec" % "commons-codec" % "1.7", - "net.databinder.dispatch" %% "dispatch-core" % "0.11.2", + "org.scalatest" %% "scalatest" % "2.2.1" % "test", + "org.scalatra" %% "scalatra" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-scalate" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-json" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-swagger" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-swagger-ext" % "2.3.0.RC3", + "org.scalatra" %% "scalatra-slf4j" % "2.3.0.RC3", + "org.json4s" %% "json4s-jackson" % "3.2.10", + "org.json4s" %% "json4s-ext" % "3.2.10", + "commons-codec" % "commons-codec" % "1.7", + "net.databinder.dispatch" %% "dispatch-core" % "0.11.2", //"net.databinder.dispatch" %% "json4s-jackson" % "0.11.2", - "net.databinder.dispatch" %% "dispatch-json4s-jackson" % "0.11.2", - "com.typesafe.akka" %% "akka-actor" % "2.3.6", - "org.eclipse.jetty" % "jetty-server" % "9.2.3.v20140905" % "container;compile;test", - "org.eclipse.jetty" % "jetty-webapp" % "9.2.3.v20140905" % "container;compile;test", - "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;compile;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar")) + "net.databinder.dispatch" %% "dispatch-json4s-jackson" % "0.11.2", + "com.typesafe.akka" %% "akka-actor" % "2.3.6", + "org.eclipse.jetty" % "jetty-server" % "9.2.3.v20140905" % "container;compile;test", + "org.eclipse.jetty" % "jetty-webapp" % "9.2.3.v20140905" % "container;compile;test", + "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;compile;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar")) ) -resolvers += "Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository" +resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository" resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" resolvers += "Sonatype OSS Releases" at "http://oss.sonatype.org/content/repositories/releases/" ivyXML := - - - - + + + + mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) => { - case "about.html" => MergeStrategy.discard + case "about.html" => MergeStrategy.discard case x => old(x) } } diff --git a/modules/swagger-codegen/src/main/resources/scalatra/model.mustache b/modules/swagger-codegen/src/main/resources/scalatra/model.mustache index f740d40bc079..8c5d19546622 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/model.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/model.mustache @@ -5,11 +5,11 @@ package {{package}} {{#models}} - {{#model}} - case class {{classname}} ( - {{#vars}}{{name}}: {{#isNotRequired}}Option[{{/isNotRequired}}{{datatype}}{{#isNotRequired}}] {{#description}} // {{description}}{{/description}} - {{/isNotRequired}}{{#hasMore}}, - {{/hasMore}}{{/vars}} - ) - {{/model}} +{{#model}} +case class {{classname}} ( + {{#vars}}{{name}}: {{#isNotRequired}}Option[{{/isNotRequired}}{{datatype}}{{#isNotRequired}}] {{#description}} // {{description}}{{/description}} + {{/isNotRequired}}{{#hasMore}}, + {{/hasMore}}{{/vars}} +) +{{/model}} {{/models}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/scalatra/web.xml b/modules/swagger-codegen/src/main/resources/scalatra/web.xml index a6e529e4aecb..2a08440458ea 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/web.xml +++ b/modules/swagger-codegen/src/main/resources/scalatra/web.xml @@ -1,17 +1,17 @@ - - - org.scalatra.servlet.ScalatraListener - + + + org.scalatra.servlet.ScalatraListener + - - default - /*.html - /css/* - /js/*.js - /images/* - + + default + /*.html + /css/* + /js/*.js + /images/* + From d8060f47a8fb289597db06750c2d39aae377fb3c Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 9 Jun 2015 12:58:41 +0800 Subject: [PATCH 25/41] rollback swagger-static template --- .../assets/css/bootstrap-responsive.css | 2337 ++++---- .../swagger-static/assets/css/bootstrap.css | 5205 ++++++++--------- .../swagger-static/assets/css/style.css | 323 +- .../swagger-static/assets/js/bootstrap.js | 3261 +++++------ .../assets/js/jquery-1.8.3.min.js | 2803 +-------- .../swagger-static/assets/js/main.js | 105 +- .../resources/swagger-static/index.mustache | 90 +- .../resources/swagger-static/model.mustache | 20 +- .../swagger-static/operation.mustache | 68 +- .../resources/swagger-static/package.mustache | 20 +- .../src/main/resources/swagger-static/pom.xml | 196 +- 11 files changed, 5674 insertions(+), 8754 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap-responsive.css b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap-responsive.css index 41580e0ea07c..a3352d774ce8 100644 --- a/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap-responsive.css +++ b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap-responsive.css @@ -9,1319 +9,1084 @@ */ @-ms-viewport { - width: device-width; + width: device-width; } .clearfix { - *zoom: 1; + *zoom: 1; } .clearfix:before, .clearfix:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .clearfix:after { - clear: both; + clear: both; } .hide-text { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; } .input-block-level { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.hidden { + display: none; + visibility: hidden; +} + +.visible-phone { + display: none !important; +} + +.visible-tablet { + display: none !important; +} + +.hidden-desktop { + display: none !important; +} + +.visible-desktop { + display: inherit !important; +} + +@media (min-width: 768px) and (max-width: 979px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important ; + } + .visible-tablet { + display: inherit !important; + } + .hidden-tablet { + display: none !important; + } +} + +@media (max-width: 767px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important; + } + .visible-phone { + display: inherit !important; + } + .hidden-phone { + display: none !important; + } +} + +@media (min-width: 1200px) { + .row { + margin-left: -30px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 30px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 1170px; + } + .span12 { + width: 1170px; + } + .span11 { + width: 1070px; + } + .span10 { + width: 970px; + } + .span9 { + width: 870px; + } + .span8 { + width: 770px; + } + .span7 { + width: 670px; + } + .span6 { + width: 570px; + } + .span5 { + width: 470px; + } + .span4 { + width: 370px; + } + .span3 { + width: 270px; + } + .span2 { + width: 170px; + } + .span1 { + width: 70px; + } + .offset12 { + margin-left: 1230px; + } + .offset11 { + margin-left: 1130px; + } + .offset10 { + margin-left: 1030px; + } + .offset9 { + margin-left: 930px; + } + .offset8 { + margin-left: 830px; + } + .offset7 { + margin-left: 730px; + } + .offset6 { + margin-left: 630px; + } + .offset5 { + margin-left: 530px; + } + .offset4 { + margin-left: 430px; + } + .offset3 { + margin-left: 330px; + } + .offset2 { + margin-left: 230px; + } + .offset1 { + margin-left: 130px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.564102564102564%; + *margin-left: 2.5109110747408616%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.564102564102564%; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.45299145299145%; + *width: 91.39979996362975%; + } + .row-fluid .span10 { + width: 82.90598290598291%; + *width: 82.8527914166212%; + } + .row-fluid .span9 { + width: 74.35897435897436%; + *width: 74.30578286961266%; + } + .row-fluid .span8 { + width: 65.81196581196582%; + *width: 65.75877432260411%; + } + .row-fluid .span7 { + width: 57.26495726495726%; + *width: 57.21176577559556%; + } + .row-fluid .span6 { + width: 48.717948717948715%; + *width: 48.664757228587014%; + } + .row-fluid .span5 { + width: 40.17094017094017%; + *width: 40.11774868157847%; + } + .row-fluid .span4 { + width: 31.623931623931625%; + *width: 31.570740134569924%; + } + .row-fluid .span3 { + width: 23.076923076923077%; + *width: 23.023731587561375%; + } + .row-fluid .span2 { + width: 14.52991452991453%; + *width: 14.476723040552828%; + } + .row-fluid .span1 { + width: 5.982905982905983%; + *width: 5.929714493544281%; + } + .row-fluid .offset12 { + margin-left: 105.12820512820512%; + *margin-left: 105.02182214948171%; + } + .row-fluid .offset12:first-child { + margin-left: 102.56410256410257%; + *margin-left: 102.45771958537915%; + } + .row-fluid .offset11 { + margin-left: 96.58119658119658%; + *margin-left: 96.47481360247316%; + } + .row-fluid .offset11:first-child { + margin-left: 94.01709401709402%; + *margin-left: 93.91071103837061%; + } + .row-fluid .offset10 { + margin-left: 88.03418803418803%; + *margin-left: 87.92780505546462%; + } + .row-fluid .offset10:first-child { + margin-left: 85.47008547008548%; + *margin-left: 85.36370249136206%; + } + .row-fluid .offset9 { + margin-left: 79.48717948717949%; + *margin-left: 79.38079650845607%; + } + .row-fluid .offset9:first-child { + margin-left: 76.92307692307693%; + *margin-left: 76.81669394435352%; + } + .row-fluid .offset8 { + margin-left: 70.94017094017094%; + *margin-left: 70.83378796144753%; + } + .row-fluid .offset8:first-child { + margin-left: 68.37606837606839%; + *margin-left: 68.26968539734497%; + } + .row-fluid .offset7 { + margin-left: 62.393162393162385%; + *margin-left: 62.28677941443899%; + } + .row-fluid .offset7:first-child { + margin-left: 59.82905982905982%; + *margin-left: 59.72267685033642%; + } + .row-fluid .offset6 { + margin-left: 53.84615384615384%; + *margin-left: 53.739770867430444%; + } + .row-fluid .offset6:first-child { + margin-left: 51.28205128205128%; + *margin-left: 51.175668303327875%; + } + .row-fluid .offset5 { + margin-left: 45.299145299145295%; + *margin-left: 45.1927623204219%; + } + .row-fluid .offset5:first-child { + margin-left: 42.73504273504273%; + *margin-left: 42.62865975631933%; + } + .row-fluid .offset4 { + margin-left: 36.75213675213675%; + *margin-left: 36.645753773413354%; + } + .row-fluid .offset4:first-child { + margin-left: 34.18803418803419%; + *margin-left: 34.081651209310785%; + } + .row-fluid .offset3 { + margin-left: 28.205128205128204%; + *margin-left: 28.0987452264048%; + } + .row-fluid .offset3:first-child { + margin-left: 25.641025641025642%; + *margin-left: 25.53464266230224%; + } + .row-fluid .offset2 { + margin-left: 19.65811965811966%; + *margin-left: 19.551736679396257%; + } + .row-fluid .offset2:first-child { + margin-left: 17.094017094017094%; + *margin-left: 16.98763411529369%; + } + .row-fluid .offset1 { + margin-left: 11.11111111111111%; + *margin-left: 11.004728132387708%; + } + .row-fluid .offset1:first-child { + margin-left: 8.547008547008547%; + *margin-left: 8.440625568285142%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 30px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 1156px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 1056px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 956px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 856px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 756px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 656px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 556px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 456px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 356px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 256px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 156px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 56px; + } + .thumbnails { + margin-left: -30px; + } + .thumbnails > li { + margin-left: 30px; + } + .row-fluid .thumbnails { + margin-left: 0; + } +} + +@media (min-width: 768px) and (max-width: 979px) { + .row { + margin-left: -20px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 20px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 724px; + } + .span12 { + width: 724px; + } + .span11 { + width: 662px; + } + .span10 { + width: 600px; + } + .span9 { + width: 538px; + } + .span8 { + width: 476px; + } + .span7 { + width: 414px; + } + .span6 { + width: 352px; + } + .span5 { + width: 290px; + } + .span4 { + width: 228px; + } + .span3 { + width: 166px; + } + .span2 { + width: 104px; + } + .span1 { + width: 42px; + } + .offset12 { + margin-left: 764px; + } + .offset11 { + margin-left: 702px; + } + .offset10 { + margin-left: 640px; + } + .offset9 { + margin-left: 578px; + } + .offset8 { + margin-left: 516px; + } + .offset7 { + margin-left: 454px; + } + .offset6 { + margin-left: 392px; + } + .offset5 { + margin-left: 330px; + } + .offset4 { + margin-left: 268px; + } + .offset3 { + margin-left: 206px; + } + .offset2 { + margin-left: 144px; + } + .offset1 { + margin-left: 82px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.7624309392265194%; + *margin-left: 2.709239449864817%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.7624309392265194%; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.43646408839778%; + *width: 91.38327259903608%; + } + .row-fluid .span10 { + width: 82.87292817679558%; + *width: 82.81973668743387%; + } + .row-fluid .span9 { + width: 74.30939226519337%; + *width: 74.25620077583166%; + } + .row-fluid .span8 { + width: 65.74585635359117%; + *width: 65.69266486422946%; + } + .row-fluid .span7 { + width: 57.18232044198895%; + *width: 57.12912895262725%; + } + .row-fluid .span6 { + width: 48.61878453038674%; + *width: 48.56559304102504%; + } + .row-fluid .span5 { + width: 40.05524861878453%; + *width: 40.00205712942283%; + } + .row-fluid .span4 { + width: 31.491712707182323%; + *width: 31.43852121782062%; + } + .row-fluid .span3 { + width: 22.92817679558011%; + *width: 22.87498530621841%; + } + .row-fluid .span2 { + width: 14.3646408839779%; + *width: 14.311449394616199%; + } + .row-fluid .span1 { + width: 5.801104972375691%; + *width: 5.747913483013988%; + } + .row-fluid .offset12 { + margin-left: 105.52486187845304%; + *margin-left: 105.41847889972962%; + } + .row-fluid .offset12:first-child { + margin-left: 102.76243093922652%; + *margin-left: 102.6560479605031%; + } + .row-fluid .offset11 { + margin-left: 96.96132596685082%; + *margin-left: 96.8549429881274%; + } + .row-fluid .offset11:first-child { + margin-left: 94.1988950276243%; + *margin-left: 94.09251204890089%; + } + .row-fluid .offset10 { + margin-left: 88.39779005524862%; + *margin-left: 88.2914070765252%; + } + .row-fluid .offset10:first-child { + margin-left: 85.6353591160221%; + *margin-left: 85.52897613729868%; + } + .row-fluid .offset9 { + margin-left: 79.8342541436464%; + *margin-left: 79.72787116492299%; + } + .row-fluid .offset9:first-child { + margin-left: 77.07182320441989%; + *margin-left: 76.96544022569647%; + } + .row-fluid .offset8 { + margin-left: 71.2707182320442%; + *margin-left: 71.16433525332079%; + } + .row-fluid .offset8:first-child { + margin-left: 68.50828729281768%; + *margin-left: 68.40190431409427%; + } + .row-fluid .offset7 { + margin-left: 62.70718232044199%; + *margin-left: 62.600799341718584%; + } + .row-fluid .offset7:first-child { + margin-left: 59.94475138121547%; + *margin-left: 59.838368402492065%; + } + .row-fluid .offset6 { + margin-left: 54.14364640883978%; + *margin-left: 54.037263430116376%; + } + .row-fluid .offset6:first-child { + margin-left: 51.38121546961326%; + *margin-left: 51.27483249088986%; + } + .row-fluid .offset5 { + margin-left: 45.58011049723757%; + *margin-left: 45.47372751851417%; + } + .row-fluid .offset5:first-child { + margin-left: 42.81767955801105%; + *margin-left: 42.71129657928765%; + } + .row-fluid .offset4 { + margin-left: 37.01657458563536%; + *margin-left: 36.91019160691196%; + } + .row-fluid .offset4:first-child { + margin-left: 34.25414364640884%; + *margin-left: 34.14776066768544%; + } + .row-fluid .offset3 { + margin-left: 28.45303867403315%; + *margin-left: 28.346655695309746%; + } + .row-fluid .offset3:first-child { + margin-left: 25.69060773480663%; + *margin-left: 25.584224756083227%; + } + .row-fluid .offset2 { + margin-left: 19.88950276243094%; + *margin-left: 19.783119783707537%; + } + .row-fluid .offset2:first-child { + margin-left: 17.12707182320442%; + *margin-left: 17.02068884448102%; + } + .row-fluid .offset1 { + margin-left: 11.32596685082873%; + *margin-left: 11.219583872105325%; + } + .row-fluid .offset1:first-child { + margin-left: 8.56353591160221%; + *margin-left: 8.457152932878806%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 20px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 710px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 648px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 586px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 524px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 462px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 400px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 338px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 276px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 214px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 152px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 90px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 28px; + } +} + +@media (max-width: 767px) { + body { + padding-right: 20px; + padding-left: 20px; + } + .navbar-fixed-top, + .navbar-fixed-bottom, + .navbar-static-top { + margin-right: -20px; + margin-left: -20px; + } + .container-fluid { + padding: 0; + } + .dl-horizontal dt { + float: none; + width: auto; + clear: none; + text-align: left; + } + .dl-horizontal dd { + margin-left: 0; + } + .container { + width: auto; + } + .row-fluid { + width: 100%; + } + .row, + .thumbnails { + margin-left: 0; + } + .thumbnails > li { + float: none; + margin-left: 0; + } + [class*="span"], + .uneditable-input[class*="span"], + .row-fluid [class*="span"] { + display: block; + float: none; + width: 100%; + margin-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .span12, + .row-fluid .span12 { + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="offset"]:first-child { + margin-left: 0; + } + .input-large, + .input-xlarge, + .input-xxlarge, + input[class*="span"], + select[class*="span"], + textarea[class*="span"], + .uneditable-input { display: block; width: 100%; min-height: 30px; -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.hidden { - display: none; - visibility: hidden; -} - -.visible-phone { - display: none !important; -} - -.visible-tablet { - display: none !important; -} - -.hidden-desktop { - display: none !important; -} - -.visible-desktop { - display: inherit !important; -} - -@media (min-width: 768px) and (max-width: 979px) { - .hidden-desktop { - display: inherit !important; - } - - .visible-desktop { - display: none !important; - } - - .visible-tablet { - display: inherit !important; - } - - .hidden-tablet { - display: none !important; - } -} - -@media (max-width: 767px) { - .hidden-desktop { - display: inherit !important; - } - - .visible-desktop { - display: none !important; - } - - .visible-phone { - display: inherit !important; - } - - .hidden-phone { - display: none !important; - } -} - -@media (min-width: 1200px) { - .row { - margin-left: -30px; - *zoom: 1; - } - - .row:before, - .row:after { - display: table; - line-height: 0; - content: ""; - } - - .row:after { - clear: both; - } - - [class*="span"] { - float: left; - min-height: 1px; - margin-left: 30px; - } - - .container, - .navbar-static-top .container, - .navbar-fixed-top .container, - .navbar-fixed-bottom .container { - width: 1170px; - } - - .span12 { - width: 1170px; - } - - .span11 { - width: 1070px; - } - - .span10 { - width: 970px; - } - - .span9 { - width: 870px; - } - - .span8 { - width: 770px; - } - - .span7 { - width: 670px; - } - - .span6 { - width: 570px; - } - - .span5 { - width: 470px; - } - - .span4 { - width: 370px; - } - - .span3 { - width: 270px; - } - - .span2 { - width: 170px; - } - - .span1 { - width: 70px; - } - - .offset12 { - margin-left: 1230px; - } - - .offset11 { - margin-left: 1130px; - } - - .offset10 { - margin-left: 1030px; - } - - .offset9 { - margin-left: 930px; - } - - .offset8 { - margin-left: 830px; - } - - .offset7 { - margin-left: 730px; - } - - .offset6 { - margin-left: 630px; - } - - .offset5 { - margin-left: 530px; - } - - .offset4 { - margin-left: 430px; - } - - .offset3 { - margin-left: 330px; - } - - .offset2 { - margin-left: 230px; - } - - .offset1 { - margin-left: 130px; - } - - .row-fluid { - width: 100%; - *zoom: 1; - } - - .row-fluid:before, - .row-fluid:after { - display: table; - line-height: 0; - content: ""; - } - - .row-fluid:after { - clear: both; - } - - .row-fluid [class*="span"] { - display: block; - float: left; - width: 100%; - min-height: 30px; - margin-left: 2.564102564102564%; - *margin-left: 2.5109110747408616%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .row-fluid [class*="span"]:first-child { - margin-left: 0; - } - - .row-fluid .controls-row [class*="span"] + [class*="span"] { - margin-left: 2.564102564102564%; - } - - .row-fluid .span12 { - width: 100%; - *width: 99.94680851063829%; - } - - .row-fluid .span11 { - width: 91.45299145299145%; - *width: 91.39979996362975%; - } - - .row-fluid .span10 { - width: 82.90598290598291%; - *width: 82.8527914166212%; - } - - .row-fluid .span9 { - width: 74.35897435897436%; - *width: 74.30578286961266%; - } - - .row-fluid .span8 { - width: 65.81196581196582%; - *width: 65.75877432260411%; - } - - .row-fluid .span7 { - width: 57.26495726495726%; - *width: 57.21176577559556%; - } - - .row-fluid .span6 { - width: 48.717948717948715%; - *width: 48.664757228587014%; - } - - .row-fluid .span5 { - width: 40.17094017094017%; - *width: 40.11774868157847%; - } - - .row-fluid .span4 { - width: 31.623931623931625%; - *width: 31.570740134569924%; - } - - .row-fluid .span3 { - width: 23.076923076923077%; - *width: 23.023731587561375%; - } - - .row-fluid .span2 { - width: 14.52991452991453%; - *width: 14.476723040552828%; - } - - .row-fluid .span1 { - width: 5.982905982905983%; - *width: 5.929714493544281%; - } - - .row-fluid .offset12 { - margin-left: 105.12820512820512%; - *margin-left: 105.02182214948171%; - } - - .row-fluid .offset12:first-child { - margin-left: 102.56410256410257%; - *margin-left: 102.45771958537915%; - } - - .row-fluid .offset11 { - margin-left: 96.58119658119658%; - *margin-left: 96.47481360247316%; - } - - .row-fluid .offset11:first-child { - margin-left: 94.01709401709402%; - *margin-left: 93.91071103837061%; - } - - .row-fluid .offset10 { - margin-left: 88.03418803418803%; - *margin-left: 87.92780505546462%; - } - - .row-fluid .offset10:first-child { - margin-left: 85.47008547008548%; - *margin-left: 85.36370249136206%; - } - - .row-fluid .offset9 { - margin-left: 79.48717948717949%; - *margin-left: 79.38079650845607%; - } - - .row-fluid .offset9:first-child { - margin-left: 76.92307692307693%; - *margin-left: 76.81669394435352%; - } - - .row-fluid .offset8 { - margin-left: 70.94017094017094%; - *margin-left: 70.83378796144753%; - } - - .row-fluid .offset8:first-child { - margin-left: 68.37606837606839%; - *margin-left: 68.26968539734497%; - } - - .row-fluid .offset7 { - margin-left: 62.393162393162385%; - *margin-left: 62.28677941443899%; - } - - .row-fluid .offset7:first-child { - margin-left: 59.82905982905982%; - *margin-left: 59.72267685033642%; - } - - .row-fluid .offset6 { - margin-left: 53.84615384615384%; - *margin-left: 53.739770867430444%; - } - - .row-fluid .offset6:first-child { - margin-left: 51.28205128205128%; - *margin-left: 51.175668303327875%; - } - - .row-fluid .offset5 { - margin-left: 45.299145299145295%; - *margin-left: 45.1927623204219%; - } - - .row-fluid .offset5:first-child { - margin-left: 42.73504273504273%; - *margin-left: 42.62865975631933%; - } - - .row-fluid .offset4 { - margin-left: 36.75213675213675%; - *margin-left: 36.645753773413354%; - } - - .row-fluid .offset4:first-child { - margin-left: 34.18803418803419%; - *margin-left: 34.081651209310785%; - } - - .row-fluid .offset3 { - margin-left: 28.205128205128204%; - *margin-left: 28.0987452264048%; - } - - .row-fluid .offset3:first-child { - margin-left: 25.641025641025642%; - *margin-left: 25.53464266230224%; - } - - .row-fluid .offset2 { - margin-left: 19.65811965811966%; - *margin-left: 19.551736679396257%; - } - - .row-fluid .offset2:first-child { - margin-left: 17.094017094017094%; - *margin-left: 16.98763411529369%; - } - - .row-fluid .offset1 { - margin-left: 11.11111111111111%; - *margin-left: 11.004728132387708%; - } - - .row-fluid .offset1:first-child { - margin-left: 8.547008547008547%; - *margin-left: 8.440625568285142%; - } - - input, - textarea, - .uneditable-input { - margin-left: 0; - } - - .controls-row [class*="span"] + [class*="span"] { - margin-left: 30px; - } - - input.span12, - textarea.span12, - .uneditable-input.span12 { - width: 1156px; - } - - input.span11, - textarea.span11, - .uneditable-input.span11 { - width: 1056px; - } - - input.span10, - textarea.span10, - .uneditable-input.span10 { - width: 956px; - } - - input.span9, - textarea.span9, - .uneditable-input.span9 { - width: 856px; - } - - input.span8, - textarea.span8, - .uneditable-input.span8 { - width: 756px; - } - - input.span7, - textarea.span7, - .uneditable-input.span7 { - width: 656px; - } - - input.span6, - textarea.span6, - .uneditable-input.span6 { - width: 556px; - } - - input.span5, - textarea.span5, - .uneditable-input.span5 { - width: 456px; - } - - input.span4, - textarea.span4, - .uneditable-input.span4 { - width: 356px; - } - - input.span3, - textarea.span3, - .uneditable-input.span3 { - width: 256px; - } - - input.span2, - textarea.span2, - .uneditable-input.span2 { - width: 156px; - } - - input.span1, - textarea.span1, - .uneditable-input.span1 { - width: 56px; - } - - .thumbnails { - margin-left: -30px; - } - - .thumbnails > li { - margin-left: 30px; - } - - .row-fluid .thumbnails { - margin-left: 0; - } -} - -@media (min-width: 768px) and (max-width: 979px) { - .row { - margin-left: -20px; - *zoom: 1; - } - - .row:before, - .row:after { - display: table; - line-height: 0; - content: ""; - } - - .row:after { - clear: both; - } - - [class*="span"] { - float: left; - min-height: 1px; - margin-left: 20px; - } - - .container, - .navbar-static-top .container, - .navbar-fixed-top .container, - .navbar-fixed-bottom .container { - width: 724px; - } - - .span12 { - width: 724px; - } - - .span11 { - width: 662px; - } - - .span10 { - width: 600px; - } - - .span9 { - width: 538px; - } - - .span8 { - width: 476px; - } - - .span7 { - width: 414px; - } - - .span6 { - width: 352px; - } - - .span5 { - width: 290px; - } - - .span4 { - width: 228px; - } - - .span3 { - width: 166px; - } - - .span2 { - width: 104px; - } - - .span1 { - width: 42px; - } - - .offset12 { - margin-left: 764px; - } - - .offset11 { - margin-left: 702px; - } - - .offset10 { - margin-left: 640px; - } - - .offset9 { - margin-left: 578px; - } - - .offset8 { - margin-left: 516px; - } - - .offset7 { - margin-left: 454px; - } - - .offset6 { - margin-left: 392px; - } - - .offset5 { - margin-left: 330px; - } - - .offset4 { - margin-left: 268px; - } - - .offset3 { - margin-left: 206px; - } - - .offset2 { - margin-left: 144px; - } - - .offset1 { - margin-left: 82px; - } - - .row-fluid { - width: 100%; - *zoom: 1; - } - - .row-fluid:before, - .row-fluid:after { - display: table; - line-height: 0; - content: ""; - } - - .row-fluid:after { - clear: both; - } - - .row-fluid [class*="span"] { - display: block; - float: left; - width: 100%; - min-height: 30px; - margin-left: 2.7624309392265194%; - *margin-left: 2.709239449864817%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .row-fluid [class*="span"]:first-child { - margin-left: 0; - } - - .row-fluid .controls-row [class*="span"] + [class*="span"] { - margin-left: 2.7624309392265194%; - } - - .row-fluid .span12 { - width: 100%; - *width: 99.94680851063829%; - } - - .row-fluid .span11 { - width: 91.43646408839778%; - *width: 91.38327259903608%; - } - - .row-fluid .span10 { - width: 82.87292817679558%; - *width: 82.81973668743387%; - } - - .row-fluid .span9 { - width: 74.30939226519337%; - *width: 74.25620077583166%; - } - - .row-fluid .span8 { - width: 65.74585635359117%; - *width: 65.69266486422946%; - } - - .row-fluid .span7 { - width: 57.18232044198895%; - *width: 57.12912895262725%; - } - - .row-fluid .span6 { - width: 48.61878453038674%; - *width: 48.56559304102504%; - } - - .row-fluid .span5 { - width: 40.05524861878453%; - *width: 40.00205712942283%; - } - - .row-fluid .span4 { - width: 31.491712707182323%; - *width: 31.43852121782062%; - } - - .row-fluid .span3 { - width: 22.92817679558011%; - *width: 22.87498530621841%; - } - - .row-fluid .span2 { - width: 14.3646408839779%; - *width: 14.311449394616199%; - } - - .row-fluid .span1 { - width: 5.801104972375691%; - *width: 5.747913483013988%; - } - - .row-fluid .offset12 { - margin-left: 105.52486187845304%; - *margin-left: 105.41847889972962%; - } - - .row-fluid .offset12:first-child { - margin-left: 102.76243093922652%; - *margin-left: 102.6560479605031%; - } - - .row-fluid .offset11 { - margin-left: 96.96132596685082%; - *margin-left: 96.8549429881274%; - } - - .row-fluid .offset11:first-child { - margin-left: 94.1988950276243%; - *margin-left: 94.09251204890089%; - } - - .row-fluid .offset10 { - margin-left: 88.39779005524862%; - *margin-left: 88.2914070765252%; - } - - .row-fluid .offset10:first-child { - margin-left: 85.6353591160221%; - *margin-left: 85.52897613729868%; - } - - .row-fluid .offset9 { - margin-left: 79.8342541436464%; - *margin-left: 79.72787116492299%; - } - - .row-fluid .offset9:first-child { - margin-left: 77.07182320441989%; - *margin-left: 76.96544022569647%; - } - - .row-fluid .offset8 { - margin-left: 71.2707182320442%; - *margin-left: 71.16433525332079%; - } - - .row-fluid .offset8:first-child { - margin-left: 68.50828729281768%; - *margin-left: 68.40190431409427%; - } - - .row-fluid .offset7 { - margin-left: 62.70718232044199%; - *margin-left: 62.600799341718584%; - } - - .row-fluid .offset7:first-child { - margin-left: 59.94475138121547%; - *margin-left: 59.838368402492065%; - } - - .row-fluid .offset6 { - margin-left: 54.14364640883978%; - *margin-left: 54.037263430116376%; - } - - .row-fluid .offset6:first-child { - margin-left: 51.38121546961326%; - *margin-left: 51.27483249088986%; - } - - .row-fluid .offset5 { - margin-left: 45.58011049723757%; - *margin-left: 45.47372751851417%; - } - - .row-fluid .offset5:first-child { - margin-left: 42.81767955801105%; - *margin-left: 42.71129657928765%; - } - - .row-fluid .offset4 { - margin-left: 37.01657458563536%; - *margin-left: 36.91019160691196%; - } - - .row-fluid .offset4:first-child { - margin-left: 34.25414364640884%; - *margin-left: 34.14776066768544%; - } - - .row-fluid .offset3 { - margin-left: 28.45303867403315%; - *margin-left: 28.346655695309746%; - } - - .row-fluid .offset3:first-child { - margin-left: 25.69060773480663%; - *margin-left: 25.584224756083227%; - } - - .row-fluid .offset2 { - margin-left: 19.88950276243094%; - *margin-left: 19.783119783707537%; - } - - .row-fluid .offset2:first-child { - margin-left: 17.12707182320442%; - *margin-left: 17.02068884448102%; - } - - .row-fluid .offset1 { - margin-left: 11.32596685082873%; - *margin-left: 11.219583872105325%; - } - - .row-fluid .offset1:first-child { - margin-left: 8.56353591160221%; - *margin-left: 8.457152932878806%; - } - - input, - textarea, - .uneditable-input { - margin-left: 0; - } - - .controls-row [class*="span"] + [class*="span"] { - margin-left: 20px; - } - - input.span12, - textarea.span12, - .uneditable-input.span12 { - width: 710px; - } - - input.span11, - textarea.span11, - .uneditable-input.span11 { - width: 648px; - } - - input.span10, - textarea.span10, - .uneditable-input.span10 { - width: 586px; - } - - input.span9, - textarea.span9, - .uneditable-input.span9 { - width: 524px; - } - - input.span8, - textarea.span8, - .uneditable-input.span8 { - width: 462px; - } - - input.span7, - textarea.span7, - .uneditable-input.span7 { - width: 400px; - } - - input.span6, - textarea.span6, - .uneditable-input.span6 { - width: 338px; - } - - input.span5, - textarea.span5, - .uneditable-input.span5 { - width: 276px; - } - - input.span4, - textarea.span4, - .uneditable-input.span4 { - width: 214px; - } - - input.span3, - textarea.span3, - .uneditable-input.span3 { - width: 152px; - } - - input.span2, - textarea.span2, - .uneditable-input.span2 { - width: 90px; - } - - input.span1, - textarea.span1, - .uneditable-input.span1 { - width: 28px; - } -} - -@media (max-width: 767px) { - body { - padding-right: 20px; - padding-left: 20px; - } - - .navbar-fixed-top, - .navbar-fixed-bottom, - .navbar-static-top { - margin-right: -20px; - margin-left: -20px; - } - - .container-fluid { - padding: 0; - } - - .dl-horizontal dt { - float: none; - width: auto; - clear: none; - text-align: left; - } - - .dl-horizontal dd { - margin-left: 0; - } - - .container { - width: auto; - } - - .row-fluid { - width: 100%; - } - - .row, - .thumbnails { - margin-left: 0; - } - - .thumbnails > li { - float: none; - margin-left: 0; - } - - [class*="span"], - .uneditable-input[class*="span"], - .row-fluid [class*="span"] { - display: block; - float: none; - width: 100%; - margin-left: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .span12, - .row-fluid .span12 { - width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .row-fluid [class*="offset"]:first-child { - margin-left: 0; - } - - .input-large, - .input-xlarge, - .input-xxlarge, - input[class*="span"], - select[class*="span"], - textarea[class*="span"], - .uneditable-input { - display: block; - width: 100%; - min-height: 30px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .input-prepend input, - .input-append input, - .input-prepend input[class*="span"], - .input-append input[class*="span"] { - display: inline-block; - width: auto; - } - - .controls-row [class*="span"] + [class*="span"] { - margin-left: 0; - } - - .modal { - position: fixed; - top: 20px; - right: 20px; - left: 20px; - width: auto; - margin: 0; - } - - .modal.fade { - top: -100px; - } - - .modal.fade.in { - top: 20px; - } + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .input-prepend input, + .input-append input, + .input-prepend input[class*="span"], + .input-append input[class*="span"] { + display: inline-block; + width: auto; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 0; + } + .modal { + position: fixed; + top: 20px; + right: 20px; + left: 20px; + width: auto; + margin: 0; + } + .modal.fade { + top: -100px; + } + .modal.fade.in { + top: 20px; + } } @media (max-width: 480px) { - .nav-collapse { - -webkit-transform: translate3d(0, 0, 0); - } - - .page-header h1 small { - display: block; - line-height: 20px; - } - - input[type="checkbox"], - input[type="radio"] { - border: 1px solid #ccc; - } - - .form-horizontal .control-label { - float: none; - width: auto; - padding-top: 0; - text-align: left; - } - - .form-horizontal .controls { - margin-left: 0; - } - - .form-horizontal .control-list { - padding-top: 0; - } - - .form-horizontal .form-actions { - padding-right: 10px; - padding-left: 10px; - } - - .media .pull-left, - .media .pull-right { - display: block; - float: none; - margin-bottom: 10px; - } - - .media-object { - margin-right: 0; - margin-left: 0; - } - - .modal { - top: 10px; - right: 10px; - left: 10px; - } - - .modal-header .close { - padding: 10px; - margin: -10px; - } - - .carousel-caption { - position: static; - } + .nav-collapse { + -webkit-transform: translate3d(0, 0, 0); + } + .page-header h1 small { + display: block; + line-height: 20px; + } + input[type="checkbox"], + input[type="radio"] { + border: 1px solid #ccc; + } + .form-horizontal .control-label { + float: none; + width: auto; + padding-top: 0; + text-align: left; + } + .form-horizontal .controls { + margin-left: 0; + } + .form-horizontal .control-list { + padding-top: 0; + } + .form-horizontal .form-actions { + padding-right: 10px; + padding-left: 10px; + } + .media .pull-left, + .media .pull-right { + display: block; + float: none; + margin-bottom: 10px; + } + .media-object { + margin-right: 0; + margin-left: 0; + } + .modal { + top: 10px; + right: 10px; + left: 10px; + } + .modal-header .close { + padding: 10px; + margin: -10px; + } + .carousel-caption { + position: static; + } } @media (max-width: 979px) { - body { - padding-top: 0; - } - - .navbar-fixed-top, - .navbar-fixed-bottom { - position: static; - } - - .navbar-fixed-top { - margin-bottom: 20px; - } - - .navbar-fixed-bottom { - margin-top: 20px; - } - - .navbar-fixed-top .navbar-inner, - .navbar-fixed-bottom .navbar-inner { - padding: 5px; - } - - .navbar .container { - width: auto; - padding: 0; - } - - .navbar .brand { - padding-right: 10px; - padding-left: 10px; - margin: 0 0 0 -5px; - } - - .nav-collapse { - clear: both; - } - - .nav-collapse .nav { - float: none; - margin: 0 0 10px; - } - - .nav-collapse .nav > li { - float: none; - } - - .nav-collapse .nav > li > a { - margin-bottom: 2px; - } - - .nav-collapse .nav > .divider-vertical { - display: none; - } - - .nav-collapse .nav .nav-header { - color: #777777; - text-shadow: none; - } - - .nav-collapse .nav > li > a, - .nav-collapse .dropdown-menu a { - padding: 9px 15px; - font-weight: bold; - color: #777777; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - } - - .nav-collapse .btn { - padding: 4px 10px 4px; - font-weight: normal; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - } - - .nav-collapse .dropdown-menu li + li a { - margin-bottom: 2px; - } - - .nav-collapse .nav > li > a:hover, - .nav-collapse .dropdown-menu a:hover { - background-color: #f2f2f2; - } - - .navbar-inverse .nav-collapse .nav > li > a, - .navbar-inverse .nav-collapse .dropdown-menu a { - color: #999999; - } - - .navbar-inverse .nav-collapse .nav > li > a:hover, - .navbar-inverse .nav-collapse .dropdown-menu a:hover { - background-color: #111111; - } - - .nav-collapse.in .btn-group { - padding: 0; - margin-top: 5px; - } - - .nav-collapse .dropdown-menu { - position: static; - top: auto; - left: auto; - display: none; - float: none; - max-width: none; - padding: 0; - margin: 0 15px; - background-color: transparent; - border: none; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - } - - .nav-collapse .open > .dropdown-menu { - display: block; - } - - .nav-collapse .dropdown-menu:before, - .nav-collapse .dropdown-menu:after { - display: none; - } - - .nav-collapse .dropdown-menu .divider { - display: none; - } - - .nav-collapse .nav > li > .dropdown-menu:before, - .nav-collapse .nav > li > .dropdown-menu:after { - display: none; - } - - .nav-collapse .navbar-form, - .nav-collapse .navbar-search { - float: none; - padding: 10px 15px; - margin: 10px 0; - border-top: 1px solid #f2f2f2; - border-bottom: 1px solid #f2f2f2; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); - } - - .navbar-inverse .nav-collapse .navbar-form, - .navbar-inverse .nav-collapse .navbar-search { - border-top-color: #111111; - border-bottom-color: #111111; - } - - .navbar .nav-collapse .nav.pull-right { - float: none; - margin-left: 0; - } - - .nav-collapse, - .nav-collapse.collapse { - height: 0; - overflow: hidden; - } - - .navbar .btn-navbar { - display: block; - } - - .navbar-static .navbar-inner { - padding-right: 10px; - padding-left: 10px; - } + body { + padding-top: 0; + } + .navbar-fixed-top, + .navbar-fixed-bottom { + position: static; + } + .navbar-fixed-top { + margin-bottom: 20px; + } + .navbar-fixed-bottom { + margin-top: 20px; + } + .navbar-fixed-top .navbar-inner, + .navbar-fixed-bottom .navbar-inner { + padding: 5px; + } + .navbar .container { + width: auto; + padding: 0; + } + .navbar .brand { + padding-right: 10px; + padding-left: 10px; + margin: 0 0 0 -5px; + } + .nav-collapse { + clear: both; + } + .nav-collapse .nav { + float: none; + margin: 0 0 10px; + } + .nav-collapse .nav > li { + float: none; + } + .nav-collapse .nav > li > a { + margin-bottom: 2px; + } + .nav-collapse .nav > .divider-vertical { + display: none; + } + .nav-collapse .nav .nav-header { + color: #777777; + text-shadow: none; + } + .nav-collapse .nav > li > a, + .nav-collapse .dropdown-menu a { + padding: 9px 15px; + font-weight: bold; + color: #777777; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + } + .nav-collapse .btn { + padding: 4px 10px 4px; + font-weight: normal; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + } + .nav-collapse .dropdown-menu li + li a { + margin-bottom: 2px; + } + .nav-collapse .nav > li > a:hover, + .nav-collapse .dropdown-menu a:hover { + background-color: #f2f2f2; + } + .navbar-inverse .nav-collapse .nav > li > a, + .navbar-inverse .nav-collapse .dropdown-menu a { + color: #999999; + } + .navbar-inverse .nav-collapse .nav > li > a:hover, + .navbar-inverse .nav-collapse .dropdown-menu a:hover { + background-color: #111111; + } + .nav-collapse.in .btn-group { + padding: 0; + margin-top: 5px; + } + .nav-collapse .dropdown-menu { + position: static; + top: auto; + left: auto; + display: none; + float: none; + max-width: none; + padding: 0; + margin: 0 15px; + background-color: transparent; + border: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + .nav-collapse .open > .dropdown-menu { + display: block; + } + .nav-collapse .dropdown-menu:before, + .nav-collapse .dropdown-menu:after { + display: none; + } + .nav-collapse .dropdown-menu .divider { + display: none; + } + .nav-collapse .nav > li > .dropdown-menu:before, + .nav-collapse .nav > li > .dropdown-menu:after { + display: none; + } + .nav-collapse .navbar-form, + .nav-collapse .navbar-search { + float: none; + padding: 10px 15px; + margin: 10px 0; + border-top: 1px solid #f2f2f2; + border-bottom: 1px solid #f2f2f2; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + } + .navbar-inverse .nav-collapse .navbar-form, + .navbar-inverse .nav-collapse .navbar-search { + border-top-color: #111111; + border-bottom-color: #111111; + } + .navbar .nav-collapse .nav.pull-right { + float: none; + margin-left: 0; + } + .nav-collapse, + .nav-collapse.collapse { + height: 0; + overflow: hidden; + } + .navbar .btn-navbar { + display: block; + } + .navbar-static .navbar-inner { + padding-right: 10px; + padding-left: 10px; + } } @media (min-width: 980px) { - .nav-collapse.collapse { - height: auto !important; - overflow: visible !important; - } + .nav-collapse.collapse { + height: auto !important; + overflow: visible !important; + } } diff --git a/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap.css b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap.css index bbe32a8627b8..db3b3bfd6a0c 100644 --- a/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap.css +++ b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap.css @@ -18,95 +18,95 @@ header, hgroup, nav, section { - display: block; + display: block; } audio, canvas, video { - display: inline-block; - *display: inline; - *zoom: 1; + display: inline-block; + *display: inline; + *zoom: 1; } audio:not([controls]) { - display: none; + display: none; } html { - font-size: 100%; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; } a:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } a:hover, a:active { - outline: 0; + outline: 0; } sub, sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; } sup { - top: -0.5em; + top: -0.5em; } sub { - bottom: -0.25em; + bottom: -0.25em; } img { - width: auto \9; - height: auto; - max-width: 100%; - vertical-align: middle; - border: 0; - -ms-interpolation-mode: bicubic; + width: auto\9; + height: auto; + max-width: 100%; + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; } #map_canvas img, .google-maps img { - max-width: none; + max-width: none; } button, input, select, textarea { - margin: 0; - font-size: 100%; - vertical-align: middle; + margin: 0; + font-size: 100%; + vertical-align: middle; } button, input { - *overflow: visible; - line-height: normal; + *overflow: visible; + line-height: normal; } button::-moz-focus-inner, input::-moz-focus-inner { - padding: 0; - border: 0; + padding: 0; + border: 0; } button, html input[type="button"], input[type="reset"], input[type="submit"] { - cursor: pointer; - -webkit-appearance: button; + cursor: pointer; + -webkit-appearance: button; } label, @@ -117,612 +117,601 @@ input[type="reset"], input[type="submit"], input[type="radio"], input[type="checkbox"] { - cursor: pointer; + cursor: pointer; } input[type="search"] { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; - -webkit-appearance: textfield; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; } input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { - -webkit-appearance: none; + -webkit-appearance: none; } textarea { - overflow: auto; - vertical-align: top; + overflow: auto; + vertical-align: top; } @media print { - * { - color: #000 !important; - text-shadow: none !important; - background: transparent !important; - box-shadow: none !important; - } - - a, - a:visited { - text-decoration: underline; - } - - a[href]:after { - content: " (" attr(href) ")"; - } - - abbr[title]:after { - content: " (" attr(title) ")"; - } - - .ir a:after, - a[href^="javascript:"]:after, - a[href^="#"]:after { - content: ""; - } - - pre, - blockquote { - border: 1px solid #999; - page-break-inside: avoid; - } - - thead { - display: table-header-group; - } - - tr, - img { - page-break-inside: avoid; - } - - img { - max-width: 100% !important; - } - - @page { - margin: 0.5cm; - } - - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - - h2, - h3 { - page-break-after: avoid; - } + * { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + @page { + margin: 0.5cm; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } } .clearfix { - *zoom: 1; + *zoom: 1; } .clearfix:before, .clearfix:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .clearfix:after { - clear: both; + clear: both; } .hide-text { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; } .input-block-level { - display: block; - width: 100%; - min-height: 30px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } body { - margin: 0; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 20px; - color: #333333; - background-color: #ffffff; + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 20px; + color: #333333; + background-color: #ffffff; } a { - color: #0088cc; - text-decoration: none; + color: #0088cc; + text-decoration: none; } a:hover { - color: #005580; - text-decoration: underline; + color: #005580; + text-decoration: underline; } .img-rounded { - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .img-polaroid { - padding: 4px; - background-color: #fff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + padding: 4px; + background-color: #fff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } .img-circle { - -webkit-border-radius: 500px; - -moz-border-radius: 500px; - border-radius: 500px; + -webkit-border-radius: 500px; + -moz-border-radius: 500px; + border-radius: 500px; } .row { - margin-left: -20px; - *zoom: 1; + margin-left: -20px; + *zoom: 1; } .row:before, .row:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .row:after { - clear: both; + clear: both; } [class*="span"] { - float: left; - min-height: 1px; - margin-left: 20px; + float: left; + min-height: 1px; + margin-left: 20px; } .container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { - width: 940px; + width: 940px; } .span12 { - width: 940px; + width: 940px; } .span11 { - width: 860px; + width: 860px; } .span10 { - width: 780px; + width: 780px; } .span9 { - width: 700px; + width: 700px; } .span8 { - width: 620px; + width: 620px; } .span7 { - width: 540px; + width: 540px; } .span6 { - width: 460px; + width: 460px; } .span5 { - width: 380px; + width: 380px; } .span4 { - width: 300px; + width: 300px; } .span3 { - width: 220px; + width: 220px; } .span2 { - width: 140px; + width: 140px; } .span1 { - width: 60px; + width: 60px; } .offset12 { - margin-left: 980px; + margin-left: 980px; } .offset11 { - margin-left: 900px; + margin-left: 900px; } .offset10 { - margin-left: 820px; + margin-left: 820px; } .offset9 { - margin-left: 740px; + margin-left: 740px; } .offset8 { - margin-left: 660px; + margin-left: 660px; } .offset7 { - margin-left: 580px; + margin-left: 580px; } .offset6 { - margin-left: 500px; + margin-left: 500px; } .offset5 { - margin-left: 420px; + margin-left: 420px; } .offset4 { - margin-left: 340px; + margin-left: 340px; } .offset3 { - margin-left: 260px; + margin-left: 260px; } .offset2 { - margin-left: 180px; + margin-left: 180px; } .offset1 { - margin-left: 100px; + margin-left: 100px; } .row-fluid { - width: 100%; - *zoom: 1; + width: 100%; + *zoom: 1; } .row-fluid:before, .row-fluid:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .row-fluid:after { - clear: both; + clear: both; } .row-fluid [class*="span"] { - display: block; - float: left; - width: 100%; - min-height: 30px; - margin-left: 2.127659574468085%; - *margin-left: 2.074468085106383%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.127659574468085%; + *margin-left: 2.074468085106383%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } .row-fluid [class*="span"]:first-child { - margin-left: 0; + margin-left: 0; } .row-fluid .controls-row [class*="span"] + [class*="span"] { - margin-left: 2.127659574468085%; + margin-left: 2.127659574468085%; } .row-fluid .span12 { - width: 100%; - *width: 99.94680851063829%; + width: 100%; + *width: 99.94680851063829%; } .row-fluid .span11 { - width: 91.48936170212765%; - *width: 91.43617021276594%; + width: 91.48936170212765%; + *width: 91.43617021276594%; } .row-fluid .span10 { - width: 82.97872340425532%; - *width: 82.92553191489361%; + width: 82.97872340425532%; + *width: 82.92553191489361%; } .row-fluid .span9 { - width: 74.46808510638297%; - *width: 74.41489361702126%; + width: 74.46808510638297%; + *width: 74.41489361702126%; } .row-fluid .span8 { - width: 65.95744680851064%; - *width: 65.90425531914893%; + width: 65.95744680851064%; + *width: 65.90425531914893%; } .row-fluid .span7 { - width: 57.44680851063829%; - *width: 57.39361702127659%; + width: 57.44680851063829%; + *width: 57.39361702127659%; } .row-fluid .span6 { - width: 48.93617021276595%; - *width: 48.88297872340425%; + width: 48.93617021276595%; + *width: 48.88297872340425%; } .row-fluid .span5 { - width: 40.42553191489362%; - *width: 40.37234042553192%; + width: 40.42553191489362%; + *width: 40.37234042553192%; } .row-fluid .span4 { - width: 31.914893617021278%; - *width: 31.861702127659576%; + width: 31.914893617021278%; + *width: 31.861702127659576%; } .row-fluid .span3 { - width: 23.404255319148934%; - *width: 23.351063829787233%; + width: 23.404255319148934%; + *width: 23.351063829787233%; } .row-fluid .span2 { - width: 14.893617021276595%; - *width: 14.840425531914894%; + width: 14.893617021276595%; + *width: 14.840425531914894%; } .row-fluid .span1 { - width: 6.382978723404255%; - *width: 6.329787234042553%; + width: 6.382978723404255%; + *width: 6.329787234042553%; } .row-fluid .offset12 { - margin-left: 104.25531914893617%; - *margin-left: 104.14893617021275%; + margin-left: 104.25531914893617%; + *margin-left: 104.14893617021275%; } .row-fluid .offset12:first-child { - margin-left: 102.12765957446808%; - *margin-left: 102.02127659574467%; + margin-left: 102.12765957446808%; + *margin-left: 102.02127659574467%; } .row-fluid .offset11 { - margin-left: 95.74468085106382%; - *margin-left: 95.6382978723404%; + margin-left: 95.74468085106382%; + *margin-left: 95.6382978723404%; } .row-fluid .offset11:first-child { - margin-left: 93.61702127659574%; - *margin-left: 93.51063829787232%; + margin-left: 93.61702127659574%; + *margin-left: 93.51063829787232%; } .row-fluid .offset10 { - margin-left: 87.23404255319149%; - *margin-left: 87.12765957446807%; + margin-left: 87.23404255319149%; + *margin-left: 87.12765957446807%; } .row-fluid .offset10:first-child { - margin-left: 85.1063829787234%; - *margin-left: 84.99999999999999%; + margin-left: 85.1063829787234%; + *margin-left: 84.99999999999999%; } .row-fluid .offset9 { - margin-left: 78.72340425531914%; - *margin-left: 78.61702127659572%; + margin-left: 78.72340425531914%; + *margin-left: 78.61702127659572%; } .row-fluid .offset9:first-child { - margin-left: 76.59574468085106%; - *margin-left: 76.48936170212764%; + margin-left: 76.59574468085106%; + *margin-left: 76.48936170212764%; } .row-fluid .offset8 { - margin-left: 70.2127659574468%; - *margin-left: 70.10638297872339%; + margin-left: 70.2127659574468%; + *margin-left: 70.10638297872339%; } .row-fluid .offset8:first-child { - margin-left: 68.08510638297872%; - *margin-left: 67.9787234042553%; + margin-left: 68.08510638297872%; + *margin-left: 67.9787234042553%; } .row-fluid .offset7 { - margin-left: 61.70212765957446%; - *margin-left: 61.59574468085106%; + margin-left: 61.70212765957446%; + *margin-left: 61.59574468085106%; } .row-fluid .offset7:first-child { - margin-left: 59.574468085106375%; - *margin-left: 59.46808510638297%; + margin-left: 59.574468085106375%; + *margin-left: 59.46808510638297%; } .row-fluid .offset6 { - margin-left: 53.191489361702125%; - *margin-left: 53.085106382978715%; + margin-left: 53.191489361702125%; + *margin-left: 53.085106382978715%; } .row-fluid .offset6:first-child { - margin-left: 51.063829787234035%; - *margin-left: 50.95744680851063%; + margin-left: 51.063829787234035%; + *margin-left: 50.95744680851063%; } .row-fluid .offset5 { - margin-left: 44.68085106382979%; - *margin-left: 44.57446808510638%; + margin-left: 44.68085106382979%; + *margin-left: 44.57446808510638%; } .row-fluid .offset5:first-child { - margin-left: 42.5531914893617%; - *margin-left: 42.4468085106383%; + margin-left: 42.5531914893617%; + *margin-left: 42.4468085106383%; } .row-fluid .offset4 { - margin-left: 36.170212765957444%; - *margin-left: 36.06382978723405%; + margin-left: 36.170212765957444%; + *margin-left: 36.06382978723405%; } .row-fluid .offset4:first-child { - margin-left: 34.04255319148936%; - *margin-left: 33.93617021276596%; + margin-left: 34.04255319148936%; + *margin-left: 33.93617021276596%; } .row-fluid .offset3 { - margin-left: 27.659574468085104%; - *margin-left: 27.5531914893617%; + margin-left: 27.659574468085104%; + *margin-left: 27.5531914893617%; } .row-fluid .offset3:first-child { - margin-left: 25.53191489361702%; - *margin-left: 25.425531914893618%; + margin-left: 25.53191489361702%; + *margin-left: 25.425531914893618%; } .row-fluid .offset2 { - margin-left: 19.148936170212764%; - *margin-left: 19.04255319148936%; + margin-left: 19.148936170212764%; + *margin-left: 19.04255319148936%; } .row-fluid .offset2:first-child { - margin-left: 17.02127659574468%; - *margin-left: 16.914893617021278%; + margin-left: 17.02127659574468%; + *margin-left: 16.914893617021278%; } .row-fluid .offset1 { - margin-left: 10.638297872340425%; - *margin-left: 10.53191489361702%; + margin-left: 10.638297872340425%; + *margin-left: 10.53191489361702%; } .row-fluid .offset1:first-child { - margin-left: 8.51063829787234%; - *margin-left: 8.404255319148938%; + margin-left: 8.51063829787234%; + *margin-left: 8.404255319148938%; } [class*="span"].hide, .row-fluid [class*="span"].hide { - display: none; + display: none; } [class*="span"].pull-right, .row-fluid [class*="span"].pull-right { - float: right; + float: right; } .container { - margin-right: auto; - margin-left: auto; - *zoom: 1; + margin-right: auto; + margin-left: auto; + *zoom: 1; } .container:before, .container:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .container:after { - clear: both; + clear: both; } .container-fluid { - padding-right: 20px; - padding-left: 20px; - *zoom: 1; + padding-right: 20px; + padding-left: 20px; + *zoom: 1; } .container-fluid:before, .container-fluid:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .container-fluid:after { - clear: both; + clear: both; } p { - margin: 0 0 10px; + margin: 0 0 10px; } .lead { - margin-bottom: 20px; - font-size: 21px; - font-weight: 200; - line-height: 30px; + margin-bottom: 20px; + font-size: 21px; + font-weight: 200; + line-height: 30px; } small { - font-size: 85%; + font-size: 85%; } strong { - font-weight: bold; + font-weight: bold; } em { - font-style: italic; + font-style: italic; } cite { - font-style: normal; + font-style: normal; } .muted { - color: #999999; + color: #999999; } a.muted:hover { - color: #808080; + color: #808080; } .text-warning { - color: #c09853; + color: #c09853; } a.text-warning:hover { - color: #a47e3c; + color: #a47e3c; } .text-error { - color: #b94a48; + color: #b94a48; } a.text-error:hover { - color: #953b39; + color: #953b39; } .text-info { - color: #3a87ad; + color: #3a87ad; } a.text-info:hover { - color: #2d6987; + color: #2d6987; } .text-success { - color: #468847; + color: #468847; } a.text-success:hover { - color: #356635; + color: #356635; } h1, @@ -731,12 +720,12 @@ h3, h4, h5, h6 { - margin: 10px 0; - font-family: inherit; - font-weight: bold; - line-height: 20px; - color: inherit; - text-rendering: optimizelegibility; + margin: 10px 0; + font-family: inherit; + font-weight: bold; + line-height: 20px; + color: inherit; + text-rendering: optimizelegibility; } h1 small, @@ -745,301 +734,301 @@ h3 small, h4 small, h5 small, h6 small { - font-weight: normal; - line-height: 1; - color: #999999; + font-weight: normal; + line-height: 1; + color: #999999; } h1, h2, h3 { - line-height: 40px; + line-height: 40px; } h1 { - font-size: 38.5px; + font-size: 38.5px; } h2 { - font-size: 31.5px; + font-size: 31.5px; } h3 { - font-size: 24.5px; + font-size: 24.5px; } h4 { - font-size: 17.5px; + font-size: 17.5px; } h5 { - font-size: 14px; + font-size: 14px; } h6 { - font-size: 11.9px; + font-size: 11.9px; } h1 small { - font-size: 24.5px; + font-size: 24.5px; } h2 small { - font-size: 17.5px; + font-size: 17.5px; } h3 small { - font-size: 14px; + font-size: 14px; } h4 small { - font-size: 14px; + font-size: 14px; } .page-header { - padding-bottom: 9px; - margin: 20px 0 30px; - border-bottom: 1px solid #eeeeee; + padding-bottom: 9px; + margin: 20px 0 30px; + border-bottom: 1px solid #eeeeee; } ul, ol { - padding: 0; - margin: 0 0 10px 25px; + padding: 0; + margin: 0 0 10px 25px; } ul ul, ul ol, ol ol, ol ul { - margin-bottom: 0; + margin-bottom: 0; } li { - line-height: 20px; + line-height: 20px; } ul.unstyled, ol.unstyled { - margin-left: 0; - list-style: none; + margin-left: 0; + list-style: none; } ul.inline, ol.inline { - margin-left: 0; - list-style: none; + margin-left: 0; + list-style: none; } ul.inline > li, ol.inline > li { - display: inline-block; - padding-right: 5px; - padding-left: 5px; + display: inline-block; + padding-right: 5px; + padding-left: 5px; } dl { - margin-bottom: 20px; + margin-bottom: 20px; } dt, dd { - line-height: 20px; + line-height: 20px; } dt { - font-weight: bold; + font-weight: bold; } dd { - margin-left: 10px; + margin-left: 10px; } .dl-horizontal { - *zoom: 1; + *zoom: 1; } .dl-horizontal:before, .dl-horizontal:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .dl-horizontal:after { - clear: both; + clear: both; } .dl-horizontal dt { - float: left; - width: 160px; - overflow: hidden; - clear: left; - text-align: right; - text-overflow: ellipsis; - white-space: nowrap; + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; } .dl-horizontal dd { - margin-left: 180px; + margin-left: 180px; } hr { - margin: 20px 0; - border: 0; - border-top: 1px solid #eeeeee; - border-bottom: 1px solid #ffffff; + margin: 20px 0; + border: 0; + border-top: 1px solid #eeeeee; + border-bottom: 1px solid #ffffff; } abbr[title], abbr[data-original-title] { - cursor: help; - border-bottom: 1px dotted #999999; + cursor: help; + border-bottom: 1px dotted #999999; } abbr.initialism { - font-size: 90%; - text-transform: uppercase; + font-size: 90%; + text-transform: uppercase; } blockquote { - padding: 0 0 0 15px; - margin: 0 0 20px; - border-left: 5px solid #eeeeee; + padding: 0 0 0 15px; + margin: 0 0 20px; + border-left: 5px solid #eeeeee; } blockquote p { - margin-bottom: 0; - font-size: 16px; - font-weight: 300; - line-height: 25px; + margin-bottom: 0; + font-size: 16px; + font-weight: 300; + line-height: 25px; } blockquote small { - display: block; - line-height: 20px; - color: #999999; + display: block; + line-height: 20px; + color: #999999; } blockquote small:before { - content: '\2014 \00A0'; + content: '\2014 \00A0'; } blockquote.pull-right { - float: right; - padding-right: 15px; - padding-left: 0; - border-right: 5px solid #eeeeee; - border-left: 0; + float: right; + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #eeeeee; + border-left: 0; } blockquote.pull-right p, blockquote.pull-right small { - text-align: right; + text-align: right; } blockquote.pull-right small:before { - content: ''; + content: ''; } blockquote.pull-right small:after { - content: '\00A0 \2014'; + content: '\00A0 \2014'; } q:before, q:after, blockquote:before, blockquote:after { - content: ""; + content: ""; } address { - display: block; - margin-bottom: 20px; - font-style: normal; - line-height: 20px; + display: block; + margin-bottom: 20px; + font-style: normal; + line-height: 20px; } code, pre { - padding: 0 3px 2px; - font-family: Monaco, Menlo, Consolas, "Courier New", monospace; - font-size: 12px; - color: #333333; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + padding: 0 3px 2px; + font-family: Monaco, Menlo, Consolas, "Courier New", monospace; + font-size: 12px; + color: #333333; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } code { - padding: 2px 4px; - color: #d14; - white-space: nowrap; - background-color: #f7f7f9; - border: 1px solid #e1e1e8; + padding: 2px 4px; + color: #d14; + white-space: nowrap; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; } pre { - display: block; - padding: 9.5px; - margin: 0 0 10px; - font-size: 13px; - line-height: 20px; - word-break: break-all; - word-wrap: break-word; - white-space: pre; - white-space: pre-wrap; - background-color: #f5f5f5; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.15); - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 20px; + word-break: break-all; + word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; + background-color: #f5f5f5; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } pre.prettyprint { - margin-bottom: 20px; + margin-bottom: 20px; } pre code { - padding: 0; - color: inherit; - white-space: pre; - white-space: pre-wrap; - background-color: transparent; - border: 0; + padding: 0; + color: inherit; + white-space: pre; + white-space: pre-wrap; + background-color: transparent; + border: 0; } .pre-scrollable { - max-height: 340px; - overflow-y: scroll; + max-height: 340px; + overflow-y: scroll; } form { - margin: 0 0 20px; + margin: 0 0 20px; } fieldset { - padding: 0; - margin: 0; - border: 0; + padding: 0; + margin: 0; + border: 0; } legend { - display: block; - width: 100%; - padding: 0; - margin-bottom: 20px; - font-size: 21px; - line-height: 40px; - color: #333333; - border: 0; - border-bottom: 1px solid #e5e5e5; + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: 40px; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; } legend small { - font-size: 15px; - color: #999999; + font-size: 15px; + color: #999999; } label, @@ -1047,21 +1036,21 @@ input, button, select, textarea { - font-size: 14px; - font-weight: normal; - line-height: 20px; + font-size: 14px; + font-weight: normal; + line-height: 20px; } input, button, select, textarea { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } label { - display: block; - margin-bottom: 5px; + display: block; + margin-bottom: 5px; } select, @@ -1081,27 +1070,27 @@ input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { - display: inline-block; - height: 20px; - padding: 4px 6px; - margin-bottom: 10px; - font-size: 14px; - line-height: 20px; - color: #555555; - vertical-align: middle; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + display: inline-block; + height: 20px; + padding: 4px 6px; + margin-bottom: 10px; + font-size: 14px; + line-height: 20px; + color: #555555; + vertical-align: middle; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } input, textarea, .uneditable-input { - width: 206px; + width: 206px; } textarea { - height: auto; + height: auto; } textarea, @@ -1120,15 +1109,15 @@ input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { - background-color: #ffffff; - border: 1px solid #cccccc; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; - -moz-transition: border linear 0.2s, box-shadow linear 0.2s; - -o-transition: border linear 0.2s, box-shadow linear 0.2s; - transition: border linear 0.2s, box-shadow linear 0.2s; + background-color: #ffffff; + border: 1px solid #cccccc; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; } textarea:focus, @@ -1147,22 +1136,22 @@ input[type="search"]:focus, input[type="tel"]:focus, input[type="color"]:focus, .uneditable-input:focus { - border-color: rgba(82, 168, 236, 0.8); - outline: 0; - outline: thin dotted \9; - /* IE6-9 */ + border-color: rgba(82, 168, 236, 0.8); + outline: 0; + outline: thin dotted \9; + /* IE6-9 */ - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); } input[type="radio"], input[type="checkbox"] { - margin: 4px 0 0; - margin-top: 1px \9; - *margin-top: 0; - line-height: normal; + margin: 4px 0 0; + margin-top: 1px \9; + *margin-top: 0; + line-height: normal; } input[type="file"], @@ -1172,128 +1161,128 @@ input[type="reset"], input[type="button"], input[type="radio"], input[type="checkbox"] { - width: auto; + width: auto; } select, input[type="file"] { - height: 30px; - /* In IE7, the height of the select element cannot be changed by height, only font-size */ + height: 30px; + /* In IE7, the height of the select element cannot be changed by height, only font-size */ - *margin-top: 4px; - /* For IE7, add top margin to align select with labels */ + *margin-top: 4px; + /* For IE7, add top margin to align select with labels */ - line-height: 30px; + line-height: 30px; } select { - width: 220px; - background-color: #ffffff; - border: 1px solid #cccccc; + width: 220px; + background-color: #ffffff; + border: 1px solid #cccccc; } select[multiple], select[size] { - height: auto; + height: auto; } select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } .uneditable-input, .uneditable-textarea { - color: #999999; - cursor: not-allowed; - background-color: #fcfcfc; - border-color: #cccccc; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + color: #999999; + cursor: not-allowed; + background-color: #fcfcfc; + border-color: #cccccc; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); } .uneditable-input { - overflow: hidden; - white-space: nowrap; + overflow: hidden; + white-space: nowrap; } .uneditable-textarea { - width: auto; - height: auto; + width: auto; + height: auto; } input:-moz-placeholder, textarea:-moz-placeholder { - color: #999999; + color: #999999; } input:-ms-input-placeholder, textarea:-ms-input-placeholder { - color: #999999; + color: #999999; } input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { - color: #999999; + color: #999999; } .radio, .checkbox { - min-height: 20px; - padding-left: 20px; + min-height: 20px; + padding-left: 20px; } .radio input[type="radio"], .checkbox input[type="checkbox"] { - float: left; - margin-left: -20px; + float: left; + margin-left: -20px; } .controls > .radio:first-child, .controls > .checkbox:first-child { - padding-top: 5px; + padding-top: 5px; } .radio.inline, .checkbox.inline { - display: inline-block; - padding-top: 5px; - margin-bottom: 0; - vertical-align: middle; + display: inline-block; + padding-top: 5px; + margin-bottom: 0; + vertical-align: middle; } .radio.inline + .radio.inline, .checkbox.inline + .checkbox.inline { - margin-left: 10px; + margin-left: 10px; } .input-mini { - width: 60px; + width: 60px; } .input-small { - width: 90px; + width: 90px; } .input-medium { - width: 150px; + width: 150px; } .input-large { - width: 210px; + width: 210px; } .input-xlarge { - width: 270px; + width: 270px; } .input-xxlarge { - width: 530px; + width: 530px; } input[class*="span"], @@ -1304,8 +1293,8 @@ textarea[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"] { - float: none; - margin-left: 0; + float: none; + margin-left: 0; } .input-append input[class*="span"], @@ -1318,114 +1307,114 @@ textarea[class*="span"], .row-fluid .uneditable-input[class*="span"], .row-fluid .input-prepend [class*="span"], .row-fluid .input-append [class*="span"] { - display: inline-block; + display: inline-block; } input, textarea, .uneditable-input { - margin-left: 0; + margin-left: 0; } .controls-row [class*="span"] + [class*="span"] { - margin-left: 20px; + margin-left: 20px; } input.span12, textarea.span12, .uneditable-input.span12 { - width: 926px; + width: 926px; } input.span11, textarea.span11, .uneditable-input.span11 { - width: 846px; + width: 846px; } input.span10, textarea.span10, .uneditable-input.span10 { - width: 766px; + width: 766px; } input.span9, textarea.span9, .uneditable-input.span9 { - width: 686px; + width: 686px; } input.span8, textarea.span8, .uneditable-input.span8 { - width: 606px; + width: 606px; } input.span7, textarea.span7, .uneditable-input.span7 { - width: 526px; + width: 526px; } input.span6, textarea.span6, .uneditable-input.span6 { - width: 446px; + width: 446px; } input.span5, textarea.span5, .uneditable-input.span5 { - width: 366px; + width: 366px; } input.span4, textarea.span4, .uneditable-input.span4 { - width: 286px; + width: 286px; } input.span3, textarea.span3, .uneditable-input.span3 { - width: 206px; + width: 206px; } input.span2, textarea.span2, .uneditable-input.span2 { - width: 126px; + width: 126px; } input.span1, textarea.span1, .uneditable-input.span1 { - width: 46px; + width: 46px; } .controls-row { - *zoom: 1; + *zoom: 1; } .controls-row:before, .controls-row:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .controls-row:after { - clear: both; + clear: both; } .controls-row [class*="span"], .row-fluid .controls-row [class*="span"] { - float: left; + float: left; } .controls-row .checkbox[class*="span"], .controls-row .radio[class*="span"] { - padding-top: 5px; + padding-top: 5px; } input[disabled], @@ -1434,21 +1423,21 @@ textarea[disabled], input[readonly], select[readonly], textarea[readonly] { - cursor: not-allowed; - background-color: #eeeeee; + cursor: not-allowed; + background-color: #eeeeee; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"][readonly], input[type="checkbox"][readonly] { - background-color: transparent; + background-color: transparent; } .control-group.warning .control-label, .control-group.warning .help-block, .control-group.warning .help-inline { - color: #c09853; + color: #c09853; } .control-group.warning .checkbox, @@ -1456,38 +1445,38 @@ input[type="checkbox"][readonly] { .control-group.warning input, .control-group.warning select, .control-group.warning textarea { - color: #c09853; + color: #c09853; } .control-group.warning input, .control-group.warning select, .control-group.warning textarea { - border-color: #c09853; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + border-color: #c09853; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.warning input:focus, .control-group.warning select:focus, .control-group.warning textarea:focus { - border-color: #a47e3c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + border-color: #a47e3c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; } .control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on { - color: #c09853; - background-color: #fcf8e3; - border-color: #c09853; + color: #c09853; + background-color: #fcf8e3; + border-color: #c09853; } .control-group.error .control-label, .control-group.error .help-block, .control-group.error .help-inline { - color: #b94a48; + color: #b94a48; } .control-group.error .checkbox, @@ -1495,38 +1484,38 @@ input[type="checkbox"][readonly] { .control-group.error input, .control-group.error select, .control-group.error textarea { - color: #b94a48; + color: #b94a48; } .control-group.error input, .control-group.error select, .control-group.error textarea { - border-color: #b94a48; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + border-color: #b94a48; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.error input:focus, .control-group.error select:focus, .control-group.error textarea:focus { - border-color: #953b39; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + border-color: #953b39; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; } .control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on { - color: #b94a48; - background-color: #f2dede; - border-color: #b94a48; + color: #b94a48; + background-color: #f2dede; + border-color: #b94a48; } .control-group.success .control-label, .control-group.success .help-block, .control-group.success .help-inline { - color: #468847; + color: #468847; } .control-group.success .checkbox, @@ -1534,38 +1523,38 @@ input[type="checkbox"][readonly] { .control-group.success input, .control-group.success select, .control-group.success textarea { - color: #468847; + color: #468847; } .control-group.success input, .control-group.success select, .control-group.success textarea { - border-color: #468847; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + border-color: #468847; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.success input:focus, .control-group.success select:focus, .control-group.success textarea:focus { - border-color: #356635; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + border-color: #356635; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; } .control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on { - color: #468847; - background-color: #dff0d8; - border-color: #468847; + color: #468847; + background-color: #dff0d8; + border-color: #468847; } .control-group.info .control-label, .control-group.info .help-block, .control-group.info .help-inline { - color: #3a87ad; + color: #3a87ad; } .control-group.info .checkbox, @@ -1573,93 +1562,93 @@ input[type="checkbox"][readonly] { .control-group.info input, .control-group.info select, .control-group.info textarea { - color: #3a87ad; + color: #3a87ad; } .control-group.info input, .control-group.info select, .control-group.info textarea { - border-color: #3a87ad; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + border-color: #3a87ad; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.info input:focus, .control-group.info select:focus, .control-group.info textarea:focus { - border-color: #2d6987; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + border-color: #2d6987; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; } .control-group.info .input-prepend .add-on, .control-group.info .input-append .add-on { - color: #3a87ad; - background-color: #d9edf7; - border-color: #3a87ad; + color: #3a87ad; + background-color: #d9edf7; + border-color: #3a87ad; } input:focus:invalid, textarea:focus:invalid, select:focus:invalid { - color: #b94a48; - border-color: #ee5f5b; + color: #b94a48; + border-color: #ee5f5b; } input:focus:invalid:focus, textarea:focus:invalid:focus, select:focus:invalid:focus { - border-color: #e9322d; - -webkit-box-shadow: 0 0 6px #f8b9b7; - -moz-box-shadow: 0 0 6px #f8b9b7; - box-shadow: 0 0 6px #f8b9b7; + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; } .form-actions { - padding: 19px 20px 20px; - margin-top: 20px; - margin-bottom: 20px; - background-color: #f5f5f5; - border-top: 1px solid #e5e5e5; - *zoom: 1; + padding: 19px 20px 20px; + margin-top: 20px; + margin-bottom: 20px; + background-color: #f5f5f5; + border-top: 1px solid #e5e5e5; + *zoom: 1; } .form-actions:before, .form-actions:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .form-actions:after { - clear: both; + clear: both; } .help-block, .help-inline { - color: #595959; + color: #595959; } .help-block { - display: block; - margin-bottom: 10px; + display: block; + margin-bottom: 10px; } .help-inline { - display: inline-block; - *display: inline; - padding-left: 5px; - vertical-align: middle; - *zoom: 1; + display: inline-block; + *display: inline; + padding-left: 5px; + vertical-align: middle; + *zoom: 1; } .input-append, .input-prepend { - margin-bottom: 5px; - font-size: 0; - white-space: nowrap; + margin-bottom: 5px; + font-size: 0; + white-space: nowrap; } .input-append input, @@ -1670,7 +1659,7 @@ select:focus:invalid:focus { .input-prepend .uneditable-input, .input-append .dropdown-menu, .input-prepend .dropdown-menu { - font-size: 14px; + font-size: 14px; } .input-append input, @@ -1679,13 +1668,13 @@ select:focus:invalid:focus { .input-prepend select, .input-append .uneditable-input, .input-prepend .uneditable-input { - position: relative; - margin-bottom: 0; - *margin-left: 0; - vertical-align: top; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + position: relative; + margin-bottom: 0; + *margin-left: 0; + vertical-align: top; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-append input:focus, @@ -1694,23 +1683,23 @@ select:focus:invalid:focus { .input-prepend select:focus, .input-append .uneditable-input:focus, .input-prepend .uneditable-input:focus { - z-index: 2; + z-index: 2; } .input-append .add-on, .input-prepend .add-on { - display: inline-block; - width: auto; - height: 20px; - min-width: 16px; - padding: 4px 5px; - font-size: 14px; - font-weight: normal; - line-height: 20px; - text-align: center; - text-shadow: 0 1px 0 #ffffff; - background-color: #eeeeee; - border: 1px solid #ccc; + display: inline-block; + width: auto; + height: 20px; + min-width: 16px; + padding: 4px 5px; + font-size: 14px; + font-weight: normal; + line-height: 20px; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + background-color: #eeeeee; + border: 1px solid #ccc; } .input-append .add-on, @@ -1719,140 +1708,140 @@ select:focus:invalid:focus { .input-prepend .btn, .input-append .btn-group > .dropdown-toggle, .input-prepend .btn-group > .dropdown-toggle { - vertical-align: top; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + vertical-align: top; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .input-append .active, .input-prepend .active { - background-color: #a9dba9; - border-color: #46a546; + background-color: #a9dba9; + border-color: #46a546; } .input-prepend .add-on, .input-prepend .btn { - margin-right: -1px; + margin-right: -1px; } .input-prepend .add-on:first-child, .input-prepend .btn:first-child { - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; } .input-append input, .input-append select, .input-append .uneditable-input { - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; } .input-append input + .btn-group .btn:last-child, .input-append select + .btn-group .btn:last-child, .input-append .uneditable-input + .btn-group .btn:last-child { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-append .add-on, .input-append .btn, .input-append .btn-group { - margin-left: -1px; + margin-left: -1px; } .input-append .add-on:last-child, .input-append .btn:last-child, .input-append .btn-group:last-child > .dropdown-toggle { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-prepend.input-append input, .input-prepend.input-append select, .input-prepend.input-append .uneditable-input { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .input-prepend.input-append input + .btn-group .btn, .input-prepend.input-append select + .btn-group .btn, .input-prepend.input-append .uneditable-input + .btn-group .btn { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-prepend.input-append .add-on:first-child, .input-prepend.input-append .btn:first-child { - margin-right: -1px; - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; } .input-prepend.input-append .add-on:last-child, .input-prepend.input-append .btn:last-child { - margin-left: -1px; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-prepend.input-append .btn-group:first-child { - margin-left: 0; + margin-left: 0; } input.search-query { - padding-right: 14px; - padding-right: 4px \9; - padding-left: 14px; - padding-left: 4px \9; - /* IE7-8 doesn't have border-radius, so don't indent the padding */ + padding-right: 14px; + padding-right: 4px \9; + padding-left: 14px; + padding-left: 4px \9; + /* IE7-8 doesn't have border-radius, so don't indent the padding */ - margin-bottom: 0; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; + margin-bottom: 0; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; } /* Allow for input prepend/append in search forms */ .form-search .input-append .search-query, .form-search .input-prepend .search-query { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .form-search .input-append .search-query { - -webkit-border-radius: 14px 0 0 14px; - -moz-border-radius: 14px 0 0 14px; - border-radius: 14px 0 0 14px; + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; } .form-search .input-append .btn { - -webkit-border-radius: 0 14px 14px 0; - -moz-border-radius: 0 14px 14px 0; - border-radius: 0 14px 14px 0; + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; } .form-search .input-prepend .search-query { - -webkit-border-radius: 0 14px 14px 0; - -moz-border-radius: 0 14px 14px 0; - border-radius: 0 14px 14px 0; + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; } .form-search .input-prepend .btn { - -webkit-border-radius: 14px 0 0 14px; - -moz-border-radius: 14px 0 0 14px; - border-radius: 14px 0 0 14px; + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; } .form-search input, @@ -1876,96 +1865,96 @@ input.search-query { .form-search .input-append, .form-inline .input-append, .form-horizontal .input-append { - display: inline-block; - *display: inline; - margin-bottom: 0; - vertical-align: middle; - *zoom: 1; + display: inline-block; + *display: inline; + margin-bottom: 0; + vertical-align: middle; + *zoom: 1; } .form-search .hide, .form-inline .hide, .form-horizontal .hide { - display: none; + display: none; } .form-search label, .form-inline label, .form-search .btn-group, .form-inline .btn-group { - display: inline-block; + display: inline-block; } .form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend { - margin-bottom: 0; + margin-bottom: 0; } .form-search .radio, .form-search .checkbox, .form-inline .radio, .form-inline .checkbox { - padding-left: 0; - margin-bottom: 0; - vertical-align: middle; + padding-left: 0; + margin-bottom: 0; + vertical-align: middle; } .form-search .radio input[type="radio"], .form-search .checkbox input[type="checkbox"], .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { - float: left; - margin-right: 3px; - margin-left: 0; + float: left; + margin-right: 3px; + margin-left: 0; } .control-group { - margin-bottom: 10px; + margin-bottom: 10px; } legend + .control-group { - margin-top: 20px; - -webkit-margin-top-collapse: separate; + margin-top: 20px; + -webkit-margin-top-collapse: separate; } .form-horizontal .control-group { - margin-bottom: 20px; - *zoom: 1; + margin-bottom: 20px; + *zoom: 1; } .form-horizontal .control-group:before, .form-horizontal .control-group:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .form-horizontal .control-group:after { - clear: both; + clear: both; } .form-horizontal .control-label { - float: left; - width: 160px; - padding-top: 5px; - text-align: right; + float: left; + width: 160px; + padding-top: 5px; + text-align: right; } .form-horizontal .controls { - *display: inline-block; - *padding-left: 20px; - margin-left: 180px; - *margin-left: 0; + *display: inline-block; + *padding-left: 20px; + margin-left: 180px; + *margin-left: 0; } .form-horizontal .controls:first-child { - *padding-left: 180px; + *padding-left: 180px; } .form-horizontal .help-block { - margin-bottom: 0; + margin-bottom: 0; } .form-horizontal input + .help-block, @@ -1974,44 +1963,44 @@ legend + .control-group { .form-horizontal .uneditable-input + .help-block, .form-horizontal .input-prepend + .help-block, .form-horizontal .input-append + .help-block { - margin-top: 10px; + margin-top: 10px; } .form-horizontal .form-actions { - padding-left: 180px; + padding-left: 180px; } table { - max-width: 100%; - background-color: transparent; - border-collapse: collapse; - border-spacing: 0; + max-width: 100%; + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; } .table, table { - width: 100%; - margin-bottom: 20px; + width: 100%; + margin-bottom: 20px; } .table th, table th, .table td, table td { - padding: 8px; - line-height: 20px; - text-align: left; - vertical-align: top; - border-top: 1px solid #dddddd; + padding: 8px; + line-height: 20px; + text-align: left; + vertical-align: top; + border-top: 1px solid #dddddd; } .table th, table th { - font-weight: bold; + font-weight: bold; } .table thead th, table thead th { - vertical-align: bottom; + vertical-align: bottom; } .table caption + thead tr:first-child th, @@ -2026,37 +2015,37 @@ table colgroup + thead tr:first-child th, table colgroup + thead tr:first-child td, table thead:first-child tr:first-child th, table thead:first-child tr:first-child td { - border-top: 0; + border-top: 0; } .table tbody + tbody, table tbody + tbody { - border-top: 2px solid #dddddd; + border-top: 2px solid #dddddd; } .table .table, table table { - background-color: #ffffff; + background-color: #ffffff; } .table-condensed th, .table-condensed td { - padding: 4px 5px; + padding: 4px 5px; } .table-bordered { - border: 1px solid #dddddd; - border-collapse: separate; - *border-collapse: collapse; - border-left: 0; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + border: 1px solid #dddddd; + border-collapse: separate; + *border-collapse: collapse; + border-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .table-bordered th, .table-bordered td { - border-left: 1px solid #dddddd; + border-left: 1px solid #dddddd; } .table-bordered caption + thead tr:first-child th, @@ -2068,222 +2057,222 @@ table table { .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td { - border-top: 0; + border-top: 0; } .table-bordered thead:first-child tr:first-child > th:first-child, .table-bordered tbody:first-child tr:first-child > td:first-child { - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; } .table-bordered thead:first-child tr:first-child > th:last-child, .table-bordered tbody:first-child tr:first-child > td:last-child { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; } .table-bordered thead:last-child tr:last-child > th:first-child, .table-bordered tbody:last-child tr:last-child > td:first-child, .table-bordered tfoot:last-child tr:last-child > td:first-child { - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; } .table-bordered thead:last-child tr:last-child > th:last-child, .table-bordered tbody:last-child tr:last-child > td:last-child, .table-bordered tfoot:last-child tr:last-child > td:last-child { - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; } .table-bordered tfoot + tbody:last-child tr:last-child td:first-child { - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomleft: 0; } .table-bordered tfoot + tbody:last-child tr:last-child td:last-child { - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomright: 0; } .table-bordered caption + thead tr:first-child th:first-child, .table-bordered caption + tbody tr:first-child td:first-child, .table-bordered colgroup + thead tr:first-child th:first-child, .table-bordered colgroup + tbody tr:first-child td:first-child { - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; } .table-bordered caption + thead tr:first-child th:last-child, .table-bordered caption + tbody tr:first-child td:last-child, .table-bordered colgroup + thead tr:first-child th:last-child, .table-bordered colgroup + tbody tr:first-child td:last-child { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; } .table-striped tbody > tr:nth-child(odd) > td, .table-striped tbody > tr:nth-child(odd) > th, table tbody > tr:nth-child(odd) > td, table tbody > tr:nth-child(odd) > th { - background-color: #f9f9f9; + background-color: #f9f9f9; } .table-hover tbody tr:hover td, .table-hover tbody tr:hover th { - background-color: #f5f5f5; + background-color: #f5f5f5; } table td[class*="span"], table th[class*="span"], .row-fluid table td[class*="span"], .row-fluid table th[class*="span"] { - display: table-cell; - float: none; - margin-left: 0; + display: table-cell; + float: none; + margin-left: 0; } .table td.span1, .table th.span1 { - float: none; - width: 44px; - margin-left: 0; + float: none; + width: 44px; + margin-left: 0; } .table td.span2, .table th.span2 { - float: none; - width: 124px; - margin-left: 0; + float: none; + width: 124px; + margin-left: 0; } .table td.span3, .table th.span3 { - float: none; - width: 204px; - margin-left: 0; + float: none; + width: 204px; + margin-left: 0; } .table td.span4, .table th.span4 { - float: none; - width: 284px; - margin-left: 0; + float: none; + width: 284px; + margin-left: 0; } .table td.span5, .table th.span5 { - float: none; - width: 364px; - margin-left: 0; + float: none; + width: 364px; + margin-left: 0; } .table td.span6, .table th.span6 { - float: none; - width: 444px; - margin-left: 0; + float: none; + width: 444px; + margin-left: 0; } .table td.span7, .table th.span7 { - float: none; - width: 524px; - margin-left: 0; + float: none; + width: 524px; + margin-left: 0; } .table td.span8, .table th.span8 { - float: none; - width: 604px; - margin-left: 0; + float: none; + width: 604px; + margin-left: 0; } .table td.span9, .table th.span9 { - float: none; - width: 684px; - margin-left: 0; + float: none; + width: 684px; + margin-left: 0; } .table td.span10, .table th.span10 { - float: none; - width: 764px; - margin-left: 0; + float: none; + width: 764px; + margin-left: 0; } .table td.span11, .table th.span11 { - float: none; - width: 844px; - margin-left: 0; + float: none; + width: 844px; + margin-left: 0; } .table td.span12, .table th.span12 { - float: none; - width: 924px; - margin-left: 0; + float: none; + width: 924px; + margin-left: 0; } .table tbody tr.success td, table tbody tr.success td { - background-color: #dff0d8; + background-color: #dff0d8; } .table tbody tr.error td, table tbody tr.error td { - background-color: #f2dede; + background-color: #f2dede; } .table tbody tr.warning td, table tbody tr.warning td { - background-color: #fcf8e3; + background-color: #fcf8e3; } .table tbody tr.info td, table tbody tr.info td { - background-color: #d9edf7; + background-color: #d9edf7; } .table-hover tbody tr.success:hover td { - background-color: #d0e9c6; + background-color: #d0e9c6; } .table-hover tbody tr.error:hover td { - background-color: #ebcccc; + background-color: #ebcccc; } .table-hover tbody tr.warning:hover td { - background-color: #faf2cc; + background-color: #faf2cc; } .table-hover tbody tr.info:hover td { - background-color: #c4e3f3; + background-color: #c4e3f3; } [class^="icon-"], [class*=" icon-"] { - display: inline-block; - width: 14px; - height: 14px; - margin-top: 1px; - *margin-right: .3em; - line-height: 14px; - vertical-align: text-top; - background-image: url("../img/glyphicons-halflings.png"); - background-position: 14px 14px; - background-repeat: no-repeat; + display: inline-block; + width: 14px; + height: 14px; + margin-top: 1px; + *margin-right: .3em; + line-height: 14px; + vertical-align: text-top; + background-image: url("../img/glyphicons-halflings.png"); + background-position: 14px 14px; + background-repeat: no-repeat; } /* White icons with optional class, or on hover/active states of certain elements */ @@ -2301,915 +2290,915 @@ table tbody tr.info td { .dropdown-menu > .active > a > [class*=" icon-"], .dropdown-submenu:hover > a > [class^="icon-"], .dropdown-submenu:hover > a > [class*=" icon-"] { - background-image: url("../img/glyphicons-halflings-white.png"); + background-image: url("../img/glyphicons-halflings-white.png"); } .icon-glass { - background-position: 0 0; + background-position: 0 0; } .icon-music { - background-position: -24px 0; + background-position: -24px 0; } .icon-search { - background-position: -48px 0; + background-position: -48px 0; } .icon-envelope { - background-position: -72px 0; + background-position: -72px 0; } .icon-heart { - background-position: -96px 0; + background-position: -96px 0; } .icon-star { - background-position: -120px 0; + background-position: -120px 0; } .icon-star-empty { - background-position: -144px 0; + background-position: -144px 0; } .icon-user { - background-position: -168px 0; + background-position: -168px 0; } .icon-film { - background-position: -192px 0; + background-position: -192px 0; } .icon-th-large { - background-position: -216px 0; + background-position: -216px 0; } .icon-th { - background-position: -240px 0; + background-position: -240px 0; } .icon-th-list { - background-position: -264px 0; + background-position: -264px 0; } .icon-ok { - background-position: -288px 0; + background-position: -288px 0; } .icon-remove { - background-position: -312px 0; + background-position: -312px 0; } .icon-zoom-in { - background-position: -336px 0; + background-position: -336px 0; } .icon-zoom-out { - background-position: -360px 0; + background-position: -360px 0; } .icon-off { - background-position: -384px 0; + background-position: -384px 0; } .icon-signal { - background-position: -408px 0; + background-position: -408px 0; } .icon-cog { - background-position: -432px 0; + background-position: -432px 0; } .icon-trash { - background-position: -456px 0; + background-position: -456px 0; } .icon-home { - background-position: 0 -24px; + background-position: 0 -24px; } .icon-file { - background-position: -24px -24px; + background-position: -24px -24px; } .icon-time { - background-position: -48px -24px; + background-position: -48px -24px; } .icon-road { - background-position: -72px -24px; + background-position: -72px -24px; } .icon-download-alt { - background-position: -96px -24px; + background-position: -96px -24px; } .icon-download { - background-position: -120px -24px; + background-position: -120px -24px; } .icon-upload { - background-position: -144px -24px; + background-position: -144px -24px; } .icon-inbox { - background-position: -168px -24px; + background-position: -168px -24px; } .icon-play-circle { - background-position: -192px -24px; + background-position: -192px -24px; } .icon-repeat { - background-position: -216px -24px; + background-position: -216px -24px; } .icon-refresh { - background-position: -240px -24px; + background-position: -240px -24px; } .icon-list-alt { - background-position: -264px -24px; + background-position: -264px -24px; } .icon-lock { - background-position: -287px -24px; + background-position: -287px -24px; } .icon-flag { - background-position: -312px -24px; + background-position: -312px -24px; } .icon-headphones { - background-position: -336px -24px; + background-position: -336px -24px; } .icon-volume-off { - background-position: -360px -24px; + background-position: -360px -24px; } .icon-volume-down { - background-position: -384px -24px; + background-position: -384px -24px; } .icon-volume-up { - background-position: -408px -24px; + background-position: -408px -24px; } .icon-qrcode { - background-position: -432px -24px; + background-position: -432px -24px; } .icon-barcode { - background-position: -456px -24px; + background-position: -456px -24px; } .icon-tag { - background-position: 0 -48px; + background-position: 0 -48px; } .icon-tags { - background-position: -25px -48px; + background-position: -25px -48px; } .icon-book { - background-position: -48px -48px; + background-position: -48px -48px; } .icon-bookmark { - background-position: -72px -48px; + background-position: -72px -48px; } .icon-print { - background-position: -96px -48px; + background-position: -96px -48px; } .icon-camera { - background-position: -120px -48px; + background-position: -120px -48px; } .icon-font { - background-position: -144px -48px; + background-position: -144px -48px; } .icon-bold { - background-position: -167px -48px; + background-position: -167px -48px; } .icon-italic { - background-position: -192px -48px; + background-position: -192px -48px; } .icon-text-height { - background-position: -216px -48px; + background-position: -216px -48px; } .icon-text-width { - background-position: -240px -48px; + background-position: -240px -48px; } .icon-align-left { - background-position: -264px -48px; + background-position: -264px -48px; } .icon-align-center { - background-position: -288px -48px; + background-position: -288px -48px; } .icon-align-right { - background-position: -312px -48px; + background-position: -312px -48px; } .icon-align-justify { - background-position: -336px -48px; + background-position: -336px -48px; } .icon-list { - background-position: -360px -48px; + background-position: -360px -48px; } .icon-indent-left { - background-position: -384px -48px; + background-position: -384px -48px; } .icon-indent-right { - background-position: -408px -48px; + background-position: -408px -48px; } .icon-facetime-video { - background-position: -432px -48px; + background-position: -432px -48px; } .icon-picture { - background-position: -456px -48px; + background-position: -456px -48px; } .icon-pencil { - background-position: 0 -72px; + background-position: 0 -72px; } .icon-map-marker { - background-position: -24px -72px; + background-position: -24px -72px; } .icon-adjust { - background-position: -48px -72px; + background-position: -48px -72px; } .icon-tint { - background-position: -72px -72px; + background-position: -72px -72px; } .icon-edit { - background-position: -96px -72px; + background-position: -96px -72px; } .icon-share { - background-position: -120px -72px; + background-position: -120px -72px; } .icon-check { - background-position: -144px -72px; + background-position: -144px -72px; } .icon-move { - background-position: -168px -72px; + background-position: -168px -72px; } .icon-step-backward { - background-position: -192px -72px; + background-position: -192px -72px; } .icon-fast-backward { - background-position: -216px -72px; + background-position: -216px -72px; } .icon-backward { - background-position: -240px -72px; + background-position: -240px -72px; } .icon-play { - background-position: -264px -72px; + background-position: -264px -72px; } .icon-pause { - background-position: -288px -72px; + background-position: -288px -72px; } .icon-stop { - background-position: -312px -72px; + background-position: -312px -72px; } .icon-forward { - background-position: -336px -72px; + background-position: -336px -72px; } .icon-fast-forward { - background-position: -360px -72px; + background-position: -360px -72px; } .icon-step-forward { - background-position: -384px -72px; + background-position: -384px -72px; } .icon-eject { - background-position: -408px -72px; + background-position: -408px -72px; } .icon-chevron-left { - background-position: -432px -72px; + background-position: -432px -72px; } .icon-chevron-right { - background-position: -456px -72px; + background-position: -456px -72px; } .icon-plus-sign { - background-position: 0 -96px; + background-position: 0 -96px; } .icon-minus-sign { - background-position: -24px -96px; + background-position: -24px -96px; } .icon-remove-sign { - background-position: -48px -96px; + background-position: -48px -96px; } .icon-ok-sign { - background-position: -72px -96px; + background-position: -72px -96px; } .icon-question-sign { - background-position: -96px -96px; + background-position: -96px -96px; } .icon-info-sign { - background-position: -120px -96px; + background-position: -120px -96px; } .icon-screenshot { - background-position: -144px -96px; + background-position: -144px -96px; } .icon-remove-circle { - background-position: -168px -96px; + background-position: -168px -96px; } .icon-ok-circle { - background-position: -192px -96px; + background-position: -192px -96px; } .icon-ban-circle { - background-position: -216px -96px; + background-position: -216px -96px; } .icon-arrow-left { - background-position: -240px -96px; + background-position: -240px -96px; } .icon-arrow-right { - background-position: -264px -96px; + background-position: -264px -96px; } .icon-arrow-up { - background-position: -289px -96px; + background-position: -289px -96px; } .icon-arrow-down { - background-position: -312px -96px; + background-position: -312px -96px; } .icon-share-alt { - background-position: -336px -96px; + background-position: -336px -96px; } .icon-resize-full { - background-position: -360px -96px; + background-position: -360px -96px; } .icon-resize-small { - background-position: -384px -96px; + background-position: -384px -96px; } .icon-plus { - background-position: -408px -96px; + background-position: -408px -96px; } .icon-minus { - background-position: -433px -96px; + background-position: -433px -96px; } .icon-asterisk { - background-position: -456px -96px; + background-position: -456px -96px; } .icon-exclamation-sign { - background-position: 0 -120px; + background-position: 0 -120px; } .icon-gift { - background-position: -24px -120px; + background-position: -24px -120px; } .icon-leaf { - background-position: -48px -120px; + background-position: -48px -120px; } .icon-fire { - background-position: -72px -120px; + background-position: -72px -120px; } .icon-eye-open { - background-position: -96px -120px; + background-position: -96px -120px; } .icon-eye-close { - background-position: -120px -120px; + background-position: -120px -120px; } .icon-warning-sign { - background-position: -144px -120px; + background-position: -144px -120px; } .icon-plane { - background-position: -168px -120px; + background-position: -168px -120px; } .icon-calendar { - background-position: -192px -120px; + background-position: -192px -120px; } .icon-random { - width: 16px; - background-position: -216px -120px; + width: 16px; + background-position: -216px -120px; } .icon-comment { - background-position: -240px -120px; + background-position: -240px -120px; } .icon-magnet { - background-position: -264px -120px; + background-position: -264px -120px; } .icon-chevron-up { - background-position: -288px -120px; + background-position: -288px -120px; } .icon-chevron-down { - background-position: -313px -119px; + background-position: -313px -119px; } .icon-retweet { - background-position: -336px -120px; + background-position: -336px -120px; } .icon-shopping-cart { - background-position: -360px -120px; + background-position: -360px -120px; } .icon-folder-close { - background-position: -384px -120px; + background-position: -384px -120px; } .icon-folder-open { - width: 16px; - background-position: -408px -120px; + width: 16px; + background-position: -408px -120px; } .icon-resize-vertical { - background-position: -432px -119px; + background-position: -432px -119px; } .icon-resize-horizontal { - background-position: -456px -118px; + background-position: -456px -118px; } .icon-hdd { - background-position: 0 -144px; + background-position: 0 -144px; } .icon-bullhorn { - background-position: -24px -144px; + background-position: -24px -144px; } .icon-bell { - background-position: -48px -144px; + background-position: -48px -144px; } .icon-certificate { - background-position: -72px -144px; + background-position: -72px -144px; } .icon-thumbs-up { - background-position: -96px -144px; + background-position: -96px -144px; } .icon-thumbs-down { - background-position: -120px -144px; + background-position: -120px -144px; } .icon-hand-right { - background-position: -144px -144px; + background-position: -144px -144px; } .icon-hand-left { - background-position: -168px -144px; + background-position: -168px -144px; } .icon-hand-up { - background-position: -192px -144px; + background-position: -192px -144px; } .icon-hand-down { - background-position: -216px -144px; + background-position: -216px -144px; } .icon-circle-arrow-right { - background-position: -240px -144px; + background-position: -240px -144px; } .icon-circle-arrow-left { - background-position: -264px -144px; + background-position: -264px -144px; } .icon-circle-arrow-up { - background-position: -288px -144px; + background-position: -288px -144px; } .icon-circle-arrow-down { - background-position: -312px -144px; + background-position: -312px -144px; } .icon-globe { - background-position: -336px -144px; + background-position: -336px -144px; } .icon-wrench { - background-position: -360px -144px; + background-position: -360px -144px; } .icon-tasks { - background-position: -384px -144px; + background-position: -384px -144px; } .icon-filter { - background-position: -408px -144px; + background-position: -408px -144px; } .icon-briefcase { - background-position: -432px -144px; + background-position: -432px -144px; } .icon-fullscreen { - background-position: -456px -144px; + background-position: -456px -144px; } .dropup, .dropdown { - position: relative; + position: relative; } .dropdown-toggle { - *margin-bottom: -3px; + *margin-bottom: -3px; } .dropdown-toggle:active, .open .dropdown-toggle { - outline: 0; + outline: 0; } .caret { - display: inline-block; - width: 0; - height: 0; - vertical-align: top; - border-top: 4px solid #000000; - border-right: 4px solid transparent; - border-left: 4px solid transparent; - content: ""; + display: inline-block; + width: 0; + height: 0; + vertical-align: top; + border-top: 4px solid #000000; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + content: ""; } .dropdown .caret { - margin-top: 8px; - margin-left: 2px; + margin-top: 8px; + margin-left: 2px; } .dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 160px; - padding: 5px 0; - margin: 2px 0 0; - list-style: none; - background-color: #ffffff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); - *border-right-width: 2px; - *border-bottom-width: 2px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; } .dropdown-menu.pull-right { - right: 0; - left: auto; + right: 0; + left: auto; } .dropdown-menu .divider { - *width: 100%; - height: 1px; - margin: 9px 1px; - *margin: -5px 0 5px; - overflow: hidden; - background-color: #e5e5e5; - border-bottom: 1px solid #ffffff; + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; } .dropdown-menu li > a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 20px; - color: #333333; - white-space: nowrap; + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; } .dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a { - color: #ffffff; - text-decoration: none; - background-color: #0081c2; - background-image: -moz-linear-gradient(top, #0088cc, #0077b3); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); - background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); - background-image: -o-linear-gradient(top, #0088cc, #0077b3); - background-image: linear-gradient(to bottom, #0088cc, #0077b3); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); + color: #ffffff; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); } .dropdown-menu .active > a, .dropdown-menu .active > a:hover { - color: #ffffff; - text-decoration: none; - background-color: #0081c2; - background-image: -moz-linear-gradient(top, #0088cc, #0077b3); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); - background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); - background-image: -o-linear-gradient(top, #0088cc, #0077b3); - background-image: linear-gradient(to bottom, #0088cc, #0077b3); - background-repeat: repeat-x; - outline: 0; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); + color: #ffffff; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + outline: 0; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); } .dropdown-menu .disabled > a, .dropdown-menu .disabled > a:hover { - color: #999999; + color: #999999; } .dropdown-menu .disabled > a:hover { - text-decoration: none; - cursor: default; - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + text-decoration: none; + cursor: default; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .open { - *z-index: 1000; + *z-index: 1000; } .open > .dropdown-menu { - display: block; + display: block; } .pull-right > .dropdown-menu { - right: 0; - left: auto; + right: 0; + left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { - border-top: 0; - border-bottom: 4px solid #000000; - content: ""; + border-top: 0; + border-bottom: 4px solid #000000; + content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { - top: auto; - bottom: 100%; - margin-bottom: 1px; + top: auto; + bottom: 100%; + margin-bottom: 1px; } .dropdown-submenu { - position: relative; + position: relative; } .dropdown-submenu > .dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - -webkit-border-radius: 0 6px 6px 6px; - -moz-border-radius: 0 6px 6px 6px; - border-radius: 0 6px 6px 6px; + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 0 6px 6px 6px; + -moz-border-radius: 0 6px 6px 6px; + border-radius: 0 6px 6px 6px; } .dropdown-submenu:hover > .dropdown-menu { - display: block; + display: block; } .dropup .dropdown-submenu > .dropdown-menu { - top: auto; - bottom: 0; - margin-top: 0; - margin-bottom: -2px; - -webkit-border-radius: 5px 5px 5px 0; - -moz-border-radius: 5px 5px 5px 0; - border-radius: 5px 5px 5px 0; + top: auto; + bottom: 0; + margin-top: 0; + margin-bottom: -2px; + -webkit-border-radius: 5px 5px 5px 0; + -moz-border-radius: 5px 5px 5px 0; + border-radius: 5px 5px 5px 0; } .dropdown-submenu > a:after { - display: block; - float: right; - width: 0; - height: 0; - margin-top: 5px; - margin-right: -10px; - border-color: transparent; - border-left-color: #cccccc; - border-style: solid; - border-width: 5px 0 5px 5px; - content: " "; + display: block; + float: right; + width: 0; + height: 0; + margin-top: 5px; + margin-right: -10px; + border-color: transparent; + border-left-color: #cccccc; + border-style: solid; + border-width: 5px 0 5px 5px; + content: " "; } .dropdown-submenu:hover > a:after { - border-left-color: #ffffff; + border-left-color: #ffffff; } .dropdown-submenu.pull-left { - float: none; + float: none; } .dropdown-submenu.pull-left > .dropdown-menu { - left: -100%; - margin-left: 10px; - -webkit-border-radius: 6px 0 6px 6px; - -moz-border-radius: 6px 0 6px 6px; - border-radius: 6px 0 6px 6px; + left: -100%; + margin-left: 10px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; } .dropdown .dropdown-menu .nav-header { - padding-right: 20px; - padding-left: 20px; + padding-right: 20px; + padding-left: 20px; } .typeahead { - z-index: 1051; - margin-top: 2px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + z-index: 1051; + margin-top: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .well { - min-height: 20px; - padding: 19px; - margin-bottom: 20px; - background-color: #f5f5f5; - border: 1px solid #e3e3e3; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { - border-color: #ddd; - border-color: rgba(0, 0, 0, 0.15); + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); } .well-large { - padding: 24px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + padding: 24px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .well-small { - padding: 9px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + padding: 9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .fade { - opacity: 0; - -webkit-transition: opacity 0.15s linear; - -moz-transition: opacity 0.15s linear; - -o-transition: opacity 0.15s linear; - transition: opacity 0.15s linear; + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; } .fade.in { - opacity: 1; + opacity: 1; } .collapse { - position: relative; - height: 0; - overflow: hidden; - -webkit-transition: height 0.35s ease; - -moz-transition: height 0.35s ease; - -o-transition: height 0.35s ease; - transition: height 0.35s ease; + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; } .collapse.in { - height: auto; + height: auto; } .close { - float: right; - font-size: 20px; - font-weight: bold; - line-height: 20px; - color: #000000; - text-shadow: 0 1px 0 #ffffff; - opacity: 0.2; - filter: alpha(opacity=20); + float: right; + font-size: 20px; + font-weight: bold; + line-height: 20px; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); } .close:hover { - color: #000000; - text-decoration: none; - cursor: pointer; - opacity: 0.4; - filter: alpha(opacity=40); + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.4; + filter: alpha(opacity=40); } button.close { - padding: 0; - cursor: pointer; - background: transparent; - border: 0; - -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; } .btn { - display: inline-block; - *display: inline; - padding: 4px 12px; - margin-bottom: 0; - *margin-left: .3em; - font-size: 14px; - line-height: 20px; - color: #333333; - text-align: center; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - vertical-align: middle; - cursor: pointer; - background-color: #f5f5f5; - *background-color: #e6e6e6; - background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); - background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); - background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); - background-repeat: repeat-x; - border: 1px solid #bbbbbb; - *border: 0; - border-color: #e6e6e6 #e6e6e6 #bfbfbf; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - border-bottom-color: #a2a2a2; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - *zoom: 1; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + display: inline-block; + *display: inline; + padding: 4px 12px; + margin-bottom: 0; + *margin-left: .3em; + font-size: 14px; + line-height: 20px; + color: #333333; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; + cursor: pointer; + background-color: #f5f5f5; + *background-color: #e6e6e6; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + border: 1px solid #bbbbbb; + *border: 0; + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + border-bottom-color: #a2a2a2; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); } .btn:hover, @@ -3217,113 +3206,113 @@ button.close { .btn.active, .btn.disabled, .btn[disabled] { - color: #333333; - background-color: #e6e6e6; - *background-color: #d9d9d9; + color: #333333; + background-color: #e6e6e6; + *background-color: #d9d9d9; } .btn:active, .btn.active { - background-color: #cccccc \9; + background-color: #cccccc \9; } .btn:first-child { - *margin-left: 0; + *margin-left: 0; } .btn:hover { - color: #333333; - text-decoration: none; - background-position: 0 -15px; - -webkit-transition: background-position 0.1s linear; - -moz-transition: background-position 0.1s linear; - -o-transition: background-position 0.1s linear; - transition: background-position 0.1s linear; + color: #333333; + text-decoration: none; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; } .btn:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } .btn.active, .btn:active { - background-image: none; - outline: 0; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); } .btn.disabled, .btn[disabled] { - cursor: default; - background-image: none; - opacity: 0.65; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; + cursor: default; + background-image: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; } .btn-large { - padding: 11px 19px; - font-size: 17.5px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + padding: 11px 19px; + font-size: 17.5px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .btn-large [class^="icon-"], .btn-large [class*=" icon-"] { - margin-top: 4px; + margin-top: 4px; } .btn-small { - padding: 2px 10px; - font-size: 11.9px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + padding: 2px 10px; + font-size: 11.9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .btn-small [class^="icon-"], .btn-small [class*=" icon-"] { - margin-top: 0; + margin-top: 0; } .btn-mini [class^="icon-"], .btn-mini [class*=" icon-"] { - margin-top: -1px; + margin-top: -1px; } .btn-mini { - padding: 0 6px; - font-size: 10.5px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + padding: 0 6px; + font-size: 10.5px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .btn-block { - display: block; - width: 100%; - padding-right: 0; - padding-left: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + display: block; + width: 100%; + padding-right: 0; + padding-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } .btn-block + .btn-block { - margin-top: 5px; + margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { - width: 100%; + width: 100%; } .btn-primary.active, @@ -3332,29 +3321,29 @@ input[type="button"].btn-block { .btn-success.active, .btn-info.active, .btn-inverse.active { - color: rgba(255, 255, 255, 0.75); + color: rgba(255, 255, 255, 0.75); } .btn { - border-color: #c5c5c5; - border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); + border-color: #c5c5c5; + border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); } .btn-primary { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #006dcc; - *background-color: #0044cc; - background-image: -moz-linear-gradient(top, #0088cc, #0044cc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); - background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); - background-image: -o-linear-gradient(top, #0088cc, #0044cc); - background-image: linear-gradient(to bottom, #0088cc, #0044cc); - background-repeat: repeat-x; - border-color: #0044cc #0044cc #002a80; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #006dcc; + *background-color: #0044cc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(to bottom, #0088cc, #0044cc); + background-repeat: repeat-x; + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-primary:hover, @@ -3362,31 +3351,31 @@ input[type="button"].btn-block { .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { - color: #ffffff; - background-color: #0044cc; - *background-color: #003bb3; + color: #ffffff; + background-color: #0044cc; + *background-color: #003bb3; } .btn-primary:active, .btn-primary.active { - background-color: #003399 \9; + background-color: #003399 \9; } .btn-warning { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #faa732; - *background-color: #f89406; - background-image: -moz-linear-gradient(top, #fbb450, #f89406); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); - background-image: -webkit-linear-gradient(top, #fbb450, #f89406); - background-image: -o-linear-gradient(top, #fbb450, #f89406); - background-image: linear-gradient(to bottom, #fbb450, #f89406); - background-repeat: repeat-x; - border-color: #f89406 #f89406 #ad6704; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #faa732; + *background-color: #f89406; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + border-color: #f89406 #f89406 #ad6704; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-warning:hover, @@ -3394,31 +3383,31 @@ input[type="button"].btn-block { .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] { - color: #ffffff; - background-color: #f89406; - *background-color: #df8505; + color: #ffffff; + background-color: #f89406; + *background-color: #df8505; } .btn-warning:active, .btn-warning.active { - background-color: #c67605 \9; + background-color: #c67605 \9; } .btn-danger { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #da4f49; - *background-color: #bd362f; - background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); - background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); - background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); - background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); - background-repeat: repeat-x; - border-color: #bd362f #bd362f #802420; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #da4f49; + *background-color: #bd362f; + background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); + background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); + background-repeat: repeat-x; + border-color: #bd362f #bd362f #802420; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-danger:hover, @@ -3426,31 +3415,31 @@ input[type="button"].btn-block { .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] { - color: #ffffff; - background-color: #bd362f; - *background-color: #a9302a; + color: #ffffff; + background-color: #bd362f; + *background-color: #a9302a; } .btn-danger:active, .btn-danger.active { - background-color: #942a25 \9; + background-color: #942a25 \9; } .btn-success { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #5bb75b; - *background-color: #51a351; - background-image: -moz-linear-gradient(top, #62c462, #51a351); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); - background-image: -webkit-linear-gradient(top, #62c462, #51a351); - background-image: -o-linear-gradient(top, #62c462, #51a351); - background-image: linear-gradient(to bottom, #62c462, #51a351); - background-repeat: repeat-x; - border-color: #51a351 #51a351 #387038; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #5bb75b; + *background-color: #51a351; + background-image: -moz-linear-gradient(top, #62c462, #51a351); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); + background-image: -webkit-linear-gradient(top, #62c462, #51a351); + background-image: -o-linear-gradient(top, #62c462, #51a351); + background-image: linear-gradient(to bottom, #62c462, #51a351); + background-repeat: repeat-x; + border-color: #51a351 #51a351 #387038; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-success:hover, @@ -3458,31 +3447,31 @@ input[type="button"].btn-block { .btn-success.active, .btn-success.disabled, .btn-success[disabled] { - color: #ffffff; - background-color: #51a351; - *background-color: #499249; + color: #ffffff; + background-color: #51a351; + *background-color: #499249; } .btn-success:active, .btn-success.active { - background-color: #408140 \9; + background-color: #408140 \9; } .btn-info { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #49afcd; - *background-color: #2f96b4; - background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); - background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); - background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); - background-image: linear-gradient(to bottom, #5bc0de, #2f96b4); - background-repeat: repeat-x; - border-color: #2f96b4 #2f96b4 #1f6377; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #49afcd; + *background-color: #2f96b4; + background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); + background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); + background-image: linear-gradient(to bottom, #5bc0de, #2f96b4); + background-repeat: repeat-x; + border-color: #2f96b4 #2f96b4 #1f6377; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-info:hover, @@ -3490,31 +3479,31 @@ input[type="button"].btn-block { .btn-info.active, .btn-info.disabled, .btn-info[disabled] { - color: #ffffff; - background-color: #2f96b4; - *background-color: #2a85a0; + color: #ffffff; + background-color: #2f96b4; + *background-color: #2a85a0; } .btn-info:active, .btn-info.active { - background-color: #24748c \9; + background-color: #24748c \9; } .btn-inverse { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #363636; - *background-color: #222222; - background-image: -moz-linear-gradient(top, #444444, #222222); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); - background-image: -webkit-linear-gradient(top, #444444, #222222); - background-image: -o-linear-gradient(top, #444444, #222222); - background-image: linear-gradient(to bottom, #444444, #222222); - background-repeat: repeat-x; - border-color: #222222 #222222 #000000; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #363636; + *background-color: #222222; + background-image: -moz-linear-gradient(top, #444444, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); + background-image: -webkit-linear-gradient(top, #444444, #222222); + background-image: -o-linear-gradient(top, #444444, #222222); + background-image: linear-gradient(to bottom, #444444, #222222); + background-repeat: repeat-x; + border-color: #222222 #222222 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-inverse:hover, @@ -3522,271 +3511,271 @@ input[type="button"].btn-block { .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] { - color: #ffffff; - background-color: #222222; - *background-color: #151515; + color: #ffffff; + background-color: #222222; + *background-color: #151515; } .btn-inverse:active, .btn-inverse.active { - background-color: #080808 \9; + background-color: #080808 \9; } button.btn, input[type="submit"].btn { - *padding-top: 3px; - *padding-bottom: 3px; + *padding-top: 3px; + *padding-bottom: 3px; } button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner { - padding: 0; - border: 0; + padding: 0; + border: 0; } button.btn.btn-large, input[type="submit"].btn.btn-large { - *padding-top: 7px; - *padding-bottom: 7px; + *padding-top: 7px; + *padding-bottom: 7px; } button.btn.btn-small, input[type="submit"].btn.btn-small { - *padding-top: 3px; - *padding-bottom: 3px; + *padding-top: 3px; + *padding-bottom: 3px; } button.btn.btn-mini, input[type="submit"].btn.btn-mini { - *padding-top: 1px; - *padding-bottom: 1px; + *padding-top: 1px; + *padding-bottom: 1px; } .btn-link, .btn-link:active, .btn-link[disabled] { - background-color: transparent; - background-image: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; + background-color: transparent; + background-image: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; } .btn-link { - color: #0088cc; - cursor: pointer; - border-color: transparent; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + color: #0088cc; + cursor: pointer; + border-color: transparent; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .btn-link:hover { - color: #005580; - text-decoration: underline; - background-color: transparent; + color: #005580; + text-decoration: underline; + background-color: transparent; } .btn-link[disabled]:hover { - color: #333333; - text-decoration: none; + color: #333333; + text-decoration: none; } .btn-group { - position: relative; - display: inline-block; - *display: inline; - *margin-left: .3em; - font-size: 0; - white-space: nowrap; - vertical-align: middle; - *zoom: 1; + position: relative; + display: inline-block; + *display: inline; + *margin-left: .3em; + font-size: 0; + white-space: nowrap; + vertical-align: middle; + *zoom: 1; } .btn-group:first-child { - *margin-left: 0; + *margin-left: 0; } .btn-group + .btn-group { - margin-left: 5px; + margin-left: 5px; } .btn-toolbar { - margin-top: 10px; - margin-bottom: 10px; - font-size: 0; + margin-top: 10px; + margin-bottom: 10px; + font-size: 0; } .btn-toolbar > .btn + .btn, .btn-toolbar > .btn-group + .btn, .btn-toolbar > .btn + .btn-group { - margin-left: 5px; + margin-left: 5px; } .btn-group > .btn { - position: relative; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + position: relative; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .btn-group > .btn + .btn { - margin-left: -1px; + margin-left: -1px; } .btn-group > .btn, .btn-group > .dropdown-menu, .btn-group > .popover { - font-size: 14px; + font-size: 14px; } .btn-group > .btn-mini { - font-size: 10.5px; + font-size: 10.5px; } .btn-group > .btn-small { - font-size: 11.9px; + font-size: 11.9px; } .btn-group > .btn-large { - font-size: 17.5px; + font-size: 17.5px; } .btn-group > .btn:first-child { - margin-left: 0; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-topleft: 4px; + margin-left: 0; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 4px; } .btn-group > .btn:last-child, .btn-group > .dropdown-toggle { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-bottomright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; } .btn-group > .btn.large:first-child { - margin-left: 0; - -webkit-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -webkit-border-top-left-radius: 6px; - border-top-left-radius: 6px; - -moz-border-radius-bottomleft: 6px; - -moz-border-radius-topleft: 6px; + margin-left: 0; + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -webkit-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-topleft: 6px; } .btn-group > .btn.large:last-child, .btn-group > .large.dropdown-toggle { - -webkit-border-top-right-radius: 6px; - border-top-right-radius: 6px; - -webkit-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - -moz-border-radius-topright: 6px; - -moz-border-radius-bottomright: 6px; + -webkit-border-top-right-radius: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-topright: 6px; + -moz-border-radius-bottomright: 6px; } .btn-group > .btn:hover, .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active { - z-index: 2; + z-index: 2; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { - outline: 0; + outline: 0; } .btn-group > .btn + .dropdown-toggle { - *padding-top: 5px; - padding-right: 8px; - *padding-bottom: 5px; - padding-left: 8px; - -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + *padding-top: 5px; + padding-right: 8px; + *padding-bottom: 5px; + padding-left: 8px; + -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); } .btn-group > .btn-mini + .dropdown-toggle { - *padding-top: 2px; - padding-right: 5px; - *padding-bottom: 2px; - padding-left: 5px; + *padding-top: 2px; + padding-right: 5px; + *padding-bottom: 2px; + padding-left: 5px; } .btn-group > .btn-small + .dropdown-toggle { - *padding-top: 5px; - *padding-bottom: 4px; + *padding-top: 5px; + *padding-bottom: 4px; } .btn-group > .btn-large + .dropdown-toggle { - *padding-top: 7px; - padding-right: 12px; - *padding-bottom: 7px; - padding-left: 12px; + *padding-top: 7px; + padding-right: 12px; + *padding-bottom: 7px; + padding-left: 12px; } .btn-group.open .dropdown-toggle { - background-image: none; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); } .btn-group.open .btn.dropdown-toggle { - background-color: #e6e6e6; + background-color: #e6e6e6; } .btn-group.open .btn-primary.dropdown-toggle { - background-color: #0044cc; + background-color: #0044cc; } .btn-group.open .btn-warning.dropdown-toggle { - background-color: #f89406; + background-color: #f89406; } .btn-group.open .btn-danger.dropdown-toggle { - background-color: #bd362f; + background-color: #bd362f; } .btn-group.open .btn-success.dropdown-toggle { - background-color: #51a351; + background-color: #51a351; } .btn-group.open .btn-info.dropdown-toggle { - background-color: #2f96b4; + background-color: #2f96b4; } .btn-group.open .btn-inverse.dropdown-toggle { - background-color: #222222; + background-color: #222222; } .btn .caret { - margin-top: 8px; - margin-left: 0; + margin-top: 8px; + margin-left: 0; } .btn-mini .caret, .btn-small .caret, .btn-large .caret { - margin-top: 6px; + margin-top: 6px; } .btn-large .caret { - border-top-width: 5px; - border-right-width: 5px; - border-left-width: 5px; + border-top-width: 5px; + border-right-width: 5px; + border-left-width: 5px; } .dropup .btn-large .caret { - border-bottom-width: 5px; + border-bottom-width: 5px; } .btn-primary .caret, @@ -3795,824 +3784,824 @@ input[type="submit"].btn.btn-mini { .btn-info .caret, .btn-success .caret, .btn-inverse .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; + border-top-color: #ffffff; + border-bottom-color: #ffffff; } .btn-group-vertical { - display: inline-block; - *display: inline; - /* IE7 inline-block hack */ + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ - *zoom: 1; + *zoom: 1; } .btn-group-vertical > .btn { - display: block; - float: none; - max-width: 100%; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + display: block; + float: none; + max-width: 100%; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .btn-group-vertical > .btn + .btn { - margin-top: -1px; - margin-left: 0; + margin-top: -1px; + margin-left: 0; } .btn-group-vertical > .btn:first-child { - -webkit-border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - border-radius: 4px 4px 0 0; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; } .btn-group-vertical > .btn:last-child { - -webkit-border-radius: 0 0 4px 4px; - -moz-border-radius: 0 0 4px 4px; - border-radius: 0 0 4px 4px; + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; } .btn-group-vertical > .btn-large:first-child { - -webkit-border-radius: 6px 6px 0 0; - -moz-border-radius: 6px 6px 0 0; - border-radius: 6px 6px 0 0; + -webkit-border-radius: 6px 6px 0 0; + -moz-border-radius: 6px 6px 0 0; + border-radius: 6px 6px 0 0; } .btn-group-vertical > .btn-large:last-child { - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; } .alert { - padding: 8px 35px 8px 14px; - margin-bottom: 20px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - background-color: #fcf8e3; - border: 1px solid #fbeed5; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + padding: 8px 35px 8px 14px; + margin-bottom: 20px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: #fcf8e3; + border: 1px solid #fbeed5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .alert, .alert h4 { - color: #c09853; + color: #c09853; } .alert h4 { - margin: 0; + margin: 0; } .alert .close { - position: relative; - top: -2px; - right: -21px; - line-height: 20px; + position: relative; + top: -2px; + right: -21px; + line-height: 20px; } .alert-success { - color: #468847; - background-color: #dff0d8; - border-color: #d6e9c6; + color: #468847; + background-color: #dff0d8; + border-color: #d6e9c6; } .alert-success h4 { - color: #468847; + color: #468847; } .alert-danger, .alert-error { - color: #b94a48; - background-color: #f2dede; - border-color: #eed3d7; + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7; } .alert-danger h4, .alert-error h4 { - color: #b94a48; + color: #b94a48; } .alert-info { - color: #3a87ad; - background-color: #d9edf7; - border-color: #bce8f1; + color: #3a87ad; + background-color: #d9edf7; + border-color: #bce8f1; } .alert-info h4 { - color: #3a87ad; + color: #3a87ad; } .alert-block { - padding-top: 14px; - padding-bottom: 14px; + padding-top: 14px; + padding-bottom: 14px; } .alert-block > p, .alert-block > ul { - margin-bottom: 0; + margin-bottom: 0; } .alert-block p + p { - margin-top: 5px; + margin-top: 5px; } .nav { - margin-bottom: 20px; - margin-left: 0; - list-style: none; + margin-bottom: 20px; + margin-left: 0; + list-style: none; } .nav > li > a { - display: block; + display: block; } .nav > li > a:hover { - text-decoration: none; - background-color: #eeeeee; + text-decoration: none; + background-color: #eeeeee; } .nav > li > a > img { - max-width: none; + max-width: none; } .nav > .pull-right { - float: right; + float: right; } .nav-header { - display: block; - padding: 3px 15px; - font-size: 11px; - font-weight: bold; - line-height: 20px; - color: #999999; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - text-transform: uppercase; + display: block; + padding: 3px 15px; + font-size: 11px; + font-weight: bold; + line-height: 20px; + color: #999999; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-transform: uppercase; } .nav li + .nav-header { - margin-top: 9px; + margin-top: 9px; } .nav-list { - padding-right: 15px; - padding-left: 15px; - margin-bottom: 0; + padding-right: 15px; + padding-left: 15px; + margin-bottom: 0; } .nav-list > li > a, .nav-list .nav-header { - margin-right: -15px; - margin-left: -15px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + margin-right: -15px; + margin-left: -15px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } .nav-list > li > a { - padding: 3px 15px; + padding: 3px 15px; } .nav-list > .active > a, .nav-list > .active > a:hover { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); - background-color: #0088cc; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + background-color: #0088cc; } .nav-list [class^="icon-"], .nav-list [class*=" icon-"] { - margin-right: 2px; + margin-right: 2px; } .nav-list .divider { - *width: 100%; - height: 1px; - margin: 9px 1px; - *margin: -5px 0 5px; - overflow: hidden; - background-color: #e5e5e5; - border-bottom: 1px solid #ffffff; + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; } .nav-tabs, .nav-pills { - *zoom: 1; + *zoom: 1; } .nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .nav-tabs:after, .nav-pills:after { - clear: both; + clear: both; } .nav-tabs > li, .nav-pills > li { - float: left; + float: left; } .nav-tabs > li > a, .nav-pills > li > a { - padding-right: 12px; - padding-left: 12px; - margin-right: 2px; - line-height: 14px; + padding-right: 12px; + padding-left: 12px; + margin-right: 2px; + line-height: 14px; } .nav-tabs { - border-bottom: 1px solid #ddd; + border-bottom: 1px solid #ddd; } .nav-tabs > li { - margin-bottom: -1px; + margin-bottom: -1px; } .nav-tabs > li > a { - padding-top: 8px; - padding-bottom: 8px; - line-height: 20px; - border: 1px solid transparent; - -webkit-border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - border-radius: 4px 4px 0 0; + padding-top: 8px; + padding-bottom: 8px; + line-height: 20px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { - border-color: #eeeeee #eeeeee #dddddd; + border-color: #eeeeee #eeeeee #dddddd; } .nav-tabs > .active > a, .nav-tabs > .active > a:hover { - color: #555555; - cursor: default; - background-color: #ffffff; - border: 1px solid #ddd; - border-bottom-color: transparent; + color: #555555; + cursor: default; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; } .nav-pills > li > a { - padding-top: 8px; - padding-bottom: 8px; - margin-top: 2px; - margin-bottom: 2px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; + padding-top: 8px; + padding-bottom: 8px; + margin-top: 2px; + margin-bottom: 2px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; } .nav-pills > .active > a, .nav-pills > .active > a:hover { - color: #ffffff; - background-color: #0088cc; + color: #ffffff; + background-color: #0088cc; } .nav-stacked > li { - float: none; + float: none; } .nav-stacked > li > a { - margin-right: 0; + margin-right: 0; } .nav-tabs.nav-stacked { - border-bottom: 0; + border-bottom: 0; } .nav-tabs.nav-stacked > li > a { - border: 1px solid #ddd; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + border: 1px solid #ddd; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .nav-tabs.nav-stacked > li:first-child > a { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-topleft: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; } .nav-tabs.nav-stacked > li:last-child > a { - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -moz-border-radius-bottomright: 4px; - -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; } .nav-tabs.nav-stacked > li > a:hover { - z-index: 2; - border-color: #ddd; + z-index: 2; + border-color: #ddd; } .nav-pills.nav-stacked > li > a { - margin-bottom: 3px; + margin-bottom: 3px; } .nav-pills.nav-stacked > li:last-child > a { - margin-bottom: 1px; + margin-bottom: 1px; } .nav-tabs .dropdown-menu { - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; } .nav-pills .dropdown-menu { - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .nav .dropdown-toggle .caret { - margin-top: 6px; - border-top-color: #0088cc; - border-bottom-color: #0088cc; + margin-top: 6px; + border-top-color: #0088cc; + border-bottom-color: #0088cc; } .nav .dropdown-toggle:hover .caret { - border-top-color: #005580; - border-bottom-color: #005580; + border-top-color: #005580; + border-bottom-color: #005580; } /* move down carets for tabs */ .nav-tabs .dropdown-toggle .caret { - margin-top: 8px; + margin-top: 8px; } .nav .active .dropdown-toggle .caret { - border-top-color: #fff; - border-bottom-color: #fff; + border-top-color: #fff; + border-bottom-color: #fff; } .nav-tabs .active .dropdown-toggle .caret { - border-top-color: #555555; - border-bottom-color: #555555; + border-top-color: #555555; + border-bottom-color: #555555; } .nav > .dropdown.active > a:hover { - cursor: pointer; + cursor: pointer; } .nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > li.dropdown.open.active > a:hover { - color: #ffffff; - background-color: #999999; - border-color: #999999; + color: #ffffff; + background-color: #999999; + border-color: #999999; } .nav li.dropdown.open .caret, .nav li.dropdown.open.active .caret, .nav li.dropdown.open a:hover .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; - opacity: 1; - filter: alpha(opacity=100); + border-top-color: #ffffff; + border-bottom-color: #ffffff; + opacity: 1; + filter: alpha(opacity=100); } .tabs-stacked .open > a:hover { - border-color: #999999; + border-color: #999999; } .tabbable { - *zoom: 1; + *zoom: 1; } .tabbable:before, .tabbable:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .tabbable:after { - clear: both; + clear: both; } .tab-content { - overflow: auto; + overflow: auto; } .tabs-below > .nav-tabs, .tabs-right > .nav-tabs, .tabs-left > .nav-tabs { - border-bottom: 0; + border-bottom: 0; } .tab-content > .tab-pane, .pill-content > .pill-pane { - display: none; + display: none; } .tab-content > .active, .pill-content > .active { - display: block; + display: block; } .tabs-below > .nav-tabs { - border-top: 1px solid #ddd; + border-top: 1px solid #ddd; } .tabs-below > .nav-tabs > li { - margin-top: -1px; - margin-bottom: 0; + margin-top: -1px; + margin-bottom: 0; } .tabs-below > .nav-tabs > li > a { - -webkit-border-radius: 0 0 4px 4px; - -moz-border-radius: 0 0 4px 4px; - border-radius: 0 0 4px 4px; + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; } .tabs-below > .nav-tabs > li > a:hover { - border-top-color: #ddd; - border-bottom-color: transparent; + border-top-color: #ddd; + border-bottom-color: transparent; } .tabs-below > .nav-tabs > .active > a, .tabs-below > .nav-tabs > .active > a:hover { - border-color: transparent #ddd #ddd #ddd; + border-color: transparent #ddd #ddd #ddd; } .tabs-left > .nav-tabs > li, .tabs-right > .nav-tabs > li { - float: none; + float: none; } .tabs-left > .nav-tabs > li > a, .tabs-right > .nav-tabs > li > a { - min-width: 74px; - margin-right: 0; - margin-bottom: 3px; + min-width: 74px; + margin-right: 0; + margin-bottom: 3px; } .tabs-left > .nav-tabs { - float: left; - margin-right: 19px; - border-right: 1px solid #ddd; + float: left; + margin-right: 19px; + border-right: 1px solid #ddd; } .tabs-left > .nav-tabs > li > a { - margin-right: -1px; - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; } .tabs-left > .nav-tabs > li > a:hover { - border-color: #eeeeee #dddddd #eeeeee #eeeeee; + border-color: #eeeeee #dddddd #eeeeee #eeeeee; } .tabs-left > .nav-tabs .active > a, .tabs-left > .nav-tabs .active > a:hover { - border-color: #ddd transparent #ddd #ddd; - *border-right-color: #ffffff; + border-color: #ddd transparent #ddd #ddd; + *border-right-color: #ffffff; } .tabs-right > .nav-tabs { - float: right; - margin-left: 19px; - border-left: 1px solid #ddd; + float: right; + margin-left: 19px; + border-left: 1px solid #ddd; } .tabs-right > .nav-tabs > li > a { - margin-left: -1px; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .tabs-right > .nav-tabs > li > a:hover { - border-color: #eeeeee #eeeeee #eeeeee #dddddd; + border-color: #eeeeee #eeeeee #eeeeee #dddddd; } .tabs-right > .nav-tabs .active > a, .tabs-right > .nav-tabs .active > a:hover { - border-color: #ddd #ddd #ddd transparent; - *border-left-color: #ffffff; + border-color: #ddd #ddd #ddd transparent; + *border-left-color: #ffffff; } .nav > .disabled > a { - color: #999999; + color: #999999; } .nav > .disabled > a:hover { - text-decoration: none; - cursor: default; - background-color: transparent; + text-decoration: none; + cursor: default; + background-color: transparent; } .navbar { - *position: relative; - *z-index: 2; - margin-bottom: 20px; - overflow: visible; + *position: relative; + *z-index: 2; + margin-bottom: 20px; + overflow: visible; } .navbar-inner { - min-height: 40px; - padding-right: 20px; - padding-left: 20px; - background-color: #fafafa; - background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); - background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); - background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); - background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); - background-repeat: repeat-x; - border: 1px solid #d4d4d4; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); - *zoom: 1; - -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); - -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + min-height: 40px; + padding-right: 20px; + padding-left: 20px; + background-color: #fafafa; + background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); + background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); + background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); + background-repeat: repeat-x; + border: 1px solid #d4d4d4; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); + *zoom: 1; + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); } .navbar-inner:before, .navbar-inner:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .navbar-inner:after { - clear: both; + clear: both; } .navbar .container { - width: auto; + width: auto; } .nav-collapse.collapse { - height: auto; - overflow: visible; + height: auto; + overflow: visible; } .navbar .brand { - display: block; - float: left; - padding: 10px 20px 10px; - margin-left: -20px; - font-size: 20px; - font-weight: 200; - color: #777777; - text-shadow: 0 1px 0 #ffffff; + display: block; + float: left; + padding: 10px 20px 10px; + margin-left: -20px; + font-size: 20px; + font-weight: 200; + color: #777777; + text-shadow: 0 1px 0 #ffffff; } .navbar .brand:hover { - text-decoration: none; + text-decoration: none; } .navbar-text { - margin-bottom: 0; - line-height: 40px; - color: #777777; + margin-bottom: 0; + line-height: 40px; + color: #777777; } .navbar-link { - color: #777777; + color: #777777; } .navbar-link:hover { - color: #333333; + color: #333333; } .navbar .divider-vertical { - height: 40px; - margin: 0 9px; - border-right: 1px solid #ffffff; - border-left: 1px solid #f2f2f2; + height: 40px; + margin: 0 9px; + border-right: 1px solid #ffffff; + border-left: 1px solid #f2f2f2; } .navbar .btn, .navbar .btn-group { - margin-top: 5px; + margin-top: 5px; } .navbar .btn-group .btn, .navbar .input-prepend .btn, .navbar .input-append .btn { - margin-top: 0; + margin-top: 0; } .navbar-form { - margin-bottom: 0; - *zoom: 1; + margin-bottom: 0; + *zoom: 1; } .navbar-form:before, .navbar-form:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .navbar-form:after { - clear: both; + clear: both; } .navbar-form input, .navbar-form select, .navbar-form .radio, .navbar-form .checkbox { - margin-top: 5px; + margin-top: 5px; } .navbar-form input, .navbar-form select, .navbar-form .btn { - display: inline-block; - margin-bottom: 0; + display: inline-block; + margin-bottom: 0; } .navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] { - margin-top: 3px; + margin-top: 3px; } .navbar-form .input-append, .navbar-form .input-prepend { - margin-top: 5px; - white-space: nowrap; + margin-top: 5px; + white-space: nowrap; } .navbar-form .input-append input, .navbar-form .input-prepend input { - margin-top: 0; + margin-top: 0; } .navbar-search { - position: relative; - float: left; - margin-top: 5px; - margin-bottom: 0; + position: relative; + float: left; + margin-top: 5px; + margin-bottom: 0; } .navbar-search .search-query { - padding: 4px 14px; - margin-bottom: 0; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 13px; - font-weight: normal; - line-height: 1; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; + padding: 4px 14px; + margin-bottom: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 1; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; } .navbar-static-top { - position: static; - margin-bottom: 0; + position: static; + margin-bottom: 0; } .navbar-static-top .navbar-inner { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .navbar-fixed-top, .navbar-fixed-bottom { - position: fixed; - right: 0; - left: 0; - z-index: 1030; - margin-bottom: 0; + position: fixed; + right: 0; + left: 0; + z-index: 1030; + margin-bottom: 0; } .navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner { - border-width: 0 0 1px; + border-width: 0 0 1px; } .navbar-fixed-bottom .navbar-inner { - border-width: 1px 0 0; + border-width: 1px 0 0; } .navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner { - padding-right: 0; - padding-left: 0; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + padding-right: 0; + padding-left: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { - width: 940px; + width: 940px; } .navbar-fixed-top { - top: 0; + top: 0; } .navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner { - -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); - box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); } .navbar-fixed-bottom { - bottom: 0; + bottom: 0; } .navbar-fixed-bottom .navbar-inner { - -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); - box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); } .navbar .nav { - position: relative; - left: 0; - display: block; - float: left; - margin: 0 10px 0 0; + position: relative; + left: 0; + display: block; + float: left; + margin: 0 10px 0 0; } .navbar .nav.pull-right { - float: right; - margin-right: 0; + float: right; + margin-right: 0; } .navbar .nav > li { - float: left; + float: left; } .navbar .nav > li > a { - float: none; - padding: 10px 15px 10px; - color: #777777; - text-decoration: none; - text-shadow: 0 1px 0 #ffffff; + float: none; + padding: 10px 15px 10px; + color: #777777; + text-decoration: none; + text-shadow: 0 1px 0 #ffffff; } .navbar .nav .dropdown-toggle .caret { - margin-top: 8px; + margin-top: 8px; } .navbar .nav > li > a:focus, .navbar .nav > li > a:hover { - color: #333333; - text-decoration: none; - background-color: transparent; + color: #333333; + text-decoration: none; + background-color: transparent; } .navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus { - color: #555555; - text-decoration: none; - background-color: #e5e5e5; - -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); - -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); - box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + color: #555555; + text-decoration: none; + background-color: #e5e5e5; + -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); } .navbar .btn-navbar { - display: none; - float: right; - padding: 7px 10px; - margin-right: 5px; - margin-left: 5px; - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #ededed; - *background-color: #e5e5e5; - background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5)); - background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5); - background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5); - background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5); - background-repeat: repeat-x; - border-color: #e5e5e5 #e5e5e5 #bfbfbf; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + display: none; + float: right; + padding: 7px 10px; + margin-right: 5px; + margin-left: 5px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #ededed; + *background-color: #e5e5e5; + background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5)); + background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5); + background-repeat: repeat-x; + border-color: #e5e5e5 #e5e5e5 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); } .navbar .btn-navbar:hover, @@ -4620,258 +4609,258 @@ input[type="submit"].btn.btn-mini { .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled] { - color: #ffffff; - background-color: #e5e5e5; - *background-color: #d9d9d9; + color: #ffffff; + background-color: #e5e5e5; + *background-color: #d9d9d9; } .navbar .btn-navbar:active, .navbar .btn-navbar.active { - background-color: #cccccc \9; + background-color: #cccccc \9; } .navbar .btn-navbar .icon-bar { - display: block; - width: 18px; - height: 2px; - background-color: #f5f5f5; - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; - -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); - -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + display: block; + width: 18px; + height: 2px; + background-color: #f5f5f5; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); } .btn-navbar .icon-bar + .icon-bar { - margin-top: 3px; + margin-top: 3px; } .navbar .nav > li > .dropdown-menu:before { - position: absolute; - top: -7px; - left: 9px; - display: inline-block; - border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; - border-left: 7px solid transparent; - border-bottom-color: rgba(0, 0, 0, 0.2); - content: ''; + position: absolute; + top: -7px; + left: 9px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-left: 7px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; } .navbar .nav > li > .dropdown-menu:after { - position: absolute; - top: -6px; - left: 10px; - display: inline-block; - border-right: 6px solid transparent; - border-bottom: 6px solid #ffffff; - border-left: 6px solid transparent; - content: ''; + position: absolute; + top: -6px; + left: 10px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + border-left: 6px solid transparent; + content: ''; } .navbar-fixed-bottom .nav > li > .dropdown-menu:before { - top: auto; - bottom: -7px; - border-top: 7px solid #ccc; - border-bottom: 0; - border-top-color: rgba(0, 0, 0, 0.2); + top: auto; + bottom: -7px; + border-top: 7px solid #ccc; + border-bottom: 0; + border-top-color: rgba(0, 0, 0, 0.2); } .navbar-fixed-bottom .nav > li > .dropdown-menu:after { - top: auto; - bottom: -6px; - border-top: 6px solid #ffffff; - border-bottom: 0; + top: auto; + bottom: -6px; + border-top: 6px solid #ffffff; + border-bottom: 0; } .navbar .nav li.dropdown > a:hover .caret { - border-top-color: #555555; - border-bottom-color: #555555; + border-top-color: #555555; + border-bottom-color: #555555; } .navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.active > .dropdown-toggle, .navbar .nav li.dropdown.open.active > .dropdown-toggle { - color: #555555; - background-color: #e5e5e5; + color: #555555; + background-color: #e5e5e5; } .navbar .nav li.dropdown > .dropdown-toggle .caret { - border-top-color: #777777; - border-bottom-color: #777777; + border-top-color: #777777; + border-bottom-color: #777777; } .navbar .nav li.dropdown.open > .dropdown-toggle .caret, .navbar .nav li.dropdown.active > .dropdown-toggle .caret, .navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { - border-top-color: #555555; - border-bottom-color: #555555; + border-top-color: #555555; + border-bottom-color: #555555; } .navbar .pull-right > li > .dropdown-menu, .navbar .nav > li > .dropdown-menu.pull-right { - right: 0; - left: auto; + right: 0; + left: auto; } .navbar .pull-right > li > .dropdown-menu:before, .navbar .nav > li > .dropdown-menu.pull-right:before { - right: 12px; - left: auto; + right: 12px; + left: auto; } .navbar .pull-right > li > .dropdown-menu:after, .navbar .nav > li > .dropdown-menu.pull-right:after { - right: 13px; - left: auto; + right: 13px; + left: auto; } .navbar .pull-right > li > .dropdown-menu .dropdown-menu, .navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { - right: 100%; - left: auto; - margin-right: -1px; - margin-left: 0; - -webkit-border-radius: 6px 0 6px 6px; - -moz-border-radius: 6px 0 6px 6px; - border-radius: 6px 0 6px 6px; + right: 100%; + left: auto; + margin-right: -1px; + margin-left: 0; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; } .navbar-inverse .navbar-inner { - background-color: #1b1b1b; - background-image: -moz-linear-gradient(top, #222222, #111111); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); - background-image: -webkit-linear-gradient(top, #222222, #111111); - background-image: -o-linear-gradient(top, #222222, #111111); - background-image: linear-gradient(to bottom, #222222, #111111); - background-repeat: repeat-x; - border-color: #252525; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); + background-color: #1b1b1b; + background-image: -moz-linear-gradient(top, #222222, #111111); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); + background-image: -webkit-linear-gradient(top, #222222, #111111); + background-image: -o-linear-gradient(top, #222222, #111111); + background-image: linear-gradient(to bottom, #222222, #111111); + background-repeat: repeat-x; + border-color: #252525; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); } .navbar-inverse .brand, .navbar-inverse .nav > li > a { - color: #999999; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + color: #999999; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .navbar-inverse .brand:hover, .navbar-inverse .nav > li > a:hover { - color: #ffffff; + color: #ffffff; } .navbar-inverse .brand { - color: #999999; + color: #999999; } .navbar-inverse .navbar-text { - color: #999999; + color: #999999; } .navbar-inverse .nav > li > a:focus, .navbar-inverse .nav > li > a:hover { - color: #ffffff; - background-color: transparent; + color: #ffffff; + background-color: transparent; } .navbar-inverse .nav .active > a, .navbar-inverse .nav .active > a:hover, .navbar-inverse .nav .active > a:focus { - color: #ffffff; - background-color: #111111; + color: #ffffff; + background-color: #111111; } .navbar-inverse .navbar-link { - color: #999999; + color: #999999; } .navbar-inverse .navbar-link:hover { - color: #ffffff; + color: #ffffff; } .navbar-inverse .divider-vertical { - border-right-color: #222222; - border-left-color: #111111; + border-right-color: #222222; + border-left-color: #111111; } .navbar-inverse .nav li.dropdown.open > .dropdown-toggle, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { - color: #ffffff; - background-color: #111111; + color: #ffffff; + background-color: #111111; } .navbar-inverse .nav li.dropdown > a:hover .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; + border-top-color: #ffffff; + border-bottom-color: #ffffff; } .navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { - border-top-color: #999999; - border-bottom-color: #999999; + border-top-color: #999999; + border-bottom-color: #999999; } .navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; + border-top-color: #ffffff; + border-bottom-color: #ffffff; } .navbar-inverse .navbar-search .search-query { - color: #ffffff; - background-color: #515151; - border-color: #111111; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - transition: none; + color: #ffffff; + background-color: #515151; + border-color: #111111; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; } .navbar-inverse .navbar-search .search-query:-moz-placeholder { - color: #cccccc; + color: #cccccc; } .navbar-inverse .navbar-search .search-query:-ms-input-placeholder { - color: #cccccc; + color: #cccccc; } .navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { - color: #cccccc; + color: #cccccc; } .navbar-inverse .navbar-search .search-query:focus, .navbar-inverse .navbar-search .search-query.focused { - padding: 5px 15px; - color: #333333; - text-shadow: 0 1px 0 #ffffff; - background-color: #ffffff; - border: 0; - outline: 0; - -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); - -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); - box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + padding: 5px 15px; + color: #333333; + text-shadow: 0 1px 0 #ffffff; + background-color: #ffffff; + border: 0; + outline: 0; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); } .navbar-inverse .btn-navbar { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #0e0e0e; - *background-color: #040404; - background-image: -moz-linear-gradient(top, #151515, #040404); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); - background-image: -webkit-linear-gradient(top, #151515, #040404); - background-image: -o-linear-gradient(top, #151515, #040404); - background-image: linear-gradient(to bottom, #151515, #040404); - background-repeat: repeat-x; - border-color: #040404 #040404 #000000; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e0e0e; + *background-color: #040404; + background-image: -moz-linear-gradient(top, #151515, #040404); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); + background-image: -webkit-linear-gradient(top, #151515, #040404); + background-image: -o-linear-gradient(top, #151515, #040404); + background-image: linear-gradient(to bottom, #151515, #040404); + background-repeat: repeat-x; + border-color: #040404 #040404 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .navbar-inverse .btn-navbar:hover, @@ -4879,1190 +4868,1190 @@ input[type="submit"].btn.btn-mini { .navbar-inverse .btn-navbar.active, .navbar-inverse .btn-navbar.disabled, .navbar-inverse .btn-navbar[disabled] { - color: #ffffff; - background-color: #040404; - *background-color: #000000; + color: #ffffff; + background-color: #040404; + *background-color: #000000; } .navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active { - background-color: #000000 \9; + background-color: #000000 \9; } .breadcrumb { - padding: 8px 15px; - margin: 0 0 20px; - list-style: none; - background-color: #f5f5f5; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + padding: 8px 15px; + margin: 0 0 20px; + list-style: none; + background-color: #f5f5f5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .breadcrumb > li { - display: inline-block; - *display: inline; - text-shadow: 0 1px 0 #ffffff; - *zoom: 1; + display: inline-block; + *display: inline; + text-shadow: 0 1px 0 #ffffff; + *zoom: 1; } .breadcrumb > li > .divider { - padding: 0 5px; - color: #ccc; + padding: 0 5px; + color: #ccc; } .breadcrumb > .active { - color: #999999; + color: #999999; } .pagination { - margin: 20px 0; + margin: 20px 0; } .pagination ul { - display: inline-block; - *display: inline; - margin-bottom: 0; - margin-left: 0; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - *zoom: 1; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + display: inline-block; + *display: inline; + margin-bottom: 0; + margin-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + *zoom: 1; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } .pagination ul > li { - display: inline; + display: inline; } .pagination ul > li > a, .pagination ul > li > span { - float: left; - padding: 4px 12px; - line-height: 20px; - text-decoration: none; - background-color: #ffffff; - border: 1px solid #dddddd; - border-left-width: 0; + float: left; + padding: 4px 12px; + line-height: 20px; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #dddddd; + border-left-width: 0; } .pagination ul > li > a:hover, .pagination ul > .active > a, .pagination ul > .active > span { - background-color: #f5f5f5; + background-color: #f5f5f5; } .pagination ul > .active > a, .pagination ul > .active > span { - color: #999999; - cursor: default; + color: #999999; + cursor: default; } .pagination ul > .disabled > span, .pagination ul > .disabled > a, .pagination ul > .disabled > a:hover { - color: #999999; - cursor: default; - background-color: transparent; + color: #999999; + cursor: default; + background-color: transparent; } .pagination ul > li:first-child > a, .pagination ul > li:first-child > span { - border-left-width: 1px; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-topleft: 4px; + border-left-width: 1px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 4px; } .pagination ul > li:last-child > a, .pagination ul > li:last-child > span { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-bottomright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; } .pagination-centered { - text-align: center; + text-align: center; } .pagination-right { - text-align: right; + text-align: right; } .pagination-large ul > li > a, .pagination-large ul > li > span { - padding: 11px 19px; - font-size: 17.5px; + padding: 11px 19px; + font-size: 17.5px; } .pagination-large ul > li:first-child > a, .pagination-large ul > li:first-child > span { - -webkit-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -webkit-border-top-left-radius: 6px; - border-top-left-radius: 6px; - -moz-border-radius-bottomleft: 6px; - -moz-border-radius-topleft: 6px; + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -webkit-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-topleft: 6px; } .pagination-large ul > li:last-child > a, .pagination-large ul > li:last-child > span { - -webkit-border-top-right-radius: 6px; - border-top-right-radius: 6px; - -webkit-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - -moz-border-radius-topright: 6px; - -moz-border-radius-bottomright: 6px; + -webkit-border-top-right-radius: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-topright: 6px; + -moz-border-radius-bottomright: 6px; } .pagination-mini ul > li:first-child > a, .pagination-small ul > li:first-child > a, .pagination-mini ul > li:first-child > span, .pagination-small ul > li:first-child > span { - -webkit-border-bottom-left-radius: 3px; - border-bottom-left-radius: 3px; - -webkit-border-top-left-radius: 3px; - border-top-left-radius: 3px; - -moz-border-radius-bottomleft: 3px; - -moz-border-radius-topleft: 3px; + -webkit-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -moz-border-radius-bottomleft: 3px; + -moz-border-radius-topleft: 3px; } .pagination-mini ul > li:last-child > a, .pagination-small ul > li:last-child > a, .pagination-mini ul > li:last-child > span, .pagination-small ul > li:last-child > span { - -webkit-border-top-right-radius: 3px; - border-top-right-radius: 3px; - -webkit-border-bottom-right-radius: 3px; - border-bottom-right-radius: 3px; - -moz-border-radius-topright: 3px; - -moz-border-radius-bottomright: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; + -moz-border-radius-topright: 3px; + -moz-border-radius-bottomright: 3px; } .pagination-small ul > li > a, .pagination-small ul > li > span { - padding: 2px 10px; - font-size: 11.9px; + padding: 2px 10px; + font-size: 11.9px; } .pagination-mini ul > li > a, .pagination-mini ul > li > span { - padding: 0 6px; - font-size: 10.5px; + padding: 0 6px; + font-size: 10.5px; } .pager { - margin: 20px 0; - text-align: center; - list-style: none; - *zoom: 1; + margin: 20px 0; + text-align: center; + list-style: none; + *zoom: 1; } .pager:before, .pager:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .pager:after { - clear: both; + clear: both; } .pager li { - display: inline; + display: inline; } .pager li > a, .pager li > span { - display: inline-block; - padding: 5px 14px; - background-color: #fff; - border: 1px solid #ddd; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; } .pager li > a:hover { - text-decoration: none; - background-color: #f5f5f5; + text-decoration: none; + background-color: #f5f5f5; } .pager .next > a, .pager .next > span { - float: right; + float: right; } .pager .previous > a, .pager .previous > span { - float: left; + float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > span { - color: #999999; - cursor: default; - background-color: #fff; + color: #999999; + cursor: default; + background-color: #fff; } .modal-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1040; - background-color: #000000; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; } .modal-backdrop.fade { - opacity: 0; + opacity: 0; } .modal-backdrop, .modal-backdrop.fade.in { - opacity: 0.8; - filter: alpha(opacity=80); + opacity: 0.8; + filter: alpha(opacity=80); } .modal { - position: fixed; - top: 10%; - left: 50%; - z-index: 1050; - width: 560px; - margin-left: -280px; - background-color: #ffffff; - border: 1px solid #999; - border: 1px solid rgba(0, 0, 0, 0.3); - *border: 1px solid #999; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - outline: none; - -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - -webkit-background-clip: padding-box; - -moz-background-clip: padding-box; - background-clip: padding-box; + position: fixed; + top: 10%; + left: 50%; + z-index: 1050; + width: 560px; + margin-left: -280px; + background-color: #ffffff; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.3); + *border: 1px solid #999; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + outline: none; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; } .modal.fade { - top: -25%; - -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; - -moz-transition: opacity 0.3s linear, top 0.3s ease-out; - -o-transition: opacity 0.3s linear, top 0.3s ease-out; - transition: opacity 0.3s linear, top 0.3s ease-out; + top: -25%; + -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; + -moz-transition: opacity 0.3s linear, top 0.3s ease-out; + -o-transition: opacity 0.3s linear, top 0.3s ease-out; + transition: opacity 0.3s linear, top 0.3s ease-out; } .modal.fade.in { - top: 10%; + top: 10%; } .modal-header { - padding: 9px 15px; - border-bottom: 1px solid #eee; + padding: 9px 15px; + border-bottom: 1px solid #eee; } .modal-header .close { - margin-top: 2px; + margin-top: 2px; } .modal-header h3 { - margin: 0; - line-height: 30px; + margin: 0; + line-height: 30px; } .modal-body { - position: relative; - max-height: 400px; - padding: 15px; - overflow-y: auto; + position: relative; + max-height: 400px; + padding: 15px; + overflow-y: auto; } .modal-form { - margin-bottom: 0; + margin-bottom: 0; } .modal-footer { - padding: 14px 15px 15px; - margin-bottom: 0; - text-align: right; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; - *zoom: 1; - -webkit-box-shadow: inset 0 1px 0 #ffffff; - -moz-box-shadow: inset 0 1px 0 #ffffff; - box-shadow: inset 0 1px 0 #ffffff; + padding: 14px 15px 15px; + margin-bottom: 0; + text-align: right; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; } .modal-footer:before, .modal-footer:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .modal-footer:after { - clear: both; + clear: both; } .modal-footer .btn + .btn { - margin-bottom: 0; - margin-left: 5px; + margin-bottom: 0; + margin-left: 5px; } .modal-footer .btn-group .btn + .btn { - margin-left: -1px; + margin-left: -1px; } .modal-footer .btn-block + .btn-block { - margin-left: 0; + margin-left: 0; } .tooltip { - position: absolute; - z-index: 1030; - display: block; - padding: 5px; - font-size: 11px; - opacity: 0; - filter: alpha(opacity=0); - visibility: visible; + position: absolute; + z-index: 1030; + display: block; + padding: 5px; + font-size: 11px; + opacity: 0; + filter: alpha(opacity=0); + visibility: visible; } .tooltip.in { - opacity: 0.8; - filter: alpha(opacity=80); + opacity: 0.8; + filter: alpha(opacity=80); } .tooltip.top { - margin-top: -3px; + margin-top: -3px; } .tooltip.right { - margin-left: 3px; + margin-left: 3px; } .tooltip.bottom { - margin-top: 3px; + margin-top: 3px; } .tooltip.left { - margin-left: -3px; + margin-left: -3px; } .tooltip-inner { - max-width: 200px; - padding: 3px 8px; - color: #ffffff; - text-align: center; - text-decoration: none; - background-color: #000000; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; } .tooltip.top .tooltip-arrow { - bottom: 0; - left: 50%; - margin-left: -5px; - border-top-color: #000000; - border-width: 5px 5px 0; + bottom: 0; + left: 50%; + margin-left: -5px; + border-top-color: #000000; + border-width: 5px 5px 0; } .tooltip.right .tooltip-arrow { - top: 50%; - left: 0; - margin-top: -5px; - border-right-color: #000000; - border-width: 5px 5px 5px 0; + top: 50%; + left: 0; + margin-top: -5px; + border-right-color: #000000; + border-width: 5px 5px 5px 0; } .tooltip.left .tooltip-arrow { - top: 50%; - right: 0; - margin-top: -5px; - border-left-color: #000000; - border-width: 5px 0 5px 5px; + top: 50%; + right: 0; + margin-top: -5px; + border-left-color: #000000; + border-width: 5px 0 5px 5px; } .tooltip.bottom .tooltip-arrow { - top: 0; - left: 50%; - margin-left: -5px; - border-bottom-color: #000000; - border-width: 0 5px 5px; + top: 0; + left: 50%; + margin-left: -5px; + border-bottom-color: #000000; + border-width: 0 5px 5px; } .popover { - position: absolute; - top: 0; - left: 0; - z-index: 1010; - display: none; - width: 236px; - padding: 1px; - text-align: left; - white-space: normal; - background-color: #ffffff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + width: 236px; + padding: 1px; + text-align: left; + white-space: normal; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; } .popover.top { - margin-top: -10px; + margin-top: -10px; } .popover.right { - margin-left: 10px; + margin-left: 10px; } .popover.bottom { - margin-top: 10px; + margin-top: 10px; } .popover.left { - margin-left: -10px; + margin-left: -10px; } .popover-title { - padding: 8px 14px; - margin: 0; - font-size: 14px; - font-weight: normal; - line-height: 18px; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; - -webkit-border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; + padding: 8px 14px; + margin: 0; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; } .popover-content { - padding: 9px 14px; + padding: 9px 14px; } .popover .arrow, .popover .arrow:after { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; } .popover .arrow { - border-width: 11px; + border-width: 11px; } .popover .arrow:after { - border-width: 10px; - content: ""; + border-width: 10px; + content: ""; } .popover.top .arrow { - bottom: -11px; - left: 50%; - margin-left: -11px; - border-top-color: #999; - border-top-color: rgba(0, 0, 0, 0.25); - border-bottom-width: 0; + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, 0.25); + border-bottom-width: 0; } .popover.top .arrow:after { - bottom: 1px; - margin-left: -10px; - border-top-color: #ffffff; - border-bottom-width: 0; + bottom: 1px; + margin-left: -10px; + border-top-color: #ffffff; + border-bottom-width: 0; } .popover.right .arrow { - top: 50%; - left: -11px; - margin-top: -11px; - border-right-color: #999; - border-right-color: rgba(0, 0, 0, 0.25); - border-left-width: 0; + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, 0.25); + border-left-width: 0; } .popover.right .arrow:after { - bottom: -10px; - left: 1px; - border-right-color: #ffffff; - border-left-width: 0; + bottom: -10px; + left: 1px; + border-right-color: #ffffff; + border-left-width: 0; } .popover.bottom .arrow { - top: -11px; - left: 50%; - margin-left: -11px; - border-bottom-color: #999; - border-bottom-color: rgba(0, 0, 0, 0.25); - border-top-width: 0; + top: -11px; + left: 50%; + margin-left: -11px; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, 0.25); + border-top-width: 0; } .popover.bottom .arrow:after { - top: 1px; - margin-left: -10px; - border-bottom-color: #ffffff; - border-top-width: 0; + top: 1px; + margin-left: -10px; + border-bottom-color: #ffffff; + border-top-width: 0; } .popover.left .arrow { - top: 50%; - right: -11px; - margin-top: -11px; - border-left-color: #999; - border-left-color: rgba(0, 0, 0, 0.25); - border-right-width: 0; + top: 50%; + right: -11px; + margin-top: -11px; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, 0.25); + border-right-width: 0; } .popover.left .arrow:after { - right: 1px; - bottom: -10px; - border-left-color: #ffffff; - border-right-width: 0; + right: 1px; + bottom: -10px; + border-left-color: #ffffff; + border-right-width: 0; } .thumbnails { - margin-left: -20px; - list-style: none; - *zoom: 1; + margin-left: -20px; + list-style: none; + *zoom: 1; } .thumbnails:before, .thumbnails:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .thumbnails:after { - clear: both; + clear: both; } .row-fluid .thumbnails { - margin-left: 0; + margin-left: 0; } .thumbnails > li { - float: left; - margin-bottom: 20px; - margin-left: 20px; + float: left; + margin-bottom: 20px; + margin-left: 20px; } .thumbnail { - display: block; - padding: 4px; - line-height: 20px; - border: 1px solid #ddd; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; + display: block; + padding: 4px; + line-height: 20px; + border: 1px solid #ddd; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; } a.thumbnail:hover { - border-color: #0088cc; - -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); - -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); - box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + border-color: #0088cc; + -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); } .thumbnail > img { - display: block; - max-width: 100%; - margin-right: auto; - margin-left: auto; + display: block; + max-width: 100%; + margin-right: auto; + margin-left: auto; } .thumbnail .caption { - padding: 9px; - color: #555555; + padding: 9px; + color: #555555; } .media, .media-body { - overflow: hidden; - *overflow: visible; - zoom: 1; + overflow: hidden; + *overflow: visible; + zoom: 1; } .media, .media .media { - margin-top: 15px; + margin-top: 15px; } .media:first-child { - margin-top: 0; + margin-top: 0; } .media-object { - display: block; + display: block; } .media-heading { - margin: 0 0 5px; + margin: 0 0 5px; } .media .pull-left { - margin-right: 10px; + margin-right: 10px; } .media .pull-right { - margin-left: 10px; + margin-left: 10px; } .media-list { - margin-left: 0; - list-style: none; + margin-left: 0; + list-style: none; } .label, .badge { - display: inline-block; - padding: 2px 4px; - font-size: 11.844px; - font-weight: bold; - line-height: 14px; - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - white-space: nowrap; - vertical-align: baseline; - background-color: #999999; + display: inline-block; + padding: 2px 4px; + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + white-space: nowrap; + vertical-align: baseline; + background-color: #999999; } .label { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .badge { - padding-right: 9px; - padding-left: 9px; - -webkit-border-radius: 9px; - -moz-border-radius: 9px; - border-radius: 9px; + padding-right: 9px; + padding-left: 9px; + -webkit-border-radius: 9px; + -moz-border-radius: 9px; + border-radius: 9px; } .label:empty, .badge:empty { - display: none; + display: none; } a.label:hover, a.badge:hover { - color: #ffffff; - text-decoration: none; - cursor: pointer; + color: #ffffff; + text-decoration: none; + cursor: pointer; } .label-important, .badge-important { - background-color: #b94a48; + background-color: #b94a48; } .label-important[href], .badge-important[href] { - background-color: #953b39; + background-color: #953b39; } .label-warning, .badge-warning { - background-color: #f89406; + background-color: #f89406; } .label-warning[href], .badge-warning[href] { - background-color: #c67605; + background-color: #c67605; } .label-success, .badge-success { - background-color: #468847; + background-color: #468847; } .label-success[href], .badge-success[href] { - background-color: #356635; + background-color: #356635; } .label-info, .badge-info { - background-color: #3a87ad; + background-color: #3a87ad; } .label-info[href], .badge-info[href] { - background-color: #2d6987; + background-color: #2d6987; } .label-inverse, .badge-inverse { - background-color: #333333; + background-color: #333333; } .label-inverse[href], .badge-inverse[href] { - background-color: #1a1a1a; + background-color: #1a1a1a; } .btn .label, .btn .badge { - position: relative; - top: -1px; + position: relative; + top: -1px; } .btn-mini .label, .btn-mini .badge { - top: 0; + top: 0; } @-webkit-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } } @-moz-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } } @-ms-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } } @-o-keyframes progress-bar-stripes { - from { - background-position: 0 0; - } - to { - background-position: 40px 0; - } + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } } @keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } } .progress { - height: 20px; - margin-bottom: 20px; - overflow: hidden; - background-color: #f7f7f7; - background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); - background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); - background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); - background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); - background-repeat: repeat-x; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f7f7f7; + background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); + background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); + background-repeat: repeat-x; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .progress .bar { - float: left; - width: 0; - height: 100%; - font-size: 12px; - color: #ffffff; - text-align: center; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #0e90d2; - background-image: -moz-linear-gradient(top, #149bdf, #0480be); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); - background-image: -webkit-linear-gradient(top, #149bdf, #0480be); - background-image: -o-linear-gradient(top, #149bdf, #0480be); - background-image: linear-gradient(to bottom, #149bdf, #0480be); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); - -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - -webkit-transition: width 0.6s ease; - -moz-transition: width 0.6s ease; - -o-transition: width 0.6s ease; - transition: width 0.6s ease; + float: left; + width: 0; + height: 100%; + font-size: 12px; + color: #ffffff; + text-align: center; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e90d2; + background-image: -moz-linear-gradient(top, #149bdf, #0480be); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); + background-image: -webkit-linear-gradient(top, #149bdf, #0480be); + background-image: -o-linear-gradient(top, #149bdf, #0480be); + background-image: linear-gradient(to bottom, #149bdf, #0480be); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition: width 0.6s ease; + -moz-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; } .progress .bar + .bar { - -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); - box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); } .progress-striped .bar { - background-color: #149bdf; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - -webkit-background-size: 40px 40px; - -moz-background-size: 40px 40px; - -o-background-size: 40px 40px; - background-size: 40px 40px; + background-color: #149bdf; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + -moz-background-size: 40px 40px; + -o-background-size: 40px 40px; + background-size: 40px 40px; } .progress.active .bar { - -webkit-animation: progress-bar-stripes 2s linear infinite; - -moz-animation: progress-bar-stripes 2s linear infinite; - -ms-animation: progress-bar-stripes 2s linear infinite; - -o-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; + -webkit-animation: progress-bar-stripes 2s linear infinite; + -moz-animation: progress-bar-stripes 2s linear infinite; + -ms-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; } .progress-danger .bar, .progress .bar-danger { - background-color: #dd514c; - background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); - background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); - background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); - background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); + background-color: #dd514c; + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); } .progress-danger.progress-striped .bar, .progress-striped .bar-danger { - background-color: #ee5f5b; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-color: #ee5f5b; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-success .bar, .progress .bar-success { - background-color: #5eb95e; - background-image: -moz-linear-gradient(top, #62c462, #57a957); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); - background-image: -webkit-linear-gradient(top, #62c462, #57a957); - background-image: -o-linear-gradient(top, #62c462, #57a957); - background-image: linear-gradient(to bottom, #62c462, #57a957); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); + background-color: #5eb95e; + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(to bottom, #62c462, #57a957); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); } .progress-success.progress-striped .bar, .progress-striped .bar-success { - background-color: #62c462; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-color: #62c462; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-info .bar, .progress .bar-info { - background-color: #4bb1cf; - background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); - background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); - background-image: -o-linear-gradient(top, #5bc0de, #339bb9); - background-image: linear-gradient(to bottom, #5bc0de, #339bb9); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); + background-color: #4bb1cf; + background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); + background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); + background-image: -o-linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(to bottom, #5bc0de, #339bb9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); } .progress-info.progress-striped .bar, .progress-striped .bar-info { - background-color: #5bc0de; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-color: #5bc0de; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-warning .bar, .progress .bar-warning { - background-color: #faa732; - background-image: -moz-linear-gradient(top, #fbb450, #f89406); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); - background-image: -webkit-linear-gradient(top, #fbb450, #f89406); - background-image: -o-linear-gradient(top, #fbb450, #f89406); - background-image: linear-gradient(to bottom, #fbb450, #f89406); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); + background-color: #faa732; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); } .progress-warning.progress-striped .bar, .progress-striped .bar-warning { - background-color: #fbb450; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-color: #fbb450; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .accordion { - margin-bottom: 20px; + margin-bottom: 20px; } .accordion-group { - margin-bottom: 2px; - border: 1px solid #e5e5e5; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + margin-bottom: 2px; + border: 1px solid #e5e5e5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .accordion-heading { - border-bottom: 0; + border-bottom: 0; } .accordion-heading .accordion-toggle { - display: block; - padding: 8px 15px; + display: block; + padding: 8px 15px; } .accordion-toggle { - cursor: pointer; + cursor: pointer; } .accordion-inner { - padding: 9px 15px; - border-top: 1px solid #e5e5e5; + padding: 9px 15px; + border-top: 1px solid #e5e5e5; } .carousel { - position: relative; - margin-bottom: 20px; - line-height: 1; + position: relative; + margin-bottom: 20px; + line-height: 1; } .carousel-inner { - position: relative; - width: 100%; - overflow: hidden; + position: relative; + width: 100%; + overflow: hidden; } .carousel-inner > .item { - position: relative; - display: none; - -webkit-transition: 0.6s ease-in-out left; - -moz-transition: 0.6s ease-in-out left; - -o-transition: 0.6s ease-in-out left; - transition: 0.6s ease-in-out left; + position: relative; + display: none; + -webkit-transition: 0.6s ease-in-out left; + -moz-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; } .carousel-inner > .item > img { - display: block; - line-height: 1; + display: block; + line-height: 1; } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { - display: block; + display: block; } .carousel-inner > .active { - left: 0; + left: 0; } .carousel-inner > .next, .carousel-inner > .prev { - position: absolute; - top: 0; - width: 100%; + position: absolute; + top: 0; + width: 100%; } .carousel-inner > .next { - left: 100%; + left: 100%; } .carousel-inner > .prev { - left: -100%; + left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { - left: 0; + left: 0; } .carousel-inner > .active.left { - left: -100%; + left: -100%; } .carousel-inner > .active.right { - left: 100%; + left: 100%; } .carousel-control { - position: absolute; - top: 40%; - left: 15px; - width: 40px; - height: 40px; - margin-top: -20px; - font-size: 60px; - font-weight: 100; - line-height: 30px; - color: #ffffff; - text-align: center; - background: #222222; - border: 3px solid #ffffff; - -webkit-border-radius: 23px; - -moz-border-radius: 23px; - border-radius: 23px; - opacity: 0.5; - filter: alpha(opacity=50); + position: absolute; + top: 40%; + left: 15px; + width: 40px; + height: 40px; + margin-top: -20px; + font-size: 60px; + font-weight: 100; + line-height: 30px; + color: #ffffff; + text-align: center; + background: #222222; + border: 3px solid #ffffff; + -webkit-border-radius: 23px; + -moz-border-radius: 23px; + border-radius: 23px; + opacity: 0.5; + filter: alpha(opacity=50); } .carousel-control.right { - right: 15px; - left: auto; + right: 15px; + left: auto; } .carousel-control:hover { - color: #ffffff; - text-decoration: none; - opacity: 0.9; - filter: alpha(opacity=90); + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); } .carousel-caption { - position: absolute; - right: 0; - bottom: 0; - left: 0; - padding: 15px; - background: #333333; - background: rgba(0, 0, 0, 0.75); + position: absolute; + right: 0; + bottom: 0; + left: 0; + padding: 15px; + background: #333333; + background: rgba(0, 0, 0, 0.75); } .carousel-caption h4, .carousel-caption p { - line-height: 20px; - color: #ffffff; + line-height: 20px; + color: #ffffff; } .carousel-caption h4 { - margin: 0 0 5px; + margin: 0 0 5px; } .carousel-caption p { - margin-bottom: 0; + margin-bottom: 0; } .hero-unit { - padding: 60px; - margin-bottom: 30px; - font-size: 18px; - font-weight: 200; - line-height: 30px; - color: inherit; - background-color: #eeeeee; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + padding: 60px; + margin-bottom: 30px; + font-size: 18px; + font-weight: 200; + line-height: 30px; + color: inherit; + background-color: #eeeeee; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .hero-unit h1 { - margin-bottom: 0; - font-size: 60px; - line-height: 1; - letter-spacing: -1px; - color: inherit; + margin-bottom: 0; + font-size: 60px; + line-height: 1; + letter-spacing: -1px; + color: inherit; } .hero-unit li { - line-height: 30px; + line-height: 30px; } .pull-right { - float: right; + float: right; } .pull-left { - float: left; + float: left; } .hide { - display: none; + display: none; } .show { - display: block; + display: block; } .invisible { - visibility: hidden; + visibility: hidden; } .affix { - position: fixed; + position: fixed; } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/style.css b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/style.css index 59a05ee958a6..f14f6bdb62c5 100644 --- a/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/style.css +++ b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/style.css @@ -1,309 +1,308 @@ .line-numbers { - margin-right: 1.0em; + margin-right: 1.0em; } .content { - padding-bottom: 100px; + padding-bottom: 100px; } .column_header_name { - width: 150px; + width: 150px; } .column_header_path { - width: 350px; + width: 350px; } .column_header_name .column_header_param_type .column_header_data_type .column_header_return_type { - width: 200px; + width: 200px; } .expandable { - display: none; + display: none; } .main_content { - margin-top: 80px; - margin-left: 25px; - margin-right: 25px; + margin-top: 80px; + margin-left: 25px; + margin-right: 25px; } .model { - float: left; + float: left; } .model-container { - float: left; - width: 500px; - padding: 0px; + float: left; + width: 500px; + padding: 0px; } .model-detail-container { - clear: left; - float: left; - width: 500px; - margin-left: 40px; + clear: left; + float: left; + width: 500px; + margin-left: 40px; } .model-detail-popup { - box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; - border-style: solid; - border-width: 1px; - border-color: black; - padding-left: 10px; - padding-right: 10px; - padding-top: 10px; - padding-bottom: 10px; - background-color: white; - opacity: 0.99; - z-index: 1; - overflow: scroll; - width: 400px; + box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; + border-style: solid; + border-width: 1px; + border-color: black; + padding-left: 10px; + padding-right: 10px; + padding-top: 10px; + padding-bottom: 10px; + background-color: white; + opacity: 0.99; + z-index: 1; + overflow: scroll; + width: 400px; } .model-detail-popup .code { - background-color: #E4F5FF; - font-family: monospace; - white-space: pre; - margin: 10px; - overflow: auto; + background-color: #E4F5FF; + font-family: monospace; + white-space: pre; + margin: 10px; + overflow: auto; } .model-detail-popup h2 { - margin-top: 0px; - padding-top: 0px; + margin-top: 0px; + padding-top: 0px; } .model-detail-popup li { - padding-bottom: 5px; + padding-bottom: 5px; } .model-detail-popup .param-reqiured-true { - font-family: monospace; - font-weight: bold; - clear: left; - display: block; - float: left; - width: 100%; + font-family: monospace; + font-weight: bold; + clear: left; + display: block; + float: left; + width: 100%; } .model-detail-popup .param-required-false { - font-family: monospace; - clear: left; - display: block; - float: left; - width: 100%; + font-family: monospace; + clear: left; + display: block; + float: left; + width: 100%; } .model-detail-popup .param-description { - margin-left: 50px; - float: left; + margin-left: 50px; + float: left; } .section-header { - border-bottom: 2px; - font-weight: bold; - font-size: 15px; - padding: 6px 0; - color: rgb(57, 57, 57); + border-bottom: 2px; + font-weight: bold; + font-size: 15px; + padding: 6px 0; + color: rgb(57,57,57); } .content { - padding-top: 100px; + padding-top: 100px; } .content h1 { - font-size: 43px; - text-align: center; - margin-top: 40px; - margin-bottom: 40px; + font-size: 43px; + text-align: center; + margin-top: 40px; + margin-bottom: 40px; } .sidebar { - box-sizing: border-box; - float: left; - display: block; - width: 240px; - overflow: scroll; - position: fixed; + box-sizing: border-box; + float: left; + display: block; + width: 240px; + overflow: scroll; + position: fixed; } .section-box { - border-bottom-style: solid; - border-bottom: 10px; + border-bottom-style: solid; + border-bottom: 10px; } .section-box ul li { - list-style: none; - margin-left: 0px; + list-style: none; + margin-left: 0px; } .non-sidebar { - box-sizing: border-box; - display: block; - margin-left: 240px; - margin-right: 0px; - width: 638px; + box-sizing: border-box; + display: block; + margin-left: 240px; + margin-right: 0px; + width: 638px; } .non-sidebar h2 { - clear: left; - padding-top: 20px; + clear: left; + padding-top: 20px; } li.parameter { - list-style: none; - display: block; - padding-left: 1em; + list-style: none; + display: block; + padding-left: 1em; } -.param { - display: block; +.param{ + display: block; } .param-name { - margin-left: 1em; + margin-left: 1em; } .param-in { - font-weight: bold; - font-size: 1.1em; + font-weight: bold; + font-size: 1.1em; } - .param-type { - margin-left: 1em; - font-style: italic; + margin-left: 1em; + font-style: italic; } .param-description { - display: block; - font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif; + display: block; + font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif; } .param-optional-flag { - font-style: italic; + font-style: italic; } .section { - font-weight: normal; - clear: left; + font-weight: normal; + clear: left; } .section a { - text-decoration: underline; + text-decoration: underline; } .code { - background-color: #E4F5FF; - font-family: monospace; - white-space: pre; - margin: 10px; - overflow: auto; - width: 600px; + background-color: #E4F5FF; + font-family: monospace; + white-space: pre; + margin: 10px; + overflow: auto; + width: 600px; } .header { - position: fixed; - text-align: left; - background-color: black; - float: left; - top: 0; - width: 100%; - height: 70px auto; - padding-bottom: 20px; - box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; + position: fixed; + text-align: left; + background-color: black; + float: left; + top: 0; + width: 100%; + height: 70px auto; + padding-bottom: 20px; + box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; } .top-bar h1 a { - width: auto; + width: auto; } .top-bar h1#logo a { - width: auto; - display: block; - clear: none; - float: left; - background-position: left;; - color: white; - text-decoration: none; + width: auto; + display: block; + clear: none; + float: left; + background-position: left;; + color: white; + text-decoration: none; } .top-bar ul li { - list-style: none; + list-style: none; } .top-bar h1#logo span { - display: block; - clear: none; - float: left; - padding-top: 10px; - padding-left: 10px; - margin: 0px; + display: block; + clear: none; + float: left; + padding-top: 10px; + padding-left: 10px; + margin: 0px; } .top-bar h1#logo a span.light { - color: #ffc97a; - color: #666666; - padding-left: 0px; + color: #ffc97a; + color: #666666; + padding-left: 0px; } .top-bar ul#nav { - float: none; - clear: both; - overflow: hidden; - margin: 0; - padding: 0; - display: block; - float: right; - clear: none; + float: none; + clear: both; + overflow: hidden; + margin: 0; + padding: 0; + display: block; + float: right; + clear: none; } .top-bar ul#nav li { - float: left; - clear: none; - margin: 0; - padding: 2px 10px; - border-right: 1px solid #dddddd; + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; } .top-bar ul#nav li:first-child, .top-bar ul#nav li.first { - padding-left: 0; + padding-left: 0; } .top-bar ul#nav li:last-child, .top-bar ul#nav li.last { - padding-right: 0; - border-right: none; + padding-right: 0; + border-right: none; } .top-bar ul#nav li { - border: none; - padding: 0 5px; + border: none; + padding: 0 5px; } .top-bar ul#nav li a { - display: block; - padding: 8px 10px 8px 10px; - color: #999999; - text-decoration: none; + display: block; + padding: 8px 10px 8px 10px; + color: #999999; + text-decoration: none; } .top-bar ul#nav li a.strong { - color: white; + color: white; } .top-bar ul#nav li a:active, .top-bar ul#nav li a.active, .top-bar ul#nav li a:hover { - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - -o-border-radius: 4px; - -ms-border-radius: 4px; - -khtml-border-radius: 4px; - border-radius: 4px; - background-image: -webkit-gradient(linear, 0% 100%, 0% 0%, color-stop(0%, #ff5401), color-stop(100%, #ffa014)); - background-image: -moz-linear-gradient(bottom, #ff5401 0%, #ffa014 100%); - background-image: linear-gradient(bottom, #ff5401 0%, #ffa014 100%); - color: white; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; + background-image: -webkit-gradient(linear, 0% 100%, 0% 0%, color-stop(0%, #ff5401), color-stop(100%, #ffa014)); + background-image: -moz-linear-gradient(bottom, #ff5401 0%, #ffa014 100%); + background-image: linear-gradient(bottom, #ff5401 0%, #ffa014 100%); + color: white; } .top-bar ul#nav:hover li { - border-color: #222222; + border-color: #222222; } diff --git a/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/bootstrap.js b/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/bootstrap.js index 96bc4e8c1035..6c15a5832964 100644 --- a/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/bootstrap.js +++ b/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/bootstrap.js @@ -20,45 +20,44 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) - * ======================================================= */ + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) + * ======================================================= */ - $(function () { + $(function () { - $.support.transition = (function () { + $.support.transition = (function () { - var transitionEnd = (function () { + var transitionEnd = (function () { - var el = document.createElement('bootstrap') - , transEndEventNames = { - 'WebkitTransition': 'webkitTransitionEnd' - , 'MozTransition': 'transitionend' - , 'OTransition': 'oTransitionEnd otransitionend' - , 'transition': 'transitionend' - } - , name + var el = document.createElement('bootstrap') + , transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + , name - for (name in transEndEventNames) { - if (el.style[name] !== undefined) { - return transEndEventNames[name] - } - } + for (name in transEndEventNames){ + if (el.style[name] !== undefined) { + return transEndEventNames[name] + } + } - }()) + }()) - return transitionEnd && { - end: transitionEnd - } + return transitionEnd && { + end: transitionEnd + } - })() + })() - }) + }) -}(window.jQuery); -/* ========================================================== +}(window.jQuery);/* ========================================================== * bootstrap-alert.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#alerts * ========================================================== @@ -80,84 +79,83 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* ALERT CLASS DEFINITION - * ====================== */ + /* ALERT CLASS DEFINITION + * ====================== */ - var dismiss = '[data-dismiss="alert"]' - , Alert = function (el) { - $(el).on('click', dismiss, this.close) - } + var dismiss = '[data-dismiss="alert"]' + , Alert = function (el) { + $(el).on('click', dismiss, this.close) + } - Alert.prototype.close = function (e) { - var $this = $(this) - , selector = $this.attr('data-target') - , $parent + Alert.prototype.close = function (e) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - $parent = $(selector) - - e && e.preventDefault() - - $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) - - $parent.trigger(e = $.Event('close')) - - if (e.isDefaultPrevented()) return - - $parent.removeClass('in') - - function removeElement() { - $parent - .trigger('closed') - .remove() - } - - $.support.transition && $parent.hasClass('fade') ? - $parent.on($.support.transition.end, removeElement) : - removeElement() + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } + $parent = $(selector) - /* ALERT PLUGIN DEFINITION - * ======================= */ + e && e.preventDefault() - var old = $.fn.alert + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) - $.fn.alert = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('alert') - if (!data) $this.data('alert', (data = new Alert(this))) - if (typeof option == 'string') data[option].call($this) - }) + $parent.trigger(e = $.Event('close')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent + .trigger('closed') + .remove() } - $.fn.alert.Constructor = Alert + $.support.transition && $parent.hasClass('fade') ? + $parent.on($.support.transition.end, removeElement) : + removeElement() + } - /* ALERT NO CONFLICT - * ================= */ + /* ALERT PLUGIN DEFINITION + * ======================= */ - $.fn.alert.noConflict = function () { - $.fn.alert = old - return this - } + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('alert') + if (!data) $this.data('alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert - /* ALERT DATA-API - * ============== */ + /* ALERT NO CONFLICT + * ================= */ - $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } -}(window.jQuery); -/* ============================================================ + + /* ALERT DATA-API + * ============== */ + + $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + +}(window.jQuery);/* ============================================================ * bootstrap-button.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#buttons * ============================================================ @@ -179,90 +177,89 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* BUTTON PUBLIC CLASS DEFINITION - * ============================== */ + /* BUTTON PUBLIC CLASS DEFINITION + * ============================== */ - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.button.defaults, options) - } + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.button.defaults, options) + } - Button.prototype.setState = function (state) { - var d = 'disabled' - , $el = this.$element - , data = $el.data() - , val = $el.is('input') ? 'val' : 'html' + Button.prototype.setState = function (state) { + var d = 'disabled' + , $el = this.$element + , data = $el.data() + , val = $el.is('input') ? 'val' : 'html' - state = state + 'Text' - data.resetText || $el.data('resetText', $el[val]()) + state = state + 'Text' + data.resetText || $el.data('resetText', $el[val]()) - $el[val](data[state] || this.options[state]) + $el[val](data[state] || this.options[state]) - // push to event loop to allow forms to submit - setTimeout(function () { - state == 'loadingText' ? - $el.addClass(d).attr(d, d) : - $el.removeClass(d).removeAttr(d) - }, 0) - } + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + }, 0) + } - Button.prototype.toggle = function () { - var $parent = this.$element.closest('[data-toggle="buttons-radio"]') + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons-radio"]') - $parent && $parent - .find('.active') - .removeClass('active') + $parent && $parent + .find('.active') + .removeClass('active') - this.$element.toggleClass('active') - } + this.$element.toggleClass('active') + } - /* BUTTON PLUGIN DEFINITION - * ======================== */ + /* BUTTON PLUGIN DEFINITION + * ======================== */ - var old = $.fn.button + var old = $.fn.button - $.fn.button = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('button') - , options = typeof option == 'object' && option - if (!data) $this.data('button', (data = new Button(this, options))) - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - $.fn.button.defaults = { - loadingText: 'loading...' - } - - $.fn.button.Constructor = Button - - - /* BUTTON NO CONFLICT - * ================== */ - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - /* BUTTON DATA-API - * =============== */ - - $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('button') + , options = typeof option == 'object' && option + if (!data) $this.data('button', (data = new Button(this, options))) + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) }) + } -}(window.jQuery); -/* ========================================================== + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $.fn.button.Constructor = Button + + + /* BUTTON NO CONFLICT + * ================== */ + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + /* BUTTON DATA-API + * =============== */ + + $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + }) + +}(window.jQuery);/* ========================================================== * bootstrap-carousel.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#carousel * ========================================================== @@ -284,172 +281,169 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* CAROUSEL CLASS DEFINITION - * ========================= */ + /* CAROUSEL CLASS DEFINITION + * ========================= */ - var Carousel = function (element, options) { - this.$element = $(element) - this.options = options - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) + var Carousel = function (element, options) { + this.$element = $(element) + this.options = options + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.prototype = { + + cycle: function (e) { + if (!e) this.paused = false + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + return this } - Carousel.prototype = { + , to: function (pos) { + var $active = this.$element.find('.item.active') + , children = $active.parent().children() + , activePos = children.index($active) + , that = this - cycle: function (e) { - if (!e) this.paused = false - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - return this - } + if (pos > (children.length - 1) || pos < 0) return - , to: function (pos) { - var $active = this.$element.find('.item.active') - , children = $active.parent().children() - , activePos = children.index($active) - , that = this - - if (pos > (children.length - 1) || pos < 0) return - - if (this.sliding) { - return this.$element.one('slid', function () { - that.to(pos) - }) - } - - if (activePos == pos) { - return this.pause().cycle() - } - - return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) - } - - , pause: function (e) { - if (!e) this.paused = true - if (this.$element.find('.next, .prev').length && $.support.transition.end) { - this.$element.trigger($.support.transition.end) - this.cycle() - } - clearInterval(this.interval) - this.interval = null - return this - } - - , next: function () { - if (this.sliding) return - return this.slide('next') - } - - , prev: function () { - if (this.sliding) return - return this.slide('prev') - } - - , slide: function (type, next) { - var $active = this.$element.find('.item.active') - , $next = next || $active[type]() - , isCycling = this.interval - , direction = type == 'next' ? 'left' : 'right' - , fallback = type == 'next' ? 'first' : 'last' - , that = this - , e - - this.sliding = true - - isCycling && this.pause() - - $next = $next.length ? $next : this.$element.find('.item')[fallback]() - - e = $.Event('slide', { - relatedTarget: $next[0] - }) - - if ($next.hasClass('active')) return - - if ($.support.transition && this.$element.hasClass('slide')) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - this.$element.one($.support.transition.end, function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { - that.$element.trigger('slid') - }, 0) - }) - } else { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger('slid') - } - - isCycling && this.cycle() - - return this - } - - } - - - /* CAROUSEL PLUGIN DEFINITION - * ========================== */ - - var old = $.fn.carousel - - $.fn.carousel = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('carousel') - , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) - , action = typeof option == 'string' ? option : options.slide - if (!data) $this.data('carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.cycle() + if (this.sliding) { + return this.$element.one('slid', function () { + that.to(pos) }) + } + + if (activePos == pos) { + return this.pause().cycle() + } + + return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) } - $.fn.carousel.defaults = { - interval: 5000 - , pause: 'hover' + , pause: function (e) { + if (!e) this.paused = true + if (this.$element.find('.next, .prev').length && $.support.transition.end) { + this.$element.trigger($.support.transition.end) + this.cycle() + } + clearInterval(this.interval) + this.interval = null + return this } - $.fn.carousel.Constructor = Carousel - - - /* CAROUSEL NO CONFLICT - * ==================== */ - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this + , next: function () { + if (this.sliding) return + return this.slide('next') } - /* CAROUSEL DATA-API - * ================= */ + , prev: function () { + if (this.sliding) return + return this.slide('prev') + } - $(document).on('click.carousel.data-api', '[data-slide]', function (e) { - var $this = $(this), href - , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - , options = $.extend({}, $target.data(), $this.data()) - $target.carousel(options) - e.preventDefault() + , slide: function (type, next) { + var $active = this.$element.find('.item.active') + , $next = next || $active[type]() + , isCycling = this.interval + , direction = type == 'next' ? 'left' : 'right' + , fallback = type == 'next' ? 'first' : 'last' + , that = this + , e + + this.sliding = true + + isCycling && this.pause() + + $next = $next.length ? $next : this.$element.find('.item')[fallback]() + + e = $.Event('slide', { + relatedTarget: $next[0] + }) + + if ($next.hasClass('active')) return + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + this.$element.one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } + + isCycling && this.cycle() + + return this + } + + } + + + /* CAROUSEL PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('carousel') + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) + , action = typeof option == 'string' ? option : options.slide + if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.cycle() }) + } -}(window.jQuery); -/* ============================================================= + $.fn.carousel.defaults = { + interval: 5000 + , pause: 'hover' + } + + $.fn.carousel.Constructor = Carousel + + + /* CAROUSEL NO CONFLICT + * ==================== */ + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + /* CAROUSEL DATA-API + * ================= */ + + $(document).on('click.carousel.data-api', '[data-slide]', function (e) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , options = $.extend({}, $target.data(), $this.data()) + $target.carousel(options) + e.preventDefault() + }) + +}(window.jQuery);/* ============================================================= * bootstrap-collapse.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#collapse * ============================================================= @@ -471,152 +465,151 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* COLLAPSE PUBLIC CLASS DEFINITION - * ================================ */ + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.collapse.defaults, options) + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) - if (this.options.parent) { - this.$parent = $(this.options.parent) - } - - this.options.toggle && this.toggle() + if (this.options.parent) { + this.$parent = $(this.options.parent) } - Collapse.prototype = { + this.options.toggle && this.toggle() + } - constructor: Collapse + Collapse.prototype = { - , dimension: function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - , show: function () { - var dimension - , scroll - , actives - , hasData - - if (this.transitioning) return - - dimension = this.dimension() - scroll = $.camelCase(['scroll', dimension].join('-')) - actives = this.$parent && this.$parent.find('> .accordion-group > .in') - - if (actives && actives.length) { - hasData = actives.data('collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('collapse', null) - } - - this.$element[dimension](0) - this.transition('addClass', $.Event('show'), 'shown') - $.support.transition && this.$element[dimension](this.$element[0][scroll]) - } - - , hide: function () { - var dimension - if (this.transitioning) return - dimension = this.dimension() - this.reset(this.$element[dimension]()) - this.transition('removeClass', $.Event('hide'), 'hidden') - this.$element[dimension](0) - } - - , reset: function (size) { - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - [dimension](size || 'auto') - [0].offsetWidth - - this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') - - return this - } - - , transition: function (method, startEvent, completeEvent) { - var that = this - , complete = function () { - if (startEvent.type == 'show') that.reset() - that.transitioning = 0 - that.$element.trigger(completeEvent) - } - - this.$element.trigger(startEvent) - - if (startEvent.isDefaultPrevented()) return - - this.transitioning = 1 - - this.$element[method]('in') - - $.support.transition && this.$element.hasClass('collapse') ? - this.$element.one($.support.transition.end, complete) : - complete() - } - - , toggle: function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } + constructor: Collapse + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' } + , show: function () { + var dimension + , scroll + , actives + , hasData - /* COLLAPSE PLUGIN DEFINITION - * ========================== */ + if (this.transitioning) return - var old = $.fn.collapse + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('collapse') - , options = typeof option == 'object' && option - if (!data) $this.data('collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + $.support.transition && this.$element[dimension](this.$element[0][scroll]) } - $.fn.collapse.defaults = { - toggle: true + , hide: function () { + var dimension + if (this.transitioning) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) } - $.fn.collapse.Constructor = Collapse + , reset: function (size) { + var dimension = this.dimension() + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth - /* COLLAPSE NO CONFLICT - * ==================== */ + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this + return this } + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } - /* COLLAPSE DATA-API - * ================= */ + this.$element.trigger(startEvent) - $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - , target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - , option = $(target).data('collapse') ? 'toggle' : $this.data() - $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - $(target).collapse(option) + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = typeof option == 'object' && option + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() }) + } -}(window.jQuery); -/* ============================================================ + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSE NO CONFLICT + * ==================== */ + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + $(target).collapse(option) + }) + +}(window.jQuery);/* ============================================================ * bootstrap-dropdown.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#dropdowns * ============================================================ @@ -638,150 +631,145 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* DROPDOWN CLASS DEFINITION - * ========================= */ + /* DROPDOWN CLASS DEFINITION + * ========================= */ - var toggle = '[data-toggle=dropdown]' - , Dropdown = function (element) { - var $el = $(element).on('click.dropdown.data-api', this.toggle) - $('html').on('click.dropdown.data-api', function () { - $el.parent().removeClass('open') - }) - } - - Dropdown.prototype = { - - constructor: Dropdown - - , toggle: function (e) { - var $this = $(this) - , $parent - , isActive - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - $parent.toggleClass('open') - } - - $this.focus() - - return false - } - - , keydown: function (e) { - var $this - , $items - , $active - , $parent - , isActive - , index - - if (!/(38|40|27)/.test(e.keyCode)) return - - $this = $(this) - - e.preventDefault() - e.stopPropagation() - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - if (!isActive || (isActive && e.keyCode == 27)) return $this.click() - - $items = $('[role=menu] li:not(.divider):visible a', $parent) - - if (!$items.length) return - - index = $items.index($items.filter(':focus')) - - if (e.keyCode == 38 && index > 0) index-- // up - if (e.keyCode == 40 && index < $items.length - 1) index++ // down - if (!~index) index = 0 - - $items - .eq(index) - .focus() - } - - } - - function clearMenus() { - $(toggle).each(function () { - getParent($(this)).removeClass('open') + var toggle = '[data-toggle=dropdown]' + , Dropdown = function (element) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function (e) { + var $this = $(this) + , $parent + , isActive + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + $parent.toggleClass('open') + } + + $this.focus() + + return false } - function getParent($this) { - var selector = $this.attr('data-target') - , $parent + , keydown: function (e) { + var $this + , $items + , $active + , $parent + , isActive + , index - if (!selector) { - selector = $this.attr('href') - selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } + if (!/(38|40|27)/.test(e.keyCode)) return - $parent = $(selector) - $parent.length || ($parent = $this.parent()) + $this = $(this) - return $parent + e.preventDefault() + e.stopPropagation() + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + if (!isActive || (isActive && e.keyCode == 27)) return $this.click() + + $items = $('[role=menu] li:not(.divider):visible a', $parent) + + if (!$items.length) return + + index = $items.index($items.filter(':focus')) + + if (e.keyCode == 38 && index > 0) index-- // up + if (e.keyCode == 40 && index < $items.length - 1) index++ // down + if (!~index) index = 0 + + $items + .eq(index) + .focus() } + } - /* DROPDOWN PLUGIN DEFINITION - * ========================== */ + function clearMenus() { + $(toggle).each(function () { + getParent($(this)).removeClass('open') + }) + } - var old = $.fn.dropdown + function getParent($this) { + var selector = $this.attr('data-target') + , $parent - $.fn.dropdown = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('dropdown') - if (!data) $this.data('dropdown', (data = new Dropdown(this))) - if (typeof option == 'string') data[option].call($this) - }) + if (!selector) { + selector = $this.attr('href') + selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } - $.fn.dropdown.Constructor = Dropdown + $parent = $(selector) + $parent.length || ($parent = $this.parent()) + + return $parent + } - /* DROPDOWN NO CONFLICT - * ==================== */ + /* DROPDOWN PLUGIN DEFINITION + * ========================== */ - $.fn.dropdown.noConflict = function () { - $.fn.dropdown = old - return this - } + var old = $.fn.dropdown + + $.fn.dropdown = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('dropdown') + if (!data) $this.data('dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.dropdown.Constructor = Dropdown - /* APPLY TO STANDARD DROPDOWN ELEMENTS - * =================================== */ + /* DROPDOWN NO CONFLICT + * ==================== */ - $(document) - .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) - .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { - e.stopPropagation() - }) - .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { - e.stopPropagation() - }) - .on('click.dropdown.data-api touchstart.dropdown.data-api', toggle, Dropdown.prototype.toggle) - .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]', Dropdown.prototype.keydown) + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } -}(window.jQuery); -/* ========================================================= + + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ + + $(document) + .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) + .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) + .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() }) + .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) + .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) + +}(window.jQuery);/* ========================================================= * bootstrap-modal.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= @@ -803,229 +791,227 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* MODAL CLASS DEFINITION - * ====================== */ + /* MODAL CLASS DEFINITION + * ====================== */ - var Modal = function (element, options) { - this.options = options - this.$element = $(element) - .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) - this.options.remote && this.$element.find('.modal-body').load(this.options.remote) - } + var Modal = function (element, options) { + this.options = options + this.$element = $(element) + .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) + this.options.remote && this.$element.find('.modal-body').load(this.options.remote) + } - Modal.prototype = { + Modal.prototype = { - constructor: Modal + constructor: Modal - , toggle: function () { - return this[!this.isShown ? 'show' : 'hide']() - } + , toggle: function () { + return this[!this.isShown ? 'show' : 'hide']() + } - , show: function () { - var that = this - , e = $.Event('show') + , show: function () { + var that = this + , e = $.Event('show') - this.$element.trigger(e) + this.$element.trigger(e) - if (this.isShown || e.isDefaultPrevented()) return + if (this.isShown || e.isDefaultPrevented()) return - this.isShown = true + this.isShown = true - this.escape() + this.escape() - this.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') + this.backdrop(function () { + var transition = $.support.transition && that.$element.hasClass('fade') - if (!that.$element.parent().length) { - that.$element.appendTo(document.body) //don't move modals dom position - } + if (!that.$element.parent().length) { + that.$element.appendTo(document.body) //don't move modals dom position + } - that.$element - .show() + that.$element + .show() - if (transition) { - that.$element[0].offsetWidth // force reflow - } + if (transition) { + that.$element[0].offsetWidth // force reflow + } - that.$element - .addClass('in') - .attr('aria-hidden', false) + that.$element + .addClass('in') + .attr('aria-hidden', false) - that.enforceFocus() + that.enforceFocus() - transition ? - that.$element.one($.support.transition.end, function () { - that.$element.focus().trigger('shown') - }) : - that.$element.focus().trigger('shown') + transition ? + that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : + that.$element.focus().trigger('shown') - }) - } - - , hide: function (e) { - e && e.preventDefault() - - var that = this - - e = $.Event('hide') - - this.$element.trigger(e) - - if (!this.isShown || e.isDefaultPrevented()) return - - this.isShown = false - - this.escape() - - $(document).off('focusin.modal') - - this.$element - .removeClass('in') - .attr('aria-hidden', true) - - $.support.transition && this.$element.hasClass('fade') ? - this.hideWithTransition() : - this.hideModal() - } - - , enforceFocus: function () { - var that = this - $(document).on('focusin.modal', function (e) { - if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { - that.$element.focus() - } - }) - } - - , escape: function () { - var that = this - if (this.isShown && this.options.keyboard) { - this.$element.on('keyup.dismiss.modal', function (e) { - e.which == 27 && that.hide() - }) - } else if (!this.isShown) { - this.$element.off('keyup.dismiss.modal') - } - } - - , hideWithTransition: function () { - var that = this - , timeout = setTimeout(function () { - that.$element.off($.support.transition.end) - that.hideModal() - }, 500) - - this.$element.one($.support.transition.end, function () { - clearTimeout(timeout) - that.hideModal() - }) - } - - , hideModal: function (that) { - this.$element - .hide() - .trigger('hidden') - - this.backdrop() - } - - , removeBackdrop: function () { - this.$backdrop.remove() - this.$backdrop = null - } - - , backdrop: function (callback) { - var that = this - , animate = this.$element.hasClass('fade') ? 'fade' : '' - - if (this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate - - this.$backdrop = $('