http://smoothgallery.jondesign.net/what/
Using mootools v1.11, this javascript gallery and slideshow system allows you to have simple and smooth (cross-fading…) image galleries, slideshows, showcases and other cool stuff on your website…
Archive for the ‘Markup Languages’ Category
smoothgallery
INTRODUCTION TO URL ENCODING GET
Background
URL Encoding is the process of converting string into valid URL format. Valid URL format means that the URL contains only what is termed “alpha | digit | safe | extra | escape” characters. You can read more about the what and the whys of these terms on the World Wide Web Consortium […]
Entity Declarations, Attributes and Expansion
by Norman Walsh
August 28, 1998
Entity Declarations
Entities must be declared before they can be used. They may be declared in the DTD, if your XML parser processes the DTD (also known as the external subset), or the internal subset. Note: if the same entity is declared more than once, only the first declaration applies and the […]
Insert content Textarea JavaScript
function eInsertContent(myField, myValue) {
//IE support
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
myField.focus();
}
//MOZILLA/NETSCAPE support
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
var scrollTop = myField.scrollTop;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
myField.focus();
myField.selectionStart = startPos + myValue.length;
myField.selectionEnd = startPos + myValue.length;
myField.scrollTop = scrollTop;
} else {
myField.value += myValue;
myField.focus();
}
}
In tinyMCE
[…]
Images With A Drop jQuery
Here’s how jQuery attacks the problem.
$(document).ready(function(){
$("img.dropshadow").wrap("<div class='wrap1'><div class='wrap2'>" +
"<div class='wrap3'></div></div></div>");
});
Assuming your images are formatted like so:
<img src="object.gif" class="dropshadow" alt="The object casting " />
find urls in tags with class JavaScript jq
$('.media_file').each(function (i) {
var url = $(this).find("a").attr("href");
console.log(url);
});
Add spans around each word
Add spans around each word then add a hover and italicize words with the letter t.
var newText = $("p").text().split(" ").join("</span> <span>");
newText = "<span>" + newText + "</span>";
$("p").html(newText)
.find("span")
.hover(function () { $(this).addClass("hilite"); },
function () { $(this).removeClass("hilite"); })
.end()
.find(":contains('t')")
.css({"font-style":"italic", "font-weight":"bolder"});
ascii art
████████▓▓▓▓░░░░░░▓▓▓▓▓▓
██████▓▓░░░░░░░░░░░░░░░░▓▓
████▓▓░░░░░░░░░░░░░░░░░░░░▓▓
██▓▓░░░░░░░░░░░░░░░░░░░░░░░░▓▓
█▓░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓
█▓░░░░░░░░░░░░░░░░░░░░░░░░░░░▓░▓
▓░░░░░░░░░░░░░░░░█░░░░░░░░░░░░░▓
▓░░░░░░░░░░░░░████░░░░░░░░░░░░░░▓
▓░░░░░░░░░░░░██▒█░░░░░░░░░░░█░░░▓
▓░░░░░░░░░░██████░░░░░░░█████░░░▓
▓░░░░░░░░░███████░░░░░░██▒▒█░░░░▓
█▓░░░░░░░░█████▒█░░░░░██████░░░▓
█▓░░░░░░░░█▒▒▒▒▒█░░░░██████░░░▓
██▓░░░░░░░█▒▒▒▒█░░░░████▒▒█░░▓
███▓░░░░░░█▒▒▒█░░░░░█▒▒▒▒█░░▓
███▓░░░░░░████░░░░░░█▒▒▒█░░▓
████▓░░░░░░░░░░░░░░░░███░░▓
█████▓▓░░░░░░░█████░░░░░░▓
███████▓▓▓░░░░░██░░░░░░░▓
██████████▓▓▓░░░░░░▓▓▓▓▓
█████████▓▓░░░░░░░░░▓
████████▓▓░░░░░░░░░░▓▓
████████▓░░▓▓░░░░░░░░░▓
███▓▓▓▓▓▓░▓░░░░░░░░░░░▓
█▓▓░░░▓▓▓▓░▓░░░░░░░░░░▓▓▓▓▓▓
█▓▓░░░░░░▓▓▓▓░░░░░░░▓▓░░░░░▓▓
█▓░░░░░░░░░░▓▓▓▓▓▓▓▓░░░░░░░░░▓
██▓▓░░░░░░░░░▓███▓░░░░░░░░░░▓
███▓▓▓▓▓▓▓▓▓▓█████▓▓▓▓▓▓▓▓▓▓
foutieve interpretatie jQuery IE
Juiste HTML voor templates
template = "<div class=\"filter\" id=\"filter\"><fieldset><legend>Remove emails from queue</legend><a class=\"deletelink\" id=\"button" +
"\">REMOVE </a><span id=\"out" +
"\"></span></fieldset></div>";
$(template).appendTo(parent);
HTML tags moeten correct afgesloten worden firefox sluit bijna alles correct af. IE zal layout breken.
Iedere post moet correcte return type bevaten.
$.post("/queue/reset/", { "filter": ""},
function(data){
dialog.dialog("close");
$("#out").text(data).fadeIn(3000);
$("#out").text(data).fadeOut(3000);
//window.document.location = "/admin/org/queue/";
}, "html");
Type […]
Scripting Debugging in Internet Explorer
I thought I’d take a couple minutes to talk about Script Debugging and Internet Explorer.
Script debugging is turned off by default you can enable it by going to:
Tools->Internet Options…->Advanced->Disable Script Debugging
Prior to XPSP2 the above will turn script debugging on for all applications that host the WebBrowser control (Outlook for example).
On XPSP2 we’ve split the […]
The Decorator Pattern JavaScript
a way to add features to objects without creating new subclasses.
The decorator pattern is used to transparently wrap objects within another object of the same
interface. This […]
Composite Pattern JavaScript
You should only use the composite pattern when you have both of the following:
• Groups of objects, in some sort of hierarchy (the exact structure of which could be
unknown at development time)
• An operation you want to perform […]
Bridges JavaScript
You can now run the API in a unit test because getBeerById is
not tightly coupled to an event response object. Instead you just supply the interface with an
ID and a callback, and voila! Completely accessible beer.
function getBeerById(id, callback) {
// Make request for beer by ID, then return the beer data.
asyncRequest('GET', […]
Django Save filter with javaScript
/* FilterManager interface. */
var fm = new Interface('FilterManager', ['_createElements', '_attachEvents']);
var eEcho = window.eEcho || {};
eEcho.Config = {
SELECT_ID: "filterSelect",
SAVE_BUTTON_ID: "save_filter",
OUTPUT_ID: "output",
LOAD_OPTIONS_PATTERN: "/filter/options/ #options option",
POSTURL: "/filter/add/",
SELECT_BIND_EVENT: "change",
SELECTED: "#filterSelect option:selected",
WINDOWPROMPT: "Filter name pleas…",
WINDOWPROMPT_VALUE: "New filter name",
};
eEcho.Template = {
HTML_TEMPLATE: "<div class=\"filter\" id=\"filter\"><fieldset><legend>Filters</legend><select id=\"" + eEcho.Config.SELECT_ID +
"\"></select><a class=\"addlink\" id=\"" + eEcho.Config.SAVE_BUTTON_ID +
"\">SAVE […]
Using ExtJS’s Grid Filtering with Django
http://www.debatablybeta.com/posts/using-extjss-grid-filtering-with-django/
This particular post was originally published on July 16, 2008.
Jump to: Related Content or Comments
Tags: ajax datagrid django extjs javascript queryset
Introduction
ExtJS 2.1 saw inclusion of the popular (at least in my world) user extension for AJAX filtering of data by grid columns. As useful as this is (provided you can abide by the GPL or […]
Are you an ExtJS and Django user?
Are you an ExtJS and Django user? If so, you will want to check out this article by Matt of Tangible Worldwide on Using ExtJS’s Grid Filtering with Django.
He goes into detail on how to tweak the grid filtering system that is aimed at PHP, and getting it to work in a way that allows […]
Core JavaScript
// Constructor.
var Interface = function(name, methods) {
if(arguments.length != 2) {
throw new Error("Interface constructor called with " + arguments.length +
"arguments, but expected exactly 2.");
}
this.name = name;
this.methods = [];
for(var i = 0, len = methods.length; i < len; i++) {
if(typeof methods[i] !== 'string') {
throw new Error("Interface constructor expects method […]
class true private methods, attributs JavaScript
/* FilterManager interface. */
var FilterManager = new Interface('FilterManager', ['save', 'del', 'show', '_createElements', '_attachEvents']);
/* FilterManager class */
eecho.FilterManager.prototype = (function() { // Implements FilterManage
/* Private attributes. */
var selectHtml, labelText;
/* Private methods. */
function _createElements() {
// DOM elements
}
function _attachEvents() {
// DOM events using bind of jQuery
[…]
Console API
http://getfirebug.com/console.html
Firebug adds a global variable named “console” to all web pages loaded in Firefox. This object contains many methods that allow you to write to the Firebug console to expose information that is flowing through your scripts.
console.log(object[, object, …])
Writes a message to the console. You may pass as many arguments as you’d like, and they […]
Chaining JavaScript
Chaining is really just a syntax hack. It allows you to express complex operations in a small
amount of code by reusing an initial operation.
// Without chaining:
addEvent($('example'), 'click', function() {
setStyle(this, 'color', 'green');
show(this);
});
// With chaining:
$('example').addEvent('click', function() {
$(this).setStyle('color', 'green').show();
});
(function() {
function _$(els) {
// …
[…]
