Skip to content

Instantly share code, notes, and snippets.

View hoatle's full-sized avatar

Hoat Le hoatle

View GitHub Profile
@hoatle
hoatle / ActivityResourcesTest.java
Created June 22, 2011 02:35
ActivityResources unit tests
/*
* Copyright (C) 2003-2011 eXo Platform SAS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@hoatle
hoatle / ActivityManagerTest.java
Created June 22, 2011 07:46
ActivityManager apis and unit test cases
/*
* Copyright (C) 2003-2010 eXo Platform SAS.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@hoatle
hoatle / ActivityStreamResources.java
Created June 22, 2011 08:06
ActivityStreamResources implementation and unit test cases
/*
* Copyright (C) 2003-2011 eXo Platform SAS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@hoatle
hoatle / ActivityResources.txt
Created June 27, 2011 03:54
ActivityResources REST spec
h1. activity
{panel}
h2. *POST* +activity._format_+
*Description*
Creates an activity to an identity's activity stream. If no *identityId* is specified, the activity will be created to the authenticated identity's activity stream.
@hoatle
hoatle / ActivityStreamResources.txt
Created June 27, 2011 03:56
ActivityStreamResources REST spec
h1. activity_stream
{panel}
h2. *GET* +activity_stream._format_+
*Description*
Gets activity stream of an identity. If no *identity_id* param is specified, the default identity will be the authenticated identity (who makes this request).
*Url*
@hoatle
hoatle / ActivityStreamResourcesTest.java
Created September 27, 2011 03:17
ActivityStreamResourcesTest
/*
* Copyright (C) 2003-2011 eXo Platform SAS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@hoatle
hoatle / ActivityStreamResources.java
Created September 27, 2011 09:24
ActivityStreamResources.java
/*
* Copyright (C) 2003-2011 eXo Platform SAS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@hoatle
hoatle / gist:1728663
Created February 3, 2012 07:13
js closure usage
for (var i = 0; i < this.allCommentSize; i++) {
(function(i) {
//when this element is displayed
if (uiActivity.commentBlockEls[i]) {
Util.addEventListener(uiActivity.commentBlockEls[i], ['mouseover', 'focus'], function(evt) {
uiActivity.deleteCommentButtonEls[i].className = 'CloseContentBoxHilight';
}, false);
Util.addEventListener(uiActivity.commentBlockEls[i], ['mouseout', 'blur'], function(evt) {
uiActivity.deleteCommentButtonEls[i].className = 'CloseContentBoxNormal';
@hoatle
hoatle / DOMUtil.js
Created February 21, 2012 04:58
eXo.social.DOMUtil
/**
* DOMUtil.js provides any missing function from eXo.core.DOMUtil that is required by Social.
* @author <a href="http://hoatle.net">hoatle (hoatlevan at gmail dot com)</a>
* @since Social 1.2.8
*/
(function() {
var window_ = this,
Util = eXo.social.Util;
@hoatle
hoatle / eXo.js
Created February 24, 2012 05:00
eXo.provide(namespace, obj);
(function(w) {
w.eXo = w.eXo || {};
/**
* Exposes a function to attach its to a namespace, this is similar but more advanced than goog.provide(namespace)
*
* @param namespace the name space string, for example: "eXo.social.MyClass".
* @param obj the associated function or singleton object to be associated with this name space
*/
eXo.provide = function(namespace, obj) {
if (!namespace || !obj) {