Skip to content

Instantly share code, notes, and snippets.

@dudelis
dudelis / Carousel.js
Created May 9, 2019
K2 React Control Carousel
View Carousel.js
@dudelis
dudelis / cloudSettings
Last active May 7, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-05-02T20:14:40.107Z","extensionVersion":"v3.2.9"}
@dudelis
dudelis / script.js
Created Apr 1, 2019
K2: Video Background
View script.js
const html = '<div id="k2-background-video" class="bg-video"><video class="bg-video__content" autoplay muted loop><source src="https://github.com/dudelis/K2Devs/raw/master/k2-ui-features/k2-video-background/video.mp4" type="video/mp4"><source src="https://github.com/dudelis/K2Devs/raw/master/k2-ui-features/k2-video-background/video.webm" type="video/webm">Your browser is not supported</video></div>';
$('.runtime-content').prepend(html);
@dudelis
dudelis / app.jsx
Created Mar 26, 2019
K2-React-Control - Part 2
View app.jsx
import React from "react";
import Masonry from "react-masonry-component";
import xml2js from "xml2js";
const fileUrl =
"/Designer/Runtime/File.ashx?_path=NOPATH&_controltype=image&X-K2-Token=&_filerequestdata=";
export default class App extends React.Component {
constructor(props) {
super(props);
@dudelis
dudelis / index.js
Created Mar 26, 2019
K2-React-Control - Part 1
View index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App';
ReactDOM.render(<App />, document.getElementsByName('react-control-root')[0]);
@dudelis
dudelis / redux-actions.ts
Last active Mar 21, 2019 — forked from milankorsos/redux-actions.ts
Correct TypeScript typing example for Redux Thunk actions
View redux-actions.ts
import {Action, ActionCreator, Dispatch} from 'redux';
import {ThunkAction} from 'redux-thunk';
// Redux action
const reduxAction: ActionCreator<Action> = (text: string) => {
return {
type: SET_TEXT,
text
};
};
View k2-subform-zoomin.css
.popup.dialog.sub-form {
-webkit-animation-name: zoomIn;
animation-name: zoomIn;
-webkit-animation-duration: 1s;
animation-duration: 1s;
}
@-webkit-keyframes zoomIn {
0% {
@dudelis
dudelis / k2-subform-slidein-right.css
Created Mar 14, 2019
K2: Subform slide in right
View k2-subform-slidein-right.css
.popup.dialog.sub-form {
animation-name: slideInRight;
animation-duration: 2s;
transform: translateX(117%);
}
.modalizer.modal-element {
animation-name: fadeOut;
animation-duration: 1s;
}
@dudelis
dudelis / css-jackinthebox.css
Created Mar 14, 2019
K2: Popup animation - Jack In the Box
View css-jackinthebox.css
.popup.dialog.runtime-message {
animation-name: jackInTheBox;
animation-duration: 2s;
}
@-webkit-keyframes jackInTheBox {
0% {
-webkit-transform: scale(.1) rotate(30deg);
-webkit-transform-origin: center bottom;
opacity: 0;
@dudelis
dudelis / script.js
Last active Feb 26, 2019
K2 - Slide In/Out worklist
View script.js
(function () {
var dataLabelName = "JS - Move Worklist"; //THIS IS WHERE YOU NEED TO SPECIFY YOUR UNIQUE NAME
$('.runtime-form').append('<div class="slideout"><div class="slideout__tab"></div><form class="slideout__form"><div class="slideout__placeholder"/></form></div>');
var view = $('[name="' + dataLabelName + '"]').closest('.view');
var viewHeader = $(view).find('.panel-header');
$(viewHeader).appendTo('.slideout__tab');
$(view).appendTo('.slideout__form');
var slideToggle = function () {
var slideout = $(".slideout");
return slideout[0].classList.toggle('show');