Configure application plugins
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{renderPlugins(renderPage)}
diff --git a/web/client/examples/plugins/assets/css/plugins.css b/web/client/examples/plugins/assets/css/plugins.css
index 182ee734db..1ea8e4acc4 100644
--- a/web/client/examples/plugins/assets/css/plugins.css
+++ b/web/client/examples/plugins/assets/css/plugins.css
@@ -76,3 +76,15 @@ html, body, #container, #map {
.checkbox {
padding-left: 5px;
}
+
+.theme-switcher span {
+ display: none;
+}
+
+#plugins-list ul {
+ margin-bottom: 10px;
+}
+
+#plugins-list .form-group {
+ padding-left: 0;
+}
diff --git a/web/client/examples/plugins/components/PluginCreator.jsx b/web/client/examples/plugins/components/PluginCreator.jsx
index 29ad2d677f..02a9a9e7ad 100644
--- a/web/client/examples/plugins/components/PluginCreator.jsx
+++ b/web/client/examples/plugins/components/PluginCreator.jsx
@@ -42,7 +42,7 @@ const PluginCreator = React.createClass({
componentWillReceiveProps(newProps) {
if (newProps.pluginCode !== this.props.pluginCode) {
this.setState({
- code: newProps.pluginConfig
+ code: newProps.pluginCode
});
}
},
diff --git a/web/client/examples/plugins/components/SaveAndLoad.jsx b/web/client/examples/plugins/components/SaveAndLoad.jsx
index 657c2fc7f3..b07b4d3af7 100644
--- a/web/client/examples/plugins/components/SaveAndLoad.jsx
+++ b/web/client/examples/plugins/components/SaveAndLoad.jsx
@@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');
-const {FormControl, Button} = require('react-bootstrap');
+const {FormControl, FormGroup, Button} = require('react-bootstrap');
const SaveButton = React.createClass({
@@ -40,13 +40,17 @@ const SaveButton = React.createClass({
render() {
const embedded = (
Load in embedded version!);
return (
-
-
-
- {(this.state.loadname !== '') ? embedded : }
-
- {this.renderSaved()}
-
+
+
+
+
+
+
+ {(this.state.loadname !== '') ? embedded : }
+
+ {this.renderSaved()}
+
+
);
},
load() {
diff --git a/web/client/examples/plugins/components/ThemeCreator.jsx b/web/client/examples/plugins/components/ThemeCreator.jsx
new file mode 100644
index 0000000000..685204ac15
--- /dev/null
+++ b/web/client/examples/plugins/components/ThemeCreator.jsx
@@ -0,0 +1,92 @@
+/**
+ * Copyright 2016, GeoSolutions Sas.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+const React = require('react');
+
+const {Button, Glyphicon, Modal, FormGroup, Checkbox} = require('react-bootstrap');
+
+const Codemirror = require('react-codemirror');
+
+
+require('codemirror/lib/codemirror.css');
+
+require('codemirror/mode/css/css');
+
+const ThemeCreator = React.createClass({
+ propTypes: {
+ themeCode: React.PropTypes.string,
+ error: React.PropTypes.string,
+ onApplyTheme: React.PropTypes.func
+ },
+ getDefaultProps() {
+ return {
+ themeCode: '',
+ onApplyTheme: () => {}
+ };
+ },
+ getInitialState() {
+ return {
+ code: "",
+ configVisible: false
+ };
+ },
+ componentWillMount() {
+ this.setState({
+ code: this.props.themeCode
+ });
+ },
+ componentWillReceiveProps(newProps) {
+ if (newProps.themeCode !== this.props.themeCode) {
+ this.setState({
+ code: newProps.themeCode
+ });
+ }
+ },
+ render() {
+ return (
+
+
+
+ Live edit your theme
+
+
+ {
+ this.setState({
+ configVisible: false
+ });
+ }}>
+
+ Live edit your own theme
+
+
+
+
+ {this.props.error}
+
+
+ );
+ },
+ updateCode(newCode) {
+ this.setState({
+ code: newCode
+ });
+ },
+ applyCode() {
+ this.props.onApplyTheme(this.state.code);
+ },
+ toggleCfg() {
+ this.setState({configVisible: !this.state.configVisible});
+ }
+});
+
+module.exports = ThemeCreator;
diff --git a/web/client/examples/plugins/icons/icons.eot b/web/client/examples/plugins/icons/icons.eot
new file mode 100644
index 0000000000..c7ead8ba9c
Binary files /dev/null and b/web/client/examples/plugins/icons/icons.eot differ
diff --git a/web/client/examples/plugins/icons/icons.svg b/web/client/examples/plugins/icons/icons.svg
new file mode 100644
index 0000000000..589ffa8059
--- /dev/null
+++ b/web/client/examples/plugins/icons/icons.svg
@@ -0,0 +1,1003 @@
+
+
+
diff --git a/web/client/examples/plugins/icons/icons.ttf b/web/client/examples/plugins/icons/icons.ttf
new file mode 100644
index 0000000000..4041edc148
Binary files /dev/null and b/web/client/examples/plugins/icons/icons.ttf differ
diff --git a/web/client/examples/plugins/icons/icons.woff b/web/client/examples/plugins/icons/icons.woff
new file mode 100644
index 0000000000..6edf76bcb2
Binary files /dev/null and b/web/client/examples/plugins/icons/icons.woff differ
diff --git a/web/client/examples/plugins/img/toggle.png b/web/client/examples/plugins/img/toggle.png
new file mode 100644
index 0000000000..ce0edd8ff8
Binary files /dev/null and b/web/client/examples/plugins/img/toggle.png differ
diff --git a/web/client/examples/plugins/img/toggle.svg b/web/client/examples/plugins/img/toggle.svg
new file mode 100644
index 0000000000..75138bd163
--- /dev/null
+++ b/web/client/examples/plugins/img/toggle.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/client/examples/plugins/index.html b/web/client/examples/plugins/index.html
index 5a0f959c6d..78c22960a3 100644
--- a/web/client/examples/plugins/index.html
+++ b/web/client/examples/plugins/index.html
@@ -8,8 +8,7 @@
-
-
+
@@ -17,8 +16,9 @@
+
-
+
diff --git a/web/client/examples/plugins/sample.less.raw b/web/client/examples/plugins/sample.less.raw
new file mode 100644
index 0000000000..4a4c1d2d84
--- /dev/null
+++ b/web/client/examples/plugins/sample.less.raw
@@ -0,0 +1,76 @@
+@import "../../themes/default/base.less";
+@import "../../themes/default/variables.less";
+
+.ms2 {
+ @import "../../themes/default/icons.less";
+ @import "../../themes/default/bootstrap-theme.less";
+ @import "../../themes/default/ms2-theme.less";
+}
+
+@ms2-color-background: #ffffff;
+@ms2-color-code: #c7254e;
+
+@ms2-color-text-primary: #ffffff;
+@ms2-color-text-placeholder: #999999;
+@ms2-color-text: #333333;
+
+@ms2-color-disabled: #5C9FB4;
+@ms2-color-text-disabled: #ffffff;
+
+@ms2-color-primary: #078aa3;
+@ms2-color-info: #5a9aab;
+@ms2-color-success: #398439;
+@ms2-color-warning: #ebbc35;
+@ms2-color-danger: #bb4940;
+
+@ms2-color-primary-hover: lighten(@ms2-color-primary, 10%);
+@ms2-color-info-hover: lighten(@ms2-color-info, 10%);
+@ms2-color-success-hover: lighten(@ms2-color-success, 10%);
+@ms2-color-warning-hover: lighten(@ms2-color-warning, 10%);
+@ms2-color-danger-hover: lighten(@ms2-color-danger, 10%);
+
+@ms2-color-primary-light: lighten(@ms2-color-primary, 40%);
+@ms2-color-info-light: lighten(@ms2-color-info, 40%);
+@ms2-color-success-light: lighten(@ms2-color-success, 40%);
+@ms2-color-warning-light: lighten(@ms2-color-warning, 40%);
+@ms2-color-danger-light: lighten(@ms2-color-danger, 40%);
+
+@ms2-color-primary-active: darken(@ms2-color-primary, 20%);
+
+@ms2-color-shade: #555555;
+@ms2-color-shade-darker: #222222;
+@ms2-color-shade-dark: #333333;
+@ms2-color-shade-light: #999999;
+@ms2-color-shade-lighter: #eeeeee;
+
+@font-family-base: 'Raleway', sans-serif;
+@font-size-base: 14px;
+@font-size-large: ceil(@font-size-base * 1.25);
+@font-size-small: ceil(@font-size-base * 0.85);
+@font-size-h1: floor((@font-size-base * 1.9));
+@font-size-h2: floor((@font-size-base * 1.7));
+@font-size-h3: floor((@font-size-base * 1.5));
+@font-size-h4: floor((@font-size-base * 1.25));
+@font-size-h5: @font-size-base;
+@font-size-h6: floor((@font-size-base * 0.85));
+@line-height-computed: floor(@font-size-base * 1.428571429);
+
+@btn-font-weight: normal;
+@icon-margin-ratio: 2;
+@icon-resize-ratio: 1.5;
+
+@icon-size: 26px;
+@padding-left-square: floor(@icon-size/@icon-margin-ratio);
+@square-btn-size: @padding-left-square * 2 + @icon-size;
+
+@icon-size-md: floor(@icon-size / @icon-resize-ratio);
+@padding-left-square-md: floor(@icon-size-md / @icon-margin-ratio);
+@square-btn-medium-size: @padding-left-square-md * 2 + @icon-size-md;
+
+@icon-size-sm: floor(@icon-size-md / @icon-resize-ratio);
+@padding-left-square-sm: floor(@icon-size-sm / @icon-margin-ratio);
+@square-btn-small-size: @padding-left-square-sm * 2 + @icon-size-sm;
+
+@grid-icon-size: 18px;
+@grid-btn-padding-left: 6px;
+@grid-btn-size: @grid-btn-padding-left * 2 + @grid-icon-size;
diff --git a/web/client/examples/plugins/store.js b/web/client/examples/plugins/store.js
index e1ae17bf41..0685bed27b 100644
--- a/web/client/examples/plugins/store.js
+++ b/web/client/examples/plugins/store.js
@@ -20,6 +20,7 @@ module.exports = (plugins, custom) => {
const allReducers = combineReducers(plugins, {
locale: require('../../reducers/locale'),
browser: require('../../reducers/browser'),
+ theme: require('../../reducers/theme'),
map: () => {return null; },
mapInitialConfig: () => {return null; },
layers: () => {return null; },
diff --git a/web/client/examples/print/index.html b/web/client/examples/print/index.html
index 5b1b17cd5d..faead1dc7b 100644
--- a/web/client/examples/print/index.html
+++ b/web/client/examples/print/index.html
@@ -68,7 +68,7 @@
}
-
+
diff --git a/web/client/examples/queryform/index.html b/web/client/examples/queryform/index.html
index fe17317252..f438faae4d 100644
--- a/web/client/examples/queryform/index.html
+++ b/web/client/examples/queryform/index.html
@@ -30,7 +30,7 @@
}
-
+
diff --git a/web/client/examples/rasterstyler/index.html b/web/client/examples/rasterstyler/index.html
index 268dfa9010..cbbf4d7269 100644
--- a/web/client/examples/rasterstyler/index.html
+++ b/web/client/examples/rasterstyler/index.html
@@ -16,10 +16,8 @@
-
+
-
-