Skip to content

Instantly share code, notes, and snippets.

@randombrad
randombrad / test.html
Created August 4, 2014 19:12
Angular
<html ng-app>
<head>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js'></script>
</head>
<body>
{{"hello"+" world"}}
</body>
</html>
<!DOCTYPE html>
#parse ($init)
<html class="$root_css_class" dir="#language ("lang.dir")" lang="$w3c_language_id">
<head>
<title>$the_title - $company_name</title>
<meta content="initial-scale=1.0, width=device-width" name="viewport" />
@randombrad
randombrad / init.vm
Last active August 29, 2015 14:05
Theme Velocity Changes from 6.1.x to 6.2.x
## ---------- Common variables ---------- ##
#set ($theme_display = $themeDisplay)
#set ($portlet_display = $portletDisplay)
#set ($theme_timestamp = $themeDisplay.getTheme().getTimestamp())
#set ($theme_settings = $themeDisplay.getThemeSettings())
#set ($root_css_class = "aui " + $languageUtil.get($locale, "lang.dir"))
#set ($css_class = $theme_display.getColorScheme().getCssClass() + " yui3-skin-sam")
@randombrad
randombrad / main.js
Last active August 29, 2015 14:05
Session Clicks
AUI().ready(
'liferay-store',
function(A) {
Liferay.Store.set('cssClass', 'sample');
console.log(Liferay.Store.get('cssClass'));
}
);
function FirstCtrl($scope){
$scope.data = {message: "Hello"};
}
/*
AngularJS v1.2.0
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
*/
(function(W,O,s){'use strict';function L(b){return function(){var a=arguments[0],c,a="["+(b?b+":":"")+a+"] http://errors.angularjs.org/undefined/"+(b?b+"/":"")+a;for(c=1;c<arguments.length;c++)a=a+(1==c?"?":"&")+"p"+(c-1)+"="+encodeURIComponent("function"==typeof arguments[c]?arguments[c].toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof arguments[c]?"undefined":"string"!=typeof arguments[c]?JSON.stringify(arguments[c]):arguments[c]);return Error(a)}}function pb(b){if(null==b||ya(b))return!1;
var a=b.length;return 1===b.nodeType&&a?!0:D(b)||J(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function q(b,a,c){var d;if(b)if(B(b))for(d in b)"prototype"!=d&&("length"!=d&&"name"!=d&&b.hasOwnProperty(d))&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==q)b.forEach(a,c);else if(pb(b))for(d=0;d<b.length;d++)a.call(c,b[d],d);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function Nb(b){var a=[],c;for(c in b)b.has
@randombrad
randombrad / layout.vm
Created September 19, 2014 19:36
Velocity Variables Dump
Color Scheme: $colorScheme
Company: $company
Layout: $layout
Layout Type Portlet: $layoutTypePortlet
Locale: $locale
Plid: $plid
Portlet Display: $portletDisplay
Portlet Group Id: $portletGroupId
Real User: $realUser
Request: $request
<%--
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of the Liferay Enterprise
* Subscription License ("License"). You may not use this file except in
* compliance with the License. You can obtain a copy of the License by
* contacting Liferay, Inc. See the License for the specific language governing
* permissions and limitations under the License, including but not limited to
* distribution rights of the Software.
@randombrad
randombrad / navigation.html
Created October 23, 2014 20:58
navigation html
<nav class="navbar" id="navigation">
<div class="navbar-inner">
<a class="btn btn-navbar" id="menu-toggler" data-navId="navigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="collapse.nav-collapse">
<ul class="nav nav-collapse">
<li class="lfr-nav-item selected" aria-selected="true" role="presentation">
@randombrad
randombrad / main.js
Last active August 29, 2015 14:08
Additional Code to Force Dropdown display on click and mouseleave
AUI.add(
'liferay-navigation-interaction-click',
function(A) {
A.mix(
Liferay.NavigationInteraction.prototype,
{
_initChildMenuHandlers: function(navigation) {
var instance = this;
if (navigation) {