Skip to content

Commit

Permalink
almost there
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoarruda committed Dec 12, 2016
1 parent 7372888 commit 1c78431
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 351 deletions.
20 changes: 20 additions & 0 deletions gulpfile.js
Expand Up @@ -6,6 +6,8 @@ var source = require('vinyl-source-stream');
var tsify = require('tsify');
var sourcemaps = require('gulp-sourcemaps');
var buffer = require('vinyl-buffer');
// glob
var glob = require('glob');
// tsd
var tsd = require('gulp-tsd');
// hbs
Expand Down Expand Up @@ -213,6 +215,24 @@ gulp.task('start', function () {
gulp.task('watchwdgt', ['wdgt'], function () {
gulp.watch(paths.wdgt, ['wdgt']);
});
gulp.task('wdgt_ts', function() {
var files = glob.sync('src/widgets/**/*.ts');
return browserify({
basedir: '.',
debug: true,
entries: files,
cache: {},
packageCache: {}
})
.plugin(tsify)
.transform("babelify")
.bundle()
.pipe(source('main.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('src/widgets/**/'));
});
}

// for gh-pages
Expand Down
351 changes: 0 additions & 351 deletions npm-debug.log

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -11,6 +11,7 @@
"devDependencies": {
"babelify": "^7.3.0",
"browserify": "^13.0.1",
"glob": "^7.1.1",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-declare": "^0.3.0",
Expand Down
11 changes: 11 additions & 0 deletions src/ts/interface/widget.ts
@@ -0,0 +1,11 @@
export interface WidgetInterface {

widgetInstanceId:number;
selector:string;

clbkCreated():void;
clbkResized():void;
clbkMoved():void;
clbkTab():void;

}
18 changes: 18 additions & 0 deletions src/widgets/topic_publisher/index.hbs
@@ -0,0 +1,18 @@
<div class="ros-widget" data-widget-name="topic-publisher" data-min-height="34" data-min-width="66" data-max-height="1200"
data-max-width="1600" data-height="300" data-width="400">

<!-- META Tags to describe topics subscription -->
<meta data-ros-topic="1" data-ros-topic-id="1" data-ros-topic-desc="Topic to publish" data-ros-topic-type="" data-ros-topic-chng="onChange"
data-ros-topic-slctd="" />
<meta data-wdgt-param="1" data-widget-param-id="1" data-widget-param-desc="Array show limit" data-widget-param-var="arrayShowLimit"
data-widget-param-value="10" />
<meta data-wdgt-param="1" data-widget-param-id="2" data-widget-param-desc="Value show limit" data-widget-param-var="valueShowLimit"
data-widget-param-value="50" />

<!-- The content which could be manipulated by widget class -->
<div class="header">
<p class="name">-- topic name --</p>
<p class="type">-- topic type --</p>
</div>
<div class="datatopic1"></div>
</div>
30 changes: 30 additions & 0 deletions src/widgets/topic_publisher/main.ts
@@ -0,0 +1,30 @@
import { WidgetInterface } from '../../ts/interface/widget';

class WidgetTopicPublisher implements WidgetInterface {
public widgetInstanceId: number;
public selector: string;

public clbkCreated(): void {
console.log("olá");
// throw new Error('Not implemented yet.');
}

public clbkResized(): void {
// throw new Error('Not implemented yet.');
}

public clbkMoved(): void {
// throw new Error('Not implemented yet.');
}

public clbkTab(): void {
// throw new Error('Not implemented yet.');
}

// selector callbacks
public onChange(): void {

}
}

window["WidgetTopicPublisher"] = WidgetTopicPublisher;

0 comments on commit 1c78431

Please sign in to comment.