Skip to content
Snippets Groups Projects
Commit 50098109 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[enh] Add RML9 plugin

parent ed49eb54
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ var paths = { ...@@ -43,7 +43,7 @@ var paths = {
// plugins: // plugins:
templatecache_plugin: ['./www/plugins/*/templates/**/*.html'], templatecache_plugin: ['./www/plugins/*/templates/**/*.html'],
ng_translate_plugin: ['./www/plugins/*/i18n/locale-*.json'], ng_translate_plugin: ['./www/plugins/*/i18n/locale-*.json'],
ng_annotate_plugin: ['./www/plugins/*/js/**/*.js', '!./www/plugins/*/js/vendor/*.js'], ng_annotate_plugin: ['./www/plugins/*/**/*.js', '!./www/plugins/*/js/vendor/*.js'],
css_plugin: ['./www/plugins/*/css/**/*.css'] css_plugin: ['./www/plugins/*/css/**/*.css']
}; };
...@@ -188,7 +188,6 @@ gulp.task('templatecache_plugin', function (done) { ...@@ -188,7 +188,6 @@ gulp.task('templatecache_plugin', function (done) {
root: "plugins/" root: "plugins/"
})) }))
.pipe(gulp.dest('./www/dist/dist_js/plugins')) .pipe(gulp.dest('./www/dist/dist_js/plugins'))
//.pipe(gulp.dest('./www/plugins'))
.on('end', done); .on('end', done);
}); });
...@@ -203,7 +202,6 @@ gulp.task('ng_translate_plugin', function() { ...@@ -203,7 +202,6 @@ gulp.task('ng_translate_plugin', function() {
return gulp.src(paths.ng_translate_plugin) return gulp.src(paths.ng_translate_plugin)
.pipe(ngTranslate({standalone:true, module: 'cesium.plugins.translations'})) .pipe(ngTranslate({standalone:true, module: 'cesium.plugins.translations'}))
.pipe(gulp.dest('www/dist/dist_js/plugins')); .pipe(gulp.dest('www/dist/dist_js/plugins'));
//.pipe(gulp.dest('www/plugins'));
}); });
gulp.task('css_plugin', function (done) { gulp.task('css_plugin', function (done) {
......
...@@ -166,6 +166,9 @@ ...@@ -166,6 +166,9 @@
<script src="dist/dist_js/plugins/graph/js/controllers/currency-controllers.js"></script> <script src="dist/dist_js/plugins/graph/js/controllers/currency-controllers.js"></script>
<script src="dist/dist_js/plugins/graph/js/controllers/account-controllers.js"></script> <script src="dist/dist_js/plugins/graph/js/controllers/account-controllers.js"></script>
<!-- RML9 plugin
<script src="dist/dist_js/plugins/rml9/plugin.js"></script>-->
<!--endRemoveIf(no-plugin)--> <!--endRemoveIf(no-plugin)-->
<!-- App --> <!-- App -->
......
{
"RML9": {
"WALLET": {
"BTN_EXPORT": "Exporter les transactions",
}
}
}
angular.module('cesium.rml9.plugin', ['cesium.services'])
.config(function($stateProvider, PluginServiceProvider, csConfig) {
'ngInject';
var enable = true; // csConfig.plugins && csConfig.plugins.rml9;
if (enable) {
PluginServiceProvider
.extendState('app.view_wallet_tx', {
points: {
'buttons': {
templateUrl: "plugins/rml9/templates/button.html",
controller: 'Rml9Ctrl'
}
}
})
;
}
})
/**
* Les controlleurs sont chargés de gérer faire la liaison entre les services d'accès aux données, et l'interface graphique.
*
* Celui-ci sert à étendre la page 'Mes opérations'
*/
.controller('Rml9Ctrl', function($scope, $state, PluginService, FileSaver, BMA, csWallet) {
'ngInject';
$scope.extensionPoint = PluginService.extensions.points.current.get();
// Manage click on the export button
$scope.onButtonClick = function() {
var pubkey = csWallet.data.pubkey;
BMA.tx.history.all({pubkey: pubkey})
.then(function(res){
if (!res || !res.history) return;
console.log(res.history);
/*var allTx = res.history.received.reduce(function(allTx, tx){
return res.concat(tx.);
}, []);*/
//var saveIdFile = new Blob(["THis is a content"], {type: 'text/plain; charset=utf-8'});
//FileSaver.saveAs(saveIdFile, 'transactions.txt');
});
};
}
);
<!-- Buttons section -->
<ng-if ng-if="extensionPoint === 'buttons'">
<button class="button button-stable button-small-padding icon ion-android-archive"
ng-click="onButtonClick()"
title="{{'RML9.WALLET.BTN_EXPORT' | translate}}">
</button>
</ng-if>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment