code
stringlengths
1
2.08M
language
stringclasses
1 value
/** * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @author mr.doob / http://mrdoob.com/ */ THREEFAB.CanvasTexture = function () { THREE.Texture.call( this ); var canvas = document.createElement( 'canvas' ); canvas.width = 512; canvas.height = 512; var ctx = canvas.getContext("2d"); ct...
JavaScript
/** * @author mikael emtinger / http://gomo.se/ */ THREEFAB.AnimationMorphTarget = function( root, scale ) { this.root = root; this.currentTime = 0; this.timeScale = scale !== undefined ? scale : 1000; this.isPlaying = false; this.isPaused = true; this.loop = true; this.influence = 1; this.keyframes = 0;...
JavaScript
/** * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @author mr.doob / http://mrdoob.com/ */ THREEFAB.DragDropLoader = function() { window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder; window.URL = window.URL || window.webkitURL || window.mozURL; // Need ...
JavaScript
/** * @class THREEFAB.ExporterUtil * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Sets up exporter for threefab. * */ THREEFAB.Exporter = function() { var code_container = $('.code-container'); this.generate = function(viewport) { var html = THREEFAB.Exporter.Utils.priva...
JavaScript
/** * @class THREEFAB.Ui * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Sets up ui components for threefab. Dependency on dat.gui. * @param [THREEFAB.Viewport] viewport The instance of the viewport class. * */ THREEFAB.Ui = function(viewport) { var _viewport = viewport, mate...
JavaScript
/* ============================================================================= Author: Jason Kadrmas Company: KadrmasConceps LLC ========================================================================== */ var THREEFAB = THREEFAB || {};
JavaScript
THREEFAB.Toolbox = Backbone.View.extend({ initialize:function() { $('.toolbox-list').bind('click', function(event) { event.preventDefault(); var target = event.target || event.srcElement, className; if(target.tagName.toLowerCase() === "a") { className = target.className; $.publish(T...
JavaScript
/** * @class THREEFAB.TextureView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup texture view. * */ THREEFAB.TextureView = Backbone.View.extend({ el: document.createElement('li'), texture: document.createElement('img'), label: document.createElement('span'), initialize...
JavaScript
/** * * @class THREEFAB.MaterialView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup for material view. * */ THREEFAB.MaterialView = Backbone.View.extend({ el: '#gui-materials-container', gui: {}, selected: {}, texture: {}, color: {}, light: {}, folders: { materi...
JavaScript
/** * @class THREEFAB.OutlinerView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup outliner view. * */ THREEFAB.OutlinerView = Backbone.View.extend({ el: document.createElement('li'), select: document.createElement('select'), initialize: function() { _.bindAll(this); ...
JavaScript
/** * @class THREEFAB.TimelineView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup timeline view. * */ THREEFAB.TimelineView = Backbone.View.extend({ el: '#bottom-toolbar', duration: '#duration', container: '.timeline-container', canvas: document.createElement("canvas"...
JavaScript
/** * @class THREEFAB.TransformView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup transform view. * */ THREEFAB.TransformView = Backbone.View.extend({ el: '#gui-transform-container', gui: {}, outliner: {}, viewport: {}, viewportView: {}, selected: {}, folders: { ...
JavaScript
/** * @class THREEFAB.OutlinerView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup outliner view. * */ THREEFAB.ViewportView = Backbone.View.extend({ el: document.createElement('li'), initialize: function() { _.bindAll(this); this.el = $(this.el); this.el.append...
JavaScript
/** * @class THREEFAB.ColorView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup color view. * */ THREEFAB.ColorView = Backbone.View.extend({ el: document.createElement('li'), types: { color: {}, ambient: {}, specular: {} }, initialize: function() { _.bindAll(...
JavaScript
/** * @class THREEFAB.MaterialModel * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Sets up material model for the right hand material panel. * */ THREEFAB.MaterialModel = Backbone.Model.extend({ materialList: [ { prop:'wireframe' }, { prop:'transparent' }, { pro...
JavaScript
/** * @class THREEFAB.LightView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup color view. * */ THREEFAB.LightView = Backbone.View.extend({ el: document.createElement('li'), types: { color: {} }, initialize: function() { _.bindAll(this); this.el = $(this.el...
JavaScript
/* ============================================================================= Name: Viewport Description: Sets up basic three.js viewport. Author: Jason Kadrmas Company: KadrmasConceps LLC ========================================================================== */ THREEFAB.Viewport = function( parameters ) ...
JavaScript
/* ============================================================================= Author: Jason Kadrmas Company: KadrmasConceps LLC ========================================================================== */ (function(){ // Ready $(document).ready(function(){ var dragDrop = new THREEFAB.DragDropLoader(), ...
JavaScript
/** * Provides requestAnimationFrame in a cross browser way. * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ */ if ( !window.requestAnimationFrame ) { window.requestAnimationFrame = ( function() { return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || // commen...
JavaScript
ManipulatorTool = function () { THREE.Object3D.call(this); // Init this.selected = {}; // setup geometery var lineGeometry = new THREE.Geometry(); lineGeometry.vertices.push(new THREE.Vertex()); lineGeometry.vertices.push(new THREE.Vertex(new THREE.Vector3(0, 100, 0))); ...
JavaScript
Events = { // VIEWPORT_MESH_SELECTED: 'viewport/mesh/selected', // VIEWPORT_LIGHT_SELECTED: 'viewport/light/selected', // VIEWPORT_OBJECT_TEXTURE_ADDED: 'viewport/object/texture/added', // VIEWPORT_OBJECT_REMOVED: 'viewport/object/removed', VIEWPORT_OBJECT_ADDED: 'viewport/object/added', // ...
JavaScript
/* * jQuery Tiny Pub/Sub - v0.6 - 1/10/2011 * http://benalman.com/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function($){var a=$("<b/>");$.subscribe=function(b,c){function d(){return c.apply(this,Array.prototype.slice.call(a...
JavaScript
CanvasTexture = function () { THREE.Texture.call( this ); var canvas = document.createElement( 'canvas' ); canvas.width = 512; canvas.height = 512; var ctx = canvas.getContext("2d"); ctx.fillStyle = "rgba(255,255,255,1)"; ctx.fillRect(0, 0, 512, 512); this.image = canvas; this.needsUpdate...
JavaScript
AxisTool = function () { THREE.Object3D.call(this); // Init this.selected = {}; // setup geometery var lineGeometry = new THREE.Geometry(); lineGeometry.vertices.push(new THREE.Vertex()); lineGeometry.vertices.push(new THREE.Vertex(new THREE.Vector3(0, 100, 0))); var c...
JavaScript
MyObject = function () { this.name = "huy"; this.age = 22; } MyObject.prototype = new Object(); MyObject.prototype.constructor = MyObject();
JavaScript
Toolbox = Backbone.View.extend({ initialize: function () { $('.toolbox-list').bind('click', function (event) { event.preventDefault(); var target = event.target || event.srcElement, className; if (target.tagName.toLowerCase() === "a") { c...
JavaScript
MyGrid = function () { THREE.Object3D.call(this); var _grid = new THREE.Mesh(new THREE.PlaneGeometry(1000, 1000, 20, 20), new THREE.MeshBasicMaterial({ color: 0x606060, wireframe: true, transparent: true })); _grid.rotation.x = Math.PI / 2; this.add(_grid); var lineGeometry = new THREE...
JavaScript
/** * dat-gui JavaScript Controller Library * http://code.google.com/p/dat-gui * * Copyright 2011 Data Arts Team, Google Creative Lab * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ...
JavaScript
// Backbone.js 0.5.3 // (c) 2010 Jeremy Ashkenas, DocumentCloud Inc. // Backbone may be freely distributed under the MIT license. // For all details and documentation: // http://documentcloud.github.com/backbone (function(){ // Initial Setup // ------------- // Save a reference to the globa...
JavaScript
/* * jQuery Tiny Pub/Sub - v0.6 - 1/10/2011 * http://benalman.com/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function($){var a=$("<b/>");$.subscribe=function(b,c){function d(){return c.apply(this,Array.prototype.slice.call(a...
JavaScript
// usage: log('inside coolFunc', this, arguments); // paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ window.log = function(){ log.history = log.history || []; // store logs to an array for reference log.history.push(arguments); if(this.console) { arguments.callee = arguments.callee.caller; ...
JavaScript
/* Author: */
JavaScript
/** * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ */ THREEFAB.Events = { VIEWPORT_MESH_SELECTED: 'viewport/mesh/selected', VIEWPORT_LIGHT_SELECTED: 'viewport/light/selected', VIEWPORT_OBJECT_TEXTURE_ADDED: 'viewport/object/texture/added', VIEWPORT_OBJECT_REMOVED: 'viewport/object/removed', VIEWPO...
JavaScript
/** * @autor itooamaneatguy http://kadrmasconcepts.com/blog/ * @author mr.doob / http://mrdoob.com/ */ THREEFAB.AmbientLightContainer = function ( scene, hex) { var geometry = new THREE.SphereGeometry( 6, 6, 6 ), material = new THREE.MeshBasicMaterial( { color: 0xfff1a6, wireframe: true }), mesh = new THREE....
JavaScript
/** * @autor itooamaneatguy http://kadrmasconcepts.com/blog/ * @author mr.doob / http://mrdoob.com/ */ THREEFAB.PointLightContainer = function ( scene, hex, intensity, distance ) { var geometry = new THREE.SphereGeometry( 6, 6, 6 ), material = new THREE.MeshBasicMaterial( { color: 0xfff1a6, wireframe: true }),...
JavaScript
/** * @autor itooamaneatguy http://kadrmasconcepts.com/blog/ * @author mr.doob / http://mrdoob.com/ */ THREEFAB.SpotLightContainer = function ( scene, hex, intensity, distance ) { var geometry = new THREE.CylinderGeometry( 0, 12.5, 25, 16, 1 ), material = new THREE.MeshBasicMaterial( { color: 0xfff1a6, wirefra...
JavaScript
/** * @author Eberhard Graether / http://egraether.com/ * @itooamaneatguy http://kadrmasconcepts.com/blog/ */ THREE.ViewportControls = function ( object, domElement ) { var _this = this, STATE = { NONE : -1, ROTATE : 0, ZOOM : 1, PAN : 2 }; this.object = object; this.domElement = ( domElement !== undefined ) ...
JavaScript
/** * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @author mr.doob / http://mrdoob.com/ */ THREE.ManipulatorTool = function () { THREE.Object3D.call( this ); // Init this.selected = {}; // setup geometery var lineGeometry = new THREE.Geometry(); lineGeometry.vertices.push( new THREE.Vert...
JavaScript
/** * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @author mr.doob / http://mrdoob.com/ */ THREE.Grid = function () { THREE.Object3D.call( this ); /*var geometry = new THREE.Geometry(); geometry.vertices.push( new THREE.Vertex( new THREE.Vector3( - 500, 0, 0 ) ) ); geometry.vertices.push( new ...
JavaScript
/** * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @author mr.doob / http://mrdoob.com/ */ THREEFAB.CanvasTexture = function () { THREE.Texture.call( this ); var canvas = document.createElement( 'canvas' ); canvas.width = 512; canvas.height = 512; var ctx = canvas.getContext("2d"); ct...
JavaScript
/** * @author mikael emtinger / http://gomo.se/ */ THREEFAB.AnimationMorphTarget = function( root, scale ) { this.root = root; this.currentTime = 0; this.timeScale = scale !== undefined ? scale : 1000; this.isPlaying = false; this.isPaused = true; this.loop = true; this.influence = 1; this.keyframes = 0;...
JavaScript
/** * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @author mr.doob / http://mrdoob.com/ */ THREEFAB.DragDropLoader = function() { window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder; window.URL = window.URL || window.webkitURL || window.mozURL; // Need ...
JavaScript
/** * @class THREEFAB.ExporterUtil * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Sets up exporter for threefab. * */ THREEFAB.Exporter = function() { var code_container = $('.code-container'); this.generate = function(viewport) { var html = THREEFAB.Exporter.Utils.priva...
JavaScript
/** * @class THREEFAB.Ui * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Sets up ui components for threefab. Dependency on dat.gui. * @param [THREEFAB.Viewport] viewport The instance of the viewport class. * */ THREEFAB.Ui = function(viewport) { var _viewport = viewport, mate...
JavaScript
/* ============================================================================= Author: Jason Kadrmas Company: KadrmasConceps LLC ========================================================================== */ var THREEFAB = THREEFAB || {};
JavaScript
THREEFAB.Toolbox = Backbone.View.extend({ initialize:function() { $('.toolbox-list').bind('click', function(event) { event.preventDefault(); var target = event.target || event.srcElement, className; if(target.tagName.toLowerCase() === "a") { className = target.className; $.publish(t...
JavaScript
/** * @class THREEFAB.TextureView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup texture view. * */ THREEFAB.TextureView = Backbone.View.extend({ el: document.createElement('li'), texture: document.createElement('img'), label: document.createElement('span'), initialize...
JavaScript
/** * * @class THREEFAB.MaterialView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup for material view. * */ THREEFAB.MaterialView = Backbone.View.extend({ el: '#gui-materials-container', gui: {}, selected: {}, texture: {}, color: {}, light: {}, folders: { materi...
JavaScript
/** * @class THREEFAB.OutlinerView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup outliner view. * */ THREEFAB.OutlinerView = Backbone.View.extend({ el: document.createElement('li'), select: document.createElement('select'), initialize: function() { _.bindAll(this); ...
JavaScript
/** * @class THREEFAB.TimelineView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup timeline view. * */ THREEFAB.TimelineView = Backbone.View.extend({ el: '#bottom-toolbar', duration: '#duration', container: '.timeline-container', canvas: document.createElement("canvas"...
JavaScript
/** * @class THREEFAB.TransformView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup transform view. * */ THREEFAB.TransformView = Backbone.View.extend({ el: '#gui-transform-container', gui: {}, outliner: {}, viewport: {}, viewportView: {}, selected: {}, folders: { ...
JavaScript
/** * @class THREEFAB.OutlinerView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup outliner view. * */ THREEFAB.ViewportView = Backbone.View.extend({ el: document.createElement('li'), initialize: function() { _.bindAll(this); this.el = $(this.el); this.el.append...
JavaScript
/** * @class THREEFAB.ColorView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup color view. * */ THREEFAB.ColorView = Backbone.View.extend({ el: document.createElement('li'), types: { color: {}, ambient: {}, specular: {} }, initialize: function() { _.bindAll(...
JavaScript
/** * @class THREEFAB.MaterialModel * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Sets up material model for the right hand material panel. * */ THREEFAB.MaterialModel = Backbone.Model.extend({ materialList: [ { prop:'wireframe' }, { prop:'transparent' }, { pro...
JavaScript
/** * @class THREEFAB.LightView * * @author itooamaneatguy / http://kadrmasconcepts.com/blog/ * @description Setup color view. * */ THREEFAB.LightView = Backbone.View.extend({ el: document.createElement('li'), types: { color: {} }, initialize: function() { _.bindAll(this); this.el = $(this.el...
JavaScript
/* ============================================================================= Name: Viewport Description: Sets up basic three.js viewport. Author: Jason Kadrmas Company: KadrmasConceps LLC ========================================================================== */ THREEFAB.Viewport = function( parameters ) ...
JavaScript
/* ============================================================================= Author: Jason Kadrmas Company: KadrmasConceps LLC ========================================================================== */ (function(){ // Ready $(document).ready(function(){ var dragDrop = new THREEFAB.DragDropLoader...
JavaScript
//////////////////////////////////////////////////////////////////////////////// // // ADOBE SYSTEMS INCORPORATED // Copyright 2006-2007 Adobe Systems Incorporated // All Rights Reserved. // // NOTICE: Adobe permits you to use, modify, and distribute this file // in accordance with the terms of the license ...
JavaScript
//////////////////////////////////////////////////////////////////////////////// // // ADOBE SYSTEMS INCORPORATED // Copyright 2006-2007 Adobe Systems Incorporated // All Rights Reserved. // // NOTICE: Adobe permits you to use, modify, and distribute this file // in accordance with the terms of the license ...
JavaScript
/** * BEGIN FIRST TIME */ // First Time Visit Processing // copyright 10th January 2006, Stephen Chapman // permission to use this Javascript on your web page is granted // provided that all of the below code in this script (including this // comment) is used without any alteration function rC(nam) {var tC = do...
JavaScript
document.write('<script type="text/javascript" src="javascript/jquery.js"></script>'); var srt = getCookie('path'); if((srt != false) && (!getCookie('gform'))&& (srt.length >5)){ document.cookie = 'gform=' + true; AlertIt(); } function AlertIt() { var answer = confirm ("Olá,\nAjude-nos a conhecê-lo mel...
JavaScript
/* * Project: Agitated User behavior data miner * Description: Help you track where your users becomes agitated in your web application * Author: Cedric Dugas, http://www.position-relative.net * License: MIT */ ;(function ( $, window, document, undefined ) { var pluginName = "behaviorMiner", defau...
JavaScript
var findPosts; (function($){ findPosts = { open : function(af_name, af_val) { var st = document.documentElement.scrollTop || $(document).scrollTop(), overlay = $( '.ui-find-overlay' ); if ( overlay.length == 0 ) { $( 'body' ).append( '<div class="ui-find-overlay"></div>' ); findPosts.overlay(); ...
JavaScript
( function( $, undef ){ // html stuff var _before = '<a tabindex="0" class="wp-color-result" />', _after = '<div class="wp-picker-holder" />', _wrap = '<div class="wp-picker-container" />', _button = '<input type="button" class="button button-small hidden" />'; // jQuery UI Widget constructor var ColorPicke...
JavaScript
var showNotice, adminMenu, columns, validateForm, screenMeta; (function($){ // Removed in 3.3. // (perhaps) needed for back-compat adminMenu = { init : function() {}, fold : function() {}, restoreMenuState : function() {}, toggle : function() {}, favorites : function() {} }; // show/hide/save table columns column...
JavaScript
var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad; jQuery(document).ready( function($) { /* Dashboard Welcome Panel */ var welcomePanel = $('#welcome-panel'), welcomePanelHide = $('#wp_welcome_panel-hide'), updateWelcomePanel = function( visible ) { $.post( ajaxurl, { action: 'update-welcome-panel', ...
JavaScript
( function( $ ){ $( document ).ready( function () { // Expand/Collapse on click $( '.accordion-container' ).on( 'click keydown', '.accordion-section-title', function( e ) { if ( e.type === 'keydown' && 13 !== e.which ) // "return" key return; e.preventDefault(); // Keep this AFTER the key filter above...
JavaScript
/** * WordPress Administration Navigation Menu * Interface JS functions * * @version 2.0.0 * * @package WordPress * @subpackage Administration */ var wpNavMenu; (function($) { var api = wpNavMenu = { options : { menuItemDepthPerLevel : 30, // Do not use directly. Use depthToPx and pxToDepth instead. ...
JavaScript
(function($) { var frame; $( function() { // Fetch available headers and apply jQuery.masonry // once the images have loaded. var $headers = $('.available-headers'); $headers.imagesLoaded( function() { $headers.masonry({ itemSelector: '.default-header', isRTL: !! ( 'undefined' != typeof isRtl && ...
JavaScript
var tagBox, commentsBox, editPermalink, makeSlugeditClickable, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint; // return an array with any duplicate, whitespace or values removed function array_unique_noempty(a) { var out = []; jQuery.each( a, function(key, val) { val = jQuery.trim(val); if...
JavaScript
/** * PubSub * * A lightweight publish/subscribe implementation. * Private use only! */ var PubSub, fullscreen, wptitlehint; PubSub = function() { this.topics = {}; }; PubSub.prototype.subscribe = function( topic, callback ) { if ( ! this.topics[ topic ] ) this.topics[ topic ] = []; this.topics[ topic ].pu...
JavaScript
var thickDims, tbWidth, tbHeight; jQuery(document).ready(function($) { thickDims = function() { var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h; w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 90; h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 60; if ( tbWindow.s...
JavaScript
/*! * Farbtastic: jQuery color picker plug-in v1.3u * * Licensed under the GPL license: * http://www.gnu.org/licenses/gpl.html */ (function($) { $.fn.farbtastic = function (options) { $.farbtastic(this, options); return this; }; $.farbtastic = function (container, callback) { var container = $(container)...
JavaScript
jQuery(document).ready( function($) { postboxes.add_postbox_toggles('comment'); var stamp = $('#timestamp').html(); $('.edit-timestamp').click(function () { if ($('#timestampdiv').is(":hidden")) { $('#timestampdiv').slideDown("normal"); $('.edit-timestamp').hide(); } return false; }); $('.cancel-tim...
JavaScript
function WPSetAsThumbnail(id, nonce){ var $link = jQuery('a#wp-post-thumbnail-' + id); $link.text( setPostThumbnailL10n.saving ); jQuery.post(ajaxurl, { action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie) }, function(str){ var win = w...
JavaScript
// Password strength meter function passwordStrength(password1, username, password2) { var shortPass = 1, badPass = 2, goodPass = 3, strongPass = 4, mismatch = 5, symbolSize = 0, natLog, score; // password 1 != password 2 if ( (password1 != password2) && password2.length > 0) return mismatch //password < 4 if ...
JavaScript
window.wp = window.wp || {}; (function($) { var revisions; revisions = wp.revisions = { model: {}, view: {}, controller: {} }; // Link settings. revisions.settings = _.isUndefined( _wpRevisionsSettings ) ? {} : _wpRevisionsSettings; // For debugging revisions.debug = false; revisions.log = function() { if...
JavaScript
var imageEdit; (function($) { imageEdit = { iasapi : {}, hold : {}, postid : '', intval : function(f) { return f | 0; }, setDisabled : function(el, s) { if ( s ) { el.removeClass('disabled'); $('input', el).removeAttr('disabled'); } else { el.addClass('disabled'); $('input', el).prop('disable...
JavaScript
(function($) { var id = 'undefined' !== typeof current_site_id ? '&site_id=' + current_site_id : ''; $(document).ready( function() { $( '.wp-suggest-user' ).autocomplete({ source: ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id, delay: 500, minLength: 2, position: ( 'undefined' ...
JavaScript
var wpWidgets; (function($) { wpWidgets = { init : function() { var rem, sidebars = $('div.widgets-sortables'), isRTL = !! ( 'undefined' != typeof isRtl && isRtl ), margin = ( isRtl ? 'marginRight' : 'marginLeft' ), the_id; $('#widgets-right').children('.widgets-holder-wrap').children('.sidebar-name').click(...
JavaScript
(function( exports, $ ){ var api = wp.customize; /* * @param options * - previewer - The Previewer instance to sync with. * - transport - The transport to use for previewing. Supports 'refresh' and 'postMessage'. */ api.Setting = api.Value.extend({ initialize: function( id, value, options ) { var eleme...
JavaScript
// send html to the post editor var wpActiveEditor; function send_to_editor(h) { var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined'; if ( !wpActiveEditor ) { if ( mce && tinymce.activeEditor ) { ed = tinymce.activeEditor; wpActiveEditor = ed.id; } else if ( !qt ) { return ...
JavaScript
(function($,undefined) { wpWordCount = { settings : { strip : /<[a-zA-Z\/][^<>]*>/g, // strip HTML tags clean : /[0-9.(),;:!?%#$¿'"_+=\\/-]+/g, // regexp to remove punctuation, etc. w : /\S\s+/g, // word-counting regexp c : /\S/g // char-counting regexp for asian languages }, block : 0, wc : fun...
JavaScript
jQuery(document).ready( function($) { $('#link_rel').prop('readonly', true); $('#linkxfndiv input').bind('click keyup', function() { var isMe = $('#me').is(':checked'), inputs = ''; $('input.valinp').each( function() { if (isMe) { $(this).prop('disabled', true).parent().addClass('disabled'); } else { ...
JavaScript
(function($) { $(document).ready(function() { var bgImage = $("#custom-background-image"), frame; $('#background-color').wpColorPicker({ change: function( event, ui ) { bgImage.css('background-color', ui.color.toString()); }, clear: function() { bgImage.css('background-color', ''); } }); ...
JavaScript
(function($) { inlineEditTax = { init : function() { var t = this, row = $('#inline-edit'); t.type = $('#the-list').attr('data-wp-lists').substr(5); t.what = '#'+t.type+'-'; $('#the-list').on('click', 'a.editinline', function(){ inlineEditTax.edit(this); return false; }); // prepare the edit row...
JavaScript
jQuery(document).ready(function($) { $('#the-list').on('click', '.delete-tag', function(e){ var t = $(this), tr = t.parents('tr'), r = true, data; if ( 'undefined' != showNotice ) r = showNotice.warn(); if ( r ) { data = t.attr('href').replace(/[^?]*\?/, '').replace(/action=delete/, 'action=delete-tag'); ...
JavaScript
var switchEditors = { switchto: function(el) { var aid = el.id, l = aid.length, id = aid.substr(0, l - 5), mode = aid.substr(l - 4); this.go(id, mode); }, go: function(id, mode) { // mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the "Text" editor tab. id = id || 'content'; mode = mode || 't...
JavaScript
jQuery(document).ready(function($) { var gallerySortable, gallerySortableInit, w, desc = false; gallerySortableInit = function() { gallerySortable = $('#media-items').sortable( { items: 'div.media-item', placeholder: 'sorthelper', axis: 'y', distance: 2, handle: 'div.filename', stop: function(e, ...
JavaScript
jQuery(function($){ $( 'body' ).bind( 'click.wp-gallery', function(e){ var target = $( e.target ), id, img_size; if ( target.hasClass( 'wp-set-header' ) ) { ( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' ); e.preventDefault(); } else if ( target.hasClass( 'wp...
JavaScript
/* Plugin Browser Thickbox related JS*/ var tb_position; jQuery(document).ready(function($) { tb_position = function() { var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0; if ( $('body.admin-bar').length ) adminbar_height =...
JavaScript
var postboxes; (function($) { postboxes = { add_postbox_toggles : function(page, args) { var self = this; self.init(page, args); $('.postbox h3, .postbox .handlediv').bind('click.postboxes', function() { var p = $(this).parent('.postbox'), id = p.attr('id'); if ( 'dashboard_browser_nag' == id ) ...
JavaScript
(function($) { inlineEditPost = { init : function(){ var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit'); t.type = $('table.widefat').hasClass('pages') ? 'page' : 'post'; t.what = '#post-'; // prepare the edit rows qeRow.keyup(function(e){ if (e.which == 27) return inlineEditPost.rev...
JavaScript
/** * Theme Browsing * * Controls visibility of theme details on manage and install themes pages. */ jQuery( function($) { $('#availablethemes').on( 'click', '.theme-detail', function (event) { var theme = $(this).closest('.available-theme'), details = theme.find('.themedetaildiv'); if ( ! details.length...
JavaScript
(function($){ function check_pass_strength() { var pass1 = $('#pass1').val(), user = $('#user_login').val(), pass2 = $('#pass2').val(), strength; $('#pass-strength-result').removeClass('short bad good strong'); if ( ! pass1 ) { $('#pass-strength-result').html( pwsL10n.empty ); return; } strength = p...
JavaScript
jQuery(document).ready( function($) { var newCat, noSyncChecks = false, syncChecks, catAddAfter; $('#link_name').focus(); // postboxes postboxes.add_postbox_toggles('link'); // category tabs $('#category-tabs a').click(function(){ var t = $(this).attr('href'); $(this).parent().addClass('tabs').siblings('li...
JavaScript
var theList, theExtraList, toggleWithKeyboard = false; (function($) { var getCount, updateCount, updatePending, dashboardTotals; setCommentsList = function() { var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dimAfter, delBefore, updateTotalCount, delAfter, refillTheExtraList; totalInput = $('input[...
JavaScript
var autosave, autosaveLast = '', autosavePeriodical, autosaveDelayPreview = false, notSaved = true, blockSave = false, fullscreen, autosaveLockRelease = true; jQuery(document).ready( function($) { if ( $('#wp-content-wrap').hasClass('tmce-active') && typeof switchEditors != 'undefined' ) { autosaveLast = wp.autosa...
JavaScript
var topWin = window.dialogArguments || opener || parent || top, uploader, uploader_init; function fileDialogStart() { jQuery("#media-upload-error").empty(); } // progress and success handlers for media multi uploads function fileQueued(fileObj) { // Get rid of unused form jQuery('.media-blank').remove(); var ite...
JavaScript
window.wp = window.wp || {}; (function( exports, $ ) { var Uploader; if ( typeof _wpPluploadSettings === 'undefined' ) return; /* * An object that helps create a WordPress uploader using plupload. * * @param options - object - The options passed to the new plupload instance. * Accepts the following p...
JavaScript