Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
eduardolundgren / gist:879835
Created March 21, 2011 17:34
extending aria plugin
instance.plug(A.Plugin.Aria, {
after: {
processAttribute: function(event) {
var instance = this;
var host = instance.get('host');
if (event.aria.attrName == 'collapsed') {
var collapsed = host.get('collapsed');
if (host.icons) {
@eduardolundgren
eduardolundgren / gist:881331
Created March 22, 2011 14:52
FormValidator conditional rule checking
<!DOCTYPE html>
<html>
<head>
<script src="../../build/aui/aui.js" type="text/javascript"></script>
<link rel="stylesheet" href="../../build/aui-skin-classic/css/aui-skin-classic-all-min.css" type="text/css" media="screen" />
<style type="text/css">
var Lang = A.Lang,
isArray = Lang.isArray,
isObject = Lang.isObject,
isValue = Lang.isValue,
Aeach = A.Array.each,
getObjectKeys = A.Object.keys,
getObjectValues = A.Object.values,
selectorTest = A.Selector.test,
YgetClassName = A.ClassNameManager.getClassName,
<!DOCTYPE html>
<html>
<head>
<script src="../../build/aui/aui.js" type="text/javascript"></script>
<script src="../../src/javascript/i18n/calendar-pt-br.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../../build/aui-skin-classic/css/aui-skin-classic-all-min.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../build/aui-button/assets/aui-button-core.css" type="text/css" media="screen" title="no title" charset="utf-8" />
@eduardolundgren
eduardolundgren / gist:935057
Created April 21, 2011 17:31
Alloy Taglibs TypeUtil
/**
* Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
AUI().use('overlay', function(A) {
//var O = A.Base.create('baseCellEditor', A.Overlay, [], {}, { ATTRS: { visible: {value:false} } });
var O = A.Component.create({
NAME: 'baseCellEditor',
ATTRS: {
visible: { value: false },
bodyContent: { value: 'BODY' },
footerContent: { value: 'FOOTER' }
@eduardolundgren
eduardolundgren / gist:1003024
Created June 1, 2011 19:01
SessionTreeJSClicks
/**
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
Y.Ransac = {
findHomography: function(matches, iter) {
var instance = this, bestScore = 0, bestHomography = null, i, mLen = matches.length;
for (i = 0, iter = ((iter === undefined) ? 100 : iter); i < iter; i++) {
var pairs = [], j, H;
for (j = 0; j < 4; j++) {
pairs.push(matches[YMath.randomInt(mLen)]);
}
@eduardolundgren
eduardolundgren / gist:1137514
Created August 10, 2011 17:25
Liferay.Localization
var Localization = {
get: A.cached(
function(xmlDoc, nodeName, languageId) {
if (isString(xmlDoc)) {
xmlDoc = A.DataType.XML.parse(xmlDoc);
}
languageId = languageId || themeDisplay.getLanguageId();
var label = Liferay.Localization.getByLanguageId(xmlDoc, nodeName, languageId);
@eduardolundgren
eduardolundgren / gist:1140352
Created August 11, 2011 18:25
Kaleo definition JSONML Array
var d = [
"workflow-definition",
{
"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance",
"xmlns":"urn:liferay.com:liferay-workflow_6.1.0",
"xsi:schemaLocation":"urn:liferay.com:liferay-workflow_6.1.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_1_0.xsd"
},
[
"name",
"Single Approver"