Compare commits
94 Commits
log
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d20ac8fafc | ||
|
|
2395a489a3 | ||
|
|
0b8eedf935 | ||
|
|
807ada0bf9 | ||
|
|
216c35c0b8 | ||
|
|
d98cd5d9a9 | ||
|
|
fb6adf316f | ||
|
|
0854317cc8 | ||
|
|
fcdefa450c | ||
|
|
dc50a460e5 | ||
|
|
31187ccb69 | ||
|
|
d4b72b06e9 | ||
|
|
922e1e6ac4 | ||
|
|
79341b2c8e | ||
|
|
8a1eebb9b0 | ||
|
|
85e26c6d93 | ||
|
|
0a1ff64d18 | ||
|
|
176f38070d | ||
|
|
4f5b0f74fd | ||
|
|
c549508417 | ||
|
|
b86515a926 | ||
|
|
1ba8c31d2c | ||
|
|
06ff1d4e8f | ||
|
|
b03a11f2b5 | ||
|
|
a362d21aa4 | ||
|
|
cd33d80a8c | ||
|
|
2bb0dd545d | ||
|
|
ac2115114c | ||
|
|
831550d847 | ||
|
|
1fa7b4a911 | ||
|
|
bcdb5ce0e6 | ||
|
|
a3485dd9b7 | ||
|
|
5a28b89f46 | ||
|
|
58b1b50c2e | ||
|
|
8f75df15e2 | ||
|
|
9883d3b064 | ||
|
|
e477ce7048 | ||
|
|
0985aed0b0 | ||
|
|
2ffda7a1a6 | ||
|
|
5cad4aa93e | ||
|
|
2a61449ce1 | ||
|
|
fe0b42c5e3 | ||
|
|
6ccc724839 | ||
|
|
56cdeffaa9 | ||
|
|
5633eb4111 | ||
|
|
6255c8dbbc | ||
|
|
1fd7d5df88 | ||
|
|
01213c5d02 | ||
|
|
49685e545b | ||
|
|
2542a24675 | ||
|
|
28d3e05ca9 | ||
|
|
00fbb5cd74 | ||
|
|
fbafcd5c92 | ||
|
|
376a90772d | ||
|
|
4f4e75859d | ||
|
|
679459f53b | ||
|
|
8baef0d873 | ||
|
|
d01dddf9e3 | ||
|
|
d61e5236d0 | ||
|
|
d514e6dc0f | ||
|
|
188d2def2d | ||
|
|
17d64ad963 | ||
|
|
d95fbe02bd | ||
|
|
212526d989 | ||
|
|
ef5052e7ea | ||
|
|
3531af4a46 | ||
|
|
b2f6fb3a00 | ||
|
|
996da0862c | ||
|
|
50dd7c1b83 | ||
|
|
2dd067170b | ||
|
|
e635ca86c5 | ||
|
|
8bd36e37a3 | ||
|
|
b3b2f7c407 | ||
|
|
f1ad3d44ff | ||
|
|
ee6ff50244 | ||
|
|
196741d5dc | ||
|
|
374c06472f | ||
|
|
12c85c60c7 | ||
|
|
4747ee93b2 | ||
|
|
5ec53c4b33 | ||
|
|
ee7f7f50cc | ||
|
|
92869e8d6c | ||
|
|
c66dda239f | ||
|
|
e927760c40 | ||
|
|
8783f9059a | ||
|
|
12e1239267 | ||
|
|
7c963193ef | ||
|
|
bce9a624d7 | ||
|
|
dac3606b4e | ||
|
|
eb00385d76 | ||
|
|
986f562266 | ||
|
|
11d0441ed4 | ||
|
|
ef46e2c51e | ||
|
|
0a3c03f18b |
23
Dockerfile
@@ -1,7 +1,7 @@
|
||||
FROM ubuntu:20.04
|
||||
MAINTAINER chenjh "842761733@qq.com"
|
||||
ADD server/target/kkFileView-*.tar.gz /opt/
|
||||
COPY fonts/* /usr/share/fonts/chienes/
|
||||
COPY fonts/* /usr/share/fonts/chinese/
|
||||
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" > /etc/apt/sources.list &&\
|
||||
apt-get clean && apt-get update &&\
|
||||
apt-get install -y locales && apt-get install -y language-pack-zh-hans &&\
|
||||
@@ -14,12 +14,21 @@ RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe m
|
||||
apt-get install xfonts-wqy &&\
|
||||
cd /tmp &&\
|
||||
wget https://kkfileview.keking.cn/server-jre-8u251-linux-x64.tar.gz &&\
|
||||
wget https://kkfileview.keking.cn/Apache_OpenOffice_4.1.6_Linux_x86-64_install-deb_zh-CN.tar.gz -cO openoffice_deb.tar.gz &&\
|
||||
tar -zxf /tmp/server-jre-8u251-linux-x64.tar.gz && mv /tmp/jdk1.8.0_251 /usr/local/ &&\
|
||||
tar -zxf /tmp/openoffice_deb.tar.gz && cd /tmp/zh-CN/DEBS &&\
|
||||
dpkg -i *.deb && dpkg -i desktop-integration/openoffice4.1-debian-menus_4.1.6-9790_all.deb &&\
|
||||
|
||||
# 安装 OpenOffice
|
||||
# wget https://kkfileview.keking.cn/Apache_OpenOffice_4.1.6_Linux_x86-64_install-deb_zh-CN.tar.gz -cO openoffice_deb.tar.gz &&\
|
||||
# tar -zxf /tmp/openoffice_deb.tar.gz && cd /tmp/zh-CN/DEBS &&\
|
||||
# dpkg -i *.deb && dpkg -i desktop-integration/openoffice4.1-debian-menus_4.1.6-9790_all.deb &&\
|
||||
|
||||
# 安装 libreoffice
|
||||
apt-get install -y libxinerama1 libcairo2 libcups2 libx11-xcb1 &&\
|
||||
wget https://kkfileview.keking.cn/LibreOffice_7.1.4_Linux_x86-64_deb.tar.gz -cO libreoffice_deb.tar.gz &&\
|
||||
tar -zxf /tmp/libreoffice_deb.tar.gz && cd /tmp/LibreOffice_7.1.4.2_Linux_x86-64_deb/DEBS &&\
|
||||
dpkg -i *.deb &&\
|
||||
|
||||
rm -rf /tmp/* && rm -rf /var/lib/apt/lists/* &&\
|
||||
cd /usr/share/fonts/chienes &&\
|
||||
cd /usr/share/fonts/chinese &&\
|
||||
mkfontscale &&\
|
||||
mkfontdir &&\
|
||||
fc-cache -fv
|
||||
@@ -28,5 +37,5 @@ ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
|
||||
ENV PATH $PATH:$JAVA_HOME/bin
|
||||
ENV LANG zh_CN.UTF-8
|
||||
ENV LC_ALL zh_CN.UTF-8
|
||||
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-3.3.0/bin
|
||||
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider","-Dspring.config.location=/opt/kkFileView-3.3.0/config/application.properties","-jar","/opt/kkFileView-3.3.0/bin/kkFileView-3.3.0.jar"]
|
||||
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.0.0/bin
|
||||
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dspring.config.location=/opt/kkFileView-4.0.0/config/application.properties","-jar","/opt/kkFileView-4.0.0/bin/kkFileView-4.0.0.jar"]
|
||||
75
README.md
@@ -2,14 +2,14 @@
|
||||
此项目为文件文档在线预览项目解决方案,对标业内付费产品有【[永中office](http://dcs.yozosoft.com/)】【[office365](http://www.officeweb365.com/)】【[idocv](https://www.idocv.com/)】等,在取得公司高层同意后以Apache协议开源出来反哺社区,在此特别感谢@唐老大的支持以及@端木详笑的贡献。该项目使用流行的spring boot搭建,易上手和部署,基本支持主流办公文档的在线预览,如doc,docx,Excel,pdf,txt,zip,rar,图片等等
|
||||
### 项目特性
|
||||
|
||||
1. 支持office,pdf, cad等办公文档
|
||||
1. 支持txt,java,php,py,md,js,css等所有纯文本
|
||||
1. 支持zip,rar,jar,tar,gzip等压缩包
|
||||
1. 支持jpg,jpeg,png,gif等图片预览(翻转,缩放,镜像)
|
||||
1. 使用spring boot开发,预览服务搭建部署非常简便
|
||||
1. rest接口提供服务,跨平台特性(java,php,python,go,php,....)都支持,应用接入简单方便
|
||||
1. 支持 office, pdf, cad 等办公文档
|
||||
1. 支持 txt, xml(渲染), md(渲染), java, php, py, js, css 等所有纯文本
|
||||
1. 支持 zip, rar, jar, tar, gzip 等压缩包
|
||||
1. 支持 jpg, jpeg, png, gif, tif, tiff 等图片预览(翻转,缩放,镜像)
|
||||
1. 使用 spring-boot 开发,预览服务搭建部署非常简便
|
||||
1. rest 接口提供服务,跨语言、跨平台特性(java,php,python,go,php,....)都支持,应用接入简单方便
|
||||
1. 抽象预览服务接口,方便二次开发,非常方便添加其他类型文件预览支持
|
||||
1. 最最重要Apache协议开源,代码pull下来想干嘛就干嘛
|
||||
1. 最最重要 Apache 协议开源,代码 pull 下来想干嘛就干嘛
|
||||
|
||||
### 官网及文档
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
1. English document:https://gitee.com/kekingcn/file-online-preview/blob/master/README.en.md
|
||||
|
||||
### 联系我们,加入组织
|
||||
> 我们会用心回答解决大家在项目使用中的问题,也请大家在提问前至少Google或baidu过,珍爱生命远离无效的交流沟通
|
||||
> 我们会用心回答解决大家在项目使用中的问题,也请大家在提问前至少 Google 或 baidu 过,珍爱生命远离无效的交流沟通
|
||||
|
||||

|
||||
|
||||
@@ -99,16 +99,59 @@ pdf预览模式预览效果如下
|
||||
- jodconverter
|
||||
> 依赖外部环境
|
||||
- redis (可选,默认不用)
|
||||
- OpenOffice或者LibreOffice(Windows下已内置,Linux会自动安装,Mac OS下需要手动安装)
|
||||
- OpenOffice 或者 LibreOffice( Windows 下已内置,Linux 脚本启动模式会自动安装,Mac OS 下需要手动安装)
|
||||
|
||||
1. 第一步:pull项目https://github.com/kekingcn/file-online-preview.git
|
||||
1. 第一步:pull 项目 https://github.com/kekingcn/file-online-preview.git
|
||||
|
||||
3. 第二步:运行FilePreviewApplication的main方法,服务启动后,访问http://localhost:8012/
|
||||
3. 第二步:运行 ServerMain 的 main 方法,服务启动后,访问 http://localhost:8012/
|
||||
会看到如下界面,代表服务启动成功
|
||||
|
||||

|
||||
|
||||
### 历史更新记录
|
||||
|
||||
> 2021年7月6日,v4.0.0 版本发布 :
|
||||
|
||||
1. 底层集成OpenOffice替换为LibreOffice,Office文件兼容性增强,预览效果提升
|
||||
2. 修复压缩文件目录穿越漏洞
|
||||
3. 修复PPT预览使用PDF模式无效
|
||||
4. 修复PPT图片预览模式前端显示异常
|
||||
5. 新增功能:首页文件上传功能可通过配置实时开启或禁用
|
||||
6. 优化增加Office进程关闭日志
|
||||
7. 优化Windows环境下,查找Office组件逻辑(内置的LibreOffice优先)
|
||||
8. 优化启动Office进程改同步执行
|
||||
|
||||
> 2021年6月17日,v3.6.0 版本发布 :
|
||||
|
||||
ofd 类型文件支持版本,本次版本重要功能均由社区开发贡献,感谢 @gaoxingzaq、@zhangxiaoxiao9527 的代码贡献
|
||||
1. 新增 ofd 类型文件预览支持,ofd 是国产的类似 pdf 格式的文件
|
||||
2. 新增了 ffmpeg 视频文件转码预览支持,打开转码功能后,理论上支持所有主流视频的预览,如 rm、rmvb、flv 等
|
||||
3. 美化了 ppt、pptx 类型文件预览效果,比之前版本好看太多
|
||||
4. 更新了 pdfbox、xstream、common-io 等依赖的版本
|
||||
|
||||
> 2021年1月28日 :
|
||||
|
||||
2020农历年最后一个版本发布,主要包含了部分 UI 改进,和解决了 QQ 群友、 Issue 里反馈的 Bug 修复,最最重要的是发个新版,过个好年
|
||||
|
||||
1. 引入galimatias,解决不规范文件名导致文件下载异常
|
||||
2. 更新index接入演示界面UI风格
|
||||
3. 更新markdown文件预览UI风格
|
||||
4. 更新XML文件预览UI风格,调整类文本预览架构,更方便扩展
|
||||
5. 更新simTxT文件预览UI风格
|
||||
6. 调整多图连续预览上下翻图的UI
|
||||
7. 采用apache-common-io包简化所有的文件下载io操作
|
||||
8. XML文件预览支持切换纯文本模式
|
||||
9. 增强url base64解码失败时的提示信息
|
||||
10. 修复导包错误以及图片预览 bug
|
||||
11. 修复发行包运行时找不到日志目录的问题
|
||||
12. 修复压缩包内多图连续预览的bug
|
||||
13. 修复大小写文件类型后缀没通用匹配的问题
|
||||
14. 指定Base64转码采用Apache Commons-code中的实现,修复base64部分jdk版本下出现的异常
|
||||
15. 修复类文本类型HTML文件预览的bug
|
||||
16. 修复:dwg文件预览时无法在jpg和pdf两种类型之间切换
|
||||
17. escaping of dangerous characters to prevent reflected xss
|
||||
18. 修复重复编码导致文档转图片预览失败的问题&编码规范
|
||||
|
||||
> 2020年12月27日 :
|
||||
|
||||
2020年年终大版本更新,架构全面设计,代码全面重构,代码质量全面提升,二次开发更便捷,欢迎拉源码品鉴,提issue、pr共同建设
|
||||
@@ -183,5 +226,13 @@ pdf预览模式预览效果如下
|
||||
1. 引入pdf.js预览doc等文件,支持doc标题生成pdf预览菜单,支持手机端预览
|
||||
|
||||
### 使用登记
|
||||
如果这个项目解决了你的实际问题,可在https://gitee.com/kekingcn/file-online-preview/issues/IGSBV
|
||||
如果这个项目解决了你的实际问题,可在 https://gitee.com/kekingcn/file-online-preview/issues/IGSBV
|
||||
登记下,如果节省了你的三方预览服务费用,也愿意支持下的话,可点击下方【捐助】请作者喝杯咖啡,也是非常感谢
|
||||
|
||||
### Stars 趋势图
|
||||
#### Gitee
|
||||
[](https://whnb.wang/kekingcn/file-online-preview?e=86400)
|
||||
|
||||
#### GitHub
|
||||
|
||||
[](https://starchart.cc/kekingcn/kkFileView)
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>cn.keking</groupId>
|
||||
|
||||
<parent>
|
||||
<artifactId>filepreview</artifactId>
|
||||
<groupId>cn.keking</groupId>
|
||||
<version>4.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>office-plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<!-- required for org.hyperic:sigar -->
|
||||
@@ -22,7 +24,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>2.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openoffice</groupId>
|
||||
|
||||
@@ -81,15 +81,16 @@ public class OfficeUtils {
|
||||
}
|
||||
if (PlatformUtils.isWindows()) {
|
||||
// %ProgramFiles(x86)% on 64-bit machines; %ProgramFiles% on 32-bit ones
|
||||
String homePath = ConfigUtils.getHomePath();
|
||||
String officePluginPath = ConfigUtils.getOfficePluginPath();
|
||||
String programFiles = System.getenv("ProgramFiles(x86)");
|
||||
if (programFiles == null) {
|
||||
programFiles = System.getenv("ProgramFiles");
|
||||
}
|
||||
return findOfficeHome(
|
||||
programFiles + File.separator + "OpenOffice 4",
|
||||
programFiles + File.separator + "LibreOffice 4",
|
||||
homePath + File.separator + "office"
|
||||
officePluginPath + File.separator + "windows-office",
|
||||
programFiles + File.separator + "LibreOffice",
|
||||
programFiles + File.separator + "OpenOffice 4",
|
||||
programFiles + File.separator + "LibreOffice 4"
|
||||
);
|
||||
} else if (PlatformUtils.isMac()) {
|
||||
return findOfficeHome(
|
||||
@@ -103,6 +104,9 @@ public class OfficeUtils {
|
||||
"/opt/openoffice.org3",
|
||||
"/opt/openoffice",
|
||||
"/opt/libreoffice",
|
||||
"/opt/libreoffice6.1",
|
||||
"/opt/libreoffice7.0",
|
||||
"/opt/libreoffice7.1",
|
||||
"/opt/openoffice4",
|
||||
"/usr/lib/openoffice",
|
||||
"/usr/lib/libreoffice"
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.io.File;
|
||||
public class ConfigUtils {
|
||||
|
||||
private static final String MAIN_DIRECTORY_NAME = "server";
|
||||
private static final String OFFICE_PLUGIN_NAME = "office-plugin";
|
||||
|
||||
public static String getHomePath() {
|
||||
String userDir = System.getenv("KKFILEVIEW_BIN_FOLDER");
|
||||
@@ -28,6 +29,23 @@ public class ConfigUtils {
|
||||
return userDir;
|
||||
}
|
||||
|
||||
|
||||
public static String getOfficePluginPath() {
|
||||
String userDir = System.getenv("KKFILEVIEW_BIN_FOLDER");
|
||||
if (userDir == null) {
|
||||
userDir = System.getProperty("user.dir");
|
||||
}
|
||||
if (userDir.endsWith("bin")) {
|
||||
userDir = userDir.substring(0, userDir.length() - 4);
|
||||
} else {
|
||||
String separator = File.separator;
|
||||
if (!userDir.contains(OFFICE_PLUGIN_NAME)) {
|
||||
userDir = userDir + separator + OFFICE_PLUGIN_NAME;
|
||||
}
|
||||
}
|
||||
return userDir;
|
||||
}
|
||||
|
||||
public static String getCustomizedConfigPath() {
|
||||
String homePath = getHomePath();
|
||||
String separator = java.io.File.separator;
|
||||
|
||||
16481
office-plugin/windows-office/CREDITS.fodt
Normal file
6787
office-plugin/windows-office/LICENSE.html
Normal file
@@ -1,5 +1,12 @@
|
||||
Portions of LibreOffice may include work under the Apache License v2.0
|
||||
requiring this NOTICE file to be provided.
|
||||
|
||||
For a more complete license statement please see the associated
|
||||
documentation
|
||||
____
|
||||
|
||||
Apache OpenOffice (http://www.openoffice.org)
|
||||
Copyright 2011, 2018 The Apache Software Foundation
|
||||
Copyright 2011, 2014 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
@@ -16,11 +23,11 @@ ____
|
||||
As part of the base system this product also includes code from the following
|
||||
Apache projects:
|
||||
- Apache Lucene
|
||||
- Apache Portable Runtime
|
||||
- Apache Portable Runtime
|
||||
- Apache Portable Runtime Utility Library
|
||||
- Apache Commons - used by MediaWiki Publisher extension
|
||||
- Apache Jakarta HttpClient - used by MediaWiki Publisher extension
|
||||
- Apache Tomcat - used by MediaWiki Piblisher extension
|
||||
- Apache Tomcat - used by MediaWiki Publisher extension
|
||||
|
||||
The notices from these projects are following:
|
||||
|
||||
@@ -117,12 +124,6 @@ the MX4J package, which is open source software. The
|
||||
original software and related information is available
|
||||
at http://mx4j.sourceforge.net/.
|
||||
|
||||
The Windows Installer is built with the Nullsoft
|
||||
Scriptable Install System (NSIS), which is
|
||||
open source software. The original software and
|
||||
related information is available at
|
||||
http://nsis.sourceforge.net/.
|
||||
|
||||
Java compilation software for JSP pages is provided by Eclipse,
|
||||
which is open source software. The original software and
|
||||
related information is available at
|
||||
@@ -130,11 +131,11 @@ http://www.eclipse.org/.
|
||||
|
||||
____
|
||||
|
||||
As part of the base system this product also includes code from the following
|
||||
As part of the base system this product may also includes code from the following
|
||||
projects which are licensed under the Apache license:
|
||||
- serf
|
||||
- redland
|
||||
- StAX
|
||||
- Apache BeanShell Scripting for Java
|
||||
|
||||
The notices from these projects are following:
|
||||
|
||||
@@ -142,45 +143,17 @@ serf
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
|
||||
redland
|
||||
This product includes Redland software (http://librdf.org/)
|
||||
developed at the Institute for Learning and Research Technology,
|
||||
University of Bristol, UK (http://www.bristol.ac.uk/).
|
||||
|
||||
|
||||
StAX
|
||||
[no notices]
|
||||
|
||||
Apache BeanShell Scripting for Java
|
||||
Copyright 1997-2012 Patrick Niemeyer
|
||||
Granted to the Apache Software Foundation 2012
|
||||
Licensed under the Apache License, Version 2.0.
|
||||
____
|
||||
|
||||
This product includes software developed by the OpenSSL Project
|
||||
for use in the OpenSSL Toolkit. (http://www.openssl.org/)
|
||||
|
||||
___
|
||||
|
||||
Apache OpenOffice has some optional parts that only get included
|
||||
when the configure option --enable-category-b has been requested.
|
||||
When you used this option make sure to comply with the
|
||||
distribution requirements of these parts by extending
|
||||
this file with the notices recommended by them:
|
||||
|
||||
___
|
||||
|
||||
Notices for CoinMP libary:
|
||||
The Computational Infrastructure for Operations Research COIN_OR
|
||||
project developed the CoinMP library (a lightweight API and DLL
|
||||
for CLP, CBC, and CGL).
|
||||
It includes and depends on
|
||||
- CoinUtils: COIN-OR utilities, utilities, data structures, and
|
||||
linear algebra methods for COIN-OR projects
|
||||
- CLP: COIN-OR Graph Classes, a collection of network representations
|
||||
and algorithms
|
||||
- CBC: COIN-OR Branch and Cut, an LP-based branch-and-cut library
|
||||
- CGL: Cut Generator Library, a library of cutting-plane generators
|
||||
The source code of these dependencies which are available under
|
||||
license EPL can found at
|
||||
http://www.coin-or.org/download/source/CoinMP/
|
||||
|
||||
___
|
||||
|
||||
100
office-plugin/windows-office/help/a11y-toggle.js
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Edenspiekermann
|
||||
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var internalId = 0;
|
||||
var togglesMap = {};
|
||||
var targetsMap = {};
|
||||
|
||||
function $ (selector, context) {
|
||||
return Array.prototype.slice.call(
|
||||
(context || document).querySelectorAll(selector)
|
||||
);
|
||||
}
|
||||
|
||||
function getClosestToggle (element) {
|
||||
if (element.closest) {
|
||||
return element.closest('[data-a11y-toggle]');
|
||||
}
|
||||
|
||||
while (element) {
|
||||
if (element.nodeType === 1 && element.hasAttribute('data-a11y-toggle')) {
|
||||
return element;
|
||||
}
|
||||
|
||||
element = element.parentNode;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function handleToggle (toggle) {
|
||||
var target = toggle && targetsMap[toggle.getAttribute('aria-controls')];
|
||||
|
||||
if (!target) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var toggles = togglesMap['#' + target.id];
|
||||
var isExpanded = target.getAttribute('aria-hidden') === 'false';
|
||||
|
||||
target.setAttribute('aria-hidden', isExpanded);
|
||||
toggles.forEach(function (toggle) {
|
||||
toggle.setAttribute('aria-expanded', !isExpanded);
|
||||
});
|
||||
}
|
||||
|
||||
var initA11yToggle = function (context) {
|
||||
togglesMap = $('[data-a11y-toggle]', context).reduce(function (acc, toggle) {
|
||||
var selector = '#' + toggle.getAttribute('data-a11y-toggle');
|
||||
acc[selector] = acc[selector] || [];
|
||||
acc[selector].push(toggle);
|
||||
return acc;
|
||||
}, togglesMap);
|
||||
|
||||
var targets = Object.keys(togglesMap);
|
||||
targets.length && $(targets).forEach(function (target) {
|
||||
var toggles = togglesMap['#' + target.id];
|
||||
var isExpanded = target.hasAttribute('data-a11y-toggle-open');
|
||||
var labelledby = [];
|
||||
|
||||
toggles.forEach(function (toggle) {
|
||||
toggle.id || toggle.setAttribute('id', 'a11y-toggle-' + internalId++);
|
||||
toggle.setAttribute('aria-controls', target.id);
|
||||
toggle.setAttribute('aria-expanded', isExpanded);
|
||||
labelledby.push(toggle.id);
|
||||
});
|
||||
|
||||
target.setAttribute('aria-hidden', !isExpanded);
|
||||
target.hasAttribute('aria-labelledby') || target.setAttribute('aria-labelledby', labelledby.join(' '));
|
||||
|
||||
targetsMap[target.id] = target;
|
||||
});
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
initA11yToggle();
|
||||
});
|
||||
|
||||
document.addEventListener('click', function (event) {
|
||||
var toggle = getClosestToggle(event.target);
|
||||
handleToggle(toggle);
|
||||
});
|
||||
|
||||
document.addEventListener('keyup', function (event) {
|
||||
if (event.which === 13 || event.which === 32) {
|
||||
var toggle = getClosestToggle(event.target);
|
||||
if (toggle && toggle.getAttribute('role') === 'button') {
|
||||
handleToggle(toggle);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
window && (window.a11yToggle = initA11yToggle);
|
||||
})();
|
||||
907
office-plugin/windows-office/help/default.css
Normal file
608
office-plugin/windows-office/help/fuzzysort.js
Normal file
46
office-plugin/windows-office/help/help.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
function getParameterByName(name, url) {
|
||||
if (!url) {
|
||||
url = window.location.href;
|
||||
}
|
||||
name = name.replace(/[\[\]]/g, "\\$&");
|
||||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)");
|
||||
var results = regex.exec(url);
|
||||
if (!results) {
|
||||
return null;
|
||||
}
|
||||
if (!results[2]) {
|
||||
return '';
|
||||
}
|
||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
var url = window.location.href;
|
||||
var n = url.indexOf('?');
|
||||
if (n != -1) {
|
||||
// the URL came from LibreOffice help (F1)
|
||||
var version = getParameterByName("Version", url);
|
||||
var query = url.substr(n + 1, url.length);
|
||||
var newURL = version + '/index.html?' + query;
|
||||
window.location.replace(newURL);
|
||||
} else {
|
||||
window.location.replace('latest/index.html');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
188
office-plugin/windows-office/help/help.js
Normal file
@@ -0,0 +1,188 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
// Pagination and fuzzy search
|
||||
var url = window.location.pathname;
|
||||
var moduleRegex = new RegExp('text\\/(\\w+)\\/');
|
||||
var regexArray = moduleRegex.exec(url);
|
||||
var modules = ['CALC', 'WRITER', 'IMPRESS', 'DRAW', 'BASE', 'MATH', 'CHART', 'BASIC', 'SHARED'];
|
||||
var indexEl = document.getElementsByClassName("index")[0];
|
||||
var fullLinks = fullLinkify(indexEl, bookmarks, modules, currentModule());
|
||||
var search = document.getElementById('search-bar');
|
||||
search.addEventListener('keyup', debounce(filter, 100, indexEl));
|
||||
// Preserve search input value during the session
|
||||
search.value = sessionStorage.getItem('searchsave');
|
||||
if (search.value !== undefined) {
|
||||
filter(indexEl);
|
||||
}
|
||||
window.addEventListener('unload', function(event) {
|
||||
sessionStorage.setItem('searchsave', search.value);
|
||||
});
|
||||
// render the unfiltered index list on page load
|
||||
fillIndex(indexEl, fullLinks, modules);
|
||||
|
||||
function currentModule() {
|
||||
var module = '';
|
||||
// get the module name from the URL and remove the first character,
|
||||
// but first deal with snowflake Base
|
||||
if(url.indexOf('explorer/database/') !== -1) {
|
||||
module = 'BASE';
|
||||
} else {
|
||||
if (null === regexArray){// comes from search or elsewhere, no defined module in URL
|
||||
module = 'HARED'
|
||||
} else {
|
||||
module = regexArray[1].toUpperCase().substring(1);
|
||||
}
|
||||
}
|
||||
return module;
|
||||
};
|
||||
function fullLinkify(indexEl, bookmarks, modules, currentModule) {
|
||||
var fullLinkified = '';
|
||||
// if user is not on a shared category page, limit the index to the current module + shared
|
||||
if(currentModule !== 'HARED') {
|
||||
bookmarks = bookmarks.filter(function(obj) {
|
||||
return obj['app'] === currentModule || obj['app'] === 'SHARED';
|
||||
});
|
||||
}
|
||||
bookmarks.forEach(function(obj) {
|
||||
fullLinkified += '<a href="' + obj['url'] + '" class="' + obj['app'] + '">' + obj['text'] + '</a>';
|
||||
});
|
||||
return fullLinkified;
|
||||
}
|
||||
function fillIndex(indexEl, content, modules) {
|
||||
indexEl.innerHTML = content;
|
||||
var indexKids = indexEl.children;
|
||||
for (var i = 0, len = indexKids.length; i < len; i++) {
|
||||
indexKids[i].removeAttribute("id");
|
||||
}
|
||||
modules.forEach(function(module) {
|
||||
var moduleHeader = indexEl.getElementsByClassName(module)[0];
|
||||
if (typeof moduleHeader !== 'undefined') {
|
||||
// let's wrap the header in a span, so the ::before element will not become a link
|
||||
moduleHeader.outerHTML = '<span id="' + module + '" class="' + module + '">' + moduleHeader.outerHTML + '</span>';
|
||||
}
|
||||
});
|
||||
Paginator(indexEl);
|
||||
}
|
||||
// filter the index list based on search field input
|
||||
function filter(indexList) {
|
||||
var results = null;
|
||||
var target = search.value.trim();
|
||||
var filtered = '';
|
||||
if (target.length < 1) {
|
||||
fillIndex(indexEl, fullLinks, modules);
|
||||
return;
|
||||
}
|
||||
results = fuzzysort.go(target, bookmarks, {threshold: -15000, key:'text'});
|
||||
|
||||
results.forEach(function(result) {
|
||||
filtered += '<a href="' + result.obj['url'] + '" class="' + result.obj['app'] + '">' + fuzzysort.highlight(result) + '</a>';
|
||||
});
|
||||
fillIndex(indexList, filtered, modules);
|
||||
|
||||
};
|
||||
// delay the rendering of the filtered results while user is typing
|
||||
function debounce(fn, wait, indexList) {
|
||||
var timeout;
|
||||
return function() {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(function() {
|
||||
fn.call(this, indexList);
|
||||
}, (wait || 150));
|
||||
};
|
||||
}
|
||||
|
||||
// copy pycode and bascode to clipboard on mouse click
|
||||
// Show border when copy is done
|
||||
divcopyable(document.getElementsByClassName("bascode"));
|
||||
divcopyable(document.getElementsByClassName("pycode"));
|
||||
|
||||
function divcopyable(itemcopyable){
|
||||
for (var i = 0, len = itemcopyable.length; i < len; i++) {
|
||||
(function() {
|
||||
var item = itemcopyable[i];
|
||||
|
||||
function changeBorder(item, color) {
|
||||
var saveBorder = item.style.border;
|
||||
item.style.borderColor = color;
|
||||
|
||||
setTimeout(function() {
|
||||
item.style.border = saveBorder;
|
||||
}, 150);
|
||||
}
|
||||
item.onclick = function() {
|
||||
document.execCommand("copy");
|
||||
changeBorder(item, "#18A303");
|
||||
};
|
||||
item.addEventListener("copy", function(event) {
|
||||
event.preventDefault();
|
||||
if (event.clipboardData) {
|
||||
event.clipboardData.setData("text/plain", item.textContent);
|
||||
}
|
||||
});
|
||||
}());
|
||||
}
|
||||
}
|
||||
|
||||
// copy useful content to clipboard on mouse click
|
||||
var copyable = document.getElementsByClassName("input");
|
||||
for (var i = 0, len = copyable.length; i < len; i++) {
|
||||
(function() {
|
||||
var item = copyable[i];
|
||||
|
||||
function changeColor(item, color, colorToChangeBackTo) {
|
||||
item.style.backgroundColor = color;
|
||||
setTimeout(function() {
|
||||
item.style.backgroundColor = colorToChangeBackTo;
|
||||
}, 150);
|
||||
}
|
||||
item.onclick = function() {
|
||||
document.execCommand("copy");
|
||||
changeColor(item, "#18A303", "transparent");
|
||||
};
|
||||
item.addEventListener("copy", function(event) {
|
||||
event.preventDefault();
|
||||
if (event.clipboardData) {
|
||||
event.clipboardData.setData("text/plain", item.textContent);
|
||||
}
|
||||
});
|
||||
}());
|
||||
}
|
||||
// auto-expand contents per subitem
|
||||
var pathname = window.location.pathname;
|
||||
var pathRegex = /text\/.*\.html$/;
|
||||
var linkIndex = 0;
|
||||
var contentMatch = pathname.match(pathRegex);
|
||||
function linksMatch(content) {
|
||||
var linkMatch = new RegExp(content);
|
||||
var links = document.getElementById("Contents").getElementsByTagName("a");
|
||||
for (var i = 0, len = links.length; i < len; i++) {
|
||||
if (links[i].href.match(linkMatch)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
linkIndex = linksMatch(contentMatch);
|
||||
if (typeof linkIndex !== "undefined") {
|
||||
var current = document.getElementById("Contents").getElementsByTagName("a")[linkIndex];
|
||||
var cItem = current.parentElement;
|
||||
var parents = [];
|
||||
while (cItem.parentElement && !cItem.parentElement.matches("#Contents") && parents.indexOf(cItem.parentElement) == -1) {
|
||||
parents.push(cItem = cItem.parentElement);
|
||||
}
|
||||
var liParents = [].filter.call(parents, function(item) {
|
||||
return item.matches("li");
|
||||
});
|
||||
for (var i = 0, len = liParents.length; i < len; i++) {
|
||||
var input = liParents[i].querySelectorAll(':scope > input');
|
||||
document.getElementById(input[0].id).checked = true;
|
||||
}
|
||||
current.classList.add('contents-current');
|
||||
}
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
||||
266
office-plugin/windows-office/help/help2.js
Normal file
@@ -0,0 +1,266 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
// Used to set Application in caseinline=APP
|
||||
function setApplSpan(spanZ) {
|
||||
var module = getParameterByName("DbPAR");
|
||||
if (module === null) {
|
||||
module = "WRITER";
|
||||
}
|
||||
var y = spanZ.getElementsByTagName("SPAN");
|
||||
var n = y.length;
|
||||
var foundAppl = false;
|
||||
for (i = 0; i < n; i++) {
|
||||
if (y[i].getAttribute("id") === null){
|
||||
continue;
|
||||
}
|
||||
else if( y[i].getAttribute("id").startsWith(module)){
|
||||
y[i].removeAttribute("hidden");
|
||||
foundAppl=true;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < n; i++) {
|
||||
if (y[i].getAttribute("id") === null){
|
||||
continue;
|
||||
}
|
||||
else if( y[i].getAttribute("id").startsWith("default")){
|
||||
if(!foundAppl){
|
||||
y[i].removeAttribute("hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Used to set system in case, caseinline=SYSTEM
|
||||
function setSystemSpan(spanZ) {
|
||||
// if no System in URL, get browser system
|
||||
var system = getParameterByName("System");
|
||||
if (system === null) {
|
||||
system = getSystem();
|
||||
}
|
||||
var y = spanZ.getElementsByTagName("SPAN");
|
||||
var n = y.length;
|
||||
var foundSystem = false;
|
||||
for (i = 0; i < n; i++) {
|
||||
if (y[i].getAttribute("id") === null){
|
||||
continue;
|
||||
}
|
||||
else if( y[i].getAttribute("id").startsWith(system)){
|
||||
y[i].removeAttribute("hidden");
|
||||
foundSystem=true;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < n; i++) {
|
||||
if (y[i].getAttribute("id") === null){
|
||||
continue;
|
||||
}
|
||||
else if( y[i].getAttribute("id").startsWith("default")){
|
||||
if(!foundSystem){
|
||||
y[i].removeAttribute("hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// paint headers and headings with appl color
|
||||
|
||||
function moduleColor (module) {
|
||||
switch (module){
|
||||
case "WRITER" : {color="#0369A3"; break;}
|
||||
case "CALC" : {color="#43C330"; break;}
|
||||
case "CHART" : {color="darkcyan"; break;}
|
||||
case "IMPRESS": {color="#A33E03"; break;}
|
||||
case "DRAW" : {color="#C99C00"; break;}
|
||||
case "BASE" : {color="#8E03A3"; break;}
|
||||
case "BASIC" : {color="black"; break;}
|
||||
case "MATH" : {color="darkslategray"; break;}
|
||||
case "SHARED" : {color="gray"; break;}
|
||||
default : {color="#18A303"; break;}
|
||||
}
|
||||
document.getElementById("TopLeftHeader").style.background = color;
|
||||
document.getElementById("SearchFrame").style.background = color;
|
||||
document.getElementById("DonationFrame").style.background = color;
|
||||
var cols = document.getElementsByClassName('tableheadcell');
|
||||
for(i = 0; i < cols.length; i++) {cols[i].style.backgroundColor = color;};
|
||||
for (j of [1,2,3,4,5,6]) {
|
||||
var hh = document.getElementsByTagName("H" + j);
|
||||
for(i = 0; i < hh.length; i++) {
|
||||
hh[i].style.color = color;
|
||||
hh[i].style.borderBottomColor = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Find spans that need the switch treatment and give it to them
|
||||
var spans = document.querySelectorAll("[class^=switch]");
|
||||
var n = spans.length;
|
||||
for (z = 0; z < n; z++) {
|
||||
var id = spans[z].getAttribute("id");
|
||||
if (id === null) {
|
||||
continue;
|
||||
}
|
||||
else if (id.startsWith("swlnsys")) {
|
||||
setSystemSpan(spans[z]);
|
||||
} else {
|
||||
setApplSpan(spans[z]);
|
||||
}
|
||||
}
|
||||
/* add &DbPAR= and &System= to the links in DisplayArea div */
|
||||
/* skip for object files */
|
||||
function fixURL(module, system) {
|
||||
if ((DisplayArea = document.getElementById("DisplayArea")) === null) return;
|
||||
var itemlink = DisplayArea.getElementsByTagName("a");
|
||||
var pSystem = (system === null) ? getSystem() : system;
|
||||
var pAppl = (module === null) ? "WRITER" : module;
|
||||
var n = itemlink.length;
|
||||
for (var i = 0; i < n; i++) {
|
||||
if (itemlink[i].getAttribute("class") != "objectfiles") {
|
||||
setURLParam(itemlink[i], pSystem, pAppl);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Set the params inside URL
|
||||
function setURLParam(itemlink, pSystem, pAppl) {
|
||||
var href = itemlink.getAttribute("href");
|
||||
if (href !== null) {
|
||||
// skip external links
|
||||
if (!href.startsWith("http")) {
|
||||
// handle bookmark.
|
||||
if (href.lastIndexOf('#') != -1) {
|
||||
var postf = href.substring(href.lastIndexOf('#'), href.length);
|
||||
var pref = href.substring(0, href.lastIndexOf('#'));
|
||||
itemlink.setAttribute("href", pref + "?" + '&DbPAR=' + pAppl + '&System=' + pSystem + postf);
|
||||
} else {
|
||||
itemlink.setAttribute("href", href + "?" + '&DbPAR=' + pAppl + '&System=' + pSystem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getSystem() {
|
||||
var system = "Unknown OS";
|
||||
if (navigator.appVersion.indexOf("Win") != -1) system = "WIN";
|
||||
if (navigator.appVersion.indexOf("Mac") != -1) system = "MAC";
|
||||
if (navigator.appVersion.indexOf("X11") != -1) system = "UNIX";
|
||||
if (navigator.appVersion.indexOf("Linux") != -1) system = "UNIX";
|
||||
return system;
|
||||
}
|
||||
|
||||
function getParameterByName(name, url) {
|
||||
if (!url) {
|
||||
url = window.location.href;
|
||||
}
|
||||
name = name.replace(/[\[\]]/g, "\\$&");
|
||||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)");
|
||||
var results = regex.exec(url);
|
||||
if (!results) {
|
||||
return null;
|
||||
}
|
||||
if (!results[2]) {
|
||||
return '';
|
||||
}
|
||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
function existingLang(lang) {
|
||||
if (lang === undefined) {
|
||||
return 'en-US';
|
||||
}
|
||||
|
||||
if (languagesSet.has(lang)) {
|
||||
return lang;
|
||||
}
|
||||
|
||||
lang = lang.replace(/[-_].*/, '');
|
||||
if (languagesSet.has(lang)) {
|
||||
return lang;
|
||||
}
|
||||
|
||||
return 'en-US';
|
||||
}
|
||||
|
||||
function setupModules(lang) {
|
||||
var modulesNav = document.getElementById('modules-nav');
|
||||
if (!modulesNav.classList.contains('loaded')) {
|
||||
var html =
|
||||
'<a href="' + lang + '/text/swriter/main0000.html?DbPAR=WRITER"><div class="writer-icon"></div>Writer</a>' +
|
||||
'<a href="' + lang + '/text/scalc/main0000.html?DbPAR=CALC"><div class="calc-icon"></div>Calc</a>' +
|
||||
'<a href="' + lang + '/text/simpress/main0000.html?DbPAR=IMPRESS"><div class="impress-icon"></div>Impress</a>' +
|
||||
'<a href="' + lang + '/text/sdraw/main0000.html?DbPAR=DRAW"><div class="draw-icon"></div>Draw</a>' +
|
||||
'<a href="' + lang + '/text/sdatabase/main.html?DbPAR=BASE"><div class="base-icon"></div>Base</a>' +
|
||||
'<a href="' + lang + '/text/smath/main0000.html?DbPAR=MATH"><div class="math-icon"></div>Math</a>' +
|
||||
'<a href="' + lang + '/text/schart/main0000.html?DbPAR=CHART"><div class="chart-icon"></div>Chart</a>' +
|
||||
'<a href="' + lang + '/text/sbasic/shared/main0601.html?DbPAR=BASIC"><div class="basic-icon"></div>Basic</a>';
|
||||
modulesNav.innerHTML = html;
|
||||
modulesNav.classList.add('loaded');
|
||||
}
|
||||
}
|
||||
|
||||
function setupLanguages(page) {
|
||||
var langNav = document.getElementById('langs-nav');
|
||||
if (!langNav.classList.contains('loaded')) {
|
||||
var html = '';
|
||||
languagesSet.forEach(function(lang) {
|
||||
html += '<a href="' + lang + page + '">' + ((lang in languageNames)? languageNames[lang]: lang) + '</a>';
|
||||
});
|
||||
langNav.innerHTML = html;
|
||||
langNav.classList.add('loaded');
|
||||
}
|
||||
}
|
||||
|
||||
// Test, if we are online
|
||||
if (document.body.getElementsByTagName('meta')) {
|
||||
var _paq = _paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['disableCookies']);
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//piwik.documentfoundation.org/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', '68']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
var system = getParameterByName("System");
|
||||
} else {
|
||||
var system = getSystem();
|
||||
}
|
||||
|
||||
var module = getParameterByName("DbPAR");
|
||||
fixURL(module,system);
|
||||
moduleColor(module);
|
||||
var helpID = getParameterByName("HID");
|
||||
// only used in xhp pages with <help-id-missing/> tags
|
||||
var missingElement = document.getElementById("bm_HID2");
|
||||
if(missingElement != null){missingElement.innerHTML = helpID;}
|
||||
|
||||
function debugInfo(dbg) {
|
||||
if (dbg == null) return;
|
||||
document.getElementById("DEBUG").style.display = "block";
|
||||
document.getElementById("bm_module").innerHTML = "Module is: "+module;
|
||||
document.getElementById("bm_system").innerHTML = "System is: "+system;
|
||||
document.getElementById("bm_HID").innerHTML = "HID is: "+helpID;
|
||||
}
|
||||
|
||||
debugInfo(getParameterByName("Debug"));
|
||||
|
||||
// Mobile devices need the modules and langs on page load
|
||||
if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 960) {
|
||||
var e = new Event('click');
|
||||
var modulesBtn = document.getElementById('modules');
|
||||
var langsBtn = document.getElementById('langs');
|
||||
var modules = document.getElementById('modules-nav');
|
||||
var langs = document.getElementById('langs-nav');
|
||||
modules.setAttribute('data-a11y-toggle-open', '');
|
||||
modulesBtn.dispatchEvent(e);
|
||||
if (langs) {
|
||||
langs.setAttribute('data-a11y-toggle-open', '');
|
||||
langsBtn.dispatchEvent(e);
|
||||
}
|
||||
}
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
||||
8433
office-plugin/windows-office/help/hid2file.js
Normal file
51
office-plugin/windows-office/help/idxcaption.xsl
Normal file
@@ -0,0 +1,51 @@
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you 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 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" encoding="UTF-8"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:office="http://openoffice.org/2000/office"
|
||||
xmlns:style="http://openoffice.org/2000/style"
|
||||
xmlns:table="http://openoffice.org/2000/table"
|
||||
xmlns:draw="http://openoffice.org/2000/drawing"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:meta="http://openoffice.org/2000/meta"
|
||||
xmlns:number="http://openoffice.org/2000/datastyle"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:chart="http://openoffice.org/2000/chart"
|
||||
xmlns:help="http://openoffice.org/2000/help"
|
||||
xmlns:index="http://sun.com/2000/XMLSearch"
|
||||
xmlns:text="http://openoffice.org/2000/text">
|
||||
|
||||
<xsl:param name="Language" select="'en-US'"/>
|
||||
<xsl:output method="text" encoding="UTF-8"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="//title" mode="include"/>
|
||||
<xsl:apply-templates select="//paragraph[@role='heading']" mode="include"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*" mode="include">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
131
office-plugin/windows-office/help/idxcontent.xsl
Normal file
@@ -0,0 +1,131 @@
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you 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 .
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" encoding="UTF-8"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:office="http://openoffice.org/2000/office"
|
||||
xmlns:style="http://openoffice.org/2000/style"
|
||||
xmlns:table="http://openoffice.org/2000/table"
|
||||
xmlns:draw="http://openoffice.org/2000/drawing"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:meta="http://openoffice.org/2000/meta"
|
||||
xmlns:number="http://openoffice.org/2000/datastyle"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:chart="http://openoffice.org/2000/chart"
|
||||
xmlns:help="http://openoffice.org/2000/help"
|
||||
xmlns:index="http://sun.com/2000/XMLSearch"
|
||||
xmlns:text="http://openoffice.org/2000/text">
|
||||
|
||||
<xsl:param name="Language" select="'en-US'"/>
|
||||
<xsl:output method="text" encoding="UTF-8"/>
|
||||
|
||||
<xsl:template match="helpdocument|body">
|
||||
<xsl:choose>
|
||||
<xsl:when test="meta/topic[@indexer='exclude']"/>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="title">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tablecell">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tablerow">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="listitem">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="emph">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sub">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sup">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="paragraph">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="section">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bookmark">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bookmark_value">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="link">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ahelp[@visibility='visible']">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
||||
74
office-plugin/windows-office/help/index.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org"/>
|
||||
<script type="text/javascript" src="polyfills.js"></script>
|
||||
<script type="text/javascript" src="hid2file.js"></script>
|
||||
<script type="text/javascript" src="languages.js"></script>
|
||||
<script type="text/javascript" src="help2.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
// We have to wait until both the deferred help2.js and the document have loaded
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
var url = window.location.href;
|
||||
var n = url.indexOf('index.html?');
|
||||
if (n != -1) {
|
||||
// the URL came from LibreOffice help (F1)
|
||||
var target = getParameterByName("Target",url);
|
||||
var lang = existingLang(getParameterByName("Language", url));
|
||||
var system = getParameterByName("System", url);
|
||||
var module;
|
||||
var defaultFile;
|
||||
var smodule = target.substr(0, target.indexOf('/'));
|
||||
switch (smodule) {
|
||||
case "swriter": {defaultFile='text/swriter/main0000.html';module="WRITER";break;}
|
||||
case "scalc": {defaultFile='text/scalc/main0000.html';module="CALC";break;}
|
||||
case "schart": {defaultFile='text/schart/main0000.html';module="CHART";break;}
|
||||
case "simpress": {defaultFile='text/simpress/main0000.html';module="IMPRESS";break;}
|
||||
case "sdraw": {defaultFile='text/sdraw/main0000.html';module="DRAW";break;}
|
||||
case "smath": {defaultFile='text/smath/main0000.html';module="MATH";break;}
|
||||
case "sdatabase": {defaultFile='text/sdatabase/main.html';module="BASE";break;}
|
||||
case "sbasic": {defaultFile='text/sbasic/shared/main0601.html';module="BASIC";break;}
|
||||
default: {defaultFile='text/shared/05/new_help.html';module="WRITER";break;}
|
||||
}
|
||||
//Special case of application F1 or menu Help -> LibreOffice Help
|
||||
if (target.indexOf('.uno:HelpIndex') != -1) {
|
||||
window.location.replace(lang + '/' + defaultFile + '?System=' + system + '&DbPAR=' + module);
|
||||
}
|
||||
var bookmark = target.slice(target.indexOf('/') + 1, target.length);
|
||||
var file = hid2fileMap[bookmark];
|
||||
// check first if a root bookmark @@nowidget@@ can be used
|
||||
if (file === undefined) {
|
||||
var b2 = bookmark.substring(0, bookmark.lastIndexOf("/")) + '/@@nowidget@@';
|
||||
file = hid2fileMap[b2];
|
||||
}
|
||||
// rebuild URL
|
||||
if (file === undefined) {
|
||||
var newURL = lang + '/text/shared/05/err_html.html?System=' + system + '&DbPAR=' + module + '&HID=' + bookmark ;
|
||||
} else {
|
||||
var indx = file.indexOf('#');
|
||||
var bm = file.substr(indx,file.length);
|
||||
file = file.substr(0,indx);
|
||||
var newURL = lang + '/' + file + '?System=' + system + '&DbPAR=' + module + '&HID=' + bookmark + bm;
|
||||
}
|
||||
window.location.replace(newURL);
|
||||
} else {
|
||||
// URL came from elsewhere, direct access to webroot, we redirect to main Help page
|
||||
var system = 'WIN';
|
||||
if (navigator.userAgent.indexOf("Mac") != -1) system = 'MAC';
|
||||
if (navigator.userAgent.indexOf("Linux") != -1) system = 'UNIX';
|
||||
window.location.replace(existingLang(navigator.language) + '/text/shared/05/new_help.html?&DbPAR=WRITER&System=' + system);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
1
office-plugin/windows-office/help/languages.js
Normal file
@@ -0,0 +1 @@
|
||||
var languagesSet = new Set(['en-US', 'am', 'ar', 'ast', 'bg', 'bn', 'bn-IN', 'bo', 'bs', 'ca', 'ca-valencia', 'cs', 'da', 'de', 'dz', 'el', 'en-GB', 'en-ZA', 'eo', 'es', 'et', 'eu', 'fi', 'fr', 'gl', 'gu', 'he', 'hi', 'hr', 'hu', 'id', 'is', 'it', 'ja', 'ka', 'km', 'ko', 'lo', 'lt', 'lv', 'mk', 'nb', 'ne', 'nl', 'nn', 'om', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'si', 'sid', 'sk', 'sl', 'sq', 'sv', 'ta', 'tg', 'tr', 'ug', 'uk', 'vi', 'zh-CN', 'zh-TW']);
|
||||
933
office-plugin/windows-office/help/main_transform.xsl
Normal file
BIN
office-plugin/windows-office/help/media/files/scalc/imtrigon.ods
Normal file
BIN
office-plugin/windows-office/help/media/files/scalc/pivot.ods
Normal file
BIN
office-plugin/windows-office/help/media/files/scalc/trigon.ods
Normal file
BIN
office-plugin/windows-office/help/media/helpimg/area1.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
office-plugin/windows-office/help/media/helpimg/area2.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_1.png
Normal file
|
After Width: | Height: | Size: 937 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_2.png
Normal file
|
After Width: | Height: | Size: 858 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_3.png
Normal file
|
After Width: | Height: | Size: 894 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_4.png
Normal file
|
After Width: | Height: | Size: 787 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_5.png
Normal file
|
After Width: | Height: | Size: 386 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_6.png
Normal file
|
After Width: | Height: | Size: 727 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_7.png
Normal file
|
After Width: | Height: | Size: 733 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_8.png
Normal file
|
After Width: | Height: | Size: 776 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_9.png
Normal file
|
After Width: | Height: | Size: 956 B |
|
After Width: | Height: | Size: 748 B |
|
After Width: | Height: | Size: 742 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_1.png
Normal file
|
After Width: | Height: | Size: 941 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_2.png
Normal file
|
After Width: | Height: | Size: 983 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_3.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_4.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_5.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_6.png
Normal file
|
After Width: | Height: | Size: 466 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_7.png
Normal file
|
After Width: | Height: | Size: 572 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_8.png
Normal file
|
After Width: | Height: | Size: 464 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_9.png
Normal file
|
After Width: | Height: | Size: 508 B |
BIN
office-plugin/windows-office/help/media/helpimg/calcein.png
Normal file
|
After Width: | Height: | Size: 621 B |
BIN
office-plugin/windows-office/help/media/helpimg/calcnav.png
Normal file
|
After Width: | Height: | Size: 656 B |
BIN
office-plugin/windows-office/help/media/helpimg/copydata.png
Normal file
|
After Width: | Height: | Size: 315 B |
BIN
office-plugin/windows-office/help/media/helpimg/diatrans.png
Normal file
|
After Width: | Height: | Size: 98 B |