Initial commit

This commit is contained in:
IllusionMan1212
2018-09-30 06:17:31 +02:00
commit 96ce7c0dce
75 changed files with 10420 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
require_once( 'config.php' );
$dir = WM_Config::$fileRoot . str_replace( '..', '', $_GET['dir'] );
if( $dir{strlen($dir)-1} != '/' ) {
$dir .= '/';
}
$find = '*.*';
switch( $_GET['type'] ) {
case 'images':
$find = '*.{png,gif,jpg,jpeg}';
break;
case 'scripts':
$find = '*.js';
break;
}
$dirs = glob( $dir.'*', GLOB_ONLYDIR );
if( $dirs === false ) { $dirs = array(); };
$files = glob( $dir.$find, GLOB_BRACE );
if( $files === false ) { $files = array(); }
$fileRootLength = strlen( WM_Config::$fileRoot );
foreach( $files as $i => $f ) {
$files[$i] = substr( $f, $fileRootLength );
}
foreach( $dirs as $i => $d ) {
$dirs[$i] = substr( $d, $fileRootLength );
}
$parent = substr($_GET['dir'], 0, strrpos($_GET['dir'], '/'));
echo json_encode( array(
'parent' => (empty($_GET['dir']) ? false : $parent),
'dirs' => $dirs,
'files' => $files
));
?>
+22
View File
@@ -0,0 +1,22 @@
<?php
class WM_Config {
public static $fileRoot = '../../../';
}
function stripslashes_deep($value)
{
$value = is_array($value) ?
array_map( 'stripslashes_deep', $value ) :
stripslashes($value);
return $value;
}
// revert magic quotes
if( function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ) {
$_GET = array_map( 'stripslashes_deep', $_GET );
$_POST = array_map( 'stripslashes_deep', $_POST );
}
?>
+21
View File
@@ -0,0 +1,21 @@
<?php
require_once( 'config.php' );
$globs = is_array($_GET['glob']) ? $_GET['glob'] : array($_GET['glob']);
$files = array();
foreach( $globs as $glob ) {
$pattern = WM_Config::$fileRoot . str_replace( '..', '', $glob );
$currentFiles = glob( $pattern );
if( $currentFiles !== false ) {
$files = array_merge( $files, $currentFiles );
}
}
$fileRootLength = strlen( WM_Config::$fileRoot );
foreach( $files as $i => $f ) {
$files[$i] = substr( $f, $fileRootLength );
}
echo json_encode( $files );
?>
+34
View File
@@ -0,0 +1,34 @@
<?php
require_once( 'config.php' );
$result = array('error' => 0);
if( !empty($_POST['path']) && !empty($_POST['data']) ) {
$path = WM_Config::$fileRoot . str_replace( '..', '', $_POST['path'] );
if( preg_match('/\.js$/', $path) ) {
$success = @file_put_contents( $path, $_POST['data'] );
if( $success === false ) {
$result = array(
'error' => '2',
'msg' => "Couldn't write to file: $path"
);
}
}
else {
$result = array(
'error' => '3',
'msg' => "File must have a .js suffix"
);
}
}
else {
$result = array(
'error' => '1',
'msg' => "No Data or Path specified"
);
}
echo json_encode($result);
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

+127
View File
@@ -0,0 +1,127 @@
ig.module(
'weltmeister.config'
)
.defines(function(){ "use strict";
wm.config = {
project: {
// The prefix path of your game's source code. You only have to change
// this if you use the 'ImpactPrefix' in your dev environment.
'modulePath': 'lib/',
// This "glob" tells Weltmeister where to load the entity files
// from. If you want to load entities from several directories,
// you can specify an array here. E.g.:
// 'entityFiles': ['lib/game/powerups/*.js', 'lib/game/entities/*.js']
'entityFiles': 'lib/game/entities/*.js',
// The default path for the level file selection box
'levelPath': 'lib/game/levels/',
// Whether to save levels as plain JSON or wrapped in a module. If
// you want to load levels asynchronously via AJAX, saving as plain
// JSON can be helpful.
'outputFormat': 'module', // 'module' or 'json'
// Whether to pretty print the JSON data in level files. If you have
// any issues with your levels, it's usually a good idea to turn this
// on and look at the saved level files with a text editor.
'prettyPrint': true
},
// Plugins for Weltmeister: an array of module names to load
plugins: [],
// Default settings when creating new layers in Weltmeister. Change these
// as you like
'layerDefaults': {
'width': 30,
'height': 20,
'tilesize': 8
},
// Whether to ask before closing Weltmeister when there are unsaved changes
'askBeforeClose': true,
// Whether to attempt to load the last opened level on startup
'loadLastLevel': true,
// Size of the "snap" grid when moving entities
'entityGrid': 4,
// Number of undo levels. You may want to increase this if you use 'undo'
// frequently.
'undoLevels': 50,
// Mouse and Key bindings in Weltmeister. Some function are bound to
// several keys. See the documentation of ig.Input for a list of available
// key names.
'binds': {
'MOUSE1': 'draw',
'MOUSE2': 'drag',
'SHIFT': 'select',
'CTRL': 'drag',
'SPACE': 'menu',
'DELETE': 'delete',
'BACKSPACE': 'delete',
'G': 'grid',
'C': 'clone',
'Z': 'undo',
'Y': 'redo',
'MWHEEL_UP': 'zoomin',
'PLUS': 'zoomin',
'MWHEEL_DOWN': 'zoomout',
'MINUS': 'zoomout'
},
// Whether to enable unidirectional scrolling for touchpads; this
// automatically unbinds the MWHEEL_UP and MWHEEL_DOWN actions.
'touchScroll': false,
// View settings. You can change the default Zoom level and whether
// to show the grid on startup here.
'view': {
'zoom': 1,
'zoomMax': 4,
'zoomMin': 0.125,
'grid': false
},
// Font face and size for entity labels and the grid coordinates
'labels': {
'draw': true,
'step': 32,
'font': '10px Bitstream Vera Sans Mono, Monaco, sans-serif'
},
// Colors to use for the background, selection boxes, text and the grid
'colors': {
'clear': '#000000', // Background Color
'highlight': '#ceff36', // Currently selected tile or entity
'primary': '#ffffff', // Labels and layer bounds
'secondary': '#555555', // Grid and tile selection bounds
'selection': '#ff9933' // Selection cursor box on tile maps
},
// Settings for the Collision tiles. You shouldn't need to change these.
// The tilesize only specifies the size in the image - resizing to final
// size for each layer happens in Weltmeister.
'collisionTiles': {
'path': 'lib/weltmeister/collisiontiles-64.png',
'tilesize': 64
},
// API paths for saving levels and browsing directories. If you use a
// different backend (i.e. not the official PHP backend), you may have
// to change these.
'api': {
'save': 'lib/weltmeister/api/save.php',
'browse': 'lib/weltmeister/api/browse.php',
'glob': 'lib/weltmeister/api/glob.php'
}
};
});
+697
View File
@@ -0,0 +1,697 @@
ig.module(
'weltmeister.edit-entities'
)
.requires(
'impact.game',
'impact.background-map',
'weltmeister.config',
'weltmeister.tile-select',
'weltmeister.entities'
)
.defines(function(){ "use strict";
wm.EditEntities = ig.Class.extend({
visible: true,
active: true,
div: null,
hotkey: -1,
ignoreLastClick: false,
name: 'entities',
entities: [],
namedEntities: {},
selectedEntity: null,
entityClasses: {},
menuDiv: null,
selector: {size:{x:2, y:2}, pos:{x:0,y:0}, offset:{x:0,y:0}},
wasSelectedOnScaleBorder: false,
gridSize: wm.config.entityGrid,
entityDefinitions: null,
init: function( div ) {
this.div = div;
div.bind( 'mouseup', this.click.bind(this) );
this.div.children('.visible').bind( 'mousedown', this.toggleVisibilityClick.bind(this) );
this.menu = $('#entityMenu');
this.importEntityClass( wm.entityModules );
this.entityDefinitions = $('#entityDefinitions');
$('#entityKey').bind( 'keydown', function(ev){
if( ev.which == 13 ){
$('#entityValue').focus();
return false;
}
return true;
});
$('#entityValue').bind( 'keydown', this.setEntitySetting.bind(this) );
},
clear: function() {
this.entities = [];
this.selectEntity( null );
},
sort: function() {
this.entities.sort( ig.Game.SORT.Z_INDEX );
},
// -------------------------------------------------------------------------
// Loading, Saving
fileNameToClassName: function( name ) {
var typeName = '-' + name.replace(/^.*\/|\.js/g,'');
typeName = typeName.replace(/-(\w)/g, function( m, a ) {
return a.toUpperCase();
});
return 'Entity' + typeName;
},
importEntityClass: function( modules ) {
var unloadedClasses = [];
for( var m in modules ) {
var className = this.fileNameToClassName(modules[m]);
var entityName = className.replace(/^Entity/, '');
// ig.global[className] should be the actual class object
if( className && ig.global[className] ) {
// Ignore entities that have the _wmIgnore flag
if( !ig.global[className].prototype._wmIgnore ) {
var a = $( '<div/>', {
'id': className,
'href': '#',
'html': entityName,
'mouseup': this.newEntityClick.bind(this)
});
this.menu.append( a );
this.entityClasses[className] = m;
}
}
else {
unloadedClasses.push( modules[m] + ' (expected name: ' + className + ')' );
}
}
if( unloadedClasses.length > 0 ) {
var warning = 'The following entity classes were not loaded due to\n'
+ 'file and class name mismatches: \n\n'
+ unloadedClasses.join( '\n' );
alert( warning );
}
},
getEntityByName: function( name ) {
return this.namedEntities[name];
},
getSaveData: function() {
var ents = [];
for( var i = 0; i < this.entities.length; i++ ) {
var ent = this.entities[i];
var type = ent._wmClassName;
var data = {type:type,x:ent.pos.x,y:ent.pos.y};
var hasSettings = false;
for( var p in ent._wmSettings ) {
hasSettings = true;
}
if( hasSettings ) {
data.settings = ent._wmSettings;
}
ents.push( data );
}
return ents;
},
// -------------------------------------------------------------------------
// Selecting
selectEntityAt: function( x, y ) {
this.selector.pos = { x: x, y: y };
// Find all possible selections
var possibleSelections = [];
for( var i = 0; i < this.entities.length; i++ ) {
if( this.entities[i].touches(this.selector) ) {
possibleSelections.push( this.entities[i] );
}
}
// Nothing found? Early out.
if( !possibleSelections.length ) {
this.selectEntity( null );
return false;
}
// Find the 'next' selection
var selectedIndex = possibleSelections.indexOf(this.selectedEntity);
var nextSelection = (selectedIndex + 1) % possibleSelections.length;
var ent = possibleSelections[nextSelection];
// Select it!
this.selector.offset = {
x: (x - ent.pos.x + ent.offset.x),
y: (y - ent.pos.y + ent.offset.y)
};
this.selectEntity( ent );
this.wasSelectedOnScaleBorder = this.isOnScaleBorder( ent, this.selector );
return ent;
},
selectEntity: function( entity ) {
if( entity && entity != this.selectedEntity ) {
this.selectedEntity = entity;
$('#entitySettings').fadeOut(100,(function(){
this.loadEntitySettings();
$('#entitySettings').fadeIn(100);
}).bind(this));
}
else if( !entity ) {
$('#entitySettings').fadeOut(100);
$('#entityKey').blur();
$('#entityValue').blur();
}
this.selectedEntity = entity;
$('#entityKey').val('');
$('#entityValue').val('');
},
// -------------------------------------------------------------------------
// Creating, Deleting, Moving
deleteSelectedEntity: function() {
if( !this.selectedEntity ) {
return false;
}
ig.game.undo.commitEntityDelete( this.selectedEntity );
this.removeEntity( this.selectedEntity );
this.selectEntity( null );
return true;
},
removeEntity: function( ent ) {
if( ent.name ) {
delete this.namedEntities[ent.name];
}
this.entities.erase( ent );
},
cloneSelectedEntity: function() {
if( !this.selectedEntity ) {
return false;
}
var className = this.selectedEntity._wmClassName;
var settings = ig.copy(this.selectedEntity._wmSettings);
if( settings.name ) {
settings.name = settings.name + '_clone';
}
var x = this.selectedEntity.pos.x + this.gridSize;
var y = this.selectedEntity.pos.y;
var newEntity = this.spawnEntity( className, x, y, settings );
newEntity._wmSettings = settings;
this.selectEntity( newEntity );
ig.game.undo.commitEntityCreate( newEntity );
return true;
},
dragOnSelectedEntity: function( x, y ) {
if( !this.selectedEntity ) {
return false;
}
// scale or move?
if( this.selectedEntity._wmScalable && this.wasSelectedOnScaleBorder ) {
this.scaleSelectedEntity( x, y );
}
else {
this.moveSelectedEntity( x, y )
}
ig.game.undo.pushEntityEdit( this.selectedEntity );
return true;
},
moveSelectedEntity: function( x, y ) {
x =
Math.round( (x - this.selector.offset.x ) / this.gridSize )
* this.gridSize + this.selectedEntity.offset.x;
y =
Math.round( (y - this.selector.offset.y ) / this.gridSize )
* this.gridSize + this.selectedEntity.offset.y;
// new position?
if( this.selectedEntity.pos.x != x || this.selectedEntity.pos.y != y ) {
$('#entityDefinitionPosX').text( x );
$('#entityDefinitionPosY').text( y );
this.selectedEntity.pos.x = x;
this.selectedEntity.pos.y = y;
}
},
scaleSelectedEntity: function( x, y ) {
var scale = this.wasSelectedOnScaleBorder;
var w = Math.round( x / this.gridSize ) * this.gridSize - this.selectedEntity.pos.x;
if( !this.selectedEntity._wmSettings.size ) {
this.selectedEntity._wmSettings.size = {};
}
if( scale == 'n' ) {
var h = this.selectedEntity.pos.y - Math.round( y / this.gridSize ) * this.gridSize;
if( this.selectedEntity.size.y + h <= this.gridSize ) {
h = (this.selectedEntity.size.y - this.gridSize) * -1;
}
this.selectedEntity.size.y += h;
this.selectedEntity.pos.y -= h;
}
else if( scale == 's' ) {
var h = Math.round( y / this.gridSize ) * this.gridSize - this.selectedEntity.pos.y;
this.selectedEntity.size.y = Math.max( this.gridSize, h );
}
else if( scale == 'e' ) {
var w = Math.round( x / this.gridSize ) * this.gridSize - this.selectedEntity.pos.x;
this.selectedEntity.size.x = Math.max( this.gridSize, w );
}
else if( scale == 'w' ) {
var w = this.selectedEntity.pos.x - Math.round( x / this.gridSize ) * this.gridSize;
if( this.selectedEntity.size.x + w <= this.gridSize ) {
w = (this.selectedEntity.size.x - this.gridSize) * -1;
}
this.selectedEntity.size.x += w;
this.selectedEntity.pos.x -= w;
}
this.selectedEntity._wmSettings.size.x = this.selectedEntity.size.x;
this.selectedEntity._wmSettings.size.y = this.selectedEntity.size.y;
this.loadEntitySettings();
},
newEntityClick: function( ev ) {
this.hideMenu();
var newEntity = this.spawnEntity( ev.target.id, 0, 0, {} );
this.selectEntity( newEntity );
this.moveSelectedEntity( this.selector.pos.x, this.selector.pos.y );
ig.editor.setModified();
ig.game.undo.commitEntityCreate( newEntity );
},
spawnEntity: function( className, x, y, settings ) {
settings = settings || {};
var entityClass = ig.global[ className ];
if( entityClass ) {
var newEntity = new (entityClass)( x, y, settings );
newEntity._wmInEditor = true;
newEntity._wmClassName = className;
newEntity._wmSettings = {};
for( var s in settings ) {
newEntity._wmSettings[s] = settings[s];
}
this.entities.push( newEntity );
if( settings.name ) {
this.namedEntities[settings.name] = newEntity;
}
this.sort();
return newEntity;
}
return null;
},
isOnScaleBorder: function( entity, selector ) {
var border = 2;
var w = selector.pos.x - entity.pos.x;
var h = selector.pos.y - entity.pos.y;
if( w < border ) return 'w';
if( w > entity.size.x - border ) return 'e';
if( h < border ) return 'n';
if( h > entity.size.y - border ) return 's';
return false;
},
// -------------------------------------------------------------------------
// Settings
loadEntitySettings: function(ent) {
if( !this.selectedEntity ) {
return;
}
var html =
'<div class="entityDefinition"><span class="key">x</span>:<span class="value" id="entityDefinitionPosX">'+this.selectedEntity.pos.x+'</span></div>'
+ '<div class="entityDefinition"><span class="key">y</span>:<span class="value" id="entityDefinitionPosY">'+this.selectedEntity.pos.y+'</span></div>';
html += this.loadEntitySettingsRecursive( this.selectedEntity._wmSettings );
this.entityDefinitions.html( html );
var className = this.selectedEntity._wmClassName.replace(/^Entity/, '');
$('#entityClass').text( className );
$('.entityDefinition').bind( 'mouseup', this.selectEntitySetting );
},
loadEntitySettingsRecursive: function( settings, path ) {
path = path || "";
var html = "";
for( var key in settings ) {
var value = settings[key];
if( typeof(value) == 'object' ) {
html += this.loadEntitySettingsRecursive( value, path + key + "." );
}
else {
html += '<div class="entityDefinition"><span class="key">'+path+key+'</span>:<span class="value">'+value+'</span></div>';
}
}
return html;
},
setEntitySetting: function( ev ) {
if( ev.which != 13 ) {
return true;
}
var key = $('#entityKey').val();
var value = $('#entityValue').val();
var floatVal = parseFloat(value);
if( value == floatVal ) {
value = floatVal;
}
if( key == 'name' ) {
if( this.selectedEntity.name ) {
delete this.namedEntities[this.selectedEntity.name];
}
this.namedEntities[ value ] = this.selectedEntity;
}
if( key == 'x' ) {
this.selectedEntity.pos.x = Math.round(value);
}
else if( key == 'y' ) {
this.selectedEntity.pos.y = Math.round(value);
}
else {
this.writeSettingAtPath( this.selectedEntity._wmSettings, key, value );
ig.merge( this.selectedEntity, this.selectedEntity._wmSettings );
}
this.sort();
ig.game.setModified();
ig.game.draw();
$('#entityKey').val('');
$('#entityValue').val('');
$('#entityValue').blur();
this.loadEntitySettings();
$('#entityKey').focus();
return false;
},
writeSettingAtPath: function( root, path, value ) {
path = path.split('.');
var cur = root;
for( var i = 0; i < path.length; i++ ) {
var n = path[i];
if( i < path.length-1 && typeof(cur[n]) != 'object' ) {
cur[n] = {};
}
if( i == path.length-1 ) {
cur[n] = value;
}
cur = cur[n];
}
this.trimObject( root );
},
trimObject: function( obj ) {
var isEmpty = true;
for( var i in obj ) {
if(
(obj[i] === "") ||
(typeof(obj[i]) == 'object' && this.trimObject(obj[i]))
) {
delete obj[i];
}
if( typeof(obj[i]) != 'undefined' ) {
isEmpty = false;
}
}
return isEmpty;
},
selectEntitySetting: function( ev ) {
$('#entityKey').val( $(this).children('.key').text() );
$('#entityValue').val( $(this).children('.value').text() );
$('#entityValue').select();
},
// -------------------------------------------------------------------------
// UI
setHotkey: function( hotkey ) {
this.hotkey = hotkey;
this.div.attr('title', 'Select Layer ('+this.hotkey+')' );
},
showMenu: function( x, y ) {
this.selector.pos = {
x: Math.round( (x + ig.editor.screen.x) / this.gridSize ) * this.gridSize,
y: Math.round( (y + ig.editor.screen.y) / this.gridSize ) * this.gridSize
};
this.menu.css({top: (y * ig.system.scale + 2), left: (x * ig.system.scale + 2) });
this.menu.show();
},
hideMenu: function( x, y ) {
ig.editor.mode = ig.editor.MODE.DEFAULT;
this.menu.hide();
},
setActive: function( active ) {
this.active = active;
if( active ) {
this.div.addClass( 'layerActive' );
} else {
this.div.removeClass( 'layerActive' );
}
},
toggleVisibility: function() {
this.visible ^= 1;
if( this.visible ) {
this.div.children('.visible').addClass('checkedVis');
} else {
this.div.children('.visible').removeClass('checkedVis');
}
ig.game.draw();
},
toggleVisibilityClick: function( ev ) {
if( !this.active ) {
this.ignoreLastClick = true;
}
this.toggleVisibility()
},
click: function() {
if( this.ignoreLastClick ) {
this.ignoreLastClick = false;
return;
}
ig.editor.setActiveLayer( 'entities' );
},
mousemove: function( x, y ) {
this.selector.pos = { x: x, y: y };
if( this.selectedEntity ) {
if( this.selectedEntity._wmScalable && this.selectedEntity.touches(this.selector) ) {
var scale = this.isOnScaleBorder( this.selectedEntity, this.selector );
if( scale == 'n' || scale == 's' ) {
$('body').css('cursor', 'n-resize');
return;
}
else if( scale == 'e' || scale == 'w' ) {
$('body').css('cursor', 'e-resize');
return;
}
}
}
$('body').css('cursor', 'default');
},
// -------------------------------------------------------------------------
// Drawing
draw: function() {
if( this.visible ) {
for( var i = 0; i < this.entities.length; i++ ) {
this.drawEntity( this.entities[i] );
}
}
},
drawEntity: function( ent ) {
// entity itself
ent.draw();
// box
if( ent._wmDrawBox ) {
ig.system.context.fillStyle = ent._wmBoxColor || 'rgba(128, 128, 128, 0.9)';
ig.system.context.fillRect(
ig.system.getDrawPos(ent.pos.x - ig.game.screen.x),
ig.system.getDrawPos(ent.pos.y - ig.game.screen.y),
ent.size.x * ig.system.scale,
ent.size.y * ig.system.scale
);
}
if( wm.config.labels.draw ) {
// description
var className = ent._wmClassName.replace(/^Entity/, '');
var description = className + (ent.name ? ': ' + ent.name : '' );
// text-shadow
ig.system.context.fillStyle = 'rgba(0,0,0,0.4)';
ig.system.context.fillText(
description,
ig.system.getDrawPos(ent.pos.x - ig.game.screen.x),
ig.system.getDrawPos(ent.pos.y - ig.game.screen.y + 0.5)
);
// text
ig.system.context.fillStyle = wm.config.colors.primary;
ig.system.context.fillText(
description,
ig.system.getDrawPos(ent.pos.x - ig.game.screen.x),
ig.system.getDrawPos(ent.pos.y - ig.game.screen.y)
);
}
// line to targets
if( typeof(ent.target) == 'object' ) {
for( var t in ent.target ) {
this.drawLineToTarget( ent, ent.target[t] );
}
}
},
drawLineToTarget: function( ent, target ) {
target = ig.game.getEntityByName( target );
if( !target ) {
return;
}
ig.system.context.strokeStyle = '#fff';
ig.system.context.lineWidth = 1;
ig.system.context.beginPath();
ig.system.context.moveTo(
ig.system.getDrawPos(ent.pos.x + ent.size.x/2 - ig.game.screen.x),
ig.system.getDrawPos(ent.pos.y + ent.size.y/2 - ig.game.screen.y)
);
ig.system.context.lineTo(
ig.system.getDrawPos(target.pos.x + target.size.x/2 - ig.game.screen.x),
ig.system.getDrawPos(target.pos.y + target.size.y/2 - ig.game.screen.y)
);
ig.system.context.stroke();
ig.system.context.closePath();
},
drawCursor: function( x, y ) {
if( this.selectedEntity ) {
ig.system.context.lineWidth = 1;
ig.system.context.strokeStyle = wm.config.colors.highlight;
ig.system.context.strokeRect(
ig.system.getDrawPos(this.selectedEntity.pos.x - ig.editor.screen.x) - 0.5,
ig.system.getDrawPos(this.selectedEntity.pos.y - ig.editor.screen.y) - 0.5,
this.selectedEntity.size.x * ig.system.scale + 1,
this.selectedEntity.size.y * ig.system.scale + 1
);
}
}
});
});
+388
View File
@@ -0,0 +1,388 @@
ig.module(
'weltmeister.edit-map'
)
.requires(
'impact.background-map',
'weltmeister.tile-select'
)
.defines(function(){ "use strict";
wm.EditMap = ig.BackgroundMap.extend({
name: '',
visible: true,
active: true,
linkWithCollision: false,
div: null,
brush: [[0]],
oldData: null,
hotkey: -1,
ignoreLastClick: false,
tileSelect: null,
isSelecting: false,
selectionBegin: null,
init: function( name, tilesize, tileset, foreground ) {
this.name = name;
this.parent( tilesize, [[0]], tileset || '' );
this.foreground = foreground;
this.div = $( '<div/>', {
'class': 'layer layerActive',
'id': ('layer_' + name),
'mouseup': this.click.bind(this)
});
this.setName( name );
if( this.foreground ) {
$('#layers').prepend( this.div );
}
else {
$('#layerEntities').after( this.div );
}
this.tileSelect = new wm.TileSelect( this );
},
getSaveData: function() {
return {
name: this.name,
width: this.width,
height: this.height,
linkWithCollision: this.linkWithCollision,
visible: this.visible,
tilesetName: this.tilesetName,
repeat: this.repeat,
preRender: this.preRender,
distance: this.distance,
tilesize: this.tilesize,
foreground: this.foreground,
data: this.data
};
},
resize: function( newWidth, newHeight ) {
var newData = new Array( newHeight );
for( var y = 0; y < newHeight; y++ ) {
newData[y] = new Array( newWidth );
for( var x = 0; x < newWidth; x++ ) {
newData[y][x] = (x < this.width && y < this.height) ? this.data[y][x] : 0;
}
}
this.data = newData;
this.width = newWidth;
this.height = newHeight;
this.resetDiv();
},
beginEditing: function() {
this.oldData = ig.copy(this.data);
},
getOldTile: function( x, y ) {
var tx = Math.floor( x / this.tilesize );
var ty = Math.floor( y / this.tilesize );
if(
(tx >= 0 && tx < this.width) &&
(ty >= 0 && ty < this.height)
) {
return this.oldData[ty][tx];
}
else {
return 0;
}
},
setTileset: function( tileset ) {
if( this.name == 'collision' ) {
this.setCollisionTileset();
}
else {
this.parent( tileset );
}
},
setCollisionTileset: function() {
var path = wm.config.collisionTiles.path;
var scale = this.tilesize / wm.config.collisionTiles.tilesize;
this.tiles = new ig.AutoResizedImage( path, scale );
},
// -------------------------------------------------------------------------
// UI
setHotkey: function( hotkey ) {
this.hotkey = hotkey;
this.setName( this.name );
},
setName: function( name ) {
this.name = name.replace(/[^0-9a-zA-Z]/g, '_');
this.resetDiv();
},
resetDiv: function() {
var visClass = this.visible ? ' checkedVis' : '';
this.div.html(
'<span class="visible'+visClass+'" title="Toggle Visibility (Shift+'+this.hotkey+')"></span>' +
'<span class="name">' + this.name + '</span>' +
'<span class="size"> (' + this.width + 'x' + this.height + ')</span>'
);
this.div.attr('title', 'Select Layer ('+this.hotkey+')' );
this.div.children('.visible').bind('mousedown', this.toggleVisibilityClick.bind(this) );
},
setActive: function( active ) {
this.active = active;
if( active ) {
this.div.addClass( 'layerActive' );
} else {
this.div.removeClass( 'layerActive' );
}
},
toggleVisibility: function() {
this.visible ^= 1;
this.resetDiv();
if( this.visible ) {
this.div.children('.visible').addClass('checkedVis');
} else {
this.div.children('.visible').removeClass('checkedVis');
}
ig.game.draw();
},
toggleVisibilityClick: function( event ) {
if( !this.active ) {
this.ignoreLastClick = true;
}
this.toggleVisibility()
},
click: function() {
if( this.ignoreLastClick ) {
this.ignoreLastClick = false;
return;
}
ig.editor.setActiveLayer( this.name );
},
destroy: function() {
this.div.remove();
},
// -------------------------------------------------------------------------
// Selecting
beginSelecting: function( x, y ) {
this.isSelecting = true;
this.selectionBegin = {x:x, y:y};
},
endSelecting: function( x, y ) {
var r = this.getSelectionRect( x, y);
var brush = [];
for( var ty = r.y; ty < r.y+r.h; ty++ ) {
var row = [];
for( var tx = r.x; tx < r.x+r.w; tx++ ) {
if( tx < 0 || ty < 0 || tx >= this.width || ty >= this.height ) {
row.push( 0 );
}
else {
row.push( this.data[ty][tx] );
}
}
brush.push( row );
}
this.isSelecting = false;
this.selectionBegin = null;
return brush;
},
getSelectionRect: function( x, y ) {
var sx = this.selectionBegin ? this.selectionBegin.x : x,
sy = this.selectionBegin ? this.selectionBegin.y : y;
var
txb = Math.floor( (sx + this.scroll.x) / this.tilesize ),
tyb = Math.floor( (sy + this.scroll.y) / this.tilesize ),
txe = Math.floor( (x + this.scroll.x) / this.tilesize ),
tye = Math.floor( (y + this.scroll.y) / this.tilesize );
return {
x: Math.min( txb, txe ),
y: Math.min( tyb, tye ),
w: Math.abs( txb - txe) + 1,
h: Math.abs( tyb - tye) + 1
}
},
// -------------------------------------------------------------------------
// Drawing
draw: function() {
// For performance reasons, repeated background maps are not drawn
// when zoomed out
if( this.visible && !(wm.config.view.zoom < 1 && this.repeat) ) {
this.drawTiled();
}
// Grid
if( this.active && wm.config.view.grid ) {
var x = -ig.system.getDrawPos(this.scroll.x % this.tilesize) - 0.5;
var y = -ig.system.getDrawPos(this.scroll.y % this.tilesize) - 0.5;
var step = this.tilesize * ig.system.scale;
ig.system.context.beginPath();
for( x; x < ig.system.realWidth; x += step ) {
ig.system.context.moveTo( x, 0 );
ig.system.context.lineTo( x, ig.system.realHeight );
}
for( y; y < ig.system.realHeight; y += step ) {
ig.system.context.moveTo( 0, y );
ig.system.context.lineTo( ig.system.realWidth, y );
}
ig.system.context.strokeStyle = wm.config.colors.secondary;
ig.system.context.stroke();
ig.system.context.closePath();
// Not calling beginPath() again has some weird performance issues
// in Firefox 5. closePath has no effect. So to make it happy:
ig.system.context.beginPath();
}
// Bounds
if( this.active ) {
ig.system.context.lineWidth = 1;
ig.system.context.strokeStyle = wm.config.colors.primary;
ig.system.context.strokeRect(
-ig.system.getDrawPos(this.scroll.x) - 0.5,
-ig.system.getDrawPos(this.scroll.y) - 0.5,
this.width * this.tilesize * ig.system.scale + 1,
this.height * this.tilesize * ig.system.scale + 1
);
}
},
getCursorOffset: function() {
var w = this.brush[0].length;
var h = this.brush.length;
//return {x:0, y:0};
return {
x: (w/2-0.5).toInt() * this.tilesize,
y: (h/2-0.5).toInt() * this.tilesize
}
},
drawCursor: function( x, y ) {
if( this.isSelecting ) {
var r = this.getSelectionRect( x, y);
ig.system.context.lineWidth = 1;
ig.system.context.strokeStyle = wm.config.colors.selection;
ig.system.context.strokeRect(
(r.x * this.tilesize - this.scroll.x) * ig.system.scale - 0.5,
(r.y * this.tilesize - this.scroll.y) * ig.system.scale - 0.5,
r.w * this.tilesize * ig.system.scale + 1,
r.h * this.tilesize * ig.system.scale + 1
);
}
else {
var w = this.brush[0].length;
var h = this.brush.length;
var co = this.getCursorOffset();
var cx = Math.floor( (x+this.scroll.x) / this.tilesize ) * this.tilesize - this.scroll.x - co.x;
var cy = Math.floor( (y+this.scroll.y) / this.tilesize ) * this.tilesize - this.scroll.y - co.y;
ig.system.context.lineWidth = 1;
ig.system.context.strokeStyle = wm.config.colors.primary;
ig.system.context.strokeRect(
ig.system.getDrawPos(cx)-0.5,
ig.system.getDrawPos(cy)-0.5,
w * this.tilesize * ig.system.scale + 1,
h * this.tilesize * ig.system.scale + 1
);
ig.system.context.globalAlpha = 0.5;
for( var ty = 0; ty < h; ty++ ) {
for( var tx = 0; tx < w; tx++ ) {
var t = this.brush[ty][tx];
if( t ) {
var px = cx + tx * this.tilesize;
var py = cy + ty * this.tilesize;
this.tiles.drawTile( px, py, t-1, this.tilesize );
}
}
}
ig.system.context.globalAlpha = 1;
}
}
});
ig.AutoResizedImage = ig.Image.extend({
internalScale: 1,
staticInstantiate: function() {
return null; // Never cache!
},
init: function( path, internalScale ) {
this.internalScale = internalScale;
this.parent( path );
},
onload: function( event ) {
this.width = Math.ceil(this.data.width * this.internalScale);
this.height = Math.ceil(this.data.height * this.internalScale);
if( this.internalScale != 1 ) {
var scaled = ig.$new('canvas');
scaled.width = this.width;
scaled.height = this.height;
var scaledCtx = scaled.getContext('2d');
scaledCtx.drawImage( this.data, 0, 0, this.data.width, this.data.height, 0, 0, this.width , this.height );
this.data = scaled;
}
this.loaded = true;
if( ig.system.scale != 1 ) {
this.resize( ig.system.scale );
}
if( this.loadCallback ) {
this.loadCallback( this.path, true );
}
}
});
});
+58
View File
@@ -0,0 +1,58 @@
ig.module(
'weltmeister.entityLoader'
)
.requires(
'weltmeister.config'
)
.defines(function(){ "use strict";
// Load the list of entity files via AJAX PHP glob
var path = wm.config.api.glob + '?',
globs = typeof wm.config.project.entityFiles == 'string' ?
[wm.config.project.entityFiles] :
wm.config.project.entityFiles;
for (var i = 0; i < globs.length; i++) {
path += 'glob[]=' + encodeURIComponent(globs[i]) + '&';
}
path += 'nocache=' + Math.random();
var req = $.ajax({
url: path,
method: 'get',
dataType: 'json',
// MUST load synchronous, as the engine would otherwise determine that it
// can't resolve dependencies to weltmeister.entities when there are
// no more files to load and weltmeister.entities is still not defined
// because the ajax request hasn't finished yet.
// FIXME FFS!
async: false,
success: function(files) {
// File names to Module names
var moduleNames = [];
var modules = {};
for( var i = 0; i < files.length; i++ ) {
var name = files[i]
.replace(new RegExp("^"+ig.lib+"|\\.js$", "g"), '')
.replace(/\//g, '.');
moduleNames.push( name );
modules[name] = files[i];
}
// Define a Module that requires all entity Modules
ig.module('weltmeister.entities')
.requires.apply(ig, moduleNames)
.defines(function(){ wm.entityModules = modules; });
},
error: function( xhr, status, error ){
throw(
"Failed to load entity list via glob.php: " + error + "\n" +
xhr.responseText
);
}
});
});
+79
View File
@@ -0,0 +1,79 @@
ig.module(
'weltmeister.evented-input'
)
.requires(
'impact.input'
)
.defines(function(){ "use strict";
wm.EventedInput = ig.Input.extend({
mousemoveCallback: null,
keyupCallback: null,
keydownCallback: null,
delayedKeyup: {push:function(){},length: 0},
keydown: function( event ) {
var tag = event.target.tagName;
if( tag == 'INPUT' || tag == 'TEXTAREA' ) { return; }
var code = event.type == 'keydown'
? event.keyCode
: (event.button == 2 ? ig.KEY.MOUSE2 : ig.KEY.MOUSE1);
var action = this.bindings[code];
if( action ) {
if( !this.actions[action] ) {
this.actions[action] = true;
if( this.keydownCallback ) {
this.keydownCallback( action );
}
}
event.stopPropagation();
event.preventDefault();
}
},
keyup: function( event ) {
var tag = event.target.tagName;
if( tag == 'INPUT' || tag == 'TEXTAREA' ) { return; }
var code = event.type == 'keyup'
? event.keyCode
: (event.button == 2 ? ig.KEY.MOUSE2 : ig.KEY.MOUSE1);
var action = this.bindings[code];
if( action ) {
this.actions[action] = false;
if( this.keyupCallback ) {
this.keyupCallback( action );
}
event.stopPropagation();
event.preventDefault();
}
},
mousewheel: function( event ) {
var delta = event.wheelDelta ? event.wheelDelta : (event.detail * -1);
var code = delta > 0 ? ig.KEY.MWHEEL_UP : ig.KEY.MWHEEL_DOWN;
var action = this.bindings[code];
if( action ) {
if( this.keyupCallback ) {
this.keyupCallback( action );
}
event.stopPropagation();
event.preventDefault();
}
},
mousemove: function( event ) {
this.parent( event );
if( this.mousemoveCallback ) {
this.mousemoveCallback();
}
}
});
});
File diff suppressed because one or more lines are too long
+107
View File
@@ -0,0 +1,107 @@
/*!
* jQuery UI 1.8.1
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
*/
jQuery.ui||function(c){c.ui={version:"1.8.1",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")=="hidden")return false;
b=b&&b=="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,
PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||
/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==
undefined)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&&
!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}(jQuery);
;/*!
* jQuery UI Widget 1.8.1
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Widget
*/
(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype=
b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g=
b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();
this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f,
h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=
b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*!
* jQuery UI Mouse 1.8.1
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Mouse
*
* Depends:
* jquery.ui.widget.js
*/
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&
this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();
return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&
this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-
a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
* jQuery UI Sortable 1.8.1
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Sortables
*
* Depends:
* jquery.ui.core.js
* jquery.ui.mouse.js
* jquery.ui.widget.js
*/
(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");
this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(self,
arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=
c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,
{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();
if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",
a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");
if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+
this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+
b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+
"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,
c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==
document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",
null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):
d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},
_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/
2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=
d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=
this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?
h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),
b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?
i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,
c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=
this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-
parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],
this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=
1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",
a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==
this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width==""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;
if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=
d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-
this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+
this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;
if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-
this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+
(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&
this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||
this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",
g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",
this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=
0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.1"})})(jQuery);
;
+108
View File
@@ -0,0 +1,108 @@
ig.module(
'weltmeister.modal-dialogs'
)
.requires(
'weltmeister.select-file-dropdown'
)
.defines(function(){ "use strict";
wm.ModalDialog = ig.Class.extend({
onOk: null,
onCancel: null,
text: '',
okText: '',
cancelText: '',
background: null,
dialogBox: null,
buttonDiv: null,
init: function( text, okText, cancelText ) {
this.text = text;
this.okText = okText || 'OK';
this.cancelText = cancelText || 'Cancel';
this.background = $('<div/>', {'class':'modalDialogBackground'});
this.dialogBox = $('<div/>', {'class':'modalDialogBox'});
this.background.append( this.dialogBox );
$('body').append( this.background );
this.initDialog( text );
},
initDialog: function() {
this.buttonDiv = $('<div/>', {'class': 'modalDialogButtons'} );
var okButton = $('<input/>', {'type': 'button', 'class':'button', 'value': this.okText});
var cancelButton = $('<input/>', {'type': 'button', 'class':'button', 'value': this.cancelText});
okButton.bind( 'click', this.clickOk.bind(this) );
cancelButton.bind( 'click', this.clickCancel.bind(this) );
this.buttonDiv.append( okButton ).append( cancelButton );
this.dialogBox.html('<div class="modalDialogText">' + this.text + '</div>' );
this.dialogBox.append( this.buttonDiv );
},
clickOk: function() {
if( this.onOk ) { this.onOk(this); }
this.close();
},
clickCancel: function() {
if( this.onCancel ) { this.onCancel(this); }
this.close();
},
open: function() {
this.background.fadeIn(100);
},
close: function() {
this.background.fadeOut(100);
}
});
wm.ModalDialogPathSelect = wm.ModalDialog.extend({
pathDropdown: null,
pathInput: null,
fileType: '',
init: function( text, okText, type ) {
this.fileType = type || '';
this.parent( text, (okText || 'Select') );
},
setPath: function( path ) {
var dir = path.replace(/\/[^\/]*$/, '');
this.pathInput.val( path );
this.pathDropdown.loadDir( dir );
},
initDialog: function() {
this.parent();
this.pathInput = $('<input/>', {'type': 'text', 'class': 'modalDialogPath'} );
this.buttonDiv.before( this.pathInput );
this.pathDropdown = new wm.SelectFileDropdown( this.pathInput, wm.config.api.browse, this.fileType );
},
clickOk: function() {
if( this.onOk ) {
this.onOk(this, this.pathInput.val());
}
this.close();
}
});
});
+99
View File
@@ -0,0 +1,99 @@
ig.module(
'weltmeister.select-file-dropdown'
)
.defines(function(){ "use strict";
wm.SelectFileDropdown = ig.Class.extend({
input: null,
boundShow: null,
div: null,
filelistPHP: '',
filetype: '',
init: function( elementId, filelistPHP, filetype ) {
this.filetype = filetype || '';
this.filelistPHP = filelistPHP;
this.input = $(elementId);
this.boundHide = this.hide.bind(this);
this.input.bind('focus', this.show.bind(this) );
this.div = $('<div/>', {'class':'selectFileDialog'});
this.input.after( this.div );
this.div.bind('mousedown', this.noHide.bind(this) );
this.loadDir( '' );
},
loadDir: function( dir ) {
var path = this.filelistPHP + '?dir=' + encodeURIComponent( dir || '' ) + '&type=' + this.filetype;
var req = $.ajax({
url:path,
dataType: 'json',
async: false,
success:this.showFiles.bind(this)
});
},
selectDir: function( event ) {
this.loadDir( $(event.target).attr('href') );
return false;
},
selectFile: function( event ) {
this.input.val( $(event.target).attr('href') );
this.input.blur();
this.hide();
return false;
},
showFiles: function( data ) {
this.div.empty();
if( data.parent !== false ) {
var parentDir = $('<a/>', {'class':'dir', href:data.parent, html: '&hellip;parent directory'});
parentDir.bind( 'click', this.selectDir.bind(this) );
this.div.append( parentDir );
}
for( var i = 0; i < data.dirs.length; i++ ) {
var name = data.dirs[i].match(/[^\/]*$/)[0] + '/';
var dir = $('<a/>', {'class':'dir', href:data.dirs[i], html: name, title: name});
dir.bind( 'click', this.selectDir.bind(this) );
this.div.append( dir );
}
for( var i = 0; i < data.files.length; i++ ) {
var name = data.files[i].match(/[^\/]*$/)[0];
var file = $('<a/>', {'class':'file', href:data.files[i], html: name, title: name});
file.bind( 'click', this.selectFile.bind(this) );
this.div.append( file );
}
},
noHide: function(event) {
event.stopPropagation();
},
show: function( event ) {
var inputPos = this.input.position();//this.input.getPosition(this.input.getOffsetParent());
var inputHeight = parseInt(this.input.innerHeight()) + parseInt(this.input.css('margin-top'));
var inputWidth = this.input.innerWidth();
$(document).bind( 'mousedown', this.boundHide );
this.div.css({
'top': inputPos.top + inputHeight + 1,
'left': inputPos.left,
'width': inputWidth
}).slideDown(100);
},
hide: function() {
$(document).unbind( 'mousedown', this.boundHide );
this.div.slideUp(100);
}
});
});
+155
View File
@@ -0,0 +1,155 @@
ig.module(
'weltmeister.tile-select'
)
.defines(function(){ "use strict";
wm.TileSelect = ig.Class.extend({
pos: {x:0, y:0},
layer: null,
selectionBegin: null,
init: function( layer ) {
this.layer = layer;
},
getCurrentTile: function() {
var b = this.layer.brush;
if( b.length == 1 && b[0].length == 1 ) {
return b[0][0] - 1;
}
else {
return -1;
}
},
setPosition: function( x, y ) {
this.selectionBegin = null;
var tile = this.getCurrentTile();
this.pos.x =
Math.floor( x / this.layer.tilesize ) * this.layer.tilesize
- Math.floor( tile * this.layer.tilesize ) % this.layer.tiles.width;
this.pos.y =
Math.floor( y / this.layer.tilesize ) * this.layer.tilesize
- Math.floor( tile * this.layer.tilesize / this.layer.tiles.width ) * this.layer.tilesize
- (tile == -1 ? this.layer.tilesize : 0);
this.pos.x = this.pos.x.limit( 0, ig.system.width - this.layer.tiles.width - (ig.system.width % this.layer.tilesize) );
this.pos.y = this.pos.y.limit( 0, ig.system.height - this.layer.tiles.height - (ig.system.height % this.layer.tilesize) );
},
beginSelecting: function( x, y ) {
this.selectionBegin = {x:x, y:y};
},
endSelecting: function( x, y ) {
var r = this.getSelectionRect( x, y);
var mw = Math.floor( this.layer.tiles.width / this.layer.tilesize );
var mh = Math.floor( this.layer.tiles.height / this.layer.tilesize );
var brush = [];
for( var ty = r.y; ty < r.y+r.h; ty++ ) {
var row = [];
for( var tx = r.x; tx < r.x+r.w; tx++ ) {
if( tx < 0 || ty < 0 || tx >= mw || ty >= mh) {
row.push( 0 );
}
else {
row.push( ty * Math.floor(this.layer.tiles.width / this.layer.tilesize) + tx + 1 );
}
}
brush.push( row );
}
this.selectionBegin = null;
return brush;
},
getSelectionRect: function( x, y ) {
var sx = this.selectionBegin ? this.selectionBegin.x : x,
sy = this.selectionBegin ? this.selectionBegin.y : y;
var
txb = Math.floor( (sx - this.pos.x) / this.layer.tilesize ),
tyb = Math.floor( (sy - this.pos.y) / this.layer.tilesize ),
txe = Math.floor( (x - this.pos.x) / this.layer.tilesize ),
tye = Math.floor( (y - this.pos.y) / this.layer.tilesize );
return {
x: Math.min( txb, txe ),
y: Math.min( tyb, tye ),
w: Math.abs( txb - txe) + 1,
h: Math.abs( tyb - tye) + 1
}
},
draw: function() {
ig.system.clear( "rgba(0,0,0,0.8)" );
if( !this.layer.tiles.loaded ) {
return;
}
// Tileset
ig.system.context.lineWidth = 1;
ig.system.context.strokeStyle = wm.config.colors.secondary;
ig.system.context.fillStyle = wm.config.colors.clear;
ig.system.context.fillRect(
this.pos.x * ig.system.scale,
this.pos.y * ig.system.scale,
this.layer.tiles.width * ig.system.scale,
this.layer.tiles.height * ig.system.scale
);
ig.system.context.strokeRect(
this.pos.x * ig.system.scale - 0.5,
this.pos.y * ig.system.scale - 0.5,
this.layer.tiles.width * ig.system.scale + 1,
this.layer.tiles.height * ig.system.scale + 1
);
this.layer.tiles.draw( this.pos.x, this.pos.y );
// Selected Tile
var tile = this.getCurrentTile();
var tx = Math.floor( tile * this.layer.tilesize ) % this.layer.tiles.width + this.pos.x;
var ty =
Math.floor( tile * this.layer.tilesize / this.layer.tiles.width )
* this.layer.tilesize + this.pos.y
+ (tile == -1 ? this.layer.tilesize : 0);
ig.system.context.lineWidth = 1;
ig.system.context.strokeStyle = wm.config.colors.highlight;
ig.system.context.strokeRect(
tx * ig.system.scale - 0.5,
ty * ig.system.scale - 0.5,
this.layer.tilesize * ig.system.scale + 1,
this.layer.tilesize * ig.system.scale + 1
);
},
drawCursor: function( x, y ) {
var cx = Math.floor( x / this.layer.tilesize ) * this.layer.tilesize;
var cy = Math.floor( y / this.layer.tilesize ) * this.layer.tilesize;
var r = this.getSelectionRect( x, y);
ig.system.context.lineWidth = 1;
ig.system.context.strokeStyle = wm.config.colors.selection;
ig.system.context.strokeRect(
(r.x * this.layer.tilesize + this.pos.x) * ig.system.scale - 0.5,
(r.y * this.layer.tilesize + this.pos.y) * ig.system.scale - 0.5,
r.w * this.layer.tilesize * ig.system.scale + 1,
r.h * this.layer.tilesize * ig.system.scale + 1
);
}
});
});
+234
View File
@@ -0,0 +1,234 @@
ig.module(
'weltmeister.undo'
)
.requires(
'weltmeister.config'
)
.defines(function(){ "use strict";
wm.Undo = ig.Class.extend({
levels: 10,
chain: [],
rpos: 0,
currentAction: null,
init: function( levels ) {
this.levels = levels || 10;
},
clear: function() {
this.chain = [];
this.currentAction = null;
},
commit: function( action ) {
if( this.rpos ) {
this.chain.splice( this.chain.length - this.rpos, this.rpos );
this.rpos = 0;
}
action.activeLayer = ig.game.activeLayer ? ig.game.activeLayer.name : '';
this.chain.push( action );
if( this.chain.length > this.levels ) {
this.chain.shift();
}
},
undo: function() {
var action = this.chain[ this.chain.length - this.rpos - 1 ];
if( !action ) {
return;
}
this.rpos++;
ig.game.setActiveLayer( action.activeLayer );
if( action.type == wm.Undo.MAP_DRAW ) {
for( var i = 0; i < action.changes.length; i++ ) {
var change = action.changes[i];
change.layer.setTile( change.x, change.y, change.old );
}
}
else if( action.type == wm.Undo.ENTITY_EDIT ) {
action.entity.pos.x = action.old.x;
action.entity.pos.y = action.old.y;
action.entity.size.x = action.old.w;
action.entity.size.y = action.old.h;
ig.game.entities.selectEntity( action.entity );
ig.game.entities.loadEntitySettings();
}
else if( action.type == wm.Undo.ENTITY_CREATE ) {
ig.game.entities.removeEntity( action.entity );
ig.game.entities.selectEntity( null );
}
else if( action.type == wm.Undo.ENTITY_DELETE ) {
ig.game.entities.entities.push( action.entity );
if( action.entity.name ) {
this.namedEntities[action.entity.name] = action.entity;
}
ig.game.entities.selectEntity( action.entity );
}
ig.game.setModified();
},
redo: function() {
if( !this.rpos ) {
return;
}
var action = this.chain[ this.chain.length - this.rpos ];
if( !action ) {
return;
}
this.rpos--;
ig.game.setActiveLayer( action.activeLayer );
if( action.type == wm.Undo.MAP_DRAW ) {
for( var i = 0; i < action.changes.length; i++ ) {
var change = action.changes[i];
change.layer.setTile( change.x, change.y, change.current );
}
}
else if( action.type == wm.Undo.ENTITY_EDIT ) {
action.entity.pos.x = action.current.x;
action.entity.pos.y = action.current.y;
action.entity.size.x = action.current.w;
action.entity.size.y = action.current.h;
ig.game.entities.selectEntity( action.entity );
ig.game.entities.loadEntitySettings();
}
else if( action.type == wm.Undo.ENTITY_CREATE ) {
ig.game.entities.entities.push( action.entity );
if( action.entity.name ) {
this.namedEntities[action.entity.name] = action.entity;
}
ig.game.entities.selectEntity( action.entity );
}
else if( action.type == wm.Undo.ENTITY_DELETE ) {
ig.game.entities.removeEntity( action.entity );
ig.game.entities.selectEntity( null );
}
ig.game.setModified();
},
// -------------------------------------------------------------------------
// Map changes
beginMapDraw: function( layer ) {
this.currentAction = {
type: wm.Undo.MAP_DRAW,
time: Date.now(),
changes: []
};
},
pushMapDraw: function( layer, x, y, oldTile, currentTile ) {
if( !this.currentAction ) {
return;
}
this.currentAction.changes.push({
layer: layer,
x: x,
y: y,
old: oldTile,
current: currentTile
});
},
endMapDraw: function() {
if( !this.currentAction || !this.currentAction.changes.length ) {
return;
}
this.commit( this.currentAction );
this.currentAction = null;
},
// -------------------------------------------------------------------------
// Entity changes
beginEntityEdit: function( entity ) {
this.currentAction = {
type: wm.Undo.ENTITY_EDIT,
time: Date.now(),
entity: entity,
old: {
x: entity.pos.x,
y: entity.pos.y,
w: entity.size.x,
h: entity.size.y
},
current: {
x: entity.pos.x,
y: entity.pos.y,
w: entity.size.x,
h: entity.size.y
}
};
},
pushEntityEdit: function( entity ) {
if( !this.currentAction ) {
return;
}
this.currentAction.current = {
x: entity.pos.x,
y: entity.pos.y,
w: entity.size.x,
h: entity.size.y
};
},
endEntityEdit: function() {
var a = this.currentAction;
if( !a || (
a.old.x == a.current.x && a.old.y == a.current.y &&
a.old.w == a.current.w && a.old.h == a.current.h
)) {
return;
}
this.commit( this.currentAction );
this.currentAction = null;
},
commitEntityCreate: function( entity ) {
this.commit({
type: wm.Undo.ENTITY_CREATE,
time: Date.now(),
entity: entity
});
},
commitEntityDelete: function( entity ) {
this.commit({
type: wm.Undo.ENTITY_DELETE,
time: Date.now(),
entity: entity
});
}
});
wm.Undo.MAP_DRAW = 1;
wm.Undo.ENTITY_EDIT = 2;
wm.Undo.ENTITY_CREATE = 3;
wm.Undo.ENTITY_DELETE = 4;
});
+486
View File
@@ -0,0 +1,486 @@
body {
background-color: #000;
color: #fff;
font-family: sans-serif;
font-size: 10pt;
margin: 0px;
overflow: hidden;
text-shadow: 0px 1px 1px rgba(0,0,0,0.5);
-webkit-font-smoothing: antialiased;
-webkit-user-select: none;
}
h2 {
margin: 0 0 4px 0;
padding: 4px 0 4px 6px;
background-color: #000;
font-size: 100%;
color: #555;
xtext-transform: uppercase;
xborder-bottom: 1px solid #555;
}
h3 {
margin: 0;
font-size: 100%;
display: block;
}
dt {
margin: 0;
padding: 4px 0 0 6px;
display:inline;
float:left;
margin-right:5px;
}
dd {
margin: 0;
padding: 2px 0 8px 6px;
}
dl {
margin:0;
}
div.clear {
clear: both;
}
label {
cursor: pointer;
}
/* --- Input ------------------------------------------------------------------ */
input {
background-color: rgba(0,0,0,0.5);
border: 1px solid rgb(50,50,50);
color: #fff;
margin: 0;
font-family: sans-serif;
-webkit-font-smoothing: antialiased;
font-size: 10pt;
outline: none;
text-shadow: 0px 1px 1px rgba(0,0,0,0.5);
}
input:focus{
border: 1px solid rgb(200,200,200);
}
input.text {
padding: 1px;
margin: 0;
}
input.number {
width: 30px;
text-align: right;
}
input.button {
font-size: 90%;
padding-left: 13px;
padding-right: 13px;
padding-top: 5px;
padding-bottom: 5px;
color: #fff;
font-weight: bold;
background-color: rgba(255,255,255,0.1);
border:none;
border-top: 1px solid rgba(255,255,255,0.1);
border-bottom: 1px solid rgba(0,0,0,0.1);
cursor: pointer;
-webkit-transition: 0.1s linear;
}
input.button:hover {
background-color: rgba(255,255,255,0.2);
}
input.button:active {
background-color: rgba(255,255,255,0.3);
}
input.text#layerName {
width:140px;
}
input.text#layerTileset {
width:138px;
}
input#levelSaveAs { margin-right: 10px; }
input#levelLoad { margin-right: 10px; }
input#reloadImages {margin-right: 10px;}
input:disabled {
background-color: #555;
color: #888;
}
/* --- Layout ------------------------------------------------------------------ */
#editor {
margin: 0px;
position: relative;
}
#canvas {
image-rendering: optimizeSpeed;
-webkit-interpolation-mode: nearest-neighbor;
}
#menu {
width: 200px;
float: right;
position:absolute;
top:0px;
right:0px;
}
/* --- Layers ------------------------------------------------------------------ */
#layerContainer {
background-color: rgba(0,0,0,0.95);
padding-right:2px;
}
#layers {
max-height: 200px;
overflow: auto;
}
#layerButtons div.button#buttonAddLayer {
position:absolute;
right: 0px;
top:-5px;
cursor: pointer;
padding: 10px;
color:rgba(255,255,255,0.5);
font-weight: bold;
font-size:110%;
margin-left:1px;
-webkit-transition: 0.1s linear;
-webkit-font-smoothing: none;
z-index:10;
}
#layerButtons div.button#buttonAddLayer:hover { color:rgba(255,255,255,1);}
#layerButtons div.button#buttonAddLayer:active { color:rgba(255,255,255,1); text-shadow:none;}
.layer {
padding: 6px 4px;
cursor: pointer;
-webkit-transition: background-color 0.1s linear;
border-top: 1px solid rgba(255,255,255,0);
border-bottom: 1px solid rgba(255,255,255,0);
}
.layer:hover {
background-color: rgba(255,255,255,0.1);
border-top: 1px solid rgba(255,255,255,0.1);
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.layer:active {
background-color: rgba(255,255,255,0.2);
border-top: 1px solid rgba(255,255,255,0.2);
border-bottom: 1px solid rgba(255,255,255,0.2);
}
.layerActive {
background-color: rgba(255,255,255,0.1);
border-top: 1px solid rgba(255,255,255,0.2);
border-bottom: 1px solid rgba(255,255,255,0.2) !important;
}
#layerEntities { border-bottom: 1px solid #000; }
.layer .visible {
background-color: rgba(255,255,255,0.2);
text-indent: -99999px;
display: inline-block;
width: 10px;
height: 10px;
margin-right: 7px;
margin-left: 4px;
-webkit-transition: 0.1s linear;
}
.layer .visible.specialVis{
margin-right: 2px;
}
.layer .checkedVis{ background-color: rgba(255,255,255,1); }
.layer span.size { font-size: 75%; color: rgba(255,255,255,0.7); }
#layerSettings {
background-color: rgba(0,0,0,0.95);
padding-top: 5px;
margin-top: 1px;
display: none;
}
/* --- Entities ------------------------------------------------------------------ */
h3#entityClass {
border-bottom: 1px solid rgba(255,255,255,0.2);
padding: 5px;
padding-left: 10px;
}
#entitySettings {
background-color: rgba(0,0,0,0.95);
margin-top: 1px;
display: none;
}
#entityDefinitions {
max-height: 220px;
overflow: auto;
}
div.entityDefinition {
color: #aaa;
padding: 2px 0;
border-bottom: 1px solid rgba(255,255,255,0.2);
cursor: pointer;
}
div.entityDefinition:hover {
background-color: rgba(255,255,255,0.1);
}
div.entityDefinition .key {
width: 50%;
display: block;
float: left;
margin: 0 0px 0 0;
padding: 0;
text-align: right;
color: #fff;
overflow: hidden;
}
div.entityDefinition .value {
padding: 0 0 0 2px;
color: #fff;
}
dl#entityDefinitionInput {
padding: 8px 0;
}
dl#entityDefinitionInput dt {
width: 40px;
display: block;
float: left;
margin: 0 4px 0 0;
padding: 4px 0 0 0;
text-align: right;
}
dl#entityDefinitionInput dd {
display: block;
margin: 0;
padding: 2px 0;
}
#entityKey, #entityValue {
}
#entityMenu {
background-color: rgba(0,0,0,0.9);
display: none;
position: absolute;
min-width: 100px;
max-height:300px;
overflow-y: scroll;
z-index: 1000;
}
#entityMenu div {
padding: 3px;
padding-left: 8px;
color: #fff;
cursor: pointer;
border-top: 1px solid rgba(255,255,255,0);
border-bottom: 1px solid rgba(255,255,255,0);
-webkit-transition: 0.1s linear;
}
#entityMenu div:hover {
background-color: rgba(255,255,255,0.2);
border-top: 1px solid rgba(255,255,255,0.2);
border-bottom: 1px solid rgba(255,255,255,0.2);
}
/* --- Dialogs ------------------------------------------------------------------ */
.selectFileDialog {
background-color: rgba(0,0,0,0.9);
border: 1px solid white;
border-top: 1px solid rgba(255,255,255,0.4);
display: none;
position: absolute;
overflow: hidden;
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,1);
max-height: 300px;
overflow-y: scroll;
}
.selectFileDialog a {
padding: 4px;
color: #fff;
display: block;
text-decoration: none;
border-top: 1px solid rgba(255,255,255,0);
border-bottom: 1px solid rgba(255,255,255,0);
}
.selectFileDialog a:hover {
background-color: rgba(255,255,255,0.2);
border-top: 1px solid rgba(255,255,255,0.2);
border-bottom: 1px solid rgba(255,255,255,0.2);
}
div.modalDialogBackground {
background-color: rgba(0,0,0,0.7);
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
display: none;
z-index: 100;
}
div.modalDialogBox {
width: 300px;
margin-left: -170px;
background-color: rgba(0,0,0,0.9);
border: 1px solid rgb(100,100,100);
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,1);
position: absolute;
top: 20%;
left: 50%;
padding: 20px;
}
div.modalDialogText {
font-size: 180%;
font-weight: bold;
}
div.modalDialogButtons {
margin-top: 20px;
text-align: right;
}
div.modalDialogButtons input.button {
min-width: 100px;
text-align: center;
margin-left: 10px;
}
input.modalDialogPath {
margin-top: 20px;
width: 100%;
outline: none;
}
input.modalDialogPath:focus {
outline: none;
border: 1px solid rgb(100,100,100);
}
#headerMenu {
position:relative;
z-index:10;
height:47px;
width:100%;
background: #131314;
background: -webkit-gradient(linear, left bottom, left top, color-stop(0,#000000), color-stop(1,#2e3033));
background: -moz-linear-gradient(center bottom, #000000 0%, #2e3033 100%);
background: -o-linear-gradient(#2e3033, #000000);
}
#headerMenu span.headerTitle {
display:inline-block;
font-weight:bold;
font-size:200%;
padding-left:20px;
padding-top:7px;
color:rgba(0,0,0,0.1);
text-shadow:0px -1px 0px rgba(255,255,255,0.4);
}
#headerMenu span.unsavedTitle {
display:inline-block;
font-weight:bold;
font-size:240%;
padding-left:0px;
color:#cc0000;
text-shadow:0px 1px 1px rgba(0,0,0,0.1);
}
#headerMenu span.headerFloat {
float: right;
}
div#zoomIndicator {
font-weight: bold;
font-size: 300%;
position: absolute;
left: 50px;
top: 30px;
color: #fff;
display: none;
}
input#toggleSidebar {
width: 200px;
height: 47px;
text-indent: -99999px;
background: url(arrow.png) 50% -37px no-repeat;
-webkit-transition: 0s linear;
opacity: 0.25;
padding: 0px;
}
input#toggleSidebar.active{
background-position: 50% 10px;
}
input[type="checkbox"] {
position: relative;
margin: 0;
border: 0;
width: 10px;
height: 10px;
display: inline-block;
-webkit-appearance: none;
-webkit-transition: 0.1s linear;
}
input[type="checkbox"] {
background-color:rgba(255,255,255,0.2);
}
input[type="checkbox"]:checked {
background-color: rgba(255,255,255,1);
}
input[type="checkbox"]:hover {
cursor: pointer;
}
input[type="checkbox"]:disabled {
background-color: rgba(255,255,255,0.1);
}
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment { display: block; height: 2px; }
::-webkit-scrollbar-button:vertical:increment { background-color: transparent; }
::-webkit-scrollbar-track-piece { background-color: rgba(0,0,0,0); }
::-webkit-scrollbar-thumb:vertical { background-color: rgba(255,255,255,1); }
File diff suppressed because it is too large Load Diff