Skip to content

Instantly share code, notes, and snippets.

@sepulchered
sepulchered / CanvasAnimation.html
Created February 13, 2014 07:21
Simple Canvas Manipulation
<!doctype html>
<html>
<head>
<title>canv1</title>
</head>
<body>
<canvas id='panel'></canvas>
<script type="text/javascript">
var PANEL = {
currentWidth: 800,
@sepulchered
sepulchered / bifrF.markdown
Created May 26, 2014 08:37
A Pen by Andrey Dresvyannikov.
@sepulchered
sepulchered / progressBarGenerator.js
Created December 18, 2012 14:33
This function generates progressbar html layout.
progressBarHtmlGenerator: (function(){
var width = progressbar_width,
cls = 'x-progress', // default class as you can see in ProgressBar.js of Ext.js
tpl = new Ext.Template( // this template also was taken from ProgressBar.js
'<div class="{cls}-wrap">',
'<div class="{cls}-inner">',
'<div class="{cls}-bar" style="width: {barWidth}px">',
'<div class="{cls}-text">',
'<div>{text}</div>',
'</div>',
@sepulchered
sepulchered / customProgressBarInGridRenderer.js
Created December 18, 2012 14:38
Custom renderer for progressbar column in grid.
renderer: function( value, metaData, record, rowIndex, colIndex, store ) {
var value = progress_value;
return this.progressBarHtmlGenerator(value);
}.createDelegate(this)
renderer: function( value, metaData, record, rowIndex, colIndex, store ){
var id = Ext.id();
(function(){
var progress = Ext.ProgressBar({
renderTo: id,
value: progress_value
});
}).defer(25);
return '<div id="' + id +'"></div>';
}
@sepulchered
sepulchered / LatitudeLongitudeObject.js
Last active December 11, 2015 13:29
Simple latitude/longitude object. It uses fraction 1/1000 of minute, but you can easily change code to use seconds instead of it. Value can be set in 3 different ways. You can provide float number and this object will get degrees, minutes and fractions. You can pass object with corresponding values and finally string (as in maskedValueRe variabl…
function LatitudeLongitude(lat){
this.direction = 1;
this.degrees = 0;
this.minutes = 0;
this.fraction = 0;
this.fValue = 0;
this.latitude = (lat != null) ? lat : true;
this.maxValue = ( this.latitude ) ? 90 : 180;
this.minValue = -this.maxValue;
}
/**
* InputTextMask script used for mask/regexp operations.
* Mask Individual Character Usage:
* 9 - designates only numeric values
* L - designates only uppercase letter values
* l - designates only lowercase letter values
* A - designates only alphanumeric values
* X - denotes that a custom client script regular expression is specified</li>
* All other characters are assumed to be "special" characters used to mask the input component.
* Example 1:
/*
* Original source is taken from http://www.sencha.com/forum/showthread.php?136002-Mask-for-TextField
* This code was created by sencha forum user http://www.sencha.com/forum/member.php?257343-FrankXP
* all rights to this code belong to him.
*
* Usage example:
* {
* xtype: 'textfield',
* mask: { text: '(999) 999-9999', placeholder:'#', includeInValue: false }
* }
Ext.ns('Ext.ux.form');
Ext.ux.form.TripleTriggerField = Ext.extend( Ext.form.TriggerField, {
initComponent : function(){
Ext.form.TwinTriggerField.superclass.initComponent.call(this);
this.triggerConfig = {
tag:'span', cls:'x-form-twin-triggers', cn:[
{tag: "img", src: Ext.BLANK_IMAGE_URL, alt: "", cls: "x-form-trigger " + this.trigger1Class},
{tag: "img", src: Ext.BLANK_IMAGE_URL, alt: "", cls: "x-form-trigger " + this.trigger2Class},