-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Corey Oordt
committed
Aug 27, 2009
1 parent
9d4d59c
commit 8deaaa2
Showing
84 changed files
with
3,247 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
function region_append(region, obj, modname) { | ||
var wrp = []; | ||
wrp.push('<fieldset class="module aligned order-item">'); | ||
wrp.push('<h2><img class="item-delete" src="'+IMG_DELETELINK_PATH+'" /><span class="handle">'+modname+'</span></h2>'); | ||
wrp.push('<div class="item-content"></div>'); | ||
wrp.push('</fieldset>'); | ||
|
||
$("#"+REGIONS[region]+"_body").children("div.order-machine").append(wrp.join("")) | ||
.children("fieldset.order-item:last").children(".item-content").append(obj); | ||
} | ||
|
||
function create_new_spare_form(form, modvar, last_id) { | ||
// create new spare form | ||
var new_form = form.html().replace( | ||
new RegExp(modvar+'-'+last_id, 'g'), | ||
modvar+'-'+(last_id+1)); | ||
new_form = '<div id="'+modvar+'_set_item_'+(last_id+1)+'">'+new_form+'</div>'; | ||
$("#"+modvar+"_set").append(new_form); | ||
} | ||
|
||
function set_item_field_value(item, field, value) { | ||
// item: DOM object created by 'region_append' function | ||
// field: "order-field" | "delete-field" | "region-choice-field" | ||
if (field=="delete-field") | ||
item.find("."+field).attr("checked",value); | ||
else if (field=="region-choice-field") { | ||
var old_region_id = REGION_MAP.indexOf(item.find("."+field).val()); | ||
item.find("."+field).val(REGION_MAP[value]); | ||
|
||
old_region_item = $("#"+REGIONS[old_region_id]+"_body"); | ||
if (old_region_item.children("div.order-machine").children().length == 0) | ||
old_region_item.children("div.empty-machine-msg").show(); | ||
else | ||
old_region_item.children("div.empty-machine-msg").hide(); | ||
|
||
new_region_item = $("#"+REGIONS[value]+"_body"); | ||
new_region_item.children("div.empty-machine-msg").hide(); | ||
} | ||
else | ||
item.find("."+field).val(value); | ||
} | ||
|
||
function move_item (region_id, item) { | ||
poorify_rich(item); | ||
$("#"+REGIONS[region_id]+"_body").children("div.order-machine").append(item); | ||
set_item_field_value(item, "region-choice-field", region_id); | ||
richify_poor(item); | ||
} | ||
|
||
function poorify_rich(item){ | ||
item.children(".item-content").hide(); | ||
if (item.find("div[id^=richtext]").length > 0) { | ||
var editor_id = item.find(".mceEditor").prev().attr("id"); | ||
tinyMCE.execCommand('mceRemoveControl', false, editor_id); | ||
} | ||
} | ||
function richify_poor(item){ | ||
item.children(".item-content").show(); | ||
if (item.find("div[id^=richtext]").length > 0) { | ||
var editor_id = item.find('textarea[name*=richtext]:visible').attr("id"); | ||
tinyMCE.execCommand('mceAddControl', false, editor_id); | ||
} | ||
} | ||
|
||
function zucht_und_ordnung(move_item) { | ||
for (var i=0; i<REGIONS.length;i++) { | ||
var container = $("#"+REGIONS[i]+"_body div.order-machine"); | ||
for (var j=0; j<container.children().length; j++) { | ||
if (move_item) | ||
container.find("input.order-field[value="+j+"]").parents("fieldset.order-item").appendTo(container); | ||
else | ||
set_item_field_value(container.find("fieldset.order-item:eq("+j+")"), "order-field", j); | ||
} | ||
} | ||
} | ||
|
||
function attach_dragdrop_handlers() { | ||
// hide content on drag n drop | ||
$("#main h2.handle").mousedown(function(){ | ||
poorify_rich($(this).parents("fieldset.order-item")); | ||
}); | ||
$("#main h2.handle").mouseup(function(){ | ||
richify_poor($(this).parents("fieldset.order-item")); | ||
}); | ||
} |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#popup_container { | ||
font-family: Arial, sans-serif; | ||
font-size: 12px; | ||
min-width: 300px; /* Dialog will be no smaller than this */ | ||
max-width: 600px; /* Dialog will wrap after this width */ | ||
background: #FFF; | ||
border: solid 1px #666; | ||
color: #000; | ||
} | ||
|
||
#popup_title { | ||
font-size: 14px; | ||
font-weight: bold; | ||
text-align: center; | ||
line-height: 1.75em; | ||
color: #666; | ||
background: #eee url(img/title.gif) top repeat-x; | ||
border: solid 1px #FFF; | ||
border-bottom: solid 1px #666; | ||
cursor: default; | ||
padding: 0em; | ||
margin: 0em; | ||
} | ||
|
||
#popup_content { | ||
background: 16px 16px no-repeat url(img/info.gif); | ||
padding: 1em 1.75em; | ||
margin: 0em; | ||
} | ||
|
||
#popup_content.alert { | ||
background-image: url(img/info.gif); | ||
} | ||
|
||
#popup_content.confirm { | ||
background-image: url(img/important.gif); | ||
} | ||
|
||
#popup_content.prompt { | ||
background-image: url(img/help.gif); | ||
} | ||
|
||
#popup_message { | ||
padding-left: 48px; | ||
} | ||
|
||
#popup_panel { | ||
text-align: center; | ||
margin: 1em 0em 0em 1em; | ||
} | ||
|
||
#popup_prompt { | ||
margin: .5em 0em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,235 @@ | ||
// jQuery Alert Dialogs Plugin | ||
// | ||
// Version 1.0 | ||
// | ||
// Cory S.N. LaViska | ||
// A Beautiful Site (http://abeautifulsite.net/) | ||
// 29 December 2008 | ||
// | ||
// Visit http://abeautifulsite.net/notebook/87 for more information | ||
// | ||
// Usage: | ||
// jAlert( message, [title, callback] ) | ||
// jConfirm( message, [title, callback] ) | ||
// jPrompt( message, [value, title, callback] ) | ||
// | ||
// History: | ||
// | ||
// 1.00 - Released (29 December 2008) | ||
// | ||
// License: | ||
// | ||
// This plugin is licensed under the GNU General Public License: http://www.gnu.org/licenses/gpl.html | ||
// | ||
(function($) { | ||
|
||
$.alerts = { | ||
|
||
// These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time | ||
|
||
verticalOffset: -75, // vertical offset of the dialog from center screen, in pixels | ||
horizontalOffset: 0, // horizontal offset of the dialog from center screen, in pixels/ | ||
repositionOnResize: true, // re-centers the dialog on window resize | ||
overlayOpacity: .01, // transparency level of overlay | ||
overlayColor: '#FFF', // base color of overlay | ||
draggable: true, // make the dialogs draggable (requires UI Draggables plugin) | ||
okButton: ' OK ', // text for the OK button | ||
cancelButton: ' Cancel ', // text for the Cancel button | ||
dialogClass: null, // if specified, this class will be applied to all dialogs | ||
|
||
// Public methods | ||
|
||
alert: function(message, title, callback) { | ||
if( title == null ) title = 'Alert'; | ||
$.alerts._show(title, message, null, 'alert', function(result) { | ||
if( callback ) callback(result); | ||
}); | ||
}, | ||
|
||
confirm: function(message, title, callback) { | ||
if( title == null ) title = 'Confirm'; | ||
$.alerts._show(title, message, null, 'confirm', function(result) { | ||
if( callback ) callback(result); | ||
}); | ||
}, | ||
|
||
prompt: function(message, value, title, callback) { | ||
if( title == null ) title = 'Prompt'; | ||
$.alerts._show(title, message, value, 'prompt', function(result) { | ||
if( callback ) callback(result); | ||
}); | ||
}, | ||
|
||
// Private methods | ||
|
||
_show: function(title, msg, value, type, callback) { | ||
|
||
$.alerts._hide(); | ||
$.alerts._overlay('show'); | ||
|
||
$("BODY").append( | ||
'<div id="popup_container">' + | ||
'<h1 id="popup_title"></h1>' + | ||
'<div id="popup_content">' + | ||
'<div id="popup_message"></div>' + | ||
'</div>' + | ||
'</div>'); | ||
|
||
if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass); | ||
|
||
// IE6 Fix | ||
var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed'; | ||
|
||
$("#popup_container").css({ | ||
position: pos, | ||
zIndex: 99999, | ||
padding: 0, | ||
margin: 0 | ||
}); | ||
|
||
$("#popup_title").text(title); | ||
$("#popup_content").addClass(type); | ||
$("#popup_message").text(msg); | ||
$("#popup_message").html( $("#popup_message").text().replace(/\n/g, '<br />') ); | ||
|
||
$("#popup_container").css({ | ||
minWidth: $("#popup_container").outerWidth(), | ||
maxWidth: $("#popup_container").outerWidth() | ||
}); | ||
|
||
$.alerts._reposition(); | ||
$.alerts._maintainPosition(true); | ||
|
||
switch( type ) { | ||
case 'alert': | ||
$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /></div>'); | ||
$("#popup_ok").click( function() { | ||
$.alerts._hide(); | ||
callback(true); | ||
}); | ||
$("#popup_ok").focus().keypress( function(e) { | ||
if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click'); | ||
}); | ||
break; | ||
case 'confirm': | ||
$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>'); | ||
$("#popup_ok").click( function() { | ||
$.alerts._hide(); | ||
if( callback ) callback(true); | ||
}); | ||
$("#popup_cancel").click( function() { | ||
$.alerts._hide(); | ||
if( callback ) callback(false); | ||
}); | ||
$("#popup_ok").focus(); | ||
$("#popup_ok, #popup_cancel").keypress( function(e) { | ||
if( e.keyCode == 13 ) $("#popup_ok").trigger('click'); | ||
if( e.keyCode == 27 ) $("#popup_cancel").trigger('click'); | ||
}); | ||
break; | ||
case 'prompt': | ||
$("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>'); | ||
$("#popup_prompt").width( $("#popup_message").width() ); | ||
$("#popup_ok").click( function() { | ||
var val = $("#popup_prompt").val(); | ||
$.alerts._hide(); | ||
if( callback ) callback( val ); | ||
}); | ||
$("#popup_cancel").click( function() { | ||
$.alerts._hide(); | ||
if( callback ) callback( null ); | ||
}); | ||
$("#popup_prompt, #popup_ok, #popup_cancel").keypress( function(e) { | ||
if( e.keyCode == 13 ) $("#popup_ok").trigger('click'); | ||
if( e.keyCode == 27 ) $("#popup_cancel").trigger('click'); | ||
}); | ||
if( value ) $("#popup_prompt").val(value); | ||
$("#popup_prompt").focus().select(); | ||
break; | ||
} | ||
|
||
// Make draggable | ||
if( $.alerts.draggable ) { | ||
try { | ||
$("#popup_container").draggable({ handle: $("#popup_title") }); | ||
$("#popup_title").css({ cursor: 'move' }); | ||
} catch(e) { /* requires jQuery UI draggables */ } | ||
} | ||
}, | ||
|
||
_hide: function() { | ||
$("#popup_container").remove(); | ||
$.alerts._overlay('hide'); | ||
$.alerts._maintainPosition(false); | ||
}, | ||
|
||
_overlay: function(status) { | ||
switch( status ) { | ||
case 'show': | ||
$.alerts._overlay('hide'); | ||
$("BODY").append('<div id="popup_overlay"></div>'); | ||
$("#popup_overlay").css({ | ||
position: 'absolute', | ||
zIndex: 99998, | ||
top: '0px', | ||
left: '0px', | ||
width: '100%', | ||
height: $(document).height(), | ||
background: $.alerts.overlayColor, | ||
opacity: $.alerts.overlayOpacity, | ||
display: 'none' | ||
}); | ||
break; | ||
case 'hide': | ||
$("#popup_overlay").remove(); | ||
break; | ||
} | ||
}, | ||
|
||
_reposition: function() { | ||
var top = (($(window).height() / 2) - ($("#popup_container").outerHeight() / 2)) + $.alerts.verticalOffset; | ||
var left = (($(window).width() / 2) - ($("#popup_container").outerWidth() / 2)) + $.alerts.horizontalOffset; | ||
if( top < 0 ) top = 0; | ||
if( left < 0 ) left = 0; | ||
|
||
// IE6 fix | ||
if( $.browser.msie && parseInt($.browser.version) <= 6 ) top = top + $(window).scrollTop(); | ||
|
||
$("#popup_container").css({ | ||
top: top + 'px', | ||
left: left + 'px' | ||
}); | ||
$("#popup_overlay").height( $(document).height() ); | ||
}, | ||
|
||
_maintainPosition: function(status) { | ||
if( $.alerts.repositionOnResize ) { | ||
switch(status) { | ||
case true: | ||
$(window).bind('resize', function() { | ||
$.alerts._reposition(); | ||
}); | ||
break; | ||
case false: | ||
$(window).unbind('resize'); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
// Shortuct functions | ||
jAlert = function(message, title, callback) { | ||
$.alerts.alert(message, title, callback); | ||
} | ||
|
||
jConfirm = function(message, title, callback) { | ||
$.alerts.confirm(message, title, callback); | ||
}; | ||
|
||
jPrompt = function(message, value, title, callback) { | ||
$.alerts.prompt(message, value, title, callback); | ||
}; | ||
|
||
})(jQuery); |
Oops, something went wrong.