Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
test/javasource/
test/deployment/
test/javasource/**/proxies/
test/javasource/com/
test/javasource/system/
test/.classpath
test/.project
test/theme/
test/userlib/
test/.classpath
test/.project
*.launch
*.tmp
*.lock
.idea/
*.bak
settings/


node_modules/
.editorconfig
*DS_Store*
.vscode/
*.bak
deployment
88 changes: 88 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Generated on 2017-02-14 using generator-mendix 2.1.0 :: git+https://github.com/mendix/generator-mendix.git
/*jshint -W069,-W097*/
"use strict";

// In case you seem to have trouble starting Mendix through `gulp modeler`, you might have to set the path to the Mendix application, otherwise leave both values as they are
var MODELER_PATH = null;
var MODELER_ARGS = "/file:{path}";

/********************************************************************************
* Do not edit anything below, unless you know what you are doing
********************************************************************************/
var gulp = require("gulp"),
zip = require("gulp-zip"),
del = require("del"),
newer = require("gulp-newer"),
gutil = require("gulp-util"),
gulpif = require("gulp-if"),
jsonTransform = require("gulp-json-transform"),
intercept = require("gulp-intercept"),
argv = require("yargs").argv,
widgetBuilderHelper = require("widgetbuilder-gulp-helper"),
jsValidate = require("gulp-jsvalidate");

var pkg = require("./package.json"),
paths = widgetBuilderHelper.generatePaths(pkg),
xmlversion = widgetBuilderHelper.xmlversion;

gulp.task("default", function() {
gulp.watch("./src/**/*", ["compress"]);
gulp.watch("./src/**/*.js", ["copy:js"]);
});

gulp.task("clean", function () {
return del([
paths.WIDGET_TEST_DEST,
paths.WIDGET_DIST_DEST
], { force: true });
});

gulp.task("compress", ["clean"], function () {
return gulp.src("src/**/*")
.pipe(zip(pkg.name + ".mpk"))
.pipe(gulp.dest(paths.TEST_WIDGETS_FOLDER))
.pipe(gulp.dest("dist"));
});

gulp.task("copy:js", function () {
return gulp.src(["./src/**/*.js"])
.pipe(jsValidate())
.pipe(newer(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER))
.pipe(gulp.dest(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER));
});

gulp.task("version:xml", function () {
return gulp.src(paths.PACKAGE_XML)
.pipe(xmlversion(argv.n))
.pipe(gulp.dest("./src/"));
});

gulp.task("version:json", function () {
return gulp.src("./package.json")
.pipe(gulpif(typeof argv.n !== "undefined", jsonTransform(function(data) {
data.version = argv.n;
return data;
}, 2)))
.pipe(gulp.dest("./"));
});

gulp.task("icon", function (cb) {
var icon = (typeof argv.file !== "undefined") ? argv.file : "./icon.png";
console.log("\nUsing this file to create a base64 string: " + gutil.colors.cyan(icon));
gulp.src(icon)
.pipe(intercept(function (file) {
console.log("\nCopy the following to your " + pkg.name + ".xml (after description):\n\n" + gutil.colors.cyan("<icon>") + file.contents.toString("base64") + gutil.colors.cyan("<\/icon>") + "\n");
cb();
}));
});

gulp.task("folders", function () {
paths.showPaths(); return;
});

gulp.task("modeler", function (cb) {
widgetBuilderHelper.runmodeler(MODELER_PATH, MODELER_ARGS, paths.TEST_PATH, cb);
});

gulp.task("build", ["compress"]);
gulp.task("version", ["version:xml", "version:json"]);
Binary file modified dist/TooltipImage.mpk
Binary file not shown.
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "TooltipImage",
"version": "1.2.0",
"description": "",
"license": "",
"author": "",
"private": true,
"dependencies": {},
"devDependencies": {
"del": "^2.2.2",
"gulp": "^3.9.1",
"gulp-if": "^2.0.1",
"gulp-intercept": "^0.1.0",
"gulp-json-transform": "^0.4.2",
"gulp-newer": "^1.3.0",
"gulp-util": "^3.0.7",
"gulp-zip": "^3.2.0",
"gulp-jsvalidate": "^3.0.0",
"widgetbuilder-gulp-helper": "https://github.com/JelteMX/widgetbuilder-gulp-helper/archive/1.0.1.tar.gz",
"yargs": "^6.0.0"
},
"engines": {
"node": ">=5"
},
"generatorVersion": "2.1.0",
"paths": {
"testProjectFolder": "./test/",
"testProjectFileName": "Test.mpr"
},
"scripts": {
"build": "node ./node_modules/gulp/bin/gulp build",
"version": "node ./node_modules/gulp/bin/gulp version",
"icon": "node ./node_modules/gulp/bin/gulp icon",
"folders": "node ./node_modules/gulp/bin/gulp folders",
"modeler": "node ./node_modules/gulp/bin/gulp modeler"
}
}
12 changes: 9 additions & 3 deletions src/TooltipImage/TooltipImage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,22 @@
<category>Appearance</category>
<description>Tooltip form</description>
</property>
<property key="tooltippos" type="enumeration" defaultValue="below">
<property key="tooltippos" type="enumeration" defaultValue="belowcentered">
<caption>Tooltip position</caption>
<category>Appearance</category>
<description>Tooltip position</description>
<enumerationValues>
<enumerationValue key="above">Above</enumerationValue>
<enumerationValue key="after">After</enumerationValue>
<enumerationValue key="below">Below</enumerationValue>
<enumerationValue key="below">Below</enumerationValue>
<enumerationValue key="before">Before</enumerationValue>
</enumerationValues>
<enumerationValue key="abovecentered">Above Centered</enumerationValue>
<enumerationValue key="aftercentered">After Centered</enumerationValue>
<enumerationValue key="belowcentered">Below Centered</enumerationValue>
<enumerationValue key="beforecentered">Before Centered</enumerationValue>
<enumerationValue key="abovealt">Above (Alternate)</enumerationValue>
<enumerationValue key="belowalt">Below (Alternate)</enumerationValue>
</enumerationValues>
</property>
<property key="imagedefault" type="image" required="false">
<caption>Default image</caption>
Expand Down
20 changes: 10 additions & 10 deletions src/TooltipImage/widget/FormTooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ define([
'mxui/dom', 'dojo/dom', 'dojo/_base/lang', 'dijit/registry', "dojo/text!TooltipImage/widget/templates/Tooltip.html"
],
function (declare, _WidgetBase, _Widget, _Templated, MasterTooltip, domMx, dom, lang, registry, widgetTemplate) {

// Declare widget.
return declare('TooltipImage.widget.FormTooltip', [ _WidgetBase, _Widget, _Templated, MasterTooltip ], {

Expand All @@ -39,23 +39,23 @@ define([
tooltipform : '',
showdelay : 0,
hidedeley : 0,

// Internal variables used.
_hideTimer : null,
_showTimer : null,
_tooltipNode : null,
_previousContext : null,
_currentContext : null,
_topWidgets : null,

_dataContainer : {},

postCreate : function() {
logger.debug(this.id + ".postCreate");

this.connect(this.targetnode, 'onmouseover', '_onShow');
this.connect(this.targetnode, 'onmouseout', '_onHide');

this.connect(mxui.widget, 'hideTooltip', this, '_hideTooltip');
},

Expand Down Expand Up @@ -92,7 +92,7 @@ define([
_fetchForm : function() {
var node = null,
ioBind = null;

logger.debug(this.id + '.fetchForm');

if(this._topWidgets) {
Expand All @@ -105,7 +105,7 @@ define([
callback: lang.hitch(this, function(form) {
var i = null,
widget;

this._tooltipNode = node.firstChild;
this._topWidgets = registry.findWidgets(this._tooltipNode)[0];

Expand Down Expand Up @@ -175,13 +175,13 @@ define([
uninitialize : function() {
logger.debug(this.id + '.uninitialize');

if (typeof this._tooltipNode !== 'undefined' && this._tooltipNode) {
mxui.widget.destroyChildren(this._tooltipNode);
if (typeof this._topWidgets !== 'undefined' && this._topWidgets) {
this._topWidgets.destroy();
}
}

});
});
require(["TooltipImage/widget/FormTooltip"], function () {
"use strict";
});
});
5 changes: 3 additions & 2 deletions src/TooltipImage/widget/MasterTooltip.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*jslint white: true, nomen: true, plusplus: true */
/*global logger, mx, mxui, mendix, dojo, require, console, define, module, TooltipImage */
define([
"dojo/_base/declare", "TooltipImage/widget/Templated",
"dojo/_base/declare", "TooltipImage/widget/Templated",
"dojo/window", "dojo/dom-class", "dojo/dom-geometry",
"dijit/Tooltip", "dojo/text!TooltipImage/widget/templates/Tooltip.html"
], function(declare, _Templated, dojoWindow, dojoClass, dojoGeometry, dijitTooltip, templateString) {
Expand Down Expand Up @@ -52,6 +52,7 @@ define([
// see dijit/_MasterTooltip.js line 40
this.aroundNode = null;

logger.debug("Calling inherited with " + position);
this.inherited(arguments, [content, aroundNode, position]);
dojoClass.add(this.domNode, "mx-tooltip");
}
Expand All @@ -61,4 +62,4 @@ define([
});
require(["TooltipImage/widget/MasterTooltip"], function () {
"use strict";
});
});
Loading