Skip to content

Instantly share code, notes, and snippets.

Mark Leusink markleusink

Block or report user

Report or block markleusink

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@markleusink
markleusink / draggable.directive.ts
Last active Apr 11, 2019
Angular directive to make ngx-bootstrap modals draggable
View draggable.directive.ts
import { Directive, ElementRef, HostListener, AfterViewInit } from '@angular/core';
/*
* Directive to add 'drag' support to Ngx Bootstrap modals (https://github.com/valor-software/ngx-bootstrap).
* Based on this library to enable drag support for an ng-bootstrap modal: https://github.com/mattxu-zz/ngb-modal-draggable
*
* Enable by adding the directive to the modal-header element, e.g.:
*
* <div class="modal-header" ngxModalDraggable> </div>
*/
@markleusink
markleusink / modal.xsp
Created Jan 23, 2019
Modal causing (partial) refresh issue in Domino 10.0.1
View modal.xsp
<?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex">
<xe:dialog
id="dialog1"
title="refresh issue">
<xp:panel id="dlgContentWrapper">
View JNA filter by city.java
// filters
List<String> filterCity = new ArrayList<String>();
List<String> cities = new ArrayList<String>(); // list of typeahead suggestions
LinkedHashSet<Integer> matchingIds = new LinkedHashSet<Integer>();
public ListController3() {
// load city typeahead options: get a list of all cities used in the view
// the list is cached in the applicationScope
View JNA open collection and sort.java
String fakenamesPath = "fakenames2018.nsf";
// open the target database/ view (collection)
NotesDatabase db = new NotesDatabase(ExtLibUtil.getCurrentSession(), "", fakenamesPath);
NotesCollection collection = db.openCollectionByName("contacts");
//resort the collection (view) according to the selected column and direction
collection.resortView(this.sortColumn,
(this.sortAscending ? Direction.Ascending : Direction.Descending));
View JNA open collection and read.java
String fakenamesPath = "fakenames2018.nsf";
// open the target database/ view (collection)
NotesDatabase db = new NotesDatabase(ExtLibUtil.getCurrentSession(), "", fakenamesPath);
NotesCollection collection = db.openCollectionByName("contacts");
// read total number of entries
totalEntries = collection.getTopLevelEntries();
// tell the API how to navigate in the view: from one entry to the next (in view ordering)
@markleusink
markleusink / toaster.js
Last active Aug 3, 2017
AngularJS-toaster example: hide toaster on close button click, goto different state on body click (and hide toaster)
View toaster.js
toaster.pop('info', 'Title', '<b>Body text here...</b>', 5000, 'trustedHtml', function callback(toast, isCloseBtn) {
if (!isCloseBtn) {
//handle the click event here, like going to a different state:
$state.go('app.prospects');
}
toaster.clear();
});
@markleusink
markleusink / dialog.xml
Created Jun 26, 2016
xpages dialog with materialize tags
View dialog.xml
<?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex">
<xp:this.resources>
<xp:script
src="/materialize-tags/dist/js/materialize-tags.min.js"
clientSide="true">
</xp:script>
@markleusink
markleusink / gist:3d8b1428eeb6f7ba59ee
Created Mar 24, 2015
dynamic xcomponents elements
View gist:3d8b1428eeb6f7ba59ee
<!doctype html>
<html>
<head>
<title>XComponents</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<!--set the hidden class here, so everything is immediately hidden-->
<style type="text/css">
@markleusink
markleusink / gist:e49950dbd92a955e9d62
Created Nov 11, 2014
Morris chart with dynamic data in XPages
View gist:e49950dbd92a955e9d62
<?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:unp="http://unplugged.teamstudio.com"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.beforePageLoad><![CDATA[#{javascript://generate the data set here: you could loop through a view for example
var chartData = [];
var year = 2006;
You can’t perform that action at this time.