Skip to content

Instantly share code, notes, and snippets.

@iwyg
iwyg / README.markdown
Created April 9, 2011 00:14
a htmlform inline validation plugin for the jQuery JavaScript Library in use of SYMPHONY-CMS

hi there

Project has moved to github

@iwyg
iwyg / cssimagecollect.js
Created April 9, 2011 13:55
Fetches all css stylesheets and extracts all image urls. Comes in handy when you want to preload your css asstets. See implementation for usage instructions.
/**
* ===================================================================================
* @name CssImageCollect
* @version 1
* @description a javascript css-image preloader
* @author Thomas Appel, mail(at)thomas-appel(dot)com
*
* released under the MIT licence
* copyright © 2011 Thomas Appel, thomas-appel.com
*
@iwyg
iwyg / implementation.js
Created April 9, 2011 14:26
A tiny css asset preloader for the jQuery Javascript Library. See implementation.js for further instructions
$(document).ready(function(){
var cssImages = ['path/to/image1.png','path/to/image2.jpg','path/to/image3.gif'],
myElement = $('myElement');
// bind eventlistener to one jquery object
myElement.bind('assetsready',function(){
// do awesome stuff
});
@iwyg
iwyg / multilingual-field.js
Created January 27, 2012 15:45
Multilingual Field initialisation proposal
(function ($, Symphony, window, undefined) {
function MultilingualField(field) {
this.field = field;
this.init();
}
MultilingualField.prototype = {
init: function () {
var self = this,
@iwyg
iwyg / master.xml
Created February 22, 2012 01:19 — forked from anonymous/master.xml
format css grid in xslt
<data>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
@iwyg
iwyg / object.extend.js
Created March 17, 2012 21:19
deep extend or copy an object
(function () {
var objStr = '[object Object]';
//var arrStr = '[object Array]';
//var isArray = function (a) {
// return Object.prototype.toString.call(a) === arrStr;
//};
var isObject = function (o) {
return Object.prototype.toString.call(o) === objStr;
<data>
<hello>paste your xml here</hello>
<goodbye></goodbye>
<array>
<item></item>
<item>
<name>object name</name>
</item>
<item>
<name></name>
<data>
<params>
<root>http://example.com</root>
<ds-toc-projects>
<item handle="project1">project1</item>
<item handle="project2">project2</item>
<item handle="project3">project3</item>
</ds-toc-projects>
<ds-toc-whatever>
<item handle="whatever1">whatever1</item>
@iwyg
iwyg / formsubmit.xsl
Created May 8, 2012 14:46
xhr submit form in symphony cms
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl" version="1.0" >
<xsl:import href="../utilities/xml2json.xsl"/>
<xsl:template match="data">
<xsl:variable name="event">
<xsl:element name="{events/post-comment/@result}">
<xsl:copy-of select="events/post-comment/*""/>
</xsl:element>
<data>
<pants>
<entry>
<content>Test 1</content>
</entry>
<entry>
<content>Test 2</content>
</entry>
<entry>
<content>Test 3</content>