Skip to content

Instantly share code, notes, and snippets.

View mattparker's full-sized avatar

Matt Parker mattparker

View GitHub Profile
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Example</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0r4/build/reset-fonts-grids/reset-fonts-grids.css&2.8.0r4/build/assets/skins/sam/skin.css">
<style>
.yui-skin-sam .yui-toolbar-container .yui-toolbar-personal {
width: 120px;
}
</style>
(function() {
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event,
Lang = YAHOO.lang,
Toolbar = YAHOO.widget.Toolbar;
/**
* The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.
* @constructor
* @class SimpleEditor
(function () {
var Paginator = YAHOO.widget.Paginator,
l = YAHOO.lang;
/**
* ui Component to generate the jump-to-page dropdown
*
* @namespace YAHOO.widget.Paginator.ui
* @class JumpToPageDropdown
<!doctype html>
<html>
<head>
<title>Extending DataTable - showing and hiding columns</title>
<link type="text/css" rel="stylesheet" href="http://developer.yahoo.com/yui/3/assets/yui.css">
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.0.0/build/cssfonts/fonts-min.css">
<style type="text/css">
/* Any special style you need beyond the usual skinning */
</style>
initPanel:function(){
if( this.panel === '' )
{
YAHOO.util.Dom.removeClass( "detailPopupPanelContainer", "hidden");
this.panel = new YAHOO.widget.Panel( "detailPopupPanelContainer" ,
{close:true,
draggable:true,
underlay:"shadow",
YUI.add('node-resize', function(Y) {
/**
* Simple resize
*/
<div>
<button id="show1">Show panel1</button>
<button id="hide1">Hide panel1</button>
</div>
<div id="container"></div>
<div id="panel1">
<div class="hd">Panel #1 from Markup</div>
<div class="bd">This is a Panel that was marked up in the document.</div>
<div class="ft">End of Panel #1</div>
@mattparker
mattparker / a really simple, drag-droppable YUI3 treeview
Created April 7, 2010 08:44
A really simple, drag-drop YUI3 treeview
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- @(#) $Id$ -->
<head>
<title>Extension of sortable lists as a tree view</title>
<!-- Dependency -->
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.1.0/build/cssfonts/fonts-min.css" />
<script type="text/javascript" src="http://yui.yahooapis.com/3.1.0/build/yui/yui.js"></script>
<!--
var menuitems = [ {text:"item 1", url: "www.1.com"}, {text:"item 2", url: "www.1.com"}, {text:"item 3", url: "www.1.com"} ];
oMenu = new YAHOO.widget.Menu( "amenu", {
fixedcenter: true,
lazyload: true,
autosubmenudisplay: true
});
oMenu.addItems(menuitems);
oMenu.render("mymenu");
oMenu.show();
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>YUI3 testbed</title>
<script type="text/javascript" src="js/shCore.js"></script>
<script type="text/javascript" src="js/shBrushJScript.js"></script>