Permalink
Browse files

Little plugin for advertising imminent destruction of the world.

  • Loading branch information...
1 parent 4a0a0ec commit 46e425d6e3ba5b910bd4e86fb0421e4622d10671 @cdujeu cdujeu committed Oct 15, 2016
View
@@ -20,3 +20,4 @@ composer.lock
/plugins/core.mailer/js/build
/plugins/uploader.html/js/build
/plugins/core.tasks/js/build
+/plugins/action.demo_counter/build
@@ -0,0 +1,11 @@
+<p>
+ This plugin adds a component to the web interface that provides the ability to pick one or more files/folders from any
+ location inside a workspace, and download this selection as a whole in Zip format.
+</p>
+<p>
+ This can be really handy for big media libraries for picking e.g. photos and building an exportable selection. The "carts"
+ can be saved, and the plugin can also be used to save all results of a specific search as a cart as well.
+</p>
+<p style="text-align: center">
+ <img src="carts.png">
+</p>
@@ -0,0 +1,34 @@
+module.exports = function(grunt) {
+ grunt.initConfig({
+ babel: {
+ options: {},
+
+ dist: {
+ files: [
+ {
+ expand: true,
+ cwd: 'react/',
+ src: ['**/*.js'],
+ dest: 'build/',
+ ext: '.js'
+ }
+ ]
+ }
+ },
+ watch: {
+ js: {
+ files: [
+ "react/**/*"
+ ],
+ tasks: ['babel'],
+ options: {
+ spawn: false
+ }
+ }
+ }
+ });
+ grunt.loadNpmTasks('grunt-babel');
+ grunt.loadNpmTasks('grunt-contrib-watch');
+ grunt.registerTask('default', ['babel']);
+
+};
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+
+ <plugin_info>
+ <core_relation packaged="false" tested_version="follow_core"/>
+ <plugin_author>Charles du Jeu</plugin_author>
+ </plugin_info>
+
+ <client_settings>
+ <resources>
+ <js className="DemoDeathCounter" file="plugins/action.demo_counter/build/DemoDeathCounter.js" depends="React"/>
+ </resources>
+ </client_settings>
+
+ <registry_contributions>
+ <client_configs>
+ <template name="pydio-demo-death-counter" element="ajxp_desktop" position="bottom"><![CDATA[
+ <div id="demo-death-counter" class="react-mui-context" ajxpClass="AjxpReactComponent" ajxpOptions='{"componentNamespace":"DemoDeathCounter","componentName":"Panel"}'></div>
+ ]]></template>
+ </client_configs>
+ </registry_contributions>
+
+</ajxp_plugin>
@@ -0,0 +1,14 @@
+{
+ "name": "action.demo_counter",
+ "version": "6.5.5",
+ "description": "",
+ "source_path":"js",
+ "main": "index.js",
+ "author": "Abstrium SAS",
+ "license": "AGPL",
+ "devDependencies": {
+ "grunt": "~0.4.5",
+ "grunt-babel": "~5.0.3",
+ "grunt-contrib-watch": "~0.6.1"
+ }
+}
@@ -0,0 +1,50 @@
+(function(global){
+
+ let Panel = React.createClass({
+
+ tick: function(){
+
+ // Compute next occurence of 0 or 30
+ let d = new Date();
+ let remainingMinutes = 30 - d.getMinutes() % 30;
+ let remainingSeconds = 60 - d.getSeconds();
+ this.setState({timeLeft: remainingMinutes + '\'' + (remainingSeconds < 10 ? '0' + remainingSeconds : remainingSeconds) + 'mn' });
+
+ },
+
+ getInitialState: function(){
+ return {timeLeft: ''};
+ },
+
+ componentDidMount: function(){
+ this._ticker = global.setInterval(this.tick.bind(this), 1);
+ },
+
+ componentWillUnmount: function(){
+ global.clearInterval(this._ticker);
+ },
+
+ render: function(){
+ let style = {
+ position: 'absolute',
+ zIndex: 10000,
+ backgroundColor: 'rgba(255,255,255,0.33)',
+ fontSize: 16,
+ top: 0,
+ left: '35%',
+ width: '30%',
+ padding: '8px 10px',
+ borderRadius: '0 0 2px 2px',
+ textAlign: 'center',
+ color: '#ffffff',
+ };
+ return <div style={style}><span className="icon-warning-sign"/> This demo will reset itself in {this.state.timeLeft}</div>;
+ }
+
+ });
+
+ let ns = global.DemoDeathCounter || {};
+ ns.Panel = Panel;
+ global.DemoDeathCounter = ns;
+
+})(window);

0 comments on commit 46e425d

Please sign in to comment.