parent
45e4087edf
commit
cf1cc735ed
@ -0,0 +1,24 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
@ -0,0 +1,21 @@
|
||||
package com.adlx.dingdong.mall;
|
||||
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
|
||||
import org.springframework.cloud.netflix.feign.EnableFeignClients;
|
||||
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
|
||||
|
||||
@EnableFeignClients
|
||||
@EnableDiscoveryClient
|
||||
@EnableEurekaClient
|
||||
@EnableZuulProxy
|
||||
@SpringCloudApplication
|
||||
public class ApiGatewayApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new SpringApplicationBuilder(ApiGatewayApplication.class).web(true).run(args);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package com.adlx.dingdong.mall.aspect;
|
||||
|
||||
import com.adlx.dingdong.mall.util.MapUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 控制器切面日志
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ControllerAspect {
|
||||
|
||||
|
||||
ThreadLocal<Long> startTime = new ThreadLocal<Long>();
|
||||
|
||||
@Pointcut("execution(public * com.adlx.dingdong.mall.controller..*.*(..))")
|
||||
public void webLog() {
|
||||
}
|
||||
|
||||
@Before("webLog()")
|
||||
public void doBefore(JoinPoint joinPoint) throws Throwable {
|
||||
startTime.set(System.currentTimeMillis());
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
Map<String, String> parameterMap = MapUtil.getParameterMap(request);
|
||||
Iterator<Map.Entry<String, String>> entries = parameterMap.entrySet().iterator();
|
||||
while (entries.hasNext()) {
|
||||
Map.Entry<String, String> entry = entries.next();
|
||||
if (entry.getValue() != null && entry.getValue().length() > 1000) {
|
||||
parameterMap.put(entry.getKey(), " value is too long");
|
||||
}
|
||||
}
|
||||
log.info("接口请求URL:{} 参数:{}", request.getRequestURL().toString(), JSON.toJSONString(parameterMap));
|
||||
}
|
||||
|
||||
@AfterReturning(returning = "object", pointcut = "webLog()")
|
||||
public void doAfterReturning(Object object) throws Throwable {
|
||||
log.info("耗时:{}ms 接口调用返回:{} ", System.currentTimeMillis() - startTime.get(), JSON.toJSONString(object));
|
||||
}
|
||||
|
||||
@AfterThrowing(pointcut = "webLog()", throwing = "e")
|
||||
public void handle(JoinPoint point, Exception e) {
|
||||
String methodName = point.getTarget().getClass() + "." + point.getSignature().getName();
|
||||
log.error("耗时:{}ms 调用方法{}错误:{} ", System.currentTimeMillis() - startTime.get(), methodName, e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.adlx.dingdong.mall.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Configuration
|
||||
@EnableAuthorizationServer
|
||||
public class OAuth2ServerConfig extends AuthorizationServerConfigurerAdapter {
|
||||
|
||||
@Autowired
|
||||
private AuthenticationManager authenticationManager;
|
||||
|
||||
@Autowired
|
||||
private RedisConnectionFactory connectionFactory;
|
||||
|
||||
@Resource
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
|
||||
@Override
|
||||
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
|
||||
endpoints.allowedTokenEndpointRequestMethods(HttpMethod.GET, HttpMethod.POST)
|
||||
.userDetailsService(userDetailsService)
|
||||
.authenticationManager(authenticationManager).tokenStore(tokenStore());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TokenStore tokenStore() {
|
||||
RedisTokenStore redis = new RedisTokenStore(connectionFactory);
|
||||
return redis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
|
||||
clients.inMemory()
|
||||
.withClient("demoApp")
|
||||
.secret("123456")
|
||||
.authorizedGrantTypes("authorization_code", "password", "client_credentials")
|
||||
// .authorities("ROLE_CLIENT", "ROLE_TRUSTED_CLIENT")
|
||||
.scopes("read", "write", "trust"); //授权用户的操作权限
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.adlx.dingdong.mall.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
|
||||
@Configuration
|
||||
@EnableResourceServer
|
||||
public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
|
||||
resources.resourceId("api-gateway").stateless(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||
.and()
|
||||
.requestMatcher(new AntPathRequestMatcher("/v1/**"))
|
||||
.authorizeRequests()
|
||||
// .antMatchers("/v1/product/**").access("#oauth2.hasScope('public')")
|
||||
.antMatchers("/v1/user/**").access("#oauth2.hasScope('write')")
|
||||
// .antMatchers("/v3/user/**").access("#oauth2.hasScope('write')")
|
||||
//TODO: add more
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.adlx.dingdong.mall.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
|
||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Bean
|
||||
public UserDetailsServiceImpl userDetailsService() {
|
||||
return new UserDetailsServiceImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Override
|
||||
public AuthenticationManager authenticationManagerBean() throws Exception {
|
||||
return super.authenticationManagerBean();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
auth.userDetailsService(userDetailsService()).passwordEncoder(new Md5PasswordEncoder());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(WebSecurity web) throws Exception {
|
||||
web.ignoring().antMatchers("/index.html", "/api/doc/**");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http.authorizeRequests()
|
||||
.antMatchers("/v1/**").access("hasRole('ROLE_USER')")
|
||||
.and()
|
||||
.csrf().disable();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.adlx.dingdong.mall.config;
|
||||
|
||||
import com.adlx.dingdong.mall.user.api.UserFeignClient;
|
||||
import com.adlx.dingdong.mall.user.dto.UserDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class UserDetailsServiceImpl implements UserDetailsService {
|
||||
|
||||
@Autowired
|
||||
private UserFeignClient userService;
|
||||
|
||||
private String defaultSecret;
|
||||
private String defaultPassword;
|
||||
private Md5PasswordEncoder encoder = new Md5PasswordEncoder();
|
||||
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
UserDTO user = userService.getUserByUsername(username);
|
||||
if (user == null) {
|
||||
throw new UsernameNotFoundException(String.format("User doesn't exist: username=%s", username));
|
||||
}
|
||||
return new org.springframework.security.core.userdetails.User(username, user.getPassword(), Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")));
|
||||
}
|
||||
|
||||
public String getDefaultPassword() {
|
||||
return defaultPassword;
|
||||
}
|
||||
|
||||
public void setDefaultPassword(String defaultPassword) {
|
||||
this.defaultPassword = StringUtils.hasText(defaultPassword) ? defaultPassword : "123456";
|
||||
setDefaultSecret(encoder.encodePassword(this.defaultPassword, null));
|
||||
}
|
||||
|
||||
public String getDefaultSecret() {
|
||||
if (defaultSecret == null) {
|
||||
setDefaultPassword(null);
|
||||
}
|
||||
return defaultSecret;
|
||||
}
|
||||
|
||||
public void setDefaultSecret(String defaultSecret) {
|
||||
this.defaultSecret = defaultSecret;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package com.adlx.dingdong.mall.controller;
|
||||
|
||||
import com.adlx.dingdong.mall.user.api.UserFeignClient;
|
||||
import com.adlx.dingdong.mall.user.dto.UserDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.propertyeditors.CustomDateEditor;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.crypto.codec.Base64;
|
||||
import org.springframework.security.oauth2.provider.ClientDetails;
|
||||
import org.springframework.security.oauth2.provider.ClientDetailsService;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.InitBinder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
|
||||
@Slf4j
|
||||
public class BaseController {
|
||||
|
||||
@Autowired
|
||||
private UserFeignClient userFeignClient;
|
||||
|
||||
@Autowired
|
||||
private ClientDetailsService clientDetailsService;
|
||||
|
||||
@InitBinder
|
||||
public void InitBinder(WebDataBinder dataBinder) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
dateFormat.setLenient(false);
|
||||
dataBinder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从Oauth认证获取用户ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getCurrentUid() {
|
||||
String userName = SecurityContextHolder.getContext().getAuthentication().getName();
|
||||
log.info("授权认证用户:" + userName);
|
||||
UserDTO user = userFeignClient.getUserByUsername(userName);
|
||||
return user != null ? user.getId().intValue() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户验证
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
protected Boolean checkOauthClient(HttpServletRequest request) {
|
||||
Enumeration headers = request.getHeaders("Authorization");
|
||||
String value;
|
||||
do {
|
||||
if (!headers.hasMoreElements()) {
|
||||
return false;
|
||||
}
|
||||
value = (String) headers.nextElement();
|
||||
} while (!value.toLowerCase().startsWith("Basic".toLowerCase()));
|
||||
|
||||
String clientIdValue = value.substring("Basic".length()).trim();
|
||||
byte[] encodeBase64 = Base64.decode(clientIdValue.getBytes());
|
||||
String client = new String(encodeBase64);
|
||||
String[] clientId = client.split(":");
|
||||
log.info("RESULT: " + clientId[0]);
|
||||
try {
|
||||
ClientDetails clientDetails = clientDetailsService.loadClientByClientId(clientId[0]);
|
||||
if (null != clientDetails && clientId.length == 2 && clientDetails.getClientSecret().equals(clientId[1])) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.adlx.dingdong.mall.controller.v1;
|
||||
|
||||
import com.adlx.dingdong.mall.client.ProductCategoryClient;
|
||||
import com.adlx.dingdong.mall.controller.BaseController;
|
||||
import com.adlx.dingdong.mall.dto.Result;
|
||||
import com.adlx.dingdong.mall.dto.ShopGoodsCategoryDTO;
|
||||
import com.adlx.dingdong.mall.vo.ShopGoodsCategoryVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//import com.github.pagehelper.PageInfo;
|
||||
|
||||
/**
|
||||
* Created by administrator on 18/8/31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = {"/v1/productCategory"})
|
||||
public class ProductCategoryController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ProductCategoryClient productCategoryClient;
|
||||
|
||||
|
||||
@RequestMapping(value = "list", method = RequestMethod.GET)
|
||||
public Result<PageInfo> getList(ShopGoodsCategoryDTO categoryDTO) {
|
||||
PageInfo<List<ShopGoodsCategoryVO>> pageInfo = productCategoryClient.getList(categoryDTO);
|
||||
return Result.success(pageInfo);
|
||||
}
|
||||
|
||||
//
|
||||
// @RequestMapping(value = "filter", method = RequestMethod.GET)
|
||||
// public Result<PageInfo> filter(ShopGoodsDTO shopGoodsDTO) {
|
||||
// PageInfo<List<ShopGoodsVO>> pageInfo = productClient.getList(shopGoodsDTO);
|
||||
// return Result.success(pageInfo);
|
||||
// }
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.adlx.dingdong.mall.controller.v1;
|
||||
|
||||
import com.adlx.dingdong.mall.controller.BaseController;
|
||||
import com.adlx.dingdong.mall.client.ProductClient;
|
||||
//import com.github.pagehelper.PageInfo;
|
||||
import com.adlx.dingdong.mall.dto.Result;
|
||||
import com.adlx.dingdong.mall.dto.ShopGoodsDTO;
|
||||
import com.adlx.dingdong.mall.vo.ShopGoodsVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by administrator on 18/8/31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = {"/v1/product"})
|
||||
public class ProductController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ProductClient productClient;
|
||||
|
||||
|
||||
@RequestMapping(value = "list", method = RequestMethod.GET)
|
||||
public Result<PageInfo> getList(ShopGoodsDTO shopGoodsDTO) {
|
||||
PageInfo<List<ShopGoodsVO>> pageInfo = productClient.getList(shopGoodsDTO);
|
||||
return Result.success(pageInfo);
|
||||
}
|
||||
|
||||
//
|
||||
// @RequestMapping(value = "filter", method = RequestMethod.GET)
|
||||
// public Result<PageInfo> filter(ShopGoodsDTO shopGoodsDTO) {
|
||||
// PageInfo<List<ShopGoodsVO>> pageInfo = productClient.getList(shopGoodsDTO);
|
||||
// return Result.success(pageInfo);
|
||||
// }
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.adlx.dingdong.mall.controller.v1;
|
||||
|
||||
import com.adlx.dingdong.mall.controller.BaseController;
|
||||
import com.adlx.dingdong.mall.dto.Result;
|
||||
import com.adlx.dingdong.mall.user.api.UserFeignClient;
|
||||
import com.adlx.dingdong.mall.user.vo.UserVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* Created by dulei on 18/1/10.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = {"/v1/user"})
|
||||
public class UserController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private UserFeignClient userFeignClient;
|
||||
|
||||
@RequestMapping("/currentUser")
|
||||
public Result<UserVO> getCurrentUser() {
|
||||
Integer uid = getCurrentUid();
|
||||
Assert.notNull(uid, "用户ID不能为空");
|
||||
//安全对象拿到用户id
|
||||
UserVO userVO = userFeignClient.get(uid.longValue());
|
||||
return Result.success(userVO);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/regUser",method = RequestMethod.POST)
|
||||
public UserVO regUser() {
|
||||
Integer uid = getCurrentUid();
|
||||
Assert.notNull(uid, "用户ID不能为空");
|
||||
//安全对象拿到用户id
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping("/info")
|
||||
public UserVO getCurrentInfo() {
|
||||
//安全对象拿到用户id
|
||||
return userFeignClient.get(1L);
|
||||
}
|
||||
|
||||
@RequestMapping("/get/{uid}")
|
||||
public Result<UserVO> get(@PathVariable("uid") Long uid) {
|
||||
//安全对象拿到用户id
|
||||
return Result.success(userFeignClient.get(uid));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.adlx.dingdong.mall.dto;
|
||||
|
||||
public class PageResult<T> extends Result<T> {
|
||||
|
||||
private long total;
|
||||
private int start;
|
||||
private int pageSize;
|
||||
|
||||
public PageResult() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PageResult(int total) {
|
||||
super();
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
public void setStart(int start) {
|
||||
this.start = start;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.adlx.dingdong.mall.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class Response<T> implements Serializable {
|
||||
|
||||
public static final int SUCCESS = 0;
|
||||
public static final int ERROR = 1;
|
||||
|
||||
private int code;
|
||||
private T result;
|
||||
|
||||
private Response(int code, T result) {
|
||||
this.code = code;
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static <T> Response<T> success(T result) {
|
||||
return new Response<T>(SUCCESS, result);
|
||||
}
|
||||
|
||||
public static Response<String> error(String message) {
|
||||
return new Response<String>(ERROR, message);
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public T getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.adlx.dingdong.mall.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
public class Result<T> {
|
||||
|
||||
private boolean success;
|
||||
private String msg;
|
||||
private Integer code;
|
||||
private T data;
|
||||
|
||||
public static <T> Result<T> success(T result) {
|
||||
return new Result<T>(true, 200, "", result);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(T result, String msg) {
|
||||
return new Result<T>(true, 200, msg, result);
|
||||
}
|
||||
|
||||
public static Result<String> error(String message) {
|
||||
return new Result<String>(false, 404, message);
|
||||
}
|
||||
|
||||
public static Result<String> error(String message, Integer code) {
|
||||
return new Result<String>(false, code, message);
|
||||
}
|
||||
|
||||
public Result() {
|
||||
super();
|
||||
this.success = true;
|
||||
this.code = 200;
|
||||
}
|
||||
|
||||
public Result(boolean success) {
|
||||
super();
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public Result(boolean success, int code, String msg) {
|
||||
super();
|
||||
this.success = success;
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public Result(boolean success, T data) {
|
||||
super();
|
||||
this.success = success;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Result(boolean success, Integer code, String msg, T data) {
|
||||
super();
|
||||
this.success = success;
|
||||
this.msg = msg;
|
||||
this.code = code;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
//package com.adlx.dingdong.mall.securit;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
//
|
||||
//@EnableWebSecurity
|
||||
//public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
//
|
||||
// @Autowired
|
||||
// public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// auth
|
||||
// .inMemoryAuthentication()
|
||||
// .withUser("admin").password("admin").roles("USER");
|
||||
// }
|
||||
//}
|
||||
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "api-server",
|
||||
"version": "1.0.0",
|
||||
"description": "mall api server",
|
||||
"title": "叮咚到账",
|
||||
"url" : "http://127.0.0.1:9999/",
|
||||
"header": {
|
||||
"title": "概述",
|
||||
"filename": "header.md"
|
||||
},
|
||||
"footer": {
|
||||
"title": "代号定义",
|
||||
"filename": "footer.md"
|
||||
},
|
||||
"order": [
|
||||
"OAuth2",
|
||||
"getAccessToken"
|
||||
|
||||
|
||||
],
|
||||
"template": {
|
||||
"forceLanguage": "zh_cn",
|
||||
"withCompare": true,
|
||||
"withGenerator": true
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,569 @@
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
* Content
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
body {
|
||||
min-width: 980px;
|
||||
max-width: 1280px;
|
||||
}
|
||||
|
||||
body, p, a, div, th, td {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
td.code {
|
||||
font-size: 14px;
|
||||
font-family: "Source Code Pro", monospace;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding-top: 16px;
|
||||
z-Index: -1;
|
||||
margin-left: 270px;
|
||||
}
|
||||
|
||||
p {
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: "Source Sans Pro Semibold", sans-serif;
|
||||
font-weight: normal;
|
||||
font-size: 44px;
|
||||
line-height: 50px;
|
||||
margin: 0 0 10px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: normal;
|
||||
font-size: 24px;
|
||||
line-height: 40px;
|
||||
margin: 0 0 20px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
section {
|
||||
border-top: 1px solid #ebebeb;
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
section h1 {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 32px;
|
||||
line-height: 40px;
|
||||
padding-bottom: 14px;
|
||||
margin: 0 0 20px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
article {
|
||||
padding: 14px 0 30px 0;
|
||||
}
|
||||
|
||||
article h1 {
|
||||
font-family: "Source Sans Pro Bold", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 24px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
article h2 {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
article h3 {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
line-height: 18px;
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
article h4 {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
margin: 0 0 8px 0;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f5f5f5;
|
||||
text-align: left;
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 700;
|
||||
padding: 4px 8px;
|
||||
border: #e0e0e0 1px solid;
|
||||
}
|
||||
|
||||
td {
|
||||
vertical-align: top;
|
||||
padding: 10px 8px 0 8px;
|
||||
border: #e0e0e0 1px solid;
|
||||
}
|
||||
|
||||
#generator .content {
|
||||
color: #b0b0b0;
|
||||
border-top: 1px solid #ebebeb;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.label-optional {
|
||||
float: right;
|
||||
background-color: grey;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.open-left {
|
||||
right: 0;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
* apidoc - intro
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
#apidoc .apidoc {
|
||||
border-top: 1px solid #ebebeb;
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
#apidoc h1 {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 32px;
|
||||
line-height: 40px;
|
||||
padding-bottom: 14px;
|
||||
margin: 0 0 20px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#apidoc h2 {
|
||||
font-family: "Source Sans Pro Bold", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 22px;
|
||||
line-height: 26px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
* pre / code
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
pre {
|
||||
background-color: #292b36;
|
||||
color: #ffffff;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
margin: 10px 0 20px 0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
pre.prettyprint {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
code.language-text {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
pre.language-json {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
pre.language-html {
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
|
||||
.type {
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
display: inline-block;
|
||||
margin: 0 0 5px 0;
|
||||
padding: 4px 5px;
|
||||
border-radius: 6px;
|
||||
text-transform: uppercase;
|
||||
background-color: #3387CC;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.type__get {
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.type__put {
|
||||
background-color: #e5c500;
|
||||
}
|
||||
|
||||
.type__post {
|
||||
background-color: #4070ec;
|
||||
}
|
||||
|
||||
.type__delete {
|
||||
background-color: #ed0039;
|
||||
}
|
||||
|
||||
pre.language-api .str {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
pre.language-api .pln,
|
||||
pre.language-api .pun {
|
||||
color: #65B042;
|
||||
}
|
||||
|
||||
pre code {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-family: "Source Code Pro", monospace;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
word-wrap: normal;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
pre code.sample-request-response-json {
|
||||
white-space: pre-wrap;
|
||||
max-height: 500px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
* Sidenav
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
.sidenav {
|
||||
width: 228px;
|
||||
margin: 0;
|
||||
padding: 0 20px 20px 20px;
|
||||
position: fixed;
|
||||
top: 50px;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background-color: #f5f5f5;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.sidenav > li > a {
|
||||
display: block;
|
||||
width: 192px;
|
||||
margin: 0;
|
||||
padding: 2px 11px;
|
||||
border: 0;
|
||||
border-left: transparent 4px solid;
|
||||
border-right: transparent 4px solid;
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.sidenav > li.nav-header {
|
||||
margin-top: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.sidenav > li.nav-header > a {
|
||||
padding: 5px 15px;
|
||||
border: 1px solid #e5e5e5;
|
||||
width: 190px;
|
||||
font-family: "Source Sans Pro", sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.sidenav > li.active > a {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
background-color: #0088cc;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.sidenav > li.has-modifications a {
|
||||
border-right: #60d060 4px solid;
|
||||
}
|
||||
|
||||
.sidenav > li.is-new a {
|
||||
border-left: #e5e5e5 4px solid;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
* Side nav search
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
.sidenav-search {
|
||||
width: 228px;
|
||||
left: 0px;
|
||||
position: fixed;
|
||||
padding: 16px 20px 10px 20px;
|
||||
background-color: #F5F5F5;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.sidenav-search .search {
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.search-reset {
|
||||
position: absolute;
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
right: 28px;
|
||||
top: 17px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
* Compare
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
ins {
|
||||
background: #60d060;
|
||||
text-decoration: none;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
del {
|
||||
background: #f05050;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.label-ins {
|
||||
background-color: #60d060;
|
||||
}
|
||||
|
||||
.label-del {
|
||||
background-color: #f05050;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
pre.ins {
|
||||
background-color: #60d060;
|
||||
}
|
||||
|
||||
pre.del {
|
||||
background-color: #f05050;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
table.ins th,
|
||||
table.ins td {
|
||||
background-color: #60d060;
|
||||
}
|
||||
|
||||
table.del th,
|
||||
table.del td {
|
||||
background-color: #f05050;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
tr.ins td {
|
||||
background-color: #60d060;
|
||||
}
|
||||
|
||||
tr.del td {
|
||||
background-color: #f05050;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
* Spinner
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
#loader {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#loader p {
|
||||
padding-top: 80px;
|
||||
margin-left: -4px;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
margin: 200px auto;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container1 > div, .container2 > div, .container3 > div {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background-color: #0088cc;
|
||||
|
||||
border-radius: 100%;
|
||||
position: absolute;
|
||||
-webkit-animation: bouncedelay 1.2s infinite ease-in-out;
|
||||
animation: bouncedelay 1.2s infinite ease-in-out;
|
||||
/* Prevent first frame from flickering when animation starts */
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
|
||||
.spinner .spinner-container {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.container2 {
|
||||
-webkit-transform: rotateZ(45deg);
|
||||
transform: rotateZ(45deg);
|
||||
}
|
||||
|
||||
.container3 {
|
||||
-webkit-transform: rotateZ(90deg);
|
||||
transform: rotateZ(90deg);
|
||||
}
|
||||
|
||||
.circle1 { top: 0; left: 0; }
|
||||
.circle2 { top: 0; right: 0; }
|
||||
.circle3 { right: 0; bottom: 0; }
|
||||
.circle4 { left: 0; bottom: 0; }
|
||||
|
||||
.container2 .circle1 {
|
||||
-webkit-animation-delay: -1.1s;
|
||||
animation-delay: -1.1s;
|
||||
}
|
||||
|
||||
.container3 .circle1 {
|
||||
-webkit-animation-delay: -1.0s;
|
||||
animation-delay: -1.0s;
|
||||
}
|
||||
|
||||
.container1 .circle2 {
|
||||
-webkit-animation-delay: -0.9s;
|
||||
animation-delay: -0.9s;
|
||||
}
|
||||
|
||||
.container2 .circle2 {
|
||||
-webkit-animation-delay: -0.8s;
|
||||
animation-delay: -0.8s;
|
||||
}
|
||||
|
||||
.container3 .circle2 {
|
||||
-webkit-animation-delay: -0.7s;
|
||||
animation-delay: -0.7s;
|
||||
}
|
||||
|
||||
.container1 .circle3 {
|
||||
-webkit-animation-delay: -0.6s;
|
||||
animation-delay: -0.6s;
|
||||
}
|
||||
|
||||
.container2 .circle3 {
|
||||
-webkit-animation-delay: -0.5s;
|
||||
animation-delay: -0.5s;
|
||||
}
|
||||
|
||||
.container3 .circle3 {
|
||||
-webkit-animation-delay: -0.4s;
|
||||
animation-delay: -0.4s;
|
||||
}
|
||||
|
||||
.container1 .circle4 {
|
||||
-webkit-animation-delay: -0.3s;
|
||||
animation-delay: -0.3s;
|
||||
}
|
||||
|
||||
.container2 .circle4 {
|
||||
-webkit-animation-delay: -0.2s;
|
||||
animation-delay: -0.2s;
|
||||
}
|
||||
|
||||
.container3 .circle4 {
|
||||
-webkit-animation-delay: -0.1s;
|
||||
animation-delay: -0.1s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes bouncedelay {
|
||||
0%, 80%, 100% { -webkit-transform: scale(0.0) }
|
||||
40% { -webkit-transform: scale(1.0) }
|
||||
}
|
||||
|
||||
@keyframes bouncedelay {
|
||||
0%, 80%, 100% {
|
||||
transform: scale(0.0);
|
||||
-webkit-transform: scale(0.0);
|
||||
} 40% {
|
||||
transform: scale(1.0);
|
||||
-webkit-transform: scale(1.0);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
* Tabs
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
ul.nav-tabs {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
p.deprecated span{
|
||||
color: #ff0000;
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------
|
||||
* Print
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
@media print {
|
||||
|
||||
#sidenav,
|
||||
#version,
|
||||
#versions,
|
||||
section .version,
|
||||
section .versions {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a:after {
|
||||
content: " [" attr(href) "] ";
|
||||
}
|
||||
|
||||
p {
|
||||
color: #000000
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
padding: 10px;
|
||||
border: #808080 1px solid;
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
margin: 10px 0 20px 0;
|
||||
}
|
||||
|
||||
} /* /@media print */
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 106 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,669 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>Loading...</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="vendor/bootstrap.min.css" rel="stylesheet" media="screen">
|
||||
<link href="vendor/prettify.css" rel="stylesheet" media="screen">
|
||||
<link href="css/style.css" rel="stylesheet" media="screen, print">
|
||||
<link href="img/favicon.ico" rel="icon" type="image/x-icon">
|
||||
<script src="vendor/polyfill.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script id="template-sidenav" type="text/x-handlebars-template">
|
||||
<nav id="scrollingNav">
|
||||
<div class="sidenav-search">
|
||||
<input class="form-control search" type="text" placeholder="{{__ "Filter..."}}">
|
||||
<span class="search-reset">x</span>
|
||||
</div>
|
||||
<ul class="sidenav nav nav-list list">
|
||||
{{#each nav}}
|
||||
{{#if title}}
|
||||
{{#if isHeader}}
|
||||
{{#if isFixed}}
|
||||
<li class="nav-fixed nav-header navbar-btn nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
|
||||
{{else}}
|
||||
<li class="nav-header nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<li class="{{#if hidden}}hide {{/if}}" data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
|
||||
<a href="#api-{{group}}-{{name}}" class="nav-list-item">{{title}}</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</nav>
|
||||
</script>
|
||||
|
||||
<script id="template-project" type="text/x-handlebars-template">
|
||||
<div class="pull-left">
|
||||
<h1>{{name}}</h1>
|
||||
{{#if description}}<h2>{{{nl2br description}}}</h2>{{/if}}
|
||||
</div>
|
||||
{{#if template.withCompare}}
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<button id="version" class="btn btn-lg btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<strong>{{version}}</strong> <span class="caret"></span>
|
||||
</button>
|
||||
<ul id="versions" class="dropdown-menu open-left">
|
||||
<li><a id="compareAllWithPredecessor" href="#">{{__ "Compare all with predecessor"}}</a></li>
|
||||
<li class="divider"></li>
|
||||
<li class="disabled"><a href="#">{{__ "show up to version:"}}</a></li>
|
||||
{{#each versions}}
|
||||
<li class="version"><a href="#">{{this}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="clearfix"></div>
|
||||
</script>
|
||||
|
||||
<script id="template-header" type="text/x-handlebars-template">
|
||||
{{#if content}}
|
||||
<div id="api-_">{{{content}}}</div>
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script id="template-footer" type="text/x-handlebars-template">
|
||||
{{#if content}}
|
||||
<div id="api-_footer">{{{content}}}</div>
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script id="template-generator" type="text/x-handlebars-template">
|
||||
{{#if template.withGenerator}}
|
||||
{{#if generator}}
|
||||
<div class="content">
|
||||
{{__ "Generated with"}} <a href="{{{generator.url}}}">{{{generator.name}}}</a> {{{generator.version}}} - {{{generator.time}}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script id="template-sections" type="text/x-handlebars-template">
|
||||
<section id="api-{{group}}">
|
||||
<h1>{{underscoreToSpace title}}</h1>
|
||||
{{#if description}}
|
||||
<p>{{{nl2br description}}}</p>
|
||||
{{/if}}
|
||||
{{#each articles}}
|
||||
<div id="api-{{group}}-{{name}}">
|
||||
{{{article}}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</section>
|
||||
</script>
|
||||
|
||||
<script id="template-article" type="text/x-handlebars-template">
|
||||
<article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}">
|
||||
<div class="pull-left">
|
||||
<h1>{{article.groupTitle}}{{#if article.title}} - {{article.title}}{{/if}}</h1>
|
||||
</div>
|
||||
{{#if template.withCompare}}
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<button class="version btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<strong>{{article.version}}</strong> <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="versions dropdown-menu open-left">
|
||||
<li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
|
||||
{{#each versions}}
|
||||
<li class="version"><a href="#">{{this}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="clearfix"></div>
|
||||
|
||||
{{#if article.deprecated}}
|
||||
<p class="deprecated"><span>{{__ "DEPRECATED"}}</span>
|
||||
{{{markdown article.deprecated.content}}}
|
||||
</p>
|
||||
{{/if}}
|
||||
|
||||
{{#if article.description}}
|
||||
<p>{{{nl2br article.description}}}</p>
|
||||
{{/if}}
|
||||
<span class="type type__{{toLowerCase article.type}}">{{toLowerCase article.type}}</span>
|
||||
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre>
|
||||
|
||||
{{#if article.permission}}
|
||||
<p>
|
||||
{{__ "Permission:"}}
|
||||
{{#each article.permission}}
|
||||
{{name}}
|
||||
{{#if title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{title}}" data-content="{{nl2br description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</p>
|
||||
{{/if}}
|
||||
|
||||
{{#if_gt article.examples.length compare=0}}
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
{{#each article.examples}}
|
||||
<li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#examples-{{../id}}-{{@index}}">{{title}}</a>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
{{#each article.examples}}
|
||||
<div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="examples-{{../id}}-{{@index}}">
|
||||
<pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{content}}</code></pre>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if_gt}}
|
||||
|
||||
{{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}}
|
||||
{{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
|
||||
{{subTemplate "article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}}
|
||||
{{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
|
||||
|
||||
{{subTemplate "article-sample-request" article=article id=id}}
|
||||
</article>
|
||||
</script>
|
||||
|
||||
<script id="template-article-param-block" type="text/x-handlebars-template">
|
||||
{{#if params}}
|
||||
{{#each params.fields}}
|
||||
<h2>{{__ @key}}</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
|
||||
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each this}}
|
||||
<tr>
|
||||
<td class="code">{{{splitFill field "." " "}}}{{#if optional}} <span class="label label-optional">{{__ "optional"}}</span>{{/if}}</td>
|
||||
{{#if ../../_hasType}}
|
||||
<td>
|
||||
{{{type}}}
|
||||
</td>
|
||||
{{/if}}
|
||||
<td>
|
||||
{{{nl2br description}}}
|
||||
{{#if defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}}
|
||||
{{#if size}}<p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}}
|
||||
{{#if allowedValues}}<p class="type-size">{{__ "Allowed values:"}}
|
||||
{{#each allowedValues}}
|
||||
<code>{{{this}}}</code>{{#unless @last}}, {{/unless}}
|
||||
{{/each}}
|
||||
</p>
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/each}}
|
||||
{{#if_gt params.examples.length compare=0}}
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
{{#each params.examples}}
|
||||
<li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
{{#each params.examples}}
|
||||
<div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="{{../section}}-examples-{{../id}}-{{@index}}">
|
||||
<pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{reformat content type}}</code></pre>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if_gt}}
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script id="template-article-sample-request" type="text/x-handlebars-template">
|
||||
{{#if article.sampleRequest}}
|
||||
<h2>{{__ "Send a Sample Request"}}</h2>
|
||||
<form class="form-horizontal">
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label" for="{{../id}}-sample-request-url"></label>
|
||||
<div class="input-group">
|
||||
<input id="{{../id}}-sample-request-url" type="text" class="form-control sample-request-url" value="{{article.sampleRequest.0.url}}" />
|
||||
<span class="input-group-addon">{{__ "url"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if article.header}}
|
||||
{{#if article.header.fields}}
|
||||
<h3>{{__ "Headers"}}</h3>
|
||||
{{#each article.header.fields}}
|
||||
<h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
|
||||
<div class="{{../id}}-sample-request-header-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
|
||||
{{#each this}}
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label" for="sample-request-header-field-{{field}}">{{field}}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" placeholder="{{field}}" id="sample-request-header-field-{{field}}" class="form-control sample-request-header" data-sample-request-header-name="{{field}}" data-sample-request-header-group="sample-request-header-{{@../index}}">
|
||||
<span class="input-group-addon">{{{type}}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if article.parameter}}
|
||||
{{#if article.parameter.fields}}
|
||||
<h3>{{__ "Parameters"}}</h3>
|
||||
{{#each article.parameter.fields}}
|
||||
<h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}" name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
|
||||
<div class="form-group {{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
|
||||
{{#each this}}
|
||||
<label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
|
||||
<div class="input-group">
|
||||
<input id="sample-request-param-field-{{field}}" type="text" placeholder="{{field}}" class="form-control sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}" {{#if optional}}data-sample-request-param-optional="true"{{/if}}>
|
||||
<div class="input-group-addon">{{{type}}}</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<div class="form-group">
|
||||
<div class="controls pull-right">
|
||||
<button class="btn btn-primary sample-request-send" data-sample-request-type="{{article.type}}">{{__ "Send"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group sample-request-response" style="display: none;">
|
||||
<h3>
|
||||
{{__ "Response"}}
|
||||
<button class="btn btn-default btn-xs pull-right sample-request-clear">X</button>
|
||||
</h3>
|
||||
<pre class="prettyprint language-json" data-type="json"><code class="sample-request-response-json"></code></pre>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script id="template-compare-article" type="text/x-handlebars-template">
|
||||
<article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}" data-compare-version="{{compare.version}}">
|
||||
<div class="pull-left">
|
||||
<h1>{{underscoreToSpace article.group}} - {{{showDiff article.title compare.title}}}</h1>
|
||||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-success" disabled>
|
||||
<strong>{{article.version}}</strong> {{__ "compared to"}}
|
||||
</button>
|
||||
<button class="version btn btn-danger dropdown-toggle" data-toggle="dropdown">
|
||||
<strong>{{compare.version}}</strong> <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="versions dropdown-menu open-left">
|
||||
<li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
|
||||
<li class="divider"></li>
|
||||
{{#each versions}}
|
||||
<li class="version"><a href="#">{{this}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
{{#if article.description}}
|
||||
<p>{{{showDiff article.description compare.description "nl2br"}}}</p>
|
||||
{{else}}
|
||||
{{#if compare.description}}
|
||||
<p>{{{showDiff "" compare.description "nl2br"}}}</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{{showDiff article.url compare.url}}}</code></pre>
|
||||
|
||||
{{subTemplate "article-compare-permission" article=article compare=compare}}
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
{{#each_compare_title article.examples compare.examples}}
|
||||
{{#if typeSame}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/each_compare_title}}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
{{#each_compare_title article.examples compare.examples}}
|
||||
|
||||
{{#if typeSame}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{/each_compare_title}}
|
||||
</div>
|
||||
|
||||
{{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
|
||||
{{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}}
|
||||
{{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
|
||||
|
||||
{{subTemplate "article-sample-request" article=article id=id}}
|
||||
|
||||
</article>
|
||||
</script>
|
||||
|
||||
<script id="template-article-compare-permission" type="text/x-handlebars-template">
|
||||
<p>
|
||||
{{__ "Permission:"}}
|
||||
{{#each_compare_list_field article.permission compare.permission field="name"}}
|
||||
{{#if source}}
|
||||
{{#if typeSame}}
|
||||
{{source.name}}
|
||||
{{#if source.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<ins>{{source.name}}</ins>
|
||||
{{#if source.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<del>{{source.name}}</del>
|
||||
{{#if source.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if typeSame}}
|
||||
{{compare.name}}
|
||||
{{#if compare.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<ins>{{compare.name}}</ins>
|
||||
{{#if compare.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<del>{{compare.name}}</del>
|
||||
{{#if compare.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/each_compare_list_field}}
|
||||
</p>
|
||||
</script>
|
||||
|
||||
<script id="template-article-compare-param-block" type="text/x-handlebars-template">
|
||||
{{#if source}}
|
||||
{{#each_compare_keys source.fields compare.fields}}
|
||||
{{#if typeSame}}
|
||||
<h2>{{__ source.key}}</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
|
||||
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../_hasType}}
|
||||
</table>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<h2><ins>{{__ source.key}}</ins></h2>
|
||||
<table class="ins">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
|
||||
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../_hasType}}
|
||||
</table>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<h2><del>{{__ compare.key}}</del></h2>
|
||||
<table class="del">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
|
||||
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../_hasType}}
|
||||
</table>
|
||||
{{/if}}
|
||||
{{/each_compare_keys}}
|
||||
|
||||
{{#if source.examples}}
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
{{#each_compare_title source.examples compare.examples}}
|
||||
{{#if typeSame}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/each_compare_title}}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
{{#each_compare_title source.examples compare.examples}}
|
||||
|
||||
{{#if typeSame}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each_compare_title}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script id="template-article-compare-param-block-body" type="text/x-handlebars-template">
|
||||
<tbody>
|
||||
{{#each_compare_field source compare}}
|
||||
{{#if typeSame}}
|
||||
<tr>
|
||||
<td class="code">
|
||||
{{{splitFill source.field "." " "}}}
|
||||
{{#if source.optional}}
|
||||
{{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span>
|
||||
{{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
|
||||
{{#if source.type}}
|
||||
{{#if compare.type}}
|
||||
<td>{{{showDiff source.type compare.type}}}</td>
|
||||
{{else}}
|
||||
<td>{{{source.type}}}</td>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if compare.type}}
|
||||
<td>{{{compare.type}}}</td>
|
||||
{{else}}
|
||||
{{#if ../../../../_hasType}}<td></td>{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
<td>
|
||||
{{{showDiff source.description compare.description "nl2br"}}}
|
||||
{{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code><p>{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<tr class="ins">
|
||||
<td class="code">
|
||||
{{{splitFill source.field "." " "}}}
|
||||
{{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
|
||||
</td>
|
||||
|
||||
{{#if source.type}}
|
||||
<td>{{{source.type}}}</td>
|
||||
{{else}}
|
||||
{{{typRowTd}}}
|
||||
{{/if}}
|
||||
|
||||
<td>
|
||||
{{{nl2br source.description}}}
|
||||
{{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code><p>{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<tr class="del">
|
||||
<td class="code">
|
||||
{{{splitFill compare.field "." " "}}}
|
||||
{{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
|
||||
</td>
|
||||
|
||||
{{#if compare.type}}
|
||||
<td>{{{compare.type}}}</td>
|
||||
{{else}}
|
||||
{{{typRowTd}}}
|
||||
{{/if}}
|
||||
|
||||
<td>
|
||||
{{{nl2br compare.description}}}
|
||||
{{#if compare.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code><p>{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
|
||||
{{/each_compare_field}}
|
||||
</tbody>
|
||||
</script>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div id="sidenav" class="span2"></div>
|
||||
<div id="content">
|
||||
<div id="project"></div>
|
||||
<div id="header"></div>
|
||||
<div id="sections"></div>
|
||||
<div id="footer"></div>
|
||||
<div id="generator"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="loader">
|
||||
<div class="spinner">
|
||||
<div class="spinner-container container1">
|
||||
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
|
||||
</div>
|
||||
<div class="spinner-container container2">
|
||||
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
|
||||
</div>
|
||||
<div class="spinner-container container3">
|
||||
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
|
||||
</div>
|
||||
<p>Loading...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script data-main="main.js" src="vendor/require.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
ca: {
|
||||
'Allowed values:' : 'Valors permesos:',
|
||||
'Compare all with predecessor': 'Comparar tot amb versió anterior',
|
||||
'compare changes to:' : 'comparar canvis amb:',
|
||||
'compared to' : 'comparat amb',
|
||||
'Default value:' : 'Valor per defecte:',
|
||||
'Description' : 'Descripció',
|
||||
'Field' : 'Camp',
|
||||
'General' : 'General',
|
||||
'Generated with' : 'Generat amb',
|
||||
'Name' : 'Nom',
|
||||
'No response values.' : 'Sense valors en la resposta.',
|
||||
'optional' : 'opcional',
|
||||
'Parameter' : 'Paràmetre',
|
||||
'Permission:' : 'Permisos:',
|
||||
'Response' : 'Resposta',
|
||||
'Send' : 'Enviar',
|
||||
'Send a Sample Request' : 'Enviar una petició d\'exemple',
|
||||
'show up to version:' : 'mostrar versió:',
|
||||
'Size range:' : 'Tamany de rang:',
|
||||
'Type' : 'Tipus',
|
||||
'url' : 'url'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
de: {
|
||||
'Allowed values:' : 'Erlaubte Werte:',
|
||||
'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern',
|
||||
'compare changes to:' : 'vergleiche Änderungen mit:',
|
||||
'compared to' : 'verglichen mit',
|
||||
'Default value:' : 'Standardwert:',
|
||||
'Description' : 'Beschreibung',
|
||||
'Field' : 'Feld',
|
||||
'General' : 'Allgemein',
|
||||
'Generated with' : 'Erstellt mit',
|
||||
'Name' : 'Name',
|
||||
'No response values.' : 'Keine Rückgabewerte.',
|
||||
'optional' : 'optional',
|
||||
'Parameter' : 'Parameter',
|
||||
'Permission:' : 'Berechtigung:',
|
||||
'Response' : 'Antwort',
|
||||
'Send' : 'Senden',
|
||||
'Send a Sample Request' : 'Eine Beispielanfrage senden',
|
||||
'show up to version:' : 'zeige bis zur Version:',
|
||||
'Size range:' : 'Größenbereich:',
|
||||
'Type' : 'Typ',
|
||||
'url' : 'url'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
es: {
|
||||
'Allowed values:' : 'Valores permitidos:',
|
||||
'Compare all with predecessor': 'Comparar todo con versión anterior',
|
||||
'compare changes to:' : 'comparar cambios con:',
|
||||
'compared to' : 'comparado con',
|
||||
'Default value:' : 'Valor por defecto:',
|
||||
'Description' : 'Descripción',
|
||||
'Field' : 'Campo',
|
||||
'General' : 'General',
|
||||
'Generated with' : 'Generado con',
|
||||
'Name' : 'Nombre',
|
||||
'No response values.' : 'Sin valores en la respuesta.',
|
||||
'optional' : 'opcional',
|
||||
'Parameter' : 'Parámetro',
|
||||
'Permission:' : 'Permisos:',
|
||||
'Response' : 'Respuesta',
|
||||
'Send' : 'Enviar',
|
||||
'Send a Sample Request' : 'Enviar una petición de ejemplo',
|
||||
'show up to version:' : 'mostrar a versión:',
|
||||
'Size range:' : 'Tamaño de rango:',
|
||||
'Type' : 'Tipo',
|
||||
'url' : 'url'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
fr: {
|
||||
'Allowed values:' : 'Valeurs autorisées :',
|
||||
'Compare all with predecessor': 'Tout comparer avec ...',
|
||||
'compare changes to:' : 'comparer les changements à :',
|
||||
'compared to' : 'comparer à',
|
||||
'Default value:' : 'Valeur par défaut :',
|
||||
'Description' : 'Description',
|
||||
'Field' : 'Champ',
|
||||
'General' : 'Général',
|
||||
'Generated with' : 'Généré avec',
|
||||
'Name' : 'Nom',
|
||||
'No response values.' : 'Aucune valeur de réponse.',
|
||||
'optional' : 'optionnel',
|
||||
'Parameter' : 'Paramètre',
|
||||
'Permission:' : 'Permission :',
|
||||
'Response' : 'Réponse',
|
||||
'Send' : 'Envoyer',
|
||||
'Send a Sample Request' : 'Envoyer une requête représentative',
|
||||
'show up to version:' : 'Montrer à partir de la version :',
|
||||
'Size range:' : 'Ordre de grandeur :',
|
||||
'Type' : 'Type',
|
||||
'url' : 'url'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
it: {
|
||||
'Allowed values:' : 'Valori permessi:',
|
||||
'Compare all with predecessor': 'Confronta tutto con versioni precedenti',
|
||||
'compare changes to:' : 'confronta modifiche con:',
|
||||
'compared to' : 'confrontato con',
|
||||
'Default value:' : 'Valore predefinito:',
|
||||
'Description' : 'Descrizione',
|
||||
'Field' : 'Campo',
|
||||
'General' : 'Generale',
|
||||
'Generated with' : 'Creato con',
|
||||
'Name' : 'Nome',
|
||||
'No response values.' : 'Nessun valore di risposta.',
|
||||
'optional' : 'opzionale',
|
||||
'Parameter' : 'Parametro',
|
||||
'Permission:' : 'Permessi:',
|
||||
'Response' : 'Risposta',
|
||||
'Send' : 'Invia',
|
||||
'Send a Sample Request' : 'Invia una richiesta di esempio',
|
||||
'show up to version:' : 'mostra alla versione:',
|
||||
'Size range:' : 'Intervallo dimensione:',
|
||||
'Type' : 'Tipo',
|
||||
'url' : 'url'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,50 @@
|
||||
define([
|
||||
'./locales/ca.js',
|
||||
'./locales/de.js',
|
||||
'./locales/es.js',
|
||||
'./locales/fr.js',
|
||||
'./locales/it.js',
|
||||
'./locales/nl.js',
|
||||
'./locales/pl.js',
|
||||
'./locales/pt_br.js',
|
||||
'./locales/ro.js',
|
||||
'./locales/ru.js',
|
||||
'./locales/tr.js',
|
||||
'./locales/vi.js',
|
||||
'./locales/zh.js',
|
||||
'./locales/zh_cn.js'
|
||||
], function() {
|
||||
var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_');
|
||||
var language = langId.substr(0, 2);
|
||||
var locales = {};
|
||||
|
||||
for (index in arguments) {
|
||||
for (property in arguments[index])
|
||||
locales[property] = arguments[index][property];
|
||||
}
|
||||
if ( ! locales['en'])
|
||||
locales['en'] = {};
|
||||
|
||||
if ( ! locales[langId] && ! locales[language])
|
||||
language = 'en';
|
||||
|
||||
var locale = (locales[langId] ? locales[langId] : locales[language]);
|
||||
|
||||
function __(text) {
|
||||
var index = locale[text];
|
||||
if (index === undefined)
|
||||
return text;
|
||||
return index;
|
||||
};
|
||||
|
||||
function setLanguage(language) {
|
||||
locale = locales[language];
|
||||
}
|
||||
|
||||
return {
|
||||
__ : __,
|
||||
locales : locales,
|
||||
locale : locale,
|
||||
setLanguage: setLanguage
|
||||
};
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
nl: {
|
||||
'Allowed values:' : 'Toegestane waarden:',
|
||||
'Compare all with predecessor': 'Vergelijk alle met voorgaande versie',
|
||||
'compare changes to:' : 'vergelijk veranderingen met:',
|
||||
'compared to' : 'vergelijk met',
|
||||
'Default value:' : 'Standaard waarde:',
|
||||
'Description' : 'Omschrijving',
|
||||
'Field' : 'Veld',
|
||||
'General' : 'Algemeen',
|
||||
'Generated with' : 'Gegenereerd met',
|
||||
'Name' : 'Naam',
|
||||
'No response values.' : 'Geen response waardes.',
|
||||
'optional' : 'optioneel',
|
||||
'Parameter' : 'Parameter',
|
||||
'Permission:' : 'Permissie:',
|
||||
'Response' : 'Antwoorden',
|
||||
'Send' : 'Sturen',
|
||||
'Send a Sample Request' : 'Stuur een sample aanvragen',
|
||||
'show up to version:' : 'toon tot en met versie:',
|
||||
'Size range:' : 'Maatbereik:',
|
||||
'Type' : 'Type',
|
||||
'url' : 'url'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
pl: {
|
||||
'Allowed values:' : 'Dozwolone wartości:',
|
||||
'Compare all with predecessor': 'Porównaj z poprzednimi wersjami',
|
||||
'compare changes to:' : 'porównaj zmiany do:',
|
||||
'compared to' : 'porównaj do:',
|
||||
'Default value:' : 'Wartość domyślna:',
|
||||
'Description' : 'Opis',
|
||||
'Field' : 'Pole',
|
||||
'General' : 'Generalnie',
|
||||
'Generated with' : 'Wygenerowano z',
|
||||
'Name' : 'Nazwa',
|
||||
'No response values.' : 'Brak odpowiedzi.',
|
||||
'optional' : 'opcjonalny',
|
||||
'Parameter' : 'Parametr',
|
||||
'Permission:' : 'Uprawnienia:',
|
||||
'Response' : 'Odpowiedź',
|
||||
'Send' : 'Wyślij',
|
||||
'Send a Sample Request' : 'Wyślij przykładowe żądanie',
|
||||
'show up to version:' : 'pokaż do wersji:',
|
||||
'Size range:' : 'Zakres rozmiaru:',
|
||||
'Type' : 'Typ',
|
||||
'url' : 'url'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
'pt_br': {
|
||||
'Allowed values:' : 'Valores permitidos:',
|
||||
'Compare all with predecessor': 'Compare todos com antecessores',
|
||||
'compare changes to:' : 'comparar alterações com:',
|
||||
'compared to' : 'comparado com',
|
||||
'Default value:' : 'Valor padrão:',
|
||||
'Description' : 'Descrição',
|
||||
'Field' : 'Campo',
|
||||
'General' : 'Geral',
|
||||
'Generated with' : 'Gerado com',
|
||||
'Name' : 'Nome',
|
||||
'No response values.' : 'Sem valores de resposta.',
|
||||
'optional' : 'opcional',
|
||||
'Parameter' : 'Parâmetro',
|
||||
'Permission:' : 'Permissão:',
|
||||
'Response' : 'Resposta',
|
||||
'Send' : 'Enviar',
|
||||
'Send a Sample Request' : 'Enviar um Exemplo de Pedido',
|
||||
'show up to version:' : 'aparecer para a versão:',
|
||||
'Size range:' : 'Faixa de tamanho:',
|
||||
'Type' : 'Tipo',
|
||||
'url' : 'url'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
ro: {
|
||||
'Allowed values:' : 'Valori permise:',
|
||||
'Compare all with predecessor': 'Compară toate cu versiunea precedentă',
|
||||
'compare changes to:' : 'compară cu versiunea:',
|
||||
'compared to' : 'comparat cu',
|
||||
'Default value:' : 'Valoare implicită:',
|
||||
'Description' : 'Descriere',
|
||||
'Field' : 'Câmp',
|
||||
'General' : 'General',
|
||||
'Generated with' : 'Generat cu',
|
||||
'Name' : 'Nume',
|
||||
'No response values.' : 'Nici o valoare returnată.',
|
||||
'optional' : 'opțional',
|
||||
'Parameter' : 'Parametru',
|
||||
'Permission:' : 'Permisiune:',
|
||||
'Response' : 'Răspuns',
|
||||
'Send' : 'Trimite',
|
||||
'Send a Sample Request' : 'Trimite o cerere de probă',
|
||||
'show up to version:' : 'arată până la versiunea:',
|
||||
'Size range:' : 'Interval permis:',
|
||||
'Type' : 'Tip',
|
||||
'url' : 'url'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
vi: {
|
||||
'Allowed values:' : 'Giá trị chấp nhận:',
|
||||
'Compare all with predecessor': 'So sánh với tất cả phiên bản trước',
|
||||
'compare changes to:' : 'so sánh sự thay đổi với:',
|
||||
'compared to' : 'so sánh với',
|
||||
'Default value:' : 'Giá trị mặc định:',
|
||||
'Description' : 'Chú thích',
|
||||
'Field' : 'Trường dữ liệu',
|
||||
'General' : 'Tổng quan',
|
||||
'Generated with' : 'Được tạo bởi',
|
||||
'Name' : 'Tên',
|
||||
'No response values.' : 'Không có kết quả trả về.',
|
||||
'optional' : 'Tùy chọn',
|
||||
'Parameter' : 'Tham số',
|
||||
'Permission:' : 'Quyền hạn:',
|
||||
'Response' : 'Kết quả',
|
||||
'Send' : 'Gửi',
|
||||
'Send a Sample Request' : 'Gửi một yêu cầu mẫu',
|
||||
'show up to version:' : 'hiển thị phiên bản:',
|
||||
'Size range:' : 'Kích cỡ:',
|
||||
'Type' : 'Kiểu',
|
||||
'url' : 'liên kết'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
define({
|
||||
'zh_cn': {
|
||||
'Allowed values:' : '允许值:',
|
||||
'Compare all with predecessor': '与所有较早的比较',
|
||||
'compare changes to:' : '将当前版本与指定版本比较:',
|
||||
'compared to' : '相比于',
|
||||
'Default value:' : '默认值:',
|
||||
'Description' : '描述',
|
||||
'Field' : '字段',
|
||||
'General' : '概要',
|
||||
'Generated with' : '基于',
|
||||
'Name' : '名称',
|
||||
'No response values.' : '无返回值.',
|
||||
'optional' : '可选',
|
||||
'Parameter' : '参数',
|
||||
'Permission:' : '权限:',
|
||||
'Response' : '返回',
|
||||
'Send' : '发送',
|
||||
'Send a Sample Request' : '发送示例请求',
|
||||
'show up to version:' : '显示到指定版本:',
|
||||
'Size range:' : '取值范围:',
|
||||
'Type' : '类型',
|
||||
'url' : '网址'
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,827 @@
|
||||
require.config({
|
||||
paths: {
|
||||
bootstrap: './vendor/bootstrap.min',
|
||||
diffMatchPatch: './vendor/diff_match_patch.min',
|
||||
handlebars: './vendor/handlebars.min',
|
||||
handlebarsExtended: './utils/handlebars_helper',
|
||||
jquery: './vendor/jquery.min',
|
||||
locales: './locales/locale',
|
||||
lodash: './vendor/lodash.custom.min',
|
||||
pathToRegexp: './vendor/path-to-regexp/index',
|
||||
prettify: './vendor/prettify/prettify',
|
||||
semver: './vendor/semver.min',
|
||||
utilsSampleRequest: './utils/send_sample_request',
|
||||
webfontloader: './vendor/webfontloader',
|
||||
list: './vendor/list.min'
|
||||
},
|
||||
shim: {
|
||||
bootstrap: {
|
||||
deps: ['jquery']
|
||||
},
|
||||
diffMatchPatch: {
|
||||
exports: 'diff_match_patch'
|
||||
},
|
||||
handlebars: {
|
||||
exports: 'Handlebars'
|
||||
},
|
||||
handlebarsExtended: {
|
||||
deps: ['jquery', 'handlebars'],
|
||||
exports: 'Handlebars'
|
||||
},
|
||||
prettify: {
|
||||
exports: 'prettyPrint'
|
||||
}
|
||||
},
|
||||
urlArgs: 'v=' + (new Date()).getTime(),
|
||||
waitSeconds: 15
|
||||
});
|
||||
|
||||
require([
|
||||
'jquery',
|
||||
'lodash',
|
||||
'locales',
|
||||
'handlebarsExtended',
|
||||
'./api_project.js',
|
||||
'./api_data.js',
|
||||
'prettify',
|
||||
'utilsSampleRequest',
|
||||
'semver',
|
||||
'webfontloader',
|
||||
'bootstrap',
|
||||
'pathToRegexp',
|
||||
'list'
|
||||
], function($, _, locale, Handlebars, apiProject, apiData, prettyPrint, sampleRequest, semver, WebFont) {
|
||||
|
||||
// load google web fonts
|
||||
loadGoogleFontCss();
|
||||
|
||||
var api = apiData.api;
|
||||
|
||||
//
|
||||
// Templates
|
||||
//
|
||||
var templateHeader = Handlebars.compile( $('#template-header').html() );
|
||||
var templateFooter = Handlebars.compile( $('#template-footer').html() );
|
||||
var templateArticle = Handlebars.compile( $('#template-article').html() );
|
||||
var templateCompareArticle = Handlebars.compile( $('#template-compare-article').html() );
|
||||
var templateGenerator = Handlebars.compile( $('#template-generator').html() );
|
||||
var templateProject = Handlebars.compile( $('#template-project').html() );
|
||||
var templateSections = Handlebars.compile( $('#template-sections').html() );
|
||||
var templateSidenav = Handlebars.compile( $('#template-sidenav').html() );
|
||||
|
||||
//
|
||||
// apiProject defaults
|
||||
//
|
||||
if ( ! apiProject.template)
|
||||
apiProject.template = {};
|
||||
|
||||
if (apiProject.template.withCompare == null)
|
||||
apiProject.template.withCompare = true;
|
||||
|
||||
if (apiProject.template.withGenerator == null)
|
||||
apiProject.template.withGenerator = true;
|
||||
|
||||
if (apiProject.template.forceLanguage)
|
||||
locale.setLanguage(apiProject.template.forceLanguage);
|
||||
|
||||
// Setup jQuery Ajax
|
||||
$.ajaxSetup(apiProject.template.jQueryAjaxSetup);
|
||||
|
||||
//
|
||||
// Data transform
|
||||
//
|
||||
// grouped by group
|
||||
var apiByGroup = _.groupBy(api, function(entry) {
|
||||
return entry.group;
|
||||
});
|
||||
|
||||
// grouped by group and name
|
||||
var apiByGroupAndName = {};
|
||||
$.each(apiByGroup, function(index, entries) {
|
||||
apiByGroupAndName[index] = _.groupBy(entries, function(entry) {
|
||||
return entry.name;
|
||||
});
|
||||
});
|
||||
|
||||
//
|
||||
// sort api within a group by title ASC and custom order
|
||||
//
|
||||
var newList = [];
|
||||
var umlauts = { 'ä': 'ae', 'ü': 'ue', 'ö': 'oe', 'ß': 'ss' }; // TODO: remove in version 1.0
|
||||
$.each (apiByGroupAndName, function(index, groupEntries) {
|
||||
// get titles from the first entry of group[].name[] (name has versioning)
|
||||
var titles = [];
|
||||
$.each (groupEntries, function(titleName, entries) {
|
||||
var title = entries[0].title;
|
||||
if(title !== undefined) {
|
||||
title.toLowerCase().replace(/[äöüß]/g, function($0) { return umlauts[$0]; });
|
||||
titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting
|
||||
}
|
||||
});
|
||||
// sort by name ASC
|
||||
titles.sort();
|
||||
|
||||
// custom order
|
||||
if (apiProject.order)
|
||||
titles = sortByOrder(titles, apiProject.order, '#~#');
|
||||
|
||||
// add single elements to the new list
|
||||
titles.forEach(function(name) {
|
||||
var values = name.split('#~#');
|
||||
var key = values[1];
|
||||
groupEntries[key].forEach(function(entry) {
|
||||
newList.push(entry);
|
||||
});
|
||||
});
|
||||
});
|
||||
// api overwrite with ordered list
|
||||
api = newList;
|
||||
|
||||
//
|
||||
// Group- and Versionlists
|
||||
//
|
||||
var apiGroups = {};
|
||||
var apiGroupTitles = {};
|
||||
var apiVersions = {};
|
||||
apiVersions[apiProject.version] = 1;
|
||||
|
||||
$.each(api, function(index, entry) {
|
||||
apiGroups[entry.group] = 1;
|
||||
apiGroupTitles[entry.group] = entry.groupTitle || entry.group;
|
||||
apiVersions[entry.version] = 1;
|
||||
});
|
||||
|
||||
// sort groups
|
||||
apiGroups = Object.keys(apiGroups);
|
||||
apiGroups.sort();
|
||||
|
||||
// custom order
|
||||
if (apiProject.order)
|
||||
apiGroups = sortByOrder(apiGroups, apiProject.order);
|
||||
|
||||
// sort versions DESC
|
||||
apiVersions = Object.keys(apiVersions);
|
||||
apiVersions.sort(semver.compare);
|
||||
apiVersions.reverse();
|
||||
|
||||
//
|
||||
// create Navigationlist
|
||||
//
|
||||
var nav = [];
|
||||
apiGroups.forEach(function(group) {
|
||||
// Mainmenu entry
|
||||
nav.push({
|
||||
group: group,
|
||||
isHeader: true,
|
||||
title: apiGroupTitles[group]
|
||||
});
|
||||
|
||||
// Submenu
|
||||
var oldName = '';
|
||||
api.forEach(function(entry) {
|
||||
if (entry.group === group) {
|
||||
if (oldName !== entry.name) {
|
||||
nav.push({
|
||||
title: entry.title,
|
||||
group: group,
|
||||
name: entry.name,
|
||||
type: entry.type,
|
||||
version: entry.version
|
||||
});
|
||||
} else {
|
||||
nav.push({
|
||||
title: entry.title,
|
||||
group: group,
|
||||
hidden: true,
|
||||
name: entry.name,
|
||||
type: entry.type,
|
||||
version: entry.version
|
||||
});
|
||||
}
|
||||
oldName = entry.name;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Add navigation items by analyzing the HTML content and searching for h1 and h2 tags
|
||||
* @param nav Object the navigation array
|
||||
* @param content string the compiled HTML content
|
||||
* @param index where to insert items
|
||||
* @return boolean true if any good-looking (i.e. with a group identifier) <h1> tag was found
|
||||
*/
|
||||
function add_nav(nav, content, index) {
|
||||
var found_level1 = false;
|
||||
if ( ! content) {
|
||||
return found_level1;
|
||||
}
|
||||
var topics = content.match(/<h(1|2).*?>(.+?)<\/h(1|2)>/gi);
|
||||
if ( topics ) {
|
||||
topics.forEach(function(entry) {
|
||||
var level = entry.substring(2,3);
|
||||
var title = entry.replace(/<.+?>/g, ''); // Remove all HTML tags for the title
|
||||
var entry_tags = entry.match(/id="api-([^\-]+)(?:-(.+))?"/); // Find the group and name in the id property
|
||||
var group = (entry_tags ? entry_tags[1] : null);
|
||||
var name = (entry_tags ? entry_tags[2] : null);
|
||||
if (level==1 && title && group) {
|
||||
nav.splice(index, 0, {
|
||||
group: group,
|
||||
isHeader: true,
|
||||
title: title,
|
||||
isFixed: true
|
||||
});
|
||||
index++;
|
||||
found_level1 = true;
|
||||
}
|
||||
if (level==2 && title && group && name) {
|
||||
nav.splice(index, 0, {
|
||||
group: group,
|
||||
name: name,
|
||||
isHeader: false,
|
||||
title: title,
|
||||
isFixed: false,
|
||||
version: '1.0'
|
||||
});
|
||||
index++;
|
||||
}
|
||||
});
|
||||
}
|
||||
return found_level1;
|
||||
}
|
||||
|
||||
// Mainmenu Header entry
|
||||
if (apiProject.header) {
|
||||
var found_level1 = add_nav(nav, apiProject.header.content, 0); // Add level 1 and 2 titles
|
||||
if (!found_level1) { // If no Level 1 tags were found, make a title
|
||||
nav.unshift({
|
||||
group: '_',
|
||||
isHeader: true,
|
||||
title: (apiProject.header.title == null) ? locale.__('General') : apiProject.header.title,
|
||||
isFixed: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Mainmenu Footer entry
|
||||
if (apiProject.footer) {
|
||||
var last_nav_index = nav.length;
|
||||
var found_level1 = add_nav(nav, apiProject.footer.content, nav.length); // Add level 1 and 2 titles
|
||||
if (!found_level1 && apiProject.footer.title != null) { // If no Level 1 tags were found, make a title
|
||||
nav.splice(last_nav_index, 0, {
|
||||
group: '_footer',
|
||||
isHeader: true,
|
||||
title: apiProject.footer.title,
|
||||
isFixed: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// render pagetitle
|
||||
var title = apiProject.title ? apiProject.title : 'apiDoc: ' + apiProject.name + ' - ' + apiProject.version;
|
||||
$(document).attr('title', title);
|
||||
|
||||
// remove loader
|
||||
$('#loader').remove();
|
||||
|
||||
// render sidenav
|
||||
var fields = {
|
||||
nav: nav
|
||||
};
|
||||
$('#sidenav').append( templateSidenav(fields) );
|
||||
|
||||
// render Generator
|
||||
$('#generator').append( templateGenerator(apiProject) );
|
||||
|
||||
// render Project
|
||||
_.extend(apiProject, { versions: apiVersions});
|
||||
$('#project').append( templateProject(apiProject) );
|
||||
|
||||
// render apiDoc, header/footer documentation
|
||||
if (apiProject.header)
|
||||
$('#header').append( templateHeader(apiProject.header) );
|
||||
|
||||
if (apiProject.footer)
|
||||
$('#footer').append( templateFooter(apiProject.footer) );
|
||||
|
||||
//
|
||||
// Render Sections and Articles
|
||||
//
|
||||
var articleVersions = {};
|
||||
var content = '';
|
||||
apiGroups.forEach(function(groupEntry) {
|
||||
var articles = [];
|
||||
var oldName = '';
|
||||
var fields = {};
|
||||
var title = groupEntry;
|
||||
var description = '';
|
||||
articleVersions[groupEntry] = {};
|
||||
|
||||
// render all articles of a group
|
||||
api.forEach(function(entry) {
|
||||
if(groupEntry === entry.group) {
|
||||
if (oldName !== entry.name) {
|
||||
// determine versions
|
||||
api.forEach(function(versionEntry) {
|
||||
if (groupEntry === versionEntry.group && entry.name === versionEntry.name) {
|
||||
if ( ! articleVersions[entry.group].hasOwnProperty(entry.name) ) {
|
||||
articleVersions[entry.group][entry.name] = [];
|
||||
}
|
||||
articleVersions[entry.group][entry.name].push(versionEntry.version);
|
||||
}
|
||||
});
|
||||
fields = {
|
||||
article: entry,
|
||||
versions: articleVersions[entry.group][entry.name]
|
||||
};
|
||||
} else {
|
||||
fields = {
|
||||
article: entry,
|
||||
hidden: true,
|
||||
versions: articleVersions[entry.group][entry.name]
|
||||
};
|
||||
}
|
||||
|
||||
// add prefix URL for endpoint
|
||||
if (apiProject.url)
|
||||
fields.article.url = apiProject.url + fields.article.url;
|
||||
|
||||
addArticleSettings(fields, entry);
|
||||
|
||||
if (entry.groupTitle)
|
||||
title = entry.groupTitle;
|
||||
|
||||
// TODO: make groupDescription compareable with older versions (not important for the moment)
|
||||
if (entry.groupDescription)
|
||||
description = entry.groupDescription;
|
||||
|
||||
articles.push({
|
||||
article: templateArticle(fields),
|
||||
group: entry.group,
|
||||
name: entry.name
|
||||
});
|
||||
oldName = entry.name;
|
||||
}
|
||||
});
|
||||
|
||||
// render Section with Articles
|
||||
var fields = {
|
||||
group: groupEntry,
|
||||
title: title,
|
||||
description: description,
|
||||
articles: articles
|
||||
};
|
||||
content += templateSections(fields);
|
||||
});
|
||||
$('#sections').append( content );
|
||||
|
||||
// Bootstrap Scrollspy
|
||||
$(this).scrollspy({ target: '#scrollingNav', offset: 18 });
|
||||
|
||||
// Content-Scroll on Navigation click.
|
||||
$('.sidenav').find('a').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var id = $(this).attr('href');
|
||||
if ($(id).length > 0)
|
||||
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 400);
|
||||
window.location.hash = $(this).attr('href');
|
||||
});
|
||||
|
||||
// Quickjump on Pageload to hash position.
|
||||
if(window.location.hash) {
|
||||
var id = window.location.hash;
|
||||
if ($(id).length > 0)
|
||||
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Parameter (sub) List has a type Field.
|
||||
* Example: @apiSuccess varname1 No type.
|
||||
* @apiSuccess {String} varname2 With type.
|
||||
*
|
||||
* @param {Object} fields
|
||||
*/
|
||||
function _hasTypeInFields(fields) {
|
||||
var result = false;
|
||||
$.each(fields, function(name) {
|
||||
result = result || _.some(fields[name], function(item) { return item.type; });
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* On Template changes, recall plugins.
|
||||
*/
|
||||
function initDynamic() {
|
||||
// Bootstrap popover
|
||||
$('button[data-toggle="popover"]').popover().click(function(e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
var version = $('#version strong').html();
|
||||
$('#sidenav li').removeClass('is-new');
|
||||
if (apiProject.template.withCompare) {
|
||||
$('#sidenav li[data-version=\'' + version + '\']').each(function(){
|
||||
var group = $(this).data('group');
|
||||
var name = $(this).data('name');
|
||||
var length = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').length;
|
||||
var index = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').index($(this));
|
||||
if (length === 1 || index === (length - 1))
|
||||
$(this).addClass('is-new');
|
||||
});
|
||||
}
|
||||
|
||||
// tabs
|
||||
$('.nav-tabs-examples a').click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
});
|
||||
$('.nav-tabs-examples').find('a:first').tab('show');
|
||||
|
||||
// sample request switch
|
||||
$('.sample-request-switch').click(function (e) {
|
||||
var name = '.' + $(this).attr('name') + '-fields';
|
||||
$(name).addClass('hide');
|
||||
$(this).parent().next(name).removeClass('hide');
|
||||
});
|
||||
|
||||
// call scrollspy refresh method
|
||||
$(window).scrollspy('refresh');
|
||||
|
||||
// init modules
|
||||
sampleRequest.initDynamic();
|
||||
}
|
||||
initDynamic();
|
||||
|
||||
// Pre- / Code-Format
|
||||
prettyPrint();
|
||||
|
||||
//
|
||||
// HTML-Template specific jQuery-Functions
|
||||
//
|
||||
// Change Main Version
|
||||
$('#versions li.version a').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var selectedVersion = $(this).html();
|
||||
$('#version strong').html(selectedVersion);
|
||||
|
||||
// hide all
|
||||
$('article').addClass('hide');
|
||||
$('#sidenav li:not(.nav-fixed)').addClass('hide');
|
||||
|
||||
// show 1st equal or lower Version of each entry
|
||||
$('article[data-version]').each(function(index) {
|
||||
var group = $(this).data('group');
|
||||
var name = $(this).data('name');
|
||||
var version = $(this).data('version');
|
||||
|
||||
if (semver.lte(version, selectedVersion)) {
|
||||
if ($('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible').length === 0) {
|
||||
// enable Article
|
||||
$('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide');
|
||||
// enable Navigation
|
||||
$('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide');
|
||||
$('#sidenav li.nav-header[data-group=\'' + group + '\']').removeClass('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// show 1st equal or lower Version of each entry
|
||||
$('article[data-version]').each(function(index) {
|
||||
var group = $(this).data('group');
|
||||
$('section#api-' + group).removeClass('hide');
|
||||
if ($('section#api-' + group + ' article:visible').length === 0) {
|
||||
$('section#api-' + group).addClass('hide');
|
||||
} else {
|
||||
$('section#api-' + group).removeClass('hide');
|
||||
}
|
||||
});
|
||||
|
||||
initDynamic();
|
||||
return;
|
||||
});
|
||||
|
||||
// compare all article with their predecessor
|
||||
$('#compareAllWithPredecessor').on('click', changeAllVersionCompareTo);
|
||||
|
||||
// change version of an article
|
||||
$('article .versions li.version a').on('click', changeVersionCompareTo);
|
||||
|
||||
// compare url-parameter
|
||||
$.urlParam = function(name) {
|
||||
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
|
||||
return (results && results[1]) ? results[1] : null;
|
||||
};
|
||||
|
||||
if ($.urlParam('compare')) {
|
||||
// URL Paramter ?compare=1 is set
|
||||
$('#compareAllWithPredecessor').trigger('click');
|
||||
|
||||
if (window.location.hash) {
|
||||
var id = window.location.hash;
|
||||
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) - 18 }, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize search
|
||||
*/
|
||||
var options = {
|
||||
valueNames: [ 'nav-list-item' ]
|
||||
};
|
||||
var endpointsList = new List('scrollingNav', options);
|
||||
|
||||
/**
|
||||
* Set initial focus to search input
|
||||
*/
|
||||
$('#scrollingNav .sidenav-search input.search').focus();
|
||||
|
||||
/**
|
||||
* Detect ESC key to reset search
|
||||
*/
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode === 27) $('span.search-reset').click();
|
||||
});
|
||||
|
||||
/**
|
||||
* Search reset
|
||||
*/
|
||||
$('span.search-reset').on('click', function() {
|
||||
$('#scrollingNav .sidenav-search input.search')
|
||||
.val("")
|
||||
.focus()
|
||||
;
|
||||
endpointsList.search();
|
||||
});
|
||||
|
||||
/**
|
||||
* Change version of an article to compare it to an other version.
|
||||
*/
|
||||
function changeVersionCompareTo(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $root = $(this).parents('article');
|
||||
var selectedVersion = $(this).html();
|
||||
var $button = $root.find('.version');
|
||||
var currentVersion = $button.find('strong').html();
|
||||
$button.find('strong').html(selectedVersion);
|
||||
|
||||
var group = $root.data('group');
|
||||
var name = $root.data('name');
|
||||
var version = $root.data('version');
|
||||
|
||||
var compareVersion = $root.data('compare-version');
|
||||
|
||||
if (compareVersion === selectedVersion)
|
||||
return;
|
||||
|
||||
if ( ! compareVersion && version == selectedVersion)
|
||||
return;
|
||||
|
||||
if (compareVersion && articleVersions[group][name][0] === selectedVersion || version === selectedVersion) {
|
||||
// the version of the entry is set to the highest version (reset)
|
||||
resetArticle(group, name, version);
|
||||
} else {
|
||||
var $compareToArticle = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + selectedVersion + '\']');
|
||||
|
||||
var sourceEntry = {};
|
||||
var compareEntry = {};
|
||||
$.each(apiByGroupAndName[group][name], function(index, entry) {
|
||||
if (entry.version === version)
|
||||
sourceEntry = entry;
|
||||
if (entry.version === selectedVersion)
|
||||
compareEntry = entry;
|
||||
});
|
||||
|
||||
var fields = {
|
||||
article: sourceEntry,
|
||||
compare: compareEntry,
|
||||
versions: articleVersions[group][name]
|
||||
};
|
||||
|
||||
// add unique id
|
||||
// TODO: replace all group-name-version in template with id.
|
||||
fields.article.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version;
|
||||
fields.article.id = fields.article.id.replace(/\./g, '_');
|
||||
|
||||
fields.compare.id = fields.compare.group + '-' + fields.compare.name + '-' + fields.compare.version;
|
||||
fields.compare.id = fields.compare.id.replace(/\./g, '_');
|
||||
|
||||
var entry = sourceEntry;
|
||||
if (entry.parameter && entry.parameter.fields)
|
||||
fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields);
|
||||
|
||||
if (entry.error && entry.error.fields)
|
||||
fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields);
|
||||
|
||||
if (entry.success && entry.success.fields)
|
||||
fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields);
|
||||
|
||||
if (entry.info && entry.info.fields)
|
||||
fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields);
|
||||
|
||||
var entry = compareEntry;
|
||||
if (fields._hasTypeInParameterFields !== true && entry.parameter && entry.parameter.fields)
|
||||
fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields);
|
||||
|
||||
if (fields._hasTypeInErrorFields !== true && entry.error && entry.error.fields)
|
||||
fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields);
|
||||
|
||||
if (fields._hasTypeInSuccessFields !== true && entry.success && entry.success.fields)
|
||||
fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields);
|
||||
|
||||
if (fields._hasTypeInInfoFields !== true && entry.info && entry.info.fields)
|
||||
fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields);
|
||||
|
||||
var content = templateCompareArticle(fields);
|
||||
$root.after(content);
|
||||
var $content = $root.next();
|
||||
|
||||
// Event on.click re-assign
|
||||
$content.find('.versions li.version a').on('click', changeVersionCompareTo);
|
||||
|
||||
// select navigation
|
||||
$('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + currentVersion + '\']').addClass('has-modifications');
|
||||
|
||||
$root.remove();
|
||||
// TODO: on change main version or select the highest version re-render
|
||||
}
|
||||
|
||||
initDynamic();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare all currently selected Versions with their predecessor.
|
||||
*/
|
||||
function changeAllVersionCompareTo(e) {
|
||||
e.preventDefault();
|
||||
$('article:visible .versions').each(function(){
|
||||
var $root = $(this).parents('article');
|
||||
var currentVersion = $root.data('version');
|
||||
var $foundElement = null;
|
||||
$(this).find('li.version a').each(function() {
|
||||
var selectVersion = $(this).html();
|
||||
if (selectVersion < currentVersion && ! $foundElement)
|
||||
$foundElement = $(this);
|
||||
});
|
||||
|
||||
if($foundElement)
|
||||
$foundElement.trigger('click');
|
||||
});
|
||||
initDynamic();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the fields.
|
||||
*/
|
||||
function sortFields(fields_object) {
|
||||
$.each(fields_object, function (key, fields) {
|
||||
|
||||
var reversed = fields.slice().reverse()
|
||||
|
||||
var max_dot_count = Math.max.apply(null, reversed.map(function (item) {
|
||||
return item.field.split(".").length - 1;
|
||||
}))
|
||||
|
||||
for (var dot_count = 1; dot_count <= max_dot_count; dot_count++) {
|
||||
reversed.forEach(function (item, index) {
|
||||
var parts = item.field.split(".");
|
||||
if (parts.length - 1 == dot_count) {
|
||||
var fields_names = fields.map(function (item) { return item.field; });
|
||||
if (parts.slice(1).length >= 1) {
|
||||
var prefix = parts.slice(0, parts.length - 1).join(".");
|
||||
var prefix_index = fields_names.indexOf(prefix);
|
||||
if (prefix_index > -1) {
|
||||
fields.splice(fields_names.indexOf(item.field), 1);
|
||||
fields.splice(prefix_index + 1, 0, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Add article settings.
|
||||
*/
|
||||
function addArticleSettings(fields, entry) {
|
||||
// add unique id
|
||||
// TODO: replace all group-name-version in template with id.
|
||||
fields.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version;
|
||||
fields.id = fields.id.replace(/\./g, '_');
|
||||
|
||||
if (entry.header && entry.header.fields) {
|
||||
sortFields(entry.header.fields);
|
||||
fields._hasTypeInHeaderFields = _hasTypeInFields(entry.header.fields);
|
||||
}
|
||||
|
||||
if (entry.parameter && entry.parameter.fields) {
|
||||
sortFields(entry.parameter.fields);
|
||||
fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields);
|
||||
}
|
||||
|
||||
if (entry.error && entry.error.fields) {
|
||||
sortFields(entry.error.fields);
|
||||
fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields);
|
||||
}
|
||||
|
||||
if (entry.success && entry.success.fields) {
|
||||
sortFields(entry.success.fields);
|
||||
fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields);
|
||||
}
|
||||
|
||||
if (entry.info && entry.info.fields) {
|
||||
sortFields(entry.info.fields);
|
||||
fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields);
|
||||
}
|
||||
|
||||
// add template settings
|
||||
fields.template = apiProject.template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render Article.
|
||||
*/
|
||||
function renderArticle(group, name, version) {
|
||||
var entry = {};
|
||||
$.each(apiByGroupAndName[group][name], function(index, currentEntry) {
|
||||
if (currentEntry.version === version)
|
||||
entry = currentEntry;
|
||||
});
|
||||
var fields = {
|
||||
article: entry,
|
||||
versions: articleVersions[group][name]
|
||||
};
|
||||
|
||||
addArticleSettings(fields, entry);
|
||||
|
||||
return templateArticle(fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render original Article and remove the current visible Article.
|
||||
*/
|
||||
function resetArticle(group, name, version) {
|
||||
var $root = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible');
|
||||
var content = renderArticle(group, name, version);
|
||||
|
||||
$root.after(content);
|
||||
var $content = $root.next();
|
||||
|
||||
// Event on.click muss neu zugewiesen werden (sollte eigentlich mit on automatisch funktionieren... sollte)
|
||||
$content.find('.versions li.version a').on('click', changeVersionCompareTo);
|
||||
|
||||
$('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('has-modifications');
|
||||
|
||||
$root.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load google fonts.
|
||||
*/
|
||||
function loadGoogleFontCss() {
|
||||
WebFont.load({
|
||||
active: function() {
|
||||
// Update scrollspy
|
||||
$(window).scrollspy('refresh')
|
||||
},
|
||||
google: {
|
||||
families: ['Source Code Pro', 'Source Sans Pro:n4,n6,n7']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return ordered entries by custom order and append not defined entries to the end.
|
||||
* @param {String[]} elements
|
||||
* @param {String[]} order
|
||||
* @param {String} splitBy
|
||||
* @return {String[]} Custom ordered list.
|
||||
*/
|
||||
function sortByOrder(elements, order, splitBy) {
|
||||
var results = [];
|
||||
order.forEach (function(name) {
|
||||
if (splitBy)
|
||||
elements.forEach (function(element) {
|
||||
var parts = element.split(splitBy);
|
||||
var key = parts[1]; // reference keep for sorting
|
||||
if (key == name)
|
||||
results.push(element);
|
||||
});
|
||||
else
|
||||
elements.forEach (function(key) {
|
||||
if (key == name)
|
||||
results.push(name);
|
||||
});
|
||||
});
|
||||
// Append all other entries that ar not defined in order
|
||||
elements.forEach(function(element) {
|
||||
if (results.indexOf(element) === -1)
|
||||
results.push(element);
|
||||
});
|
||||
return results;
|
||||
}
|
||||
|
||||
});
|
||||
@ -0,0 +1,357 @@
|
||||
define([
|
||||
'locales',
|
||||
'handlebars',
|
||||
'diffMatchPatch'
|
||||
], function(locale, Handlebars, DiffMatchPatch) {
|
||||
|
||||
/**
|
||||
* Return a text as markdown.
|
||||
* Currently only a little helper to replace apidoc-inline Links (#Group:Name).
|
||||
* Should be replaced with a full markdown lib.
|
||||
* @param string text
|
||||
*/
|
||||
Handlebars.registerHelper('markdown', function(text) {
|
||||
if ( ! text ) {
|
||||
return text;
|
||||
}
|
||||
text = text.replace(/((\[(.*?)\])?\(#)((.+?):(.+?))(\))/mg, function(match, p1, p2, p3, p4, p5, p6) {
|
||||
var link = p3 || p5 + '/' + p6;
|
||||
return '<a href="#api-' + p5 + '-' + p6 + '">' + link + '</a>';
|
||||
});
|
||||
return text;
|
||||
});
|
||||
|
||||
/**
|
||||
* start/stop timer for simple performance check.
|
||||
*/
|
||||
var timer;
|
||||
Handlebars.registerHelper('startTimer', function(text) {
|
||||
timer = new Date();
|
||||
return '';
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('stopTimer', function(text) {
|
||||
console.log(new Date() - timer);
|
||||
return '';
|
||||
});
|
||||
|
||||
/**
|
||||
* Return localized Text.
|
||||
* @param string text
|
||||
*/
|
||||
Handlebars.registerHelper('__', function(text) {
|
||||
return locale.__(text);
|
||||
});
|
||||
|
||||
/**
|
||||
* Console log.
|
||||
* @param mixed obj
|
||||
*/
|
||||
Handlebars.registerHelper('cl', function(obj) {
|
||||
console.log(obj);
|
||||
return '';
|
||||
});
|
||||
|
||||
/**
|
||||
* Replace underscore with space.
|
||||
* @param string text
|
||||
*/
|
||||
Handlebars.registerHelper('underscoreToSpace', function(text) {
|
||||
return text.replace(/(_+)/g, ' ');
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('assign', function(name) {
|
||||
if(arguments.length > 0) {
|
||||
var type = typeof(arguments[1]);
|
||||
var arg = null;
|
||||
if(type === 'string' || type === 'number' || type === 'boolean') arg = arguments[1];
|
||||
Handlebars.registerHelper(name, function() { return arg; });
|
||||
}
|
||||
return '';
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('nl2br', function(text) {
|
||||
return _handlebarsNewlineToBreak(text);
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('if_eq', function(context, options) {
|
||||
var compare = context;
|
||||
// Get length if context is an object
|
||||
if (context instanceof Object && ! (options.hash.compare instanceof Object))
|
||||
compare = Object.keys(context).length;
|
||||
|
||||
if (compare === options.hash.compare)
|
||||
return options.fn(this);
|
||||
|
||||
return options.inverse(this);
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('if_gt', function(context, options) {
|
||||
var compare = context;
|
||||
// Get length if context is an object
|
||||
if (context instanceof Object && ! (options.hash.compare instanceof Object))
|
||||
compare = Object.keys(context).length;
|
||||
|
||||
if(compare > options.hash.compare)
|
||||
return options.fn(this);
|
||||
|
||||
return options.inverse(this);
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
var templateCache = {};
|
||||
Handlebars.registerHelper('subTemplate', function(name, sourceContext) {
|
||||
if ( ! templateCache[name])
|
||||
templateCache[name] = Handlebars.compile($('#template-' + name).html());
|
||||
|
||||
var template = templateCache[name];
|
||||
var templateContext = $.extend({}, this, sourceContext.hash);
|
||||
return new Handlebars.SafeString( template(templateContext) );
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('toLowerCase', function(value) {
|
||||
return (value && typeof value === 'string') ? value.toLowerCase() : '';
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('splitFill', function(value, splitChar, fillChar) {
|
||||
var splits = value.split(splitChar);
|
||||
return new Array(splits.length).join(fillChar) + splits[splits.length - 1];
|
||||
});
|
||||
|
||||
/**
|
||||
* Convert Newline to HTML-Break (nl2br).
|
||||
*
|
||||
* @param {String} text
|
||||
* @returns {String}
|
||||
*/
|
||||
function _handlebarsNewlineToBreak(text) {
|
||||
return ('' + text).replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '<br>' + '$2');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('each_compare_list_field', function(source, compare, options) {
|
||||
var fieldName = options.hash.field;
|
||||
var newSource = [];
|
||||
if (source) {
|
||||
source.forEach(function(entry) {
|
||||
var values = entry;
|
||||
values['key'] = entry[fieldName];
|
||||
newSource.push(values);
|
||||
});
|
||||
}
|
||||
|
||||
var newCompare = [];
|
||||
if (compare) {
|
||||
compare.forEach(function(entry) {
|
||||
var values = entry;
|
||||
values['key'] = entry[fieldName];
|
||||
newCompare.push(values);
|
||||
});
|
||||
}
|
||||
return _handlebarsEachCompared('key', newSource, newCompare, options);
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('each_compare_keys', function(source, compare, options) {
|
||||
var newSource = [];
|
||||
if (source) {
|
||||
var sourceFields = Object.keys(source);
|
||||
sourceFields.forEach(function(name) {
|
||||
var values = {};
|
||||
values['value'] = source[name];
|
||||
values['key'] = name;
|
||||
newSource.push(values);
|
||||
});
|
||||
}
|
||||
|
||||
var newCompare = [];
|
||||
if (compare) {
|
||||
var compareFields = Object.keys(compare);
|
||||
compareFields.forEach(function(name) {
|
||||
var values = {};
|
||||
values['value'] = compare[name];
|
||||
values['key'] = name;
|
||||
newCompare.push(values);
|
||||
});
|
||||
}
|
||||
return _handlebarsEachCompared('key', newSource, newCompare, options);
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('each_compare_field', function(source, compare, options) {
|
||||
return _handlebarsEachCompared('field', source, compare, options);
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('each_compare_title', function(source, compare, options) {
|
||||
return _handlebarsEachCompared('title', source, compare, options);
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('reformat', function(source, type){
|
||||
if (type == 'json')
|
||||
try {
|
||||
return JSON.stringify(JSON.parse(source.trim()),null, " ");
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
return source
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Handlebars.registerHelper('showDiff', function(source, compare, options) {
|
||||
var ds = '';
|
||||
if(source === compare) {
|
||||
ds = source;
|
||||
} else {
|
||||
if( ! source)
|
||||
return compare;
|
||||
|
||||
if( ! compare)
|
||||
return source;
|
||||
|
||||
var d = diffMatchPatch.diff_main(compare, source);
|
||||
diffMatchPatch.diff_cleanupSemantic(d);
|
||||
ds = diffMatchPatch.diff_prettyHtml(d);
|
||||
ds = ds.replace(/¶/gm, '');
|
||||
}
|
||||
if(options === 'nl2br')
|
||||
ds = _handlebarsNewlineToBreak(ds);
|
||||
|
||||
return ds;
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function _handlebarsEachCompared(fieldname, source, compare, options)
|
||||
{
|
||||
var dataList = [];
|
||||
var index = 0;
|
||||
if(source) {
|
||||
source.forEach(function(sourceEntry) {
|
||||
var found = false;
|
||||
if (compare) {
|
||||
compare.forEach(function(compareEntry) {
|
||||
if(sourceEntry[fieldname] === compareEntry[fieldname]) {
|
||||
var data = {
|
||||
typeSame: true,
|
||||
source: sourceEntry,
|
||||
compare: compareEntry,
|
||||
index: index
|
||||
};
|
||||
dataList.push(data);
|
||||
found = true;
|
||||
index++;
|
||||
}
|
||||
});
|
||||
}
|
||||
if ( ! found) {
|
||||
var data = {
|
||||
typeIns: true,
|
||||
source: sourceEntry,
|
||||
index: index
|
||||
};
|
||||
dataList.push(data);
|
||||
index++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (compare) {
|
||||
compare.forEach(function(compareEntry) {
|
||||
var found = false;
|
||||
if (source) {
|
||||
source.forEach(function(sourceEntry) {
|
||||
if(sourceEntry[fieldname] === compareEntry[fieldname])
|
||||
found = true;
|
||||
});
|
||||
}
|
||||
if ( ! found) {
|
||||
var data = {
|
||||
typeDel: true,
|
||||
compare: compareEntry,
|
||||
index: index
|
||||
};
|
||||
dataList.push(data);
|
||||
index++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var ret = '';
|
||||
var length = dataList.length;
|
||||
for (var index in dataList) {
|
||||
if(index == (length - 1))
|
||||
dataList[index]['_last'] = true;
|
||||
ret = ret + options.fn(dataList[index]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
var diffMatchPatch = new DiffMatchPatch();
|
||||
|
||||
/**
|
||||
* Overwrite Colors
|
||||
*/
|
||||
DiffMatchPatch.prototype.diff_prettyHtml = function(diffs) {
|
||||
var html = [];
|
||||
var pattern_amp = /&/g;
|
||||
var pattern_lt = /</g;
|
||||
var pattern_gt = />/g;
|
||||
var pattern_para = /\n/g;
|
||||
for (var x = 0; x < diffs.length; x++) {
|
||||
var op = diffs[x][0]; // Operation (insert, delete, equal)
|
||||
var data = diffs[x][1]; // Text of change.
|
||||
var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')
|
||||
.replace(pattern_gt, '>').replace(pattern_para, '¶<br>');
|
||||
switch (op) {
|
||||
case DIFF_INSERT:
|
||||
html[x] = '<ins>' + text + '</ins>';
|
||||
break;
|
||||
case DIFF_DELETE:
|
||||
html[x] = '<del>' + text + '</del>';
|
||||
break;
|
||||
case DIFF_EQUAL:
|
||||
html[x] = '<span>' + text + '</span>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
return html.join('');
|
||||
};
|
||||
|
||||
// Exports
|
||||
return Handlebars;
|
||||
});
|
||||
@ -0,0 +1,184 @@
|
||||
define([
|
||||
'jquery',
|
||||
'lodash'
|
||||
], function($, _) {
|
||||
|
||||
var initDynamic = function() {
|
||||
// Button send
|
||||
$(".sample-request-send").off("click");
|
||||
$(".sample-request-send").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
var $root = $(this).parents("article");
|
||||
var group = $root.data("group");
|
||||
var name = $root.data("name");
|
||||
var version = $root.data("version");
|
||||
sendSampleRequest(group, name, version, $(this).data("sample-request-type"));
|
||||
});
|
||||
|
||||
// Button clear
|
||||
$(".sample-request-clear").off("click");
|
||||
$(".sample-request-clear").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
var $root = $(this).parents("article");
|
||||
var group = $root.data("group");
|
||||
var name = $root.data("name");
|
||||
var version = $root.data("version");
|
||||
clearSampleRequest(group, name, version);
|
||||
});
|
||||
}; // initDynamic
|
||||
|
||||
function sendSampleRequest(group, name, version, type)
|
||||
{
|
||||
var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]');
|
||||
|
||||
// Optional header
|
||||
var header = {};
|
||||
$root.find(".sample-request-header:checked").each(function(i, element) {
|
||||
var group = $(element).data("sample-request-header-group-id");
|
||||
$root.find("[data-sample-request-header-group=\"" + group + "\"]").each(function(i, element) {
|
||||
var key = $(element).data("sample-request-header-name");
|
||||
var value = element.value;
|
||||
if ( ! element.optional && element.defaultValue !== '') {
|
||||
value = element.defaultValue;
|
||||
}
|
||||
header[key] = value;
|
||||
});
|
||||
});
|
||||
|
||||
// create JSON dictionary of parameters
|
||||
var param = {};
|
||||
var paramType = {};
|
||||
$root.find(".sample-request-param:checked").each(function(i, element) {
|
||||
var group = $(element).data("sample-request-param-group-id");
|
||||
$root.find("[data-sample-request-param-group=\"" + group + "\"]").not(function(){
|
||||
return $(this).val() == "" && $(this).is("[data-sample-request-param-optional='true']");
|
||||
}).each(function(i, element) {
|
||||
var key = $(element).data("sample-request-param-name");
|
||||
var value = element.value;
|
||||
if ( ! element.optional && element.defaultValue !== '') {
|
||||
value = element.defaultValue;
|
||||
}
|
||||
param[key] = value;
|
||||
paramType[key] = $(element).next().text();
|
||||
});
|
||||
});
|
||||
|
||||
// grab user-inputted URL
|
||||
var url = $root.find(".sample-request-url").val();
|
||||
|
||||
// Insert url parameter
|
||||
var pattern = pathToRegexp(url, null);
|
||||
var matches = pattern.exec(url);
|
||||
for (var i = 1; i < matches.length; i++) {
|
||||
var key = matches[i].substr(1);
|
||||
if (param[key] !== undefined) {
|
||||
url = url.replace(matches[i], encodeURIComponent(param[key]));
|
||||
|
||||
// remove URL parameters from list
|
||||
delete param[key];
|
||||
}
|
||||
} // for
|
||||
|
||||
$root.find(".sample-request-response").fadeTo(250, 1);
|
||||
$root.find(".sample-request-response-json").html("Loading...");
|
||||
refreshScrollSpy();
|
||||
|
||||
_.each( param, function( val, key ) {
|
||||
var t = paramType[ key ].toLowerCase();
|
||||
if ( t === 'object' || t === 'array' ) {
|
||||
try {
|
||||
param[ key ] = JSON.parse( val );
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// send AJAX request, catch success or error callback
|
||||
var ajaxRequest = {
|
||||
url : url,
|
||||
headers : header,
|
||||
data : param,
|
||||
type : type.toUpperCase(),
|
||||
success : displaySuccess,
|
||||
error : displayError
|
||||
};
|
||||
|
||||
$.ajax(ajaxRequest);
|
||||
|
||||
|
||||
function displaySuccess(data, status, jqXHR) {
|
||||
var jsonResponse;
|
||||
try {
|
||||
jsonResponse = JSON.parse(jqXHR.responseText);
|
||||
jsonResponse = JSON.stringify(jsonResponse, null, 4);
|
||||
} catch (e) {
|
||||
jsonResponse = data;
|
||||
}
|
||||
$root.find(".sample-request-response-json").html(jsonResponse);
|
||||
refreshScrollSpy();
|
||||
};
|
||||
|
||||
function displayError(jqXHR, textStatus, error) {
|
||||
var message = "Error " + jqXHR.status + ": " + error;
|
||||
var jsonResponse;
|
||||
try {
|
||||
jsonResponse = JSON.parse(jqXHR.responseText);
|
||||
jsonResponse = JSON.stringify(jsonResponse, null, 4);
|
||||
} catch (e) {
|
||||
jsonResponse = escape(jqXHR.responseText);
|
||||
}
|
||||
|
||||
if (jsonResponse)
|
||||
message += "<br>" + jsonResponse;
|
||||
|
||||
// flicker on previous error to make clear that there is a new response
|
||||
if($root.find(".sample-request-response").is(":visible"))
|
||||
$root.find(".sample-request-response").fadeTo(1, 0.1);
|
||||
|
||||
$root.find(".sample-request-response").fadeTo(250, 1);
|
||||
$root.find(".sample-request-response-json").html(message);
|
||||
refreshScrollSpy();
|
||||
};
|
||||
}
|
||||
|
||||
function clearSampleRequest(group, name, version)
|
||||
{
|
||||
var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]');
|
||||
|
||||
// hide sample response
|
||||
$root.find(".sample-request-response-json").html("");
|
||||
$root.find(".sample-request-response").hide();
|
||||
|
||||
// reset value of parameters
|
||||
$root.find(".sample-request-param").each(function(i, element) {
|
||||
element.value = "";
|
||||
});
|
||||
|
||||
// restore default URL
|
||||
var $urlElement = $root.find(".sample-request-url");
|
||||
$urlElement.val($urlElement.prop("defaultValue"));
|
||||
|
||||
refreshScrollSpy();
|
||||
}
|
||||
|
||||
function refreshScrollSpy()
|
||||
{
|
||||
$('[data-spy="scroll"]').each(function () {
|
||||
$(this).scrollspy("refresh");
|
||||
});
|
||||
}
|
||||
|
||||
function escapeHtml(str) {
|
||||
var div = document.createElement("div");
|
||||
div.appendChild(document.createTextNode(str));
|
||||
return div.innerHTML;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports.
|
||||
*/
|
||||
return {
|
||||
initDynamic: initDynamic
|
||||
};
|
||||
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,49 @@
|
||||
(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32}
|
||||
diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a,
|
||||
b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a};
|
||||
diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100<a.length&&100<b.length?this.diff_lineMode_(a,b,
|
||||
d):this.diff_bisect_(a,b,d)};
|
||||
diff_match_patch.prototype.diff_lineMode_=function(a,b,c){var d=this.diff_linesToChars_(a,b);a=d.chars1;b=d.chars2;d=d.lineArray;a=this.diff_main(a,b,!1,c);this.diff_charsToLines_(a,d);this.diff_cleanupSemantic(a);a.push([0,""]);for(var e=d=b=0,f="",g="";b<a.length;){switch(a[b][0]){case 1:e++;g+=a[b][1];break;case -1:d++;f+=a[b][1];break;case 0:if(1<=d&&1<=e){a.splice(b-d-e,d+e);b=b-d-e;d=this.diff_main(f,g,!1,c);for(e=d.length-1;0<=e;e--)a.splice(b,0,d[e]);b+=d.length}d=e=0;g=f=""}b++}a.pop();return a};
|
||||
diff_match_patch.prototype.diff_bisect_=function(a,b,c){for(var d=a.length,e=b.length,f=Math.ceil((d+e)/2),g=f,h=2*f,j=Array(h),i=Array(h),k=0;k<h;k++)j[k]=-1,i[k]=-1;j[g+1]=0;i[g+1]=0;for(var k=d-e,q=0!=k%2,r=0,t=0,p=0,w=0,v=0;v<f&&!((new Date).getTime()>c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]<j[l+1]?j[l+1]:j[l-1]+1;for(var s=m-n;m<d&&s<e&&a.charAt(m)==b.charAt(s);)m++,s++;j[l]=m;if(m>d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l<h&&-1!=i[l])){var u=d-i[l];if(m>=
|
||||
u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]<i[l+1]?i[l+1]:i[l-1]+1;for(m=u-n;u<d&&m<e&&a.charAt(d-u-1)==b.charAt(e-m-1);)u++,m++;i[l]=u;if(u>d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l<h&&-1!=j[l])&&(m=j[l],s=g+m-l,u=d-u,m>=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]};
|
||||
diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)};
|
||||
diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;f<a.length-1;){f=a.indexOf("\n",c);-1==f&&(f=a.length-1);var r=a.substring(c,f+1),c=f+1;(e.hasOwnProperty?e.hasOwnProperty(r):void 0!==e[r])?b+=String.fromCharCode(e[r]):(b+=String.fromCharCode(g),e[r]=g,d[g++]=r)}return b}var d=[],e={};d[0]="";var f=c(a),g=c(b);return{chars1:f,chars2:g,lineArray:d}};
|
||||
diff_match_patch.prototype.diff_charsToLines_=function(a,b){for(var c=0;c<a.length;c++){for(var d=a[c][1],e=[],f=0;f<d.length;f++)e[f]=b[d.charCodeAt(f)];a[c][1]=e.join("")}};diff_match_patch.prototype.diff_commonPrefix=function(a,b){if(!a||!b||a.charAt(0)!=b.charAt(0))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(f,e)==b.substring(f,e)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
||||
diff_match_patch.prototype.diff_commonSuffix=function(a,b){if(!a||!b||a.charAt(a.length-1)!=b.charAt(b.length-1))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(a.length-e,a.length-f)==b.substring(b.length-e,b.length-f)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
||||
diff_match_patch.prototype.diff_commonOverlap_=function(a,b){var c=a.length,d=b.length;if(0==c||0==d)return 0;c>d?a=a.substring(c-d):c<d&&(b=b.substring(0,c));c=Math.min(c,d);if(a==b)return c;for(var d=0,e=1;;){var f=a.substring(c-e),f=b.indexOf(f);if(-1==f)return d;e+=f;if(0==f||a.substring(c-e)==b.substring(0,e))d=e,e++}};
|
||||
diff_match_patch.prototype.diff_halfMatch_=function(a,b){function c(a,b,c){for(var d=a.substring(c,c+Math.floor(a.length/4)),e=-1,g="",h,j,n,l;-1!=(e=b.indexOf(d,e+1));){var m=f.diff_commonPrefix(a.substring(c),b.substring(e)),s=f.diff_commonSuffix(a.substring(0,c),b.substring(0,e));g.length<s+m&&(g=b.substring(e-s,e)+b.substring(e,e+m),h=a.substring(0,c-s),j=a.substring(c+m),n=b.substring(0,e-s),l=b.substring(e+m))}return 2*g.length>=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null;
|
||||
var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.length<d.length)return null;var f=this,g=c(d,e,Math.ceil(d.length/4)),d=c(d,e,Math.ceil(d.length/2)),h;if(!g&&!d)return null;h=d?g?g[4].length>d[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]};
|
||||
diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f<a.length;)0==a[f][0]?(c[d++]=f,g=j,h=i,i=j=0,e=a[f][1]):(1==a[f][0]?j+=a[f][1].length:i+=a[f][1].length,e&&(e.length<=Math.max(g,h)&&e.length<=Math.max(j,i))&&(a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,d--,f=0<d?c[d-1]:-1,i=j=h=g=0,e=null,b=!0)),f++;b&&this.diff_cleanupMerge(a);this.diff_cleanupSemanticLossless(a);for(f=1;f<a.length;){if(-1==a[f-1][0]&&1==a[f][0]){b=a[f-1][1];c=a[f][1];
|
||||
d=this.diff_commonOverlap_(b,c);e=this.diff_commonOverlap_(c,b);if(d>=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}};
|
||||
diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_);
|
||||
return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c<a.length-1;){if(0==a[c-1][0]&&0==a[c+1][0]){var d=a[c-1][1],e=a[c][1],f=a[c+1][1],g=this.diff_commonSuffix(d,e);if(g)var h=e.substring(e.length-g),d=d.substring(0,d.length-g),e=h+e.substring(0,e.length-g),f=h+f;for(var g=d,h=e,j=f,i=b(d,e)+b(e,f);e.charAt(0)===f.charAt(0);){var d=d+e.charAt(0),e=e.substring(1)+f.charAt(0),f=f.substring(1),k=b(d,e)+b(e,f);k>=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]=
|
||||
h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/;
|
||||
diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;f<a.length;){if(0==a[f][0])a[f][1].length<this.Diff_EditCost&&(j||i)?(c[d++]=f,g=j,h=i,e=a[f][1]):(d=0,e=null),j=i=!1;else if(-1==a[f][0]?i=!0:j=!0,e&&(g&&h&&j&&i||e.length<this.Diff_EditCost/2&&3==g+h+j+i))a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,e=null,g&&h?(j=i=!0,d=0):(d--,f=0<d?c[d-1]:-1,j=i=!1),b=!0;f++}b&&this.diff_cleanupMerge(a)};
|
||||
diff_match_patch.prototype.diff_cleanupMerge=function(a){a.push([0,""]);for(var b=0,c=0,d=0,e="",f="",g;b<a.length;)switch(a[b][0]){case 1:d++;f+=a[b][1];b++;break;case -1:c++;e+=a[b][1];b++;break;case 0:1<c+d?(0!==c&&0!==d&&(g=this.diff_commonPrefix(f,e),0!==g&&(0<b-c-d&&0==a[b-c-d-1][0]?a[b-c-d-1][1]+=f.substring(0,g):(a.splice(0,0,[0,f.substring(0,g)]),b++),f=f.substring(g),e=e.substring(g)),g=this.diff_commonSuffix(f,e),0!==g&&(a[b][1]=f.substring(f.length-g)+a[b][1],f=f.substring(0,f.length-
|
||||
g),e=e.substring(0,e.length-g))),0===c?a.splice(b-d,c+d,[1,f]):0===d?a.splice(b-c,c+d,[-1,e]):a.splice(b-c-d,c+d,[-1,e],[1,f]),b=b-c-d+(c?1:0)+(d?1:0)+1):0!==b&&0==a[b-1][0]?(a[b-1][1]+=a[b][1],a.splice(b,1)):b++,c=d=0,f=e=""}""===a[a.length-1][1]&&a.pop();c=!1;for(b=1;b<a.length-1;)0==a[b-1][0]&&0==a[b+1][0]&&(a[b][1].substring(a[b][1].length-a[b-1][1].length)==a[b-1][1]?(a[b][1]=a[b-1][1]+a[b][1].substring(0,a[b][1].length-a[b-1][1].length),a[b+1][1]=a[b-1][1]+a[b+1][1],a.splice(b-1,1),c=!0):a[b][1].substring(0,
|
||||
a[b+1][1].length)==a[b+1][1]&&(a[b-1][1]+=a[b+1][1],a[b][1]=a[b][1].substring(a[b+1][1].length)+a[b+1][1],a.splice(b+1,1),c=!0)),b++;c&&this.diff_cleanupMerge(a)};diff_match_patch.prototype.diff_xIndex=function(a,b){var c=0,d=0,e=0,f=0,g;for(g=0;g<a.length;g++){1!==a[g][0]&&(c+=a[g][1].length);-1!==a[g][0]&&(d+=a[g][1].length);if(c>b)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)};
|
||||
diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=/</g,e=/>/g,f=/\n/g,g=0;g<a.length;g++){var h=a[g][0],j=a[g][1],j=j.replace(c,"&").replace(d,"<").replace(e,">").replace(f,"¶<br>");switch(h){case 1:b[g]='<ins style="background:#e6ffe6;">'+j+"</ins>";break;case -1:b[g]='<del style="background:#ffe6e6;">'+j+"</del>";break;case 0:b[g]="<span>"+j+"</span>"}}return b.join("")};
|
||||
diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;c<a.length;c++)1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_text2=function(a){for(var b=[],c=0;c<a.length;c++)-1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_levenshtein=function(a){for(var b=0,c=0,d=0,e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];switch(f){case 1:c+=g.length;break;case -1:d+=g.length;break;case 0:b+=Math.max(c,d),d=c=0}}return b+=Math.max(c,d)};
|
||||
diff_match_patch.prototype.diff_toDelta=function(a){for(var b=[],c=0;c<a.length;c++)switch(a[c][0]){case 1:b[c]="+"+encodeURI(a[c][1]);break;case -1:b[c]="-"+a[c][1].length;break;case 0:b[c]="="+a[c][1].length}return b.join("\t").replace(/%20/g," ")};
|
||||
diff_match_patch.prototype.diff_fromDelta=function(a,b){for(var c=[],d=0,e=0,f=b.split(/\t/g),g=0;g<f.length;g++){var h=f[g].substring(1);switch(f[g].charAt(0)){case "+":try{c[d++]=[1,decodeURI(h)]}catch(j){throw Error("Illegal escape in diff_fromDelta: "+h);}break;case "-":case "=":var i=parseInt(h,10);if(isNaN(i)||0>i)throw Error("Invalid number in diff_fromDelta: "+h);h=a.substring(e,e+=i);"="==f[g].charAt(0)?c[d++]=[0,h]:c[d++]=[-1,h];break;default:if(f[g])throw Error("Invalid diff operation in diff_fromDelta: "+
|
||||
f[g]);}}if(e!=a.length)throw Error("Delta length ("+e+") does not equal source text length ("+a.length+").");return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error("Null input. (match_main)");c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1};
|
||||
diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<<b.length-1,h=-1,i,k,q=b.length+a.length,r,t=0;t<b.length;t++){i=0;for(k=q;i<k;)d(t,c+
|
||||
k)<=g?i=k:q=k,k=Math.floor((q-i)/2+i);q=k;i=Math.max(1,c-k+1);var p=Math.min(c+k,a.length)+b.length;k=Array(p+2);for(k[p+1]=(1<<t)-1;p>=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h};
|
||||
diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=0;for(c=0;c<a.length;c++)b[a.charAt(c)]|=1<<a.length-c-1;return b};
|
||||
diff_match_patch.prototype.patch_addContext_=function(a,b){if(0!=b.length){for(var c=b.substring(a.start2,a.start2+a.length1),d=0;b.indexOf(c)!=b.lastIndexOf(c)&&c.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)d+=this.Patch_Margin,c=b.substring(a.start2-d,a.start2+a.length1+d);d+=this.Patch_Margin;(c=b.substring(a.start2-d,a.start2))&&a.diffs.unshift([0,c]);(d=b.substring(a.start2+a.length1,a.start2+a.length1+d))&&a.diffs.push([0,d]);a.start1-=c.length;a.start2-=c.length;a.length1+=
|
||||
c.length+d.length;a.length2+=c.length+d.length}};
|
||||
diff_match_patch.prototype.patch_make=function(a,b,c){var d;if("string"==typeof a&&"string"==typeof b&&"undefined"==typeof c)d=a,b=this.diff_main(d,b,!0),2<b.length&&(this.diff_cleanupSemantic(b),this.diff_cleanupEfficiency(b));else if(a&&"object"==typeof a&&"undefined"==typeof b&&"undefined"==typeof c)b=a,d=this.diff_text1(b);else if("string"==typeof a&&b&&"object"==typeof b&&"undefined"==typeof c)d=a;else if("string"==typeof a&&"string"==typeof b&&c&&"object"==typeof c)d=a,b=c;else throw Error("Unknown call format to patch_make.");
|
||||
if(0===b.length)return[];c=[];a=new diff_match_patch.patch_obj;for(var e=0,f=0,g=0,h=d,j=0;j<b.length;j++){var i=b[j][0],k=b[j][1];!e&&0!==i&&(a.start1=f,a.start2=g);switch(i){case 1:a.diffs[e++]=b[j];a.length2+=k.length;d=d.substring(0,g)+k+d.substring(g);break;case -1:a.length1+=k.length;a.diffs[e++]=b[j];d=d.substring(0,g)+d.substring(g+k.length);break;case 0:k.length<=2*this.Patch_Margin&&e&&b.length!=j+1?(a.diffs[e++]=b[j],a.length1+=k.length,a.length2+=k.length):k.length>=2*this.Patch_Margin&&
|
||||
e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=new diff_match_patch.patch_obj;e.diffs=[];for(var f=0;f<d.diffs.length;f++)e.diffs[f]=d.diffs[f].slice();e.start1=d.start1;e.start2=d.start2;e.length1=d.length1;e.length2=d.length2;b[c]=e}return b};
|
||||
diff_match_patch.prototype.patch_apply=function(a,b){if(0==a.length)return[b,[]];a=this.patch_deepCopy(a);var c=this.patch_addPadding(a);b=c+b+c;this.patch_splitMax(a);for(var d=0,e=[],f=0;f<a.length;f++){var g=a[f].start2+d,h=this.diff_text1(a[f].diffs),j,i=-1;if(h.length>this.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g);
|
||||
if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;i<a[f].diffs.length;i++){var q=a[f].diffs[i];0!==q[0]&&(k=this.diff_xIndex(g,h));1===q[0]?b=b.substring(0,
|
||||
j+k)+q[1]+b.substring(j+k):-1===q[0]&&(b=b.substring(0,j+k)+b.substring(j+this.diff_xIndex(g,h+q[1].length)));-1!==q[0]&&(h+=q[1].length)}}}b=b.substring(c.length,b.length-c.length);return[b,e]};
|
||||
diff_match_patch.prototype.patch_addPadding=function(a){for(var b=this.Patch_Margin,c="",d=1;d<=b;d++)c+=String.fromCharCode(d);for(d=0;d<a.length;d++)a[d].start1+=b,a[d].start2+=b;var d=a[0],e=d.diffs;if(0==e.length||0!=e[0][0])e.unshift([0,c]),d.start1-=b,d.start2-=b,d.length1+=b,d.length2+=b;else if(b>e[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0,
|
||||
c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c};
|
||||
diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c<a.length;c++)if(!(a[c].length1<=b)){var d=a[c];a.splice(c--,1);for(var e=d.start1,f=d.start2,g="";0!==d.diffs.length;){var h=new diff_match_patch.patch_obj,j=!0;h.start1=e-g.length;h.start2=f-g.length;""!==g&&(h.length1=h.length2=g.length,h.diffs.push([0,g]));for(;0!==d.diffs.length&&h.length1<b-this.Patch_Margin;){var g=d.diffs[0][0],i=d.diffs[0][1];1===g?(h.length2+=i.length,f+=i.length,h.diffs.push(d.diffs.shift()),
|
||||
j=!1):-1===g&&1==h.diffs.length&&0==h.diffs[0][0]&&i.length>2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&&
|
||||
(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b.join("")};
|
||||
diff_match_patch.prototype.patch_fromText=function(a){var b=[];if(!a)return b;a=a.split("\n");for(var c=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;c<a.length;){var e=a[c].match(d);if(!e)throw Error("Invalid patch string: "+a[c]);var f=new diff_match_patch.patch_obj;b.push(f);f.start1=parseInt(e[1],10);""===e[2]?(f.start1--,f.length1=1):"0"==e[2]?f.length1=0:(f.start1--,f.length1=parseInt(e[2],10));f.start2=parseInt(e[3],10);""===e[4]?(f.start2--,f.length2=1):"0"==e[4]?f.length2=0:(f.start2--,f.length2=
|
||||
parseInt(e[4],10));for(c++;c<a.length;){e=a[c].charAt(0);try{var g=decodeURI(a[c].substring(1))}catch(h){throw Error("Illegal escape in patch_fromText: "+g);}if("-"==e)f.diffs.push([-1,g]);else if("+"==e)f.diffs.push([1,g]);else if(" "==e)f.diffs.push([0,g]);else if("@"==e)break;else if(""!==e)throw Error('Invalid patch mode "'+e+'" in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0};
|
||||
diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;b=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;a=["@@ -"+a+" +"+b+" @@\n"];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[b][0]){case 1:c="+";break;case -1:c="-";break;case 0:c=" "}a[b+1]=c+encodeURI(this.diffs[b][1])+"\n"}return a.join("").replace(/%20/g," ")};
|
||||
this.diff_match_patch=diff_match_patch;this.DIFF_DELETE=-1;this.DIFF_INSERT=1;this.DIFF_EQUAL=0;})()
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @license
|
||||
* Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
* Build: `lodash -p -o template/vendor/lodash.custom.min.js include="groupBy,each,extend,some" exports="amd"`
|
||||
*/
|
||||
;(function(){function t(t,e){return t.set(e[0],e[1]),t}function e(t,e){return t.add(e),t}function r(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function n(t,e,r,n){for(var o=-1,c=null==t?0:t.length;++o<c;){var u=t[o];e(n,u,r(u),t)}return n}function o(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&false!==e(t[r],r,t););return t}function c(t,e){for(var r=-1,n=null==t?0:t.length,o=0,c=[];++r<n;){
|
||||
var u=t[r];e(u,r,t)&&(c[o++]=u)}return c}function u(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function i(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)r=e(r,t[n],n,t);return r}function a(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return true;return false}function f(t){return function(e){return null==e?Bt:e[t]}}function s(t){return function(e){return t(e)}}function l(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function b(t){var e=Object;
|
||||
return function(r){return t(e(r))}}function h(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}function p(){}function y(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function j(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function _(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function g(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new _;++e<r;)this.add(t[e]);
|
||||
}function v(t){this.size=(this.__data__=new j(t)).size}function d(t,e){var r=Je(t),n=!r&&He(t),o=!r&&!n&&Ke(t),c=!r&&!n&&!o&&Qe(t);if(r=r||n||o||c){for(var n=t.length,u=String,i=-1,a=Array(n);++i<n;)a[i]=u(i);n=a}else n=[];var f,u=n.length;for(f in t)!e&&!oe.call(t,f)||r&&("length"==f||o&&("offset"==f||"parent"==f)||c&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||ct(f,u))||n.push(f);return n}function A(t,e,r){var n=t[e];oe.call(t,e)&&yt(n,r)&&(r!==Bt||e in t)||z(t,e,r)}function w(t,e){for(var r=t.length;r--;)if(yt(t[r][0],e))return r;
|
||||
return-1}function m(t,e,r,n){return Pe(t,function(t,o,c){e(n,t,r(t),c)}),n}function O(t,e){return t&&q(e,St(e),t)}function S(t,e){return t&&q(e,zt(e),t)}function z(t,e,r){"__proto__"==e&&_e?_e(t,e,{configurable:true,enumerable:true,value:r,writable:true}):t[e]=r}function k(t,e,r,n,c,u){var i,a=1&e,f=2&e,s=4&e;if(r&&(i=c?r(t,n,c,u):r(t)),i!==Bt)return i;if(!vt(t))return t;if(n=Je(t)){if(i=nt(t),!a)return G(t,i)}else{var l=Ne(t),b="[object Function]"==l||"[object GeneratorFunction]"==l;if(Ke(t))return N(t,a);
|
||||
if("[object Object]"==l||"[object Arguments]"==l||b&&!c){if(i=f||b?{}:typeof t.constructor!="function"||at(t)?{}:Le(be(t)),!a)return f?J(t,S(i,t)):H(t,O(i,t))}else{if(!Wt[l])return c?t:{};i=ot(t,l,k,a)}}if(u||(u=new v),c=u.get(t))return c;u.set(t,i);var f=s?f?Y:X:f?zt:St,h=n?Bt:f(t);return o(h||t,function(n,o){h&&(o=n,n=t[o]),A(i,o,k(n,e,r,o,t,u))}),i}function x(t,e){e=C(e,t);for(var r=0,n=e.length;null!=t&&r<n;)t=t[lt(e[r++])];return r&&r==n?t:Bt}function F(t,e,r){return e=e(t),Je(t)?e:u(e,r(t));
|
||||
}function I(t){if(null==t)t=t===Bt?"[object Undefined]":"[object Null]";else if(je&&je in Object(t)){var e=oe.call(t,je),r=t[je];try{t[je]=Bt;var n=true}catch(t){}var o=ue.call(t);n&&(e?t[je]=r:delete t[je]),t=o}else t=ue.call(t);return t}function E(t){return dt(t)&&"[object Arguments]"==I(t)}function U(t,e,r,n,o){if(t===e)e=true;else if(null==t||null==e||!dt(t)&&!dt(e))e=t!==t&&e!==e;else t:{var c=Je(t),u=Je(e),i=c?"[object Array]":Ne(t),a=u?"[object Array]":Ne(e),i="[object Arguments]"==i?"[object Object]":i,a="[object Arguments]"==a?"[object Object]":a,f="[object Object]"==i,u="[object Object]"==a;
|
||||
if((a=i==a)&&Ke(t)){if(!Ke(e)){e=false;break t}c=true,f=false}if(a&&!f)o||(o=new v),e=c||Qe(t)?K(t,e,r,n,U,o):Q(t,e,i,r,n,U,o);else{if(!(1&r)&&(c=f&&oe.call(t,"__wrapped__"),i=u&&oe.call(e,"__wrapped__"),c||i)){t=c?t.value():t,e=i?e.value():e,o||(o=new v),e=U(t,e,r,n,o);break t}if(a)e:if(o||(o=new v),c=1&r,i=X(t),u=i.length,a=X(e).length,u==a||c){for(f=u;f--;){var s=i[f];if(!(c?s in e:oe.call(e,s))){e=false;break e}}if((a=o.get(t))&&o.get(e))e=a==e;else{a=true,o.set(t,e),o.set(e,t);for(var l=c;++f<u;){var s=i[f],b=t[s],h=e[s];
|
||||
if(n)var p=c?n(h,b,s,e,t,o):n(b,h,s,t,e,o);if(p===Bt?b!==h&&!U(b,h,r,n,o):!p){a=false;break}l||(l="constructor"==s)}a&&!l&&(r=t.constructor,n=e.constructor,r!=n&&"constructor"in t&&"constructor"in e&&!(typeof r=="function"&&r instanceof r&&typeof n=="function"&&n instanceof n)&&(a=false)),o.delete(t),o.delete(e),e=a}}else e=false;else e=false}}return e}function B(t,e){var r=e.length,n=r;if(null==t)return!n;for(t=Object(t);r--;){var o=e[r];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return false}for(;++r<n;){var o=e[r],c=o[0],u=t[c],i=o[1];
|
||||
if(o[2]){if(u===Bt&&!(c in t))return false}else if(o=new v,void 0===Bt?!U(i,u,3,void 0,o):1)return false}return true}function M(t){return dt(t)&>(t.length)&&!!Nt[I(t)]}function D(t){return typeof t=="function"?t:null==t?xt:typeof t=="object"?Je(t)?L(t[0],t[1]):$(t):It(t)}function $(t){var e=et(t);return 1==e.length&&e[0][2]?ft(e[0][0],e[0][1]):function(r){return r===t||B(r,e)}}function L(t,e){return it(t)&&e===e&&!vt(e)?ft(lt(t),e):function(r){var n=mt(r,t);return n===Bt&&n===e?Ot(r,t):U(e,n,3)}}function P(t){
|
||||
return function(e){return x(e,t)}}function V(t){return We(st(t,xt),t+"")}function R(t,e){var r;return Pe(t,function(t,n,o){return r=e(t,n,o),!r}),!!r}function T(t){if(typeof t=="string")return t;if(Je(t)){for(var e=T,r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o+""}return At(t)?$e?$e.call(t):"":(e=t+"","0"==e&&1/t==-Mt?"-0":e)}function C(t,e){return Je(t)?t:it(t,e)?[t]:Ge(wt(t))}function N(t,e){if(e)return t.slice();var r=t.length,r=le?le(r):new t.constructor(r);return t.copy(r),
|
||||
r}function W(t){var e=new t.constructor(t.byteLength);return new se(e).set(new se(t)),e}function G(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function q(t,e,r){var n=!r;r||(r={});for(var o=-1,c=e.length;++o<c;){var u=e[o],i=Bt;i===Bt&&(i=t[u]),n?z(r,u,i):A(r,u,i)}return r}function H(t,e){return q(t,Te(t),e)}function J(t,e){return q(t,Ce(t),e)}function K(t,e,r,n,o,c){var u=1&r,i=t.length,f=e.length;if(i!=f&&!(u&&f>i))return false;if((f=c.get(t))&&c.get(e))return f==e;var f=-1,s=true,l=2&r?new g:Bt;
|
||||
for(c.set(t,e),c.set(e,t);++f<i;){var b=t[f],h=e[f];if(n)var p=u?n(h,b,f,e,t,c):n(b,h,f,t,e,c);if(p!==Bt){if(p)continue;s=false;break}if(l){if(!a(e,function(t,e){if(!l.has(e)&&(b===t||o(b,t,r,n,c)))return l.push(e)})){s=false;break}}else if(b!==h&&!o(b,h,r,n,c)){s=false;break}}return c.delete(t),c.delete(e),s}function Q(t,e,r,n,o,c,u){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)break;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":if(t.byteLength!=e.byteLength||!c(new se(t),new se(e)))break;
|
||||
return true;case"[object Boolean]":case"[object Date]":case"[object Number]":return yt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var i=l;case"[object Set]":if(i||(i=h),t.size!=e.size&&!(1&n))break;return(r=u.get(t))?r==e:(n|=2,u.set(t,e),e=K(i(t),i(e),n,o,c,u),u.delete(t),e);case"[object Symbol]":if(De)return De.call(t)==De.call(e)}return false}function X(t){return F(t,St,Te)}function Y(t){return F(t,zt,Ce);
|
||||
}function Z(){var t=p.iteratee||Ft,t=t===Ft?D:t;return arguments.length?t(arguments[0],arguments[1]):t}function tt(t,e){var r=t.__data__,n=typeof e;return("string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e)?r[typeof e=="string"?"string":"hash"]:r.map}function et(t){for(var e=St(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,o===o&&!vt(o)]}return e}function rt(t,e){var r=null==t?Bt:t[e];return(!vt(r)||ce&&ce in r?0:(_t(r)?ie:Tt).test(bt(r)))?r:Bt}function nt(t){var e=t.length,r=t.constructor(e);
|
||||
return e&&"string"==typeof t[0]&&oe.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function ot(r,n,o,c){var u=r.constructor;switch(n){case"[object ArrayBuffer]":return W(r);case"[object Boolean]":case"[object Date]":return new u(+r);case"[object DataView]":return n=c?W(r.buffer):r.buffer,new r.constructor(n,r.byteOffset,r.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":
|
||||
case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return n=c?W(r.buffer):r.buffer,new r.constructor(n,r.byteOffset,r.length);case"[object Map]":return n=c?o(l(r),1):l(r),i(n,t,new r.constructor);case"[object Number]":case"[object String]":return new u(r);case"[object RegExp]":return n=new r.constructor(r.source,Rt.exec(r)),n.lastIndex=r.lastIndex,n;case"[object Set]":return n=c?o(h(r),1):h(r),i(n,e,new r.constructor);case"[object Symbol]":return De?Object(De.call(r)):{};
|
||||
}}function ct(t,e){return e=null==e?9007199254740991:e,!!e&&(typeof t=="number"||Ct.test(t))&&-1<t&&0==t%1&&t<e}function ut(t,e,r){if(!vt(r))return false;var n=typeof e;return!!("number"==n?jt(r)&&ct(e,r.length):"string"==n&&e in r)&&yt(r[e],t)}function it(t,e){if(Je(t))return false;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!At(t))||($t.test(t)||!Dt.test(t)||null!=e&&t in Object(e))}function at(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||ee)}function ft(t,e){
|
||||
return function(r){return null!=r&&(r[t]===e&&(e!==Bt||t in Object(r)))}}function st(t,e){var n=void 0,n=Ae(n===Bt?t.length-1:n,0);return function(){for(var o=arguments,c=-1,u=Ae(o.length-n,0),i=Array(u);++c<u;)i[c]=o[n+c];for(c=-1,u=Array(n+1);++c<n;)u[c]=o[c];return u[n]=e(i),r(t,this,u)}}function lt(t){if(typeof t=="string"||At(t))return t;var e=t+"";return"0"==e&&1/t==-Mt?"-0":e}function bt(t){if(null!=t){try{return ne.call(t)}catch(t){}return t+""}return""}function ht(t,e){return(Je(t)?o:Pe)(t,Z(e,3));
|
||||
}function pt(t,e){function r(){var n=arguments,o=e?e.apply(this,n):n[0],c=r.cache;return c.has(o)?c.get(o):(n=t.apply(this,n),r.cache=c.set(o,n)||c,n)}if(typeof t!="function"||null!=e&&typeof e!="function")throw new TypeError("Expected a function");return r.cache=new(pt.Cache||_),r}function yt(t,e){return t===e||t!==t&&e!==e}function jt(t){return null!=t&>(t.length)&&!_t(t)}function _t(t){return!!vt(t)&&(t=I(t),"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t);
|
||||
}function gt(t){return typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t}function vt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function dt(t){return null!=t&&typeof t=="object"}function At(t){return typeof t=="symbol"||dt(t)&&"[object Symbol]"==I(t)}function wt(t){return null==t?"":T(t)}function mt(t,e,r){return t=null==t?Bt:x(t,e),t===Bt?r:t}function Ot(t,e){var r;if(r=null!=t){r=t;var n;n=C(e,r);for(var o=-1,c=n.length,u=false;++o<c;){var i=lt(n[o]);if(!(u=null!=r&&null!=r&&i in Object(r)))break;
|
||||
r=r[i]}u||++o!=c?r=u:(c=null==r?0:r.length,r=!!c&>(c)&&ct(i,c)&&(Je(r)||He(r)))}return r}function St(t){if(jt(t))t=d(t);else if(at(t)){var e,r=[];for(e in Object(t))oe.call(t,e)&&"constructor"!=e&&r.push(e);t=r}else t=de(t);return t}function zt(t){if(jt(t))t=d(t,true);else if(vt(t)){var e,r=at(t),n=[];for(e in t)("constructor"!=e||!r&&oe.call(t,e))&&n.push(e);t=n}else{if(e=[],null!=t)for(r in Object(t))e.push(r);t=e}return t}function kt(t){return function(){return t}}function xt(t){return t}function Ft(t){
|
||||
return D(typeof t=="function"?t:k(t,1))}function It(t){return it(t)?f(lt(t)):P(t)}function Et(){return[]}function Ut(){return false}var Bt,Mt=1/0,Dt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$t=/^\w*$/,Lt=/^\./,Pt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vt=/\\(\\)?/g,Rt=/\w*$/,Tt=/^\[object .+?Constructor\]$/,Ct=/^(?:0|[1-9]\d*)$/,Nt={};Nt["[object Float32Array]"]=Nt["[object Float64Array]"]=Nt["[object Int8Array]"]=Nt["[object Int16Array]"]=Nt["[object Int32Array]"]=Nt["[object Uint8Array]"]=Nt["[object Uint8ClampedArray]"]=Nt["[object Uint16Array]"]=Nt["[object Uint32Array]"]=true,
|
||||
Nt["[object Arguments]"]=Nt["[object Array]"]=Nt["[object ArrayBuffer]"]=Nt["[object Boolean]"]=Nt["[object DataView]"]=Nt["[object Date]"]=Nt["[object Error]"]=Nt["[object Function]"]=Nt["[object Map]"]=Nt["[object Number]"]=Nt["[object Object]"]=Nt["[object RegExp]"]=Nt["[object Set]"]=Nt["[object String]"]=Nt["[object WeakMap]"]=false;var Wt={};Wt["[object Arguments]"]=Wt["[object Array]"]=Wt["[object ArrayBuffer]"]=Wt["[object DataView]"]=Wt["[object Boolean]"]=Wt["[object Date]"]=Wt["[object Float32Array]"]=Wt["[object Float64Array]"]=Wt["[object Int8Array]"]=Wt["[object Int16Array]"]=Wt["[object Int32Array]"]=Wt["[object Map]"]=Wt["[object Number]"]=Wt["[object Object]"]=Wt["[object RegExp]"]=Wt["[object Set]"]=Wt["[object String]"]=Wt["[object Symbol]"]=Wt["[object Uint8Array]"]=Wt["[object Uint8ClampedArray]"]=Wt["[object Uint16Array]"]=Wt["[object Uint32Array]"]=true,
|
||||
Wt["[object Error]"]=Wt["[object Function]"]=Wt["[object WeakMap]"]=false;var Gt,qt=typeof global=="object"&&global&&global.Object===Object&&global,Ht=typeof self=="object"&&self&&self.Object===Object&&self,Jt=qt||Ht||Function("return this")(),Kt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qt=Kt&&typeof module=="object"&&module&&!module.nodeType&&module,Xt=Qt&&Qt.exports===Kt,Yt=Xt&&qt.process;t:{try{Gt=Yt&&Yt.binding&&Yt.binding("util");break t}catch(t){}Gt=void 0}var Zt=Gt&&Gt.isTypedArray,te=Array.prototype,ee=Object.prototype,re=Jt["__core-js_shared__"],ne=Function.prototype.toString,oe=ee.hasOwnProperty,ce=function(){
|
||||
var t=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ue=ee.toString,ie=RegExp("^"+ne.call(oe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ae=Xt?Jt.Buffer:Bt,fe=Jt.Symbol,se=Jt.Uint8Array,le=ae?ae.a:Bt,be=b(Object.getPrototypeOf),he=Object.create,pe=ee.propertyIsEnumerable,ye=te.splice,je=fe?fe.toStringTag:Bt,_e=function(){try{var t=rt(Object,"defineProperty");return t({},"",{}),t}catch(t){}
|
||||
}(),ge=Object.getOwnPropertySymbols,ve=ae?ae.isBuffer:Bt,de=b(Object.keys),Ae=Math.max,we=Date.now,me=rt(Jt,"DataView"),Oe=rt(Jt,"Map"),Se=rt(Jt,"Promise"),ze=rt(Jt,"Set"),ke=rt(Jt,"WeakMap"),xe=rt(Object,"create"),Fe=bt(me),Ie=bt(Oe),Ee=bt(Se),Ue=bt(ze),Be=bt(ke),Me=fe?fe.prototype:Bt,De=Me?Me.valueOf:Bt,$e=Me?Me.toString:Bt,Le=function(){function t(){}return function(e){return vt(e)?he?he(e):(t.prototype=e,e=new t,t.prototype=Bt,e):{}}}();y.prototype.clear=function(){this.__data__=xe?xe(null):{},
|
||||
this.size=0},y.prototype.delete=function(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t},y.prototype.get=function(t){var e=this.__data__;return xe?(t=e[t],"__lodash_hash_undefined__"===t?Bt:t):oe.call(e,t)?e[t]:Bt},y.prototype.has=function(t){var e=this.__data__;return xe?e[t]!==Bt:oe.call(e,t)},y.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=xe&&e===Bt?"__lodash_hash_undefined__":e,this},j.prototype.clear=function(){this.__data__=[],this.size=0;
|
||||
},j.prototype.delete=function(t){var e=this.__data__;return t=w(e,t),!(0>t)&&(t==e.length-1?e.pop():ye.call(e,t,1),--this.size,true)},j.prototype.get=function(t){var e=this.__data__;return t=w(e,t),0>t?Bt:e[t][1]},j.prototype.has=function(t){return-1<w(this.__data__,t)},j.prototype.set=function(t,e){var r=this.__data__,n=w(r,t);return 0>n?(++this.size,r.push([t,e])):r[n][1]=e,this},_.prototype.clear=function(){this.size=0,this.__data__={hash:new y,map:new(Oe||j),string:new y}},_.prototype.delete=function(t){
|
||||
return t=tt(this,t).delete(t),this.size-=t?1:0,t},_.prototype.get=function(t){return tt(this,t).get(t)},_.prototype.has=function(t){return tt(this,t).has(t)},_.prototype.set=function(t,e){var r=tt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},g.prototype.add=g.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},g.prototype.has=function(t){return this.__data__.has(t)},v.prototype.clear=function(){this.__data__=new j,this.size=0},v.prototype.delete=function(t){
|
||||
var e=this.__data__;return t=e.delete(t),this.size=e.size,t},v.prototype.get=function(t){return this.__data__.get(t)},v.prototype.has=function(t){return this.__data__.has(t)},v.prototype.set=function(t,e){var r=this.__data__;if(r instanceof j){var n=r.__data__;if(!Oe||199>n.length)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new _(n)}return r.set(t,e),this.size=r.size,this};var Pe=function(t,e){return function(r,n){if(null==r)return r;if(!jt(r))return t(r,n);for(var o=r.length,c=e?o:-1,u=Object(r);(e?c--:++c<o)&&false!==n(u[c],c,u););
|
||||
return r}}(function(t,e){return t&&Ve(t,e,St)}),Ve=function(t){return function(e,r,n){var o=-1,c=Object(e);n=n(e);for(var u=n.length;u--;){var i=n[t?u:++o];if(false===r(c[i],i,c))break}return e}}(),Re=_e?function(t,e){return _e(t,"toString",{configurable:true,enumerable:false,value:kt(e),writable:true})}:xt,Te=ge?function(t){return null==t?[]:(t=Object(t),c(ge(t),function(e){return pe.call(t,e)}))}:Et,Ce=ge?function(t){for(var e=[];t;)u(e,Te(t)),t=be(t);return e}:Et,Ne=I;(me&&"[object DataView]"!=Ne(new me(new ArrayBuffer(1)))||Oe&&"[object Map]"!=Ne(new Oe)||Se&&"[object Promise]"!=Ne(Se.resolve())||ze&&"[object Set]"!=Ne(new ze)||ke&&"[object WeakMap]"!=Ne(new ke))&&(Ne=function(t){
|
||||
var e=I(t);if(t=(t="[object Object]"==e?t.constructor:Bt)?bt(t):"")switch(t){case Fe:return"[object DataView]";case Ie:return"[object Map]";case Ee:return"[object Promise]";case Ue:return"[object Set]";case Be:return"[object WeakMap]"}return e});var We=function(t){var e=0,r=0;return function(){var n=we(),o=16-(n-r);if(r=n,0<o){if(800<=++e)return arguments[0]}else e=0;return t.apply(Bt,arguments)}}(Re),Ge=function(t){t=pt(t,function(t){return 500===e.size&&e.clear(),t});var e=t.cache;return t}(function(t){
|
||||
var e=[];return Lt.test(t)&&e.push(""),t.replace(Pt,function(t,r,n,o){e.push(n?o.replace(Vt,"$1"):r||t)}),e}),qe=function(t,e){return function(r,o){var c=Je(r)?n:m,u=e?e():{};return c(r,t,Z(o,2),u)}}(function(t,e,r){oe.call(t,r)?t[r].push(e):z(t,r,[e])});pt.Cache=_;var He=E(function(){return arguments}())?E:function(t){return dt(t)&&oe.call(t,"callee")&&!pe.call(t,"callee")},Je=Array.isArray,Ke=ve||Ut,Qe=Zt?s(Zt):M,Xe=function(t){return V(function(e,r){var n=-1,o=r.length,c=1<o?r[o-1]:Bt,u=2<o?r[2]:Bt,c=3<t.length&&typeof c=="function"?(o--,
|
||||
c):Bt;for(u&&ut(r[0],r[1],u)&&(c=3>o?Bt:c,o=1),e=Object(e);++n<o;)(u=r[n])&&t(e,u,n,c);return e})}(function(t,e){q(e,zt(e),t)});p.assignIn=Xe,p.constant=kt,p.groupBy=qe,p.iteratee=Ft,p.keys=St,p.keysIn=zt,p.memoize=pt,p.property=It,p.extend=Xe,p.eq=yt,p.forEach=ht,p.get=mt,p.hasIn=Ot,p.identity=xt,p.isArguments=He,p.isArray=Je,p.isArrayLike=jt,p.isBuffer=Ke,p.isFunction=_t,p.isLength=gt,p.isObject=vt,p.isObjectLike=dt,p.isSymbol=At,p.isTypedArray=Qe,p.stubArray=Et,p.stubFalse=Ut,p.some=function(t,e,r){
|
||||
var n=Je(t)?a:R;return r&&ut(t,e,r)&&(e=Bt),n(t,Z(e,3))},p.toString=wt,p.each=ht,p.VERSION="4.17.4",typeof define=="function"&&typeof define.amd=="object"&&define.amd&& define(function(){return p})}).call(this);
|
||||
@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash -o ./dist/lodash.compat.js`
|
||||
*/
|
||||
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
|
||||
}}function r(n){return n.charCodeAt(0)}function u(n,t){for(var e=n.m,r=t.m,u=-1,o=e.length;++u<o;){var a=e[u],i=r[u];if(a!==i){if(a>i||typeof a=="undefined")return 1;if(a<i||typeof i=="undefined")return-1}}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Y[n]
|
||||
}function i(){return v.pop()||[]}function l(){return y.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(n){n.length=0,v.length<w&&v.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<w&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];
|
||||
return u}function g(e){function v(n){return n&&typeof n=="object"&&!qe(n)&&we.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n}function w(n){function t(){if(r){var n=s(r);je.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return xt(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return ze(t,n),t}function Y(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!xt(n))return n;var a=he.call(n);if(!V[a]||!Le.nodeClass&&f(n))return n;
|
||||
var l=Te[a];switch(a){case L:case z:return new l(+n);case W:case M:return new l(n);case J:return o=l(n.source,S.exec(n)),o.lastIndex=n.lastIndex,o}if(a=qe(n),t){var p=!r;r||(r=i()),u||(u=i());for(var g=r.length;g--;)if(r[g]==n)return u[g];o=a?l(n.length):{}}else o=a?s(n):Ye({},n);return a&&(we.call(n,"index")&&(o.index=n.index),we.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?Xe:tr)(n,function(n,a){o[a]=Y(n,t,e,r,u)}),p&&(c(r),c(u)),o):o}function nt(n){return xt(n)?Se(n):{}}function tt(n,t,e){if(typeof n!="function")return Ht;
|
||||
if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(Le.funcNames&&(r=!n.name),r=r||!Le.funcDecomp,!r)){var u=be.call(n);Le.funcNames||(r=!A.test(u)),r||(r=B.test(u),ze(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Mt(n,t)}function et(n){function t(){var n=l?a:this;
|
||||
if(u){var h=s(u);je.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&je.apply(h,o),c&&h.length<i)?(r|=16,et([e,p?r:-4&r,h,null,a,i])):(h||(h=arguments),f&&(e=n[g]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),xt(h)?h:n):e.apply(n,h))}var e=n[0],r=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=1&r,f=2&r,c=4&r,p=8&r,g=e;return ze(t,n),t}function rt(e,r){var u=-1,a=ht(),i=e?e.length:0,l=i>=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false}for(;++u<i;)c=e[u],0>a(r,c)&&f.push(c);return l&&p(r),f}function ot(n,t,e,r){r=(r||0)-1;
|
||||
for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(qe(a)||dt(a))){t||(a=ot(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o}function at(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&X[typeof n]||t&&X[typeof t]))return false;if(null==n||null==t)return n===t;var l=he.call(n),p=he.call(t);if(l==T&&(l=G),p==T&&(p=G),l!=p)return false;switch(l){case L:case z:return+n==+t;
|
||||
case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case J:case M:return n==ie(t)}if(p=l==$,!p){var s=we.call(n,"__wrapped__"),g=we.call(t,"__wrapped__");if(s||g)return at(s?n.__wrapped__:n,g?t.__wrapped__:t,e,r,u,o);if(l!=G||!Le.nodeClass&&(f(n)||f(t)))return false;if(l=!Le.argsObject&&dt(n)?oe:n.constructor,s=!Le.argsObject&&dt(t)?oe:t.constructor,l!=s&&!(jt(l)&&l instanceof l&&jt(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)return false}for(l=!u,u||(u=i()),o||(o=i()),s=u.length;s--;)if(u[s]==n)return o[s]==t;
|
||||
var h=0,a=true;if(u.push(n),o.push(t),p){if(s=n.length,h=t.length,(a=h==s)||r)for(;h--;)if(p=s,g=t[h],r)for(;p--&&!(a=at(n[p],g,e,r,u,o)););else if(!(a=at(n[h],g,e,r,u,o)))break}else nr(t,function(t,i,l){return we.call(l,i)?(h++,a=we.call(n,i)&&at(n[i],t,e,r,u,o)):void 0}),a&&!r&&nr(n,function(n,t,e){return we.call(e,t)?a=-1<--h:void 0});return u.pop(),o.pop(),l&&(c(u),c(o)),a}function it(n,t,e,r,u){(qe(t)?Dt:tr)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=qe(t))||er(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];
|
||||
break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?qe(f)?f:[]:er(f)?f:{}),r.push(t),u.push(f),c||it(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[o]=f})}function lt(n,t){return n+de(Fe()*(t-n+1))}function ft(e,r,u){var a=-1,l=ht(),f=e?e.length:0,s=[],g=!r&&f>=_&&l===n,h=u||g?i():s;for(g&&(h=o(h),l=t);++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function ct(n){return function(t,e,r){var u={};
|
||||
if(e=v.createCallback(e,r,3),qe(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Xe(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function pt(n,t,e,r,u,o){var a=1&t,i=4&t,l=16&t,f=32&t;if(!(2&t||jt(n)))throw new le;l&&!e.length&&(t&=-17,l=e=false),f&&!r.length&&(t&=-33,f=r=false);var c=n&&n.__bindData__;return c&&true!==c?(c=s(c),c[2]&&(c[2]=s(c[2])),c[3]&&(c[3]=s(c[3])),!a||1&c[1]||(c[4]=u),!a&&1&c[1]&&(t|=8),!i||4&c[1]||(c[5]=o),l&&je.apply(c[2]||(c[2]=[]),e),f&&Ee.apply(c[3]||(c[3]=[]),r),c[1]|=t,pt.apply(null,c)):(1==t||17===t?w:et)([n,t,e,r,u,o])
|
||||
}function st(){Q.h=F,Q.b=Q.c=Q.g=Q.i="",Q.e="t",Q.j=true;for(var n,t=0;n=arguments[t];t++)for(var e in n)Q[e]=n[e];t=Q.a,Q.d=/^[^,]+/.exec(t)[0],n=ee,t="return function("+t+"){",e=Q;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",Le.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):Le.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),Le.enumPrototypes&&(r+="var G=typeof t=='function';"),Le.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");
|
||||
var u=[];if(Le.enumPrototypes&&u.push('!(G&&n=="prototype")'),Le.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}";else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",Le.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";
|
||||
r+="}"}return(e.b||Le.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,q,ce,we,d,dt,qe,kt,Q.f,pe,X,$e,M,se,he)}function gt(n){return Ve[n]}function ht(){var t=(t=v.indexOf)===zt?n:t;return t}function vt(n){return typeof n=="function"&&ve.test(n)}function yt(n){var t,e;return!n||he.call(n)!=G||(t=n.constructor,jt(t)&&!(t instanceof t))||!Le.argsClass&&dt(n)||!Le.nodeClass&&f(n)?false:Le.ownLast?(nr(n,function(n,t,r){return e=we.call(r,t),false}),false!==e):(nr(n,function(n,t){e=t
|
||||
}),typeof e=="undefined"||we.call(n,e))}function mt(n){return He[n]}function dt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&he.call(n)==T||false}function bt(n,t,e){var r=We(n),u=r.length;for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function _t(n){var t=[];return nr(n,function(n,e){jt(n)&&t.push(e)}),t.sort()}function wt(n){for(var t=-1,e=We(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function jt(n){return typeof n=="function"}function xt(n){return!(!n||!X[typeof n])
|
||||
}function Ct(n){return typeof n=="number"||n&&typeof n=="object"&&he.call(n)==W||false}function kt(n){return typeof n=="string"||n&&typeof n=="object"&&he.call(n)==M||false}function Et(n){for(var t=-1,e=We(n),r=e.length,u=Zt(r);++t<r;)u[t]=n[e[t]];return u}function Ot(n,t,e){var r=-1,u=ht(),o=n?n.length:0,a=false;return e=(0>e?Be(0,o+e):e)||0,qe(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(kt(n)?n.indexOf(t,e):u(n,t,e)):Xe(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function St(n,t,e){var r=true;if(t=v.createCallback(t,e,3),qe(n)){e=-1;
|
||||
for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Xe(n,function(n,e,u){return r=!!t(n,e,u)});return r}function At(n,t,e){var r=[];if(t=v.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else Xe(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function It(n,t,e){if(t=v.createCallback(t,e,3),!qe(n)){var r;return Xe(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function Dt(n,t,e){if(t&&typeof e=="undefined"&&qe(n)){e=-1;
|
||||
for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Xe(n,t,e);return n}function Nt(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),qe(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=We(n),u=o.length;else Le.unindexedChars&&kt(n)&&(r=n.split(""));Xe(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Bt(n,t,e){var r=-1,u=n?n.length:0,o=Zt(typeof u=="number"?u:0);if(t=v.createCallback(t,e,3),qe(n))for(;++r<u;)o[r]=t(n[r],r,n);else Xe(n,function(n,e,u){o[++r]=t(n,e,u)
|
||||
});return o}function Pt(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=null==t&&kt(n)?r:v.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Rt(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),qe(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Xe(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function Ft(n,t,e,r){var u=3>arguments.length;
|
||||
return t=v.createCallback(t,r,4),Nt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Tt(n){var t=-1,e=n?n.length:0,r=Zt(typeof e=="number"?e:0);return Dt(n,function(n){var e=lt(0,++t);r[t]=r[e],r[e]=n}),r}function $t(n,t,e){var r;if(t=v.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Xe(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Lt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++
|
||||
}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Pe(Be(0,r),u))}function zt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Be(0,u+r):r||0}else if(r)return r=Kt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=v.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Be(0,t);return s(n,r)}function Kt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?v.createCallback(e,r,1):Ht,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;
|
||||
return u}function Wt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=v.createCallback(e,r,3)),ft(n,t,e)}function Gt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Pt(ar(n,"length")):0,r=Zt(0>e?0:e);++t<e;)r[t]=ar(n,t);return r}function Jt(n,t){var e=-1,r=n?n.length:0,u={};for(t||!r||qe(n[0])||(t=[]);++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Mt(n,t){return 2<arguments.length?pt(n,17,s(arguments,2),null,t):pt(n,1,null,null,t)
|
||||
}function Vt(n,t,e){var r,u,o,a,i,l,f,c=0,p=false,s=true;if(!jt(n))throw new le;if(t=Be(0,t)||0,true===e)var g=true,s=false;else xt(e)&&(g=e.leading,p="maxWait"in e&&(Be(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var v=function(){var e=t-(ir()-a);0<e?l=Ce(v,e):(u&&me(u),e=f,u=l=f=h,e&&(c=ir(),o=n.apply(i,r),l||u||(r=i=null)))},y=function(){l&&me(l),u=l=f=h,(s||p!==t)&&(c=ir(),o=n.apply(i,r),l||u||(r=i=null))};return function(){if(r=arguments,a=ir(),i=this,f=s&&(l||!g),false===p)var e=g&&!l;else{u||g||(c=a);
|
||||
var h=p-(a-c),m=0>=h;m?(u&&(u=me(u)),c=a,o=n.apply(i,r)):u||(u=Ce(y,h))}return m&&l?l=me(l):l||t===p||(l=Ce(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Ht(n){return n}function Ut(n,t,e){var r=true,u=t&&_t(t);t&&(e||u.length)||(null==e&&(e=t),o=y,t=n,n=v,u=_t(t)),false===e?r=false:xt(e)&&"chain"in e&&(r=e.chain);var o=n,a=jt(o);Dt(u,function(e){var u=n[e]=t[e];a&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,a=[e];if(je.apply(a,arguments),a=u.apply(n,a),r||t){if(e===a&&xt(a))return this;
|
||||
a=new o(a),a.__chain__=t}return a})})}function Qt(){}function Xt(n){return function(t){return t[n]}}function Yt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var Zt=e.Array,ne=e.Boolean,te=e.Date,ee=e.Function,re=e.Math,ue=e.Number,oe=e.Object,ae=e.RegExp,ie=e.String,le=e.TypeError,fe=[],ce=e.Error.prototype,pe=oe.prototype,se=ie.prototype,ge=e._,he=pe.toString,ve=ae("^"+ie(he).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ye=re.ceil,me=e.clearTimeout,de=re.floor,be=ee.prototype.toString,_e=vt(_e=oe.getPrototypeOf)&&_e,we=pe.hasOwnProperty,je=fe.push,xe=pe.propertyIsEnumerable,Ce=e.setTimeout,ke=fe.splice,Ee=fe.unshift,Oe=function(){try{var n={},t=vt(t=oe.defineProperty)&&t,e=t(n,n,n)&&t
|
||||
}catch(r){}return e}(),Se=vt(Se=oe.create)&&Se,Ae=vt(Ae=Zt.isArray)&&Ae,Ie=e.isFinite,De=e.isNaN,Ne=vt(Ne=oe.keys)&&Ne,Be=re.max,Pe=re.min,Re=e.parseInt,Fe=re.random,Te={};Te[$]=Zt,Te[L]=ne,Te[z]=te,Te[K]=ee,Te[G]=oe,Te[W]=ue,Te[J]=ae,Te[M]=ie;var $e={};$e[$]=$e[z]=$e[W]={constructor:true,toLocaleString:true,toString:true,valueOf:true},$e[L]=$e[M]={constructor:true,toString:true,valueOf:true},$e[q]=$e[K]=$e[J]={constructor:true,toString:true},$e[G]={constructor:true},function(){for(var n=F.length;n--;){var t,e=F[n];
|
||||
for(t in $e)we.call($e,t)&&!we.call($e[t],e)&&($e[t][e]=false)}}(),y.prototype=v.prototype;var Le=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);Le.argsClass=he.call(arguments)==T,Le.argsObject=arguments.constructor==oe&&!(arguments instanceof Zt),Le.enumErrorProps=xe.call(ce,"message")||xe.call(ce,"name"),Le.enumPrototypes=xe.call(n,"prototype"),Le.funcDecomp=!vt(e.WinRTError)&&B.test(g),Le.funcNames=typeof ee.name=="string",Le.nonEnumArgs=0!=u,Le.nonEnumShadows=!/valueOf/.test(r),Le.ownLast="x"!=r[0],Le.spliceObjects=(fe.splice.call(t,0,1),!t[0]),Le.unindexedChars="xx"!="x"[0]+oe("x")[0];
|
||||
try{Le.nodeClass=!(he.call(document)==G&&!({toString:0}+""))}catch(o){Le.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:v}},Se||(nt=function(){function n(){}return function(t){if(xt(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var ze=Oe?function(n,t){U.value=t,Oe(n,"__bindData__",U)}:Qt;Le.argsClass||(dt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&we.call(n,"callee")&&!xe.call(n,"callee")||false
|
||||
});var qe=Ae||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&he.call(n)==$||false},Ke=st({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),We=Ne?function(n){return xt(n)?Le.enumPrototypes&&typeof n=="function"||Le.nonEnumArgs&&n.length&&dt(n)?Ke(n):Ne(n):[]}:Ke,Ge={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:We,g:"if(e(t[n],n,g)===false)return E"},Je={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:We,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Me={i:"if(!B[typeof t])return E;"+Ge.i,b:false},Ve={"&":"&","<":"<",">":">",'"':""","'":"'"},He=wt(Ve),Ue=ae("("+We(He).join("|")+")","g"),Qe=ae("["+We(Ve).join("")+"]","g"),Xe=st(Ge),Ye=st(Je,{i:Je.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Ze=st(Je),nr=st(Ge,Me,{j:false}),tr=st(Ge,Me);
|
||||
jt(/x/)&&(jt=function(n){return typeof n=="function"&&he.call(n)==K});var er=_e?function(n){if(!n||he.call(n)!=G||!Le.argsClass&&dt(n))return false;var t=n.valueOf,e=vt(t)&&(e=_e(t))&&_e(e);return e?n==e||_e(n)==e:yt(n)}:yt,rr=ct(function(n,t,e){we.call(n,e)?n[e]++:n[e]=1}),ur=ct(function(n,t,e){(we.call(n,e)?n[e]:n[e]=[]).push(t)}),or=ct(function(n,t,e){n[e]=t}),ar=Bt,ir=vt(ir=te.now)&&ir||function(){return(new te).getTime()},lr=8==Re(j+"08")?Re:function(n,t){return Re(kt(n)?n.replace(D,""):n,t||0)};
|
||||
return v.after=function(n,t){if(!jt(t))throw new le;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=Ye,v.at=function(n){var t=arguments,e=-1,r=ot(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Zt(t);for(Le.unindexedChars&&kt(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},v.bind=Mt,v.bindAll=function(n){for(var t=1<arguments.length?ot(arguments,true,false,1):_t(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=pt(n[u],1,null,null,n)}return n},v.bindKey=function(n,t){return 2<arguments.length?pt(t,19,s(arguments,2),null,n):pt(t,3,null,null,n)
|
||||
},v.chain=function(n){return n=new y(n),n.__chain__=true,n},v.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},v.compose=function(){for(var n=arguments,t=n.length;t--;)if(!jt(n[t]))throw new le;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},v.constant=function(n){return function(){return n}},v.countBy=rr,v.create=function(n,t){var e=nt(n);return t?Ye(e,t):e},v.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e);
|
||||
if("object"!=r)return Xt(n);var u=We(n),o=u[0],a=n[o];return 1!=u.length||a!==a||xt(a)?function(t){for(var e=u.length,r=false;e--&&(r=at(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},v.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,pt(n,4,null,null,null,t)},v.debounce=Vt,v.defaults=Ze,v.defer=function(n){if(!jt(n))throw new le;var t=s(arguments,1);return Ce(function(){n.apply(h,t)},1)},v.delay=function(n,t){if(!jt(n))throw new le;var e=s(arguments,2);
|
||||
return Ce(function(){n.apply(h,e)},t)},v.difference=function(n){return rt(n,ot(arguments,true,true,1))},v.filter=At,v.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Bt(n,e,r)),ot(n,t)},v.forEach=Dt,v.forEachRight=Nt,v.forIn=nr,v.forInRight=function(n,t,e){var r=[];nr(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},v.forOwn=tr,v.forOwnRight=bt,v.functions=_t,v.groupBy=ur,v.indexBy=or,v.initial=function(n,t,e){var r=0,u=n?n.length:0;
|
||||
if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Pe(Be(0,u-r),u))},v.intersection=function(){for(var e=[],r=-1,u=arguments.length,a=i(),l=ht(),f=l===n,s=i();++r<u;){var g=arguments[r];(qe(g)||dt(g))&&(e.push(g),a.push(f&&g.length>=_&&o(r?e[r]:s)))}var f=e[0],h=-1,v=f?f.length:0,y=[];n:for(;++h<v;){var m=a[0],g=f[h];if(0>(m?t(m,g):l(s,g))){for(r=u,(m||s).push(g);--r;)if(m=a[r],0>(m?t(m,g):l(e[r],g)))continue n;y.push(g)
|
||||
}}for(;u--;)(m=a[u])&&p(m);return c(a),c(s),y},v.invert=wt,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Zt(typeof o=="number"?o:0);return Dt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=We,v.map=Bt,v.mapValues=function(n,t,e){var r={};return t=v.createCallback(t,e,3),tr(n,function(n,e,u){r[e]=t(n,e,u)}),r},v.max=Pt,v.memoize=function(n,t){if(!jt(n))throw new le;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];return we.call(r,u)?r[u]:r[u]=n.apply(this,arguments)
|
||||
};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!xt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=i(),a=i();++u<e;)it(n,t[u],r,o,a);return c(o),c(a),n},v.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=null==t&&kt(n)?r:v.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)
|
||||
});return o},v.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];nr(n,function(n,t){u.push(t)});for(var u=rt(u,ot(arguments,true,false,1)),o=-1,a=u.length;++o<a;){var i=u[o];r[i]=n[i]}}else t=v.createCallback(t,e,3),nr(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},v.once=function(n){var t,e;if(!jt(n))throw new le;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)}},v.pairs=function(n){for(var t=-1,e=We(n),r=e.length,u=Zt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u
|
||||
},v.partial=function(n){return pt(n,16,s(arguments,1))},v.partialRight=function(n){return pt(n,32,null,s(arguments,1))},v.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=ot(arguments,true,false,1),a=xt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=v.createCallback(t,e,3),nr(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},v.pluck=ar,v.property=Xt,v.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(ke.call(n,o--,1),u--);
|
||||
return n},v.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Be(0,ye((t-n)/(e||1)));for(var u=Zt(t);++r<t;)u[r]=n,n+=e;return u},v.reject=function(n,t,e){return t=v.createCallback(t,e,3),At(n,function(n,e,r){return!t(n,e,r)})},v.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=v.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),ke.call(n,r--,1),u--);return o},v.rest=qt,v.shuffle=Tt,v.sortBy=function(n,t,e){var r=-1,o=qe(t),a=n?n.length:0,f=Zt(typeof a=="number"?a:0);
|
||||
for(o||(t=v.createCallback(t,e,3)),Dt(n,function(n,e,u){var a=f[++r]=l();o?a.m=Bt(t,function(t){return n[t]}):(a.m=i())[0]=t(n,e,u),a.n=r,a.o=n}),a=f.length,f.sort(u);a--;)n=f[a],f[a]=n.o,o||c(n.m),p(n);return f},v.tap=function(n,t){return t(n),n},v.throttle=function(n,t,e){var r=true,u=true;if(!jt(n))throw new le;return false===e?r=false:xt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),H.leading=r,H.maxWait=t,H.trailing=u,Vt(n,t,H)},v.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Zt(n);
|
||||
for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},v.toArray=function(n){return n&&typeof n.length=="number"?Le.unindexedChars&&kt(n)?n.split(""):s(n):Et(n)},v.transform=function(n,t,e,r){var u=qe(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=v.createCallback(t,r,4),(u?Xe:tr)(n,function(n,r,u){return t(e,n,r,u)})),e},v.union=function(){return ft(ot(arguments,true,true))},v.uniq=Wt,v.values=Et,v.where=At,v.without=function(n){return rt(n,s(arguments,1))},v.wrap=function(n,t){return pt(t,16,[n])
|
||||
},v.xor=function(){for(var n=-1,t=arguments.length;++n<t;){var e=arguments[n];if(qe(e)||dt(e))var r=r?ft(rt(r,e).concat(rt(e,r))):e}return r||[]},v.zip=Gt,v.zipObject=Jt,v.collect=Bt,v.drop=qt,v.each=Dt,v.eachRight=Nt,v.extend=Ye,v.methods=_t,v.object=Jt,v.select=At,v.tail=qt,v.unique=Wt,v.unzip=Gt,Ut(v),v.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Y(n,t,typeof e=="function"&&tt(e,r,1))},v.cloneDeep=function(n,t,e){return Y(n,true,typeof t=="function"&&tt(t,e,1))},v.contains=Ot,v.escape=function(n){return null==n?"":ie(n).replace(Qe,gt)
|
||||
},v.every=St,v.find=It,v.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=v.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},v.findKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),tr(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.findLast=function(n,t,e){var r;return t=v.createCallback(t,e,3),Nt(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r},v.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=v.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;
|
||||
return-1},v.findLastKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),bt(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.has=function(n,t){return n?we.call(n,t):false},v.identity=Ht,v.indexOf=zt,v.isArguments=dt,v.isArray=qe,v.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&he.call(n)==L||false},v.isDate=function(n){return n&&typeof n=="object"&&he.call(n)==z||false},v.isElement=function(n){return n&&1===n.nodeType||false},v.isEmpty=function(n){var t=true;if(!n)return t;var e=he.call(n),r=n.length;
|
||||
return e==$||e==M||(Le.argsClass?e==T:dt(n))||e==G&&typeof r=="number"&&jt(n.splice)?!r:(tr(n,function(){return t=false}),t)},v.isEqual=function(n,t,e,r){return at(n,t,typeof e=="function"&&tt(e,r,2))},v.isFinite=function(n){return Ie(n)&&!De(parseFloat(n))},v.isFunction=jt,v.isNaN=function(n){return Ct(n)&&n!=+n},v.isNull=function(n){return null===n},v.isNumber=Ct,v.isObject=xt,v.isPlainObject=er,v.isRegExp=function(n){return n&&X[typeof n]&&he.call(n)==J||false},v.isString=kt,v.isUndefined=function(n){return typeof n=="undefined"
|
||||
},v.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Be(0,r+e):Pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Ut,v.noConflict=function(){return e._=ge,this},v.noop=Qt,v.now=ir,v.parseInt=lr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Fe(),Pe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):lt(n,t)},v.reduce=Rt,v.reduceRight=Ft,v.result=function(n,t){if(n){var e=n[t];
|
||||
return jt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:We(n).length},v.some=$t,v.sortedIndex=Kt,v.template=function(n,t,e){var r=v.templateSettings;n=ie(n||""),e=Ze({},e,r);var u,o=Ze({},e.imports,r.imports),r=We(o),o=Et(o),i=0,l=e.interpolate||N,f="__p+='",l=ae((e.escape||N).source+"|"+l.source+"|"+(l===I?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(P,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t
|
||||
}),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=ee(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":ie(n).replace(Ue,mt)},v.uniqueId=function(n){var t=++m;return ie(null==n?"":n)+t
|
||||
},v.all=St,v.any=$t,v.detect=It,v.findWhere=It,v.foldl=Rt,v.foldr=Ft,v.include=Ot,v.inject=Rt,Ut(function(){var n={};return tr(v,function(t,e){v.prototype[e]||(n[e]=t)}),n}(),false),v.first=Lt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Be(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=Et(n):Le.unindexedChars&&kt(n)&&(n=n.split("")),null==t||e?n?n[lt(0,n.length-1)]:h:(n=Tt(n),n.length=Pe(Be(0,t),n.length),n)
|
||||
},v.take=Lt,v.head=Lt,tr(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.4.1",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return ie(this.__wrapped__)},v.prototype.value=Yt,v.prototype.valueOf=Yt,Xe(["join","pop","shift"],function(n){var t=fe[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
|
||||
return n?new y(e,n):e}}),Xe(["push","reverse","sort","unshift"],function(n){var t=fe[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xe(["concat","slice","splice"],function(n){var t=fe[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Le.spliceObjects||Xe(["pop","shift","splice"],function(n){var t=fe[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u
|
||||
}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,A=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,B=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setTimeout".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),T="[object Arguments]",$="[object Array]",L="[object Boolean]",z="[object Date]",q="[object Error]",K="[object Function]",W="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",V={};
|
||||
V[K]=false,V[T]=V[$]=V[L]=V[z]=V[W]=V[G]=V[J]=V[M]=true;var H={leading:false,maxWait:0,trailing:false},U={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global;
|
||||
!rt||rt.global!==rt&&rt.window!==rt||(Z=rt);var ut=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=ut, define(function(){return ut})):nt&&tt?et?(tt.exports=ut)._=ut:nt._=ut:Z._=ut}).call(this);
|
||||
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@ -0,0 +1,204 @@
|
||||
var isArray = Array.isArray || function (arr) {
|
||||
return Object.prototype.toString.call(arr) == '[object Array]';
|
||||
};
|
||||
|
||||
/**
|
||||
* Expose `pathToRegexp`.
|
||||
*/
|
||||
// module.exports = pathToRegexp
|
||||
|
||||
/**
|
||||
* The main path matching regexp utility.
|
||||
*
|
||||
* @type {RegExp}
|
||||
*/
|
||||
var PATH_REGEXP = new RegExp([
|
||||
// Match escaped characters that would otherwise appear in future matches.
|
||||
// This allows the user to escape special characters that won't transform.
|
||||
'(\\\\.)',
|
||||
// Match Express-style parameters and un-named parameters with a prefix
|
||||
// and optional suffixes. Matches appear as:
|
||||
//
|
||||
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?"]
|
||||
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined]
|
||||
'([\\/.])?(?:\\:(\\w+)(?:\\(((?:\\\\.|[^)])*)\\))?|\\(((?:\\\\.|[^)])*)\\))([+*?])?',
|
||||
// Match regexp special characters that are always escaped.
|
||||
'([.+*?=^!:${}()[\\]|\\/])'
|
||||
].join('|'), 'g');
|
||||
|
||||
/**
|
||||
* Escape the capturing group by escaping special characters and meaning.
|
||||
*
|
||||
* @param {String} group
|
||||
* @return {String}
|
||||
*/
|
||||
function escapeGroup (group) {
|
||||
return group.replace(/([=!:$\/()])/g, '\\$1');
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach the keys as a property of the regexp.
|
||||
*
|
||||
* @param {RegExp} re
|
||||
* @param {Array} keys
|
||||
* @return {RegExp}
|
||||
*/
|
||||
function attachKeys (re, keys) {
|
||||
re.keys = keys;
|
||||
return re;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the flags for a regexp from the options.
|
||||
*
|
||||
* @param {Object} options
|
||||
* @return {String}
|
||||
*/
|
||||
function flags (options) {
|
||||
return options.sensitive ? '' : 'i';
|
||||
}
|
||||
|
||||
/**
|
||||
* Pull out keys from a regexp.
|
||||
*
|
||||
* @param {RegExp} path
|
||||
* @param {Array} keys
|
||||
* @return {RegExp}
|
||||
*/
|
||||
function regexpToRegexp (path, keys) {
|
||||
// Use a negative lookahead to match only capturing groups.
|
||||
var groups = path.source.match(/\((?!\?)/g);
|
||||
|
||||
if (groups) {
|
||||
for (var i = 0; i < groups.length; i++) {
|
||||
keys.push({
|
||||
name: i,
|
||||
delimiter: null,
|
||||
optional: false,
|
||||
repeat: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return attachKeys(path, keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform an array into a regexp.
|
||||
*
|
||||
* @param {Array} path
|
||||
* @param {Array} keys
|
||||
* @param {Object} options
|
||||
* @return {RegExp}
|
||||
*/
|
||||
function arrayToRegexp (path, keys, options) {
|
||||
var parts = [];
|
||||
|
||||
for (var i = 0; i < path.length; i++) {
|
||||
parts.push(pathToRegexp(path[i], keys, options).source);
|
||||
}
|
||||
|
||||
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
|
||||
return attachKeys(regexp, keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the specific tags with regexp strings.
|
||||
*
|
||||
* @param {String} path
|
||||
* @param {Array} keys
|
||||
* @return {String}
|
||||
*/
|
||||
function replacePath (path, keys) {
|
||||
var index = 0;
|
||||
|
||||
function replace (_, escaped, prefix, key, capture, group, suffix, escape) {
|
||||
if (escaped) {
|
||||
return escaped;
|
||||
}
|
||||
|
||||
if (escape) {
|
||||
return '\\' + escape;
|
||||
}
|
||||
|
||||
var repeat = suffix === '+' || suffix === '*';
|
||||
var optional = suffix === '?' || suffix === '*';
|
||||
|
||||
keys.push({
|
||||
name: key || index++,
|
||||
delimiter: prefix || '/',
|
||||
optional: optional,
|
||||
repeat: repeat
|
||||
});
|
||||
|
||||
prefix = prefix ? ('\\' + prefix) : '';
|
||||
capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?');
|
||||
|
||||
if (repeat) {
|
||||
capture = capture + '(?:' + prefix + capture + ')*';
|
||||
}
|
||||
|
||||
if (optional) {
|
||||
return '(?:' + prefix + '(' + capture + '))?';
|
||||
}
|
||||
|
||||
// Basic parameter support.
|
||||
return prefix + '(' + capture + ')';
|
||||
}
|
||||
|
||||
return path.replace(PATH_REGEXP, replace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize the given path string, returning a regular expression.
|
||||
*
|
||||
* An empty array can be passed in for the keys, which will hold the
|
||||
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
|
||||
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
|
||||
*
|
||||
* @param {(String|RegExp|Array)} path
|
||||
* @param {Array} [keys]
|
||||
* @param {Object} [options]
|
||||
* @return {RegExp}
|
||||
*/
|
||||
function pathToRegexp (path, keys, options) {
|
||||
keys = keys || [];
|
||||
|
||||
if (!isArray(keys)) {
|
||||
options = keys;
|
||||
keys = [];
|
||||
} else if (!options) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (path instanceof RegExp) {
|
||||
return regexpToRegexp(path, keys, options);
|
||||
}
|
||||
|
||||
if (isArray(path)) {
|
||||
return arrayToRegexp(path, keys, options);
|
||||
}
|
||||
|
||||
var strict = options.strict;
|
||||
var end = options.end !== false;
|
||||
var route = replacePath(path, keys);
|
||||
var endsWithSlash = path.charAt(path.length - 1) === '/';
|
||||
|
||||
// In non-strict mode we allow a slash at the end of match. If the path to
|
||||
// match already ends with a slash, we remove it for consistency. The slash
|
||||
// is valid at the end of a path match, not in the middle. This is important
|
||||
// in non-ending mode, where "/test/" shouldn't match "/test//route".
|
||||
if (!strict) {
|
||||
route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?';
|
||||
}
|
||||
|
||||
if (end) {
|
||||
route += '$';
|
||||
} else {
|
||||
// In non-ending mode, we need the capturing groups to match as much as
|
||||
// possible by using a positive lookahead to the end or next path segment.
|
||||
route += strict && endsWithSlash ? '' : '(?=\\/|$)';
|
||||
}
|
||||
|
||||
return attachKeys(new RegExp('^' + route, flags(options)), keys);
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
|
||||
if (!Object.keys) {
|
||||
Object.keys = (function () {
|
||||
'use strict';
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
|
||||
dontEnums = [
|
||||
'toString',
|
||||
'toLocaleString',
|
||||
'valueOf',
|
||||
'hasOwnProperty',
|
||||
'isPrototypeOf',
|
||||
'propertyIsEnumerable',
|
||||
'constructor'
|
||||
],
|
||||
dontEnumsLength = dontEnums.length;
|
||||
|
||||
return function (obj) {
|
||||
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
|
||||
throw new TypeError('Object.keys called on non-object');
|
||||
}
|
||||
|
||||
var result = [], prop, i;
|
||||
|
||||
for (prop in obj) {
|
||||
if (hasOwnProperty.call(obj, prop)) {
|
||||
result.push(prop);
|
||||
}
|
||||
}
|
||||
|
||||
if (hasDontEnumBug) {
|
||||
for (i = 0; i < dontEnumsLength; i++) {
|
||||
if (hasOwnProperty.call(obj, dontEnums[i])) {
|
||||
result.push(dontEnums[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}());
|
||||
}
|
||||
|
||||
//Production steps of ECMA-262, Edition 5, 15.4.4.18
|
||||
//Reference: http://es5.github.com/#x15.4.4.18
|
||||
if (!Array.prototype.forEach) {
|
||||
Array.prototype.forEach = function (callback, thisArg) {
|
||||
var T, k;
|
||||
|
||||
if (this == null) {
|
||||
throw new TypeError(' this is null or not defined');
|
||||
}
|
||||
|
||||
// 1. Let O be the result of calling ToObject passing the |this| value as the argument.
|
||||
var O = Object(this);
|
||||
|
||||
// 2. Let lenValue be the result of calling the Get internal method of O with the argument "length".
|
||||
// 3. Let len be ToUint32(lenValue).
|
||||
var len = O.length >>> 0;
|
||||
|
||||
// 4. If IsCallable(callback) is false, throw a TypeError exception.
|
||||
// See: http://es5.github.com/#x9.11
|
||||
if (typeof callback !== "function") {
|
||||
throw new TypeError(callback + " is not a function");
|
||||
}
|
||||
|
||||
// 5. If thisArg was supplied, let T be thisArg; else let T be undefined.
|
||||
if (arguments.length > 1) {
|
||||
T = thisArg;
|
||||
}
|
||||
|
||||
// 6. Let k be 0
|
||||
k = 0;
|
||||
|
||||
// 7. Repeat, while k < len
|
||||
while (k < len) {
|
||||
var kValue;
|
||||
|
||||
// a. Let Pk be ToString(k).
|
||||
// This is implicit for LHS operands of the in operator
|
||||
// b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.
|
||||
// This step can be combined with c
|
||||
// c. If kPresent is true, then
|
||||
if (k in O) {
|
||||
// i. Let kValue be the result of calling the Get internal method of O with argument Pk.
|
||||
kValue = O[k];
|
||||
|
||||
// ii. Call the Call internal method of callback with T as the this value and
|
||||
// argument list containing kValue, k, and O.
|
||||
callback.call(T, kValue, k, O);
|
||||
}
|
||||
// d. Increase k by 1.
|
||||
k++;
|
||||
}
|
||||
// 8. return undefined
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
/* Pretty printing styles. Used with prettify.js. */
|
||||
/* Vim sunburst theme by David Leibovic */
|
||||
|
||||
pre .str, code .str { color: #65B042; } /* string - green */
|
||||
pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */
|
||||
pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */
|
||||
pre .typ, code .typ { color: #89bdff; } /* type - light blue */
|
||||
pre .lit, code .lit { color: #3387CC; } /* literal - blue */
|
||||
pre .pun, code .pun { color: #fff; } /* punctuation - white */
|
||||
pre .pln, code .pln { color: #fff; } /* plaintext - white */
|
||||
pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */
|
||||
pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */
|
||||
pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */
|
||||
pre .dec, code .dec { color: #3387CC; } /* decimal - blue */
|
||||
|
||||
pre.prettyprint, code.prettyprint {
|
||||
background-color: #000;
|
||||
-moz-border-radius: 8px;
|
||||
-webkit-border-radius: 8px;
|
||||
-o-border-radius: 8px;
|
||||
-ms-border-radius: 8px;
|
||||
-khtml-border-radius: 8px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
pre.prettyprint {
|
||||
width: 95%;
|
||||
margin: 1em auto;
|
||||
padding: 1em;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
|
||||
/* Specify class=linenums on a pre to get line numbering */
|
||||
ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
|
||||
li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
|
||||
/* Alternate shading for lines */
|
||||
li.L1,li.L3,li.L5,li.L7,li.L9 { }
|
||||
|
||||
@media print {
|
||||
pre .str, code .str { color: #060; }
|
||||
pre .kwd, code .kwd { color: #006; font-weight: bold; }
|
||||
pre .com, code .com { color: #600; font-style: italic; }
|
||||
pre .typ, code .typ { color: #404; font-weight: bold; }
|
||||
pre .lit, code .lit { color: #044; }
|
||||
pre .pun, code .pun { color: #440; }
|
||||
pre .pln, code .pln { color: #000; }
|
||||
pre .tag, code .tag { color: #006; font-weight: bold; }
|
||||
pre .atn, code .atn { color: #404; }
|
||||
pre .atv, code .atv { color: #060; }
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2012 Jeffrey B. Arnold
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/],
|
||||
["pun",/^(?:<<?-|->>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2009 Onno Hommes.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
|
||||
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2009 Onno Hommes.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
|
||||
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2009 Onno Hommes.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
|
||||
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Peter Kofler
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i,
|
||||
null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Peter Kofler
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i,
|
||||
null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2008 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
Copyright (C) 2011 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[\(\{\[]+/,null,"([{"],["clo",/^[\)\}\]]+/,null,")]}"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,
|
||||
null],["typ",/^:[0-9a-zA-Z\-]+/]]),["clj"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2009 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']+)\)/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],
|
||||
["com",/^(?:\x3c!--|--\x3e)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#(?:[0-9a-f]{3}){1,2}\b/i],["pln",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],["pun",/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^\)\"\']+/]]),["css-str"]);
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!(?:.*)/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/(?:.*)/],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|async|await|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|sync|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i],
|
||||
["typ",/^\b(?:bool|double|Dynamic|int|num|Object|String|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?[\']{3}[\s|\S]*?[^\\][\']{3}/],["str",/^r?[\"]{3}[\s|\S]*?[^\\][\"]{3}/],["str",/^r?\'(\'|(?:[^\n\r\f])*?[^\\]\')/],["str",/^r?\"(\"|(?:[^\n\r\f])*?[^\\]\")/],["typ",/^[A-Z]\w*/],["pln",/^[a-z_$][a-z0-9_]*/i],["pun",/^[~!%^&*+=|?:<>/-]/],["lit",/^\b0x[0-9a-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",
|
||||
/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(){}\[\],.;]/]]),["dart"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2008 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Andrew Allen
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/],
|
||||
["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Andrew Allen
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/],
|
||||
["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2008 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],
|
||||
["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]);
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2010 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])+(?:\'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/],["pln",/^(?:[^\/\"\'`]|\/(?![\/\*]))+/i]]),["go"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2009 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/,
|
||||
null],["pln",/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],["pun",/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),["hs"]);
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Eric Knibbe
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//],
|
||||
["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i],
|
||||
["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]);
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Eric Knibbe
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//],
|
||||
["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i],
|
||||
["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]);
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2011 Martin S.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2014 Paulo Moura
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/],
|
||||
["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2008 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Nikhil Dabas
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]);
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Nikhil Dabas
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2014 Paulo Moura
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/],
|
||||
["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]);
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Eric Knibbe
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//],
|
||||
["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i],
|
||||
["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2008 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2008 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],["str",/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],
|
||||
["pln",/^[a-z_]\w*/i],["pun",/^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]]),["lua"]);
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2008 Google Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],
|
||||
["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2011 Kitware Inc.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"]|\\.)*")/,null,'"']],[["com",/^;[^\r\n]*/,null,";"],["dec",/^(?:\$(?:D|DEVICE|EC|ECODE|ES|ESTACK|ET|ETRAP|H|HOROLOG|I|IO|J|JOB|K|KEY|P|PRINCIPAL|Q|QUIT|ST|STACK|S|STORAGE|SY|SYSTEM|T|TEST|TL|TLEVEL|TR|TRESTART|X|Y|Z[A-Z]*|A|ASCII|C|CHAR|D|DATA|E|EXTRACT|F|FIND|FN|FNUMBER|G|GET|J|JUSTIFY|L|LENGTH|NA|NAME|O|ORDER|P|PIECE|QL|QLENGTH|QS|QSUBSCRIPT|Q|QUERY|R|RANDOM|RE|REVERSE|S|SELECT|ST|STACK|T|TEXT|TR|TRANSLATE|NaN))\b/i,
|
||||
null],["kwd",/^(?:[^\$]B|BREAK|C|CLOSE|D|DO|E|ELSE|F|FOR|G|GOTO|H|HALT|H|HANG|I|IF|J|JOB|K|KILL|L|LOCK|M|MERGE|N|NEW|O|OPEN|Q|QUIT|R|READ|S|SET|TC|TCOMMIT|TRE|TRESTART|TRO|TROLLBACK|TS|TSTART|U|USE|V|VIEW|W|WRITE|X|XECUTE)\b/i,null],["lit",/^[+-]?(?:(?:\.\d+|\d+(?:\.\d*)?)(?:E[+\-]?\d+)?)/i],["pln",/^[a-z][a-zA-Z0-9]*/i],["pun",/^[^\w\t\n\r\xA0\"\$;%\^]|_/]]),["mumps"]);
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2011 Zimin A.V.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/,
|
||||
null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/,
|
||||
null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]);
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2011 Zimin A.V.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/,
|
||||
null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/,
|
||||
null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]);
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Peter Kofler
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$))/,null,"'"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^\(\*[\s\S]*?(?:\*\)|$)|^\{[\s\S]*?(?:\}|$)/,null],["kwd",/^(?:ABSOLUTE|AND|ARRAY|ASM|ASSEMBLER|BEGIN|CASE|CONST|CONSTRUCTOR|DESTRUCTOR|DIV|DO|DOWNTO|ELSE|END|EXTERNAL|FOR|FORWARD|FUNCTION|GOTO|IF|IMPLEMENTATION|IN|INLINE|INTERFACE|INTERRUPT|LABEL|MOD|NOT|OBJECT|OF|OR|PACKED|PROCEDURE|PROGRAM|RECORD|REPEAT|SET|SHL|SHR|THEN|TO|TYPE|UNIT|UNTIL|USES|VAR|VIRTUAL|WHILE|WITH|XOR)\b/i,
|
||||
null],["lit",/^(?:true|false|self|nil)/i,null],["pln",/^[a-z][a-z0-9]*/i,null],["lit",/^(?:\$[a-f0-9]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?)/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\/]*/,null]]),["pascal"]);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue