Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 46e425d

Browse files
committed
Little plugin for advertising imminent destruction of the world.
1 parent 4a0a0ec commit 46e425d

File tree

6 files changed

+133
-0
lines changed

6 files changed

+133
-0
lines changed

core/src/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ composer.lock
2020
/plugins/core.mailer/js/build
2121
/plugins/uploader.html/js/build
2222
/plugins/core.tasks/js/build
23+
/plugins/action.demo_counter/build
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<p>
2+
This plugin adds a component to the web interface that provides the ability to pick one or more files/folders from any
3+
location inside a workspace, and download this selection as a whole in Zip format.
4+
</p>
5+
<p>
6+
This can be really handy for big media libraries for picking e.g. photos and building an exportable selection. The "carts"
7+
can be saved, and the plugin can also be used to save all results of a specific search as a cart as well.
8+
</p>
9+
<p style="text-align: center">
10+
<img src="carts.png">
11+
</p>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = function(grunt) {
2+
grunt.initConfig({
3+
babel: {
4+
options: {},
5+
6+
dist: {
7+
files: [
8+
{
9+
expand: true,
10+
cwd: 'react/',
11+
src: ['**/*.js'],
12+
dest: 'build/',
13+
ext: '.js'
14+
}
15+
]
16+
}
17+
},
18+
watch: {
19+
js: {
20+
files: [
21+
"react/**/*"
22+
],
23+
tasks: ['babel'],
24+
options: {
25+
spawn: false
26+
}
27+
}
28+
}
29+
});
30+
grunt.loadNpmTasks('grunt-babel');
31+
grunt.loadNpmTasks('grunt-contrib-watch');
32+
grunt.registerTask('default', ['babel']);
33+
34+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ajxp_plugin enabled="false" id="action.demo_counter" label="CONF_MESSAGE[Demo Death Counter]" description="CONF_MESSAGE[Display a panel advertising the demo will die in XX minutes]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
3+
4+
<plugin_info>
5+
<core_relation packaged="false" tested_version="follow_core"/>
6+
<plugin_author>Charles du Jeu</plugin_author>
7+
</plugin_info>
8+
9+
<client_settings>
10+
<resources>
11+
<js className="DemoDeathCounter" file="plugins/action.demo_counter/build/DemoDeathCounter.js" depends="React"/>
12+
</resources>
13+
</client_settings>
14+
15+
<registry_contributions>
16+
<client_configs>
17+
<template name="pydio-demo-death-counter" element="ajxp_desktop" position="bottom"><![CDATA[
18+
<div id="demo-death-counter" class="react-mui-context" ajxpClass="AjxpReactComponent" ajxpOptions='{"componentNamespace":"DemoDeathCounter","componentName":"Panel"}'></div>
19+
]]></template>
20+
</client_configs>
21+
</registry_contributions>
22+
23+
</ajxp_plugin>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "action.demo_counter",
3+
"version": "6.5.5",
4+
"description": "",
5+
"source_path":"js",
6+
"main": "index.js",
7+
"author": "Abstrium SAS",
8+
"license": "AGPL",
9+
"devDependencies": {
10+
"grunt": "~0.4.5",
11+
"grunt-babel": "~5.0.3",
12+
"grunt-contrib-watch": "~0.6.1"
13+
}
14+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
(function(global){
2+
3+
let Panel = React.createClass({
4+
5+
tick: function(){
6+
7+
// Compute next occurence of 0 or 30
8+
let d = new Date();
9+
let remainingMinutes = 30 - d.getMinutes() % 30;
10+
let remainingSeconds = 60 - d.getSeconds();
11+
this.setState({timeLeft: remainingMinutes + '\'' + (remainingSeconds < 10 ? '0' + remainingSeconds : remainingSeconds) + 'mn' });
12+
13+
},
14+
15+
getInitialState: function(){
16+
return {timeLeft: ''};
17+
},
18+
19+
componentDidMount: function(){
20+
this._ticker = global.setInterval(this.tick.bind(this), 1);
21+
},
22+
23+
componentWillUnmount: function(){
24+
global.clearInterval(this._ticker);
25+
},
26+
27+
render: function(){
28+
let style = {
29+
position: 'absolute',
30+
zIndex: 10000,
31+
backgroundColor: 'rgba(255,255,255,0.33)',
32+
fontSize: 16,
33+
top: 0,
34+
left: '35%',
35+
width: '30%',
36+
padding: '8px 10px',
37+
borderRadius: '0 0 2px 2px',
38+
textAlign: 'center',
39+
color: '#ffffff',
40+
};
41+
return <div style={style}><span className="icon-warning-sign"/> This demo will reset itself in {this.state.timeLeft}</div>;
42+
}
43+
44+
});
45+
46+
let ns = global.DemoDeathCounter || {};
47+
ns.Panel = Panel;
48+
global.DemoDeathCounter = ns;
49+
50+
})(window);

0 commit comments

Comments
 (0)