Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added notifications when a user changes settings.

+Added checkmarks to growl notification boxes
  • Loading branch information...
commit 602645be2119ee1e0a20b737c72427fb83ee2bba 1 parent 0c21928
@jtanderson authored
View
2  application/views/settings.php
@@ -15,7 +15,7 @@
<input type="hidden" id="PK_UserNum" value="<?php echo $this->session->userdata('LocalID');?>"/>
<div id="message_container">
<div id="DEFAULT_warning" style="display:none;" class="message">
- <a href="#" onclick="removeWarning(this);" class="remove_warning"><img style="height: 15px; width: 15px;" src="/cdn/img/moblin-close.png"/></a>
+ <a href="#" onclick="MainObj.removeWarning(this);" class="remove_warning"><img style="height: 15px; width: 15px;" src="/cdn/img/moblin-close.png"/></a>
<table>
<tr>
<td><img src="/cdn/img/Red_triangle_alert_icon.png" class="error_img"/></td>
View
5 cdn/css/main.css
@@ -401,4 +401,9 @@ legend span.current{
legend span:hover{
color: #c3c3c3;
/* background-color: #222;*/
+}
+
+div.growlUI { background: url(/cdn/img/check36.png) no-repeat 10px 10px; }
+div.growlUI h1, div.growlUI h2 {
+ color: white; padding: 5px 5px 5px 75px; text-align: left
}
View
BIN  cdn/img/check36.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  cdn/img/check48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
27 cdn/js/_uncompressed/main.js
@@ -94,6 +94,33 @@ MainObj.displayWarning = function(text){
}
}
+
+MainObj.displayMessage = function(text, options){
+ if ( options == undefined ){options = {}};
+ if ( text != undefined && typeof(text) == "string" ){
+ var container = $('#message_container');
+ var newErrorBox = $('#DEFAULT_warning').clone();
+ var idx = $('#message_container').find("[id$=_warning]").not("#DEFAULT_warning").length;
+ newErrorBox.attr('id', idx+'_warning');
+ newErrorBox.find('.warning_text').html(text);
+ // newErrorBox.css('display','');
+
+ if ( options.classes != undefined ){
+ newErrorBox.addClass(options.classes)
+ }
+
+ if ( options.fadeout != undefined ){
+ setTimeout(function(){newErrorBox.fadeOut(1000);}, options.fadeout);
+ }
+
+ container.append(newErrorBox);
+ newErrorBox.fadeIn(1000);
+ } else {
+ console.log("Warning: displayMessage function called with unacceptable parameters.");
+ }
+}
+
+
/**
* Function removeWarning
*
View
21 cdn/js/_uncompressed/settings.js
@@ -120,15 +120,34 @@ SettingsObj.saveSettings = function(){
// console.log( postData );
}
-
+/**
+ * Sends the data to the backend and displays confirmation
+ *
+ * @author Joseph T. Anderson <jtanderson@ratiocaeli.com>
+ * @since 2012-03-26
+ * @version 2012-03-26
+ *
+ * @param el An element that holds the setting to update
+ */
SettingsObj.updateSetting = function(el){
var postData = {};
postData[$(el).attr('id')] = $(el).val();
$.post('/homeAjax/updateSetting', postData, function(json){
// TODO: Add some sort of confirmation
+ if ( json.success ){
+ $.growlUI('System Notification', 'The changes have been saved.');
+ }
}, 'json');
}
+
+/**
+ * Sets up the tab interface events.
+ *
+ * @author Joseph T. Anderson <jtanderson@ratiocaeli.com>
+ * @since 2012-03-26
+ * @version 2012-03-26
+ */
SettingsObj.setTabEvents = function(){
$('legend span').each( function(){
$(this).click( function(){
View
4 cdn/js/jquery/jquery.blockUI.js
@@ -36,8 +36,8 @@ $.unblockUI = function(opts) { remove(window, opts); };
// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
$.growlUI = function(title, message, timeout, onClose) {
var $m = $('<div class="growlUI"></div>');
- if (title) $m.append('<h1>'+title+'</h1>');
- if (message) $m.append('<h2>'+message+'</h2>');
+ if (title) $m.append('<h2>'+title+'</h2>');
+ if (message) $m.append('<h4>'+message+'</h4>');
if (timeout == undefined) timeout = 3000;
$.blockUI({
message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
View
18 cdn/js/jquery/jquery.blockUI.min.js
@@ -3,14 +3,14 @@ f.display=h.style.display;f.position=h.style.position;f.parent&&f.parent.removeC
';display:none"></div>'):b('<div class="blockUI blockOverlay" style="z-index:'+f++ +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),f=b(a.theme&&e?'<div class="blockUI '+a.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(f+10)+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(a.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>':a.theme?
'<div class="blockUI '+a.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(f+10)+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(a.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>':e?'<div class="blockUI '+a.blockMsgClass+' blockPage" style="z-index:'+(f+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+a.blockMsgClass+' blockElement" style="z-index:'+
(f+10)+';display:none;position:absolute"></div>');c&&(a.theme?(f.css(i),f.addClass("ui-widget-content")):f.css(g));!a.theme&&(!a.applyPlatformOpacityRules||!b.browser.mozilla||!/Linux/.test(navigator.platform))&&h.css(a.overlayCSS);h.css("position",e?"fixed":"absolute");(b.browser.msie||a.forceIframe)&&k.css("opacity",0);var g=[k,h,f],o=e?b("body"):b(d);b.each(g,function(){this.appendTo(o)});a.theme&&a.draggable&&b.fn.draggable&&f.draggable({handle:".ui-dialog-titlebar",cancel:"li"});g=v&&(!b.boxModel||
-0<b("object,embed",e?null:d).length);if(r||g){e&&a.allowBodyStretch&&b.boxModel&&b("html,body").css("height","100%");if((r||!b.boxModel)&&!e)var g=parseInt(b.css(d,"borderTopWidth"))||0,i=parseInt(b.css(d,"borderLeftWidth"))||0,m=g?"(0 - "+g+")":0,n=i?"(0 - "+i+")":0;b.each([k,h,f],function(b,d){var c=d[0].style;c.position="absolute";if(2>b)e?c.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+a.quirksmodeOffsetHack+') + "px"'):c.setExpression("height",
-'this.parentNode.offsetHeight + "px"'),e?c.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):c.setExpression("width",'this.parentNode.offsetWidth + "px"'),n&&c.setExpression("left",n),m&&c.setExpression("top",m);else if(a.centerY)e&&c.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),
-c.marginTop=0;else if(!a.centerY&&e){var f="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+(a.css&&a.css.top?parseInt(a.css.top):0)+') + "px"';c.setExpression("top",f)}})}c&&(a.theme?f.find(".ui-widget-content").append(c):f.append(c),(c.jquery||c.nodeType)&&b(c).show());(b.browser.msie||a.forceIframe)&&a.showOverlay&&k.show();if(a.fadeIn)g=a.onBlock?a.onBlock:q,k=a.showOverlay&&!c?g:q,g=c?g:q,a.showOverlay&&h._fadeIn(a.fadeIn,k),c&&f._fadeIn(a.fadeIn,
-g);else if(a.showOverlay&&h.show(),c&&f.show(),a.onBlock)a.onBlock();s(1,d,a);e?(j=f[0],l=b(":input:enabled:visible",j),a.focusInput&&setTimeout(t,20)):w(f[0],a.centerX,a.centerY);a.timeout&&(c=setTimeout(function(){e?b.unblockUI(a):b(d).unblock(a)},a.timeout),b(d).data("blockUI.timeout",c))}function p(d,a){var e=d==window,c=b(d),g=c.data("blockUI.history"),i=c.data("blockUI.timeout");i&&(clearTimeout(i),c.removeData("blockUI.timeout"));a=b.extend({},b.blockUI.defaults,a||{});s(0,d,a);if(null===a.onUnblock)a.onUnblock=
-c.data("blockUI.onUnblock"),c.removeData("blockUI.onUnblock");var h;h=e?b("body").children().filter(".blockUI").add("body > .blockUI"):b(".blockUI",d);e&&(j=l=null);a.fadeOut?(h.fadeOut(a.fadeOut),setTimeout(function(){n(h,g,a,d)},a.fadeOut)):n(h,g,a,d)}function n(d,a,e,c){d.each(function(){this.parentNode&&this.parentNode.removeChild(this)});if(a&&a.el)a.el.style.display=a.display,a.el.style.position=a.position,a.parent&&a.parent.appendChild(a.el),b(c).removeData("blockUI.history");if("function"==
-typeof e.onUnblock)e.onUnblock(c,e)}function s(d,a,e){var c=a==window,a=b(a);if(d||!(c&&!j||!c&&!a.data("blockUI.isBlocked")))c||a.data("blockUI.isBlocked",d),e.bindEvents&&(!d||e.showOverlay)&&(d?b(document).bind("mousedown mouseup keydown keypress",e,u):b(document).unbind("mousedown mouseup keydown keypress",u))}function u(d){if(d.keyCode&&9==d.keyCode&&j&&d.data.constrainTabKey){var a=l,e=d.shiftKey&&d.target===a[0];if(!d.shiftKey&&d.target===a[a.length-1]||e)return setTimeout(function(){t(e)},
-10),!1}a=d.data;return 0<b(d.target).parents("div."+a.blockMsgClass).length?!0:0==b(d.target).parents().children().filter("div.blockUI").length}function t(b){l&&(b=l[!0===b?l.length-1:0])&&b.focus()}function w(d,a,e){var c=d.parentNode,g=d.style,i=(c.offsetWidth-d.offsetWidth)/2-(parseInt(b.css(c,"borderLeftWidth"))||0),d=(c.offsetHeight-d.offsetHeight)/2-(parseInt(b.css(c,"borderTopWidth"))||0);if(a)g.left=0<i?i+"px":"0";if(e)g.top=0<d?d+"px":"0"}if(/1\.(0|1|2)\.(0|1|2)/.test(b.fn.jquery)||/^1.1/.test(b.fn.jquery))alert("blockUI requires jQuery v1.2.3 or later! You are using v"+
-b.fn.jquery);else{b.fn._fadeIn=b.fn.fadeIn;var q=function(){},o=document.documentMode||0,v=b.browser.msie&&(8>b.browser.version&&!o||8>o),r=b.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!o;b.blockUI=function(b){m(window,b)};b.unblockUI=function(b){p(window,b)};b.growlUI=function(d,a,e,c){var g=b('<div class="growlUI"></div>');d&&g.append("<h1>"+d+"</h1>");a&&g.append("<h2>"+a+"</h2>");void 0==e&&(e=3E3);b.blockUI({message:g,fadeIn:700,fadeOut:1E3,centerY:!1,timeout:e,showOverlay:!1,onUnblock:c,
-css:b.blockUI.defaults.growlCSS})};b.fn.block=function(d){return this.unblock({fadeOut:0}).each(function(){if("static"==b.css(this,"position"))this.style.position="relative";if(b.browser.msie)this.style.zoom=1;m(this,d)})};b.fn.unblock=function(b){return this.each(function(){p(this,b)})};b.blockUI.version=2.39;b.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",
+0<b("object,embed",e?null:d).length);if(r||g){e&&a.allowBodyStretch&&b.boxModel&&b("html,body").css("height","100%");if((r||!b.boxModel)&&!e)var g=parseInt(b.css(d,"borderTopWidth"))||0,i=parseInt(b.css(d,"borderLeftWidth"))||0,m=g?"(0 - "+g+")":0,n=i?"(0 - "+i+")":0;b.each([k,h,f],function(b,d){var c=d[0].style;c.position="absolute";if(b<2){e?c.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+a.quirksmodeOffsetHack+') + "px"'):c.setExpression("height",
+'this.parentNode.offsetHeight + "px"');e?c.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):c.setExpression("width",'this.parentNode.offsetWidth + "px"');n&&c.setExpression("left",n);m&&c.setExpression("top",m)}else if(a.centerY){e&&c.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
+c.marginTop=0}else if(!a.centerY&&e){var f="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+(a.css&&a.css.top?parseInt(a.css.top):0)+') + "px"';c.setExpression("top",f)}})}c&&(a.theme?f.find(".ui-widget-content").append(c):f.append(c),(c.jquery||c.nodeType)&&b(c).show());(b.browser.msie||a.forceIframe)&&a.showOverlay&&k.show();if(a.fadeIn)g=a.onBlock?a.onBlock:q,k=a.showOverlay&&!c?g:q,g=c?g:q,a.showOverlay&&h._fadeIn(a.fadeIn,k),c&&f._fadeIn(a.fadeIn,
+g);else if(a.showOverlay&&h.show(),c&&f.show(),a.onBlock)a.onBlock();s(1,d,a);e?(j=f[0],l=b(":input:enabled:visible",j),a.focusInput&&setTimeout(t,20)):w(f[0],a.centerX,a.centerY);a.timeout&&(c=setTimeout(function(){e?b.unblockUI(a):b(d).unblock(a)},a.timeout),b(d).data("blockUI.timeout",c))}function p(d,a){var e=d==window,c=b(d),g=c.data("blockUI.history"),i=c.data("blockUI.timeout");i&&(clearTimeout(i),c.removeData("blockUI.timeout"));a=b.extend({},b.blockUI.defaults,a||{});s(0,d,a);null===a.onUnblock&&
+(a.onUnblock=c.data("blockUI.onUnblock"),c.removeData("blockUI.onUnblock"));var h;h=e?b("body").children().filter(".blockUI").add("body > .blockUI"):b(".blockUI",d);e&&(j=l=null);a.fadeOut?(h.fadeOut(a.fadeOut),setTimeout(function(){n(h,g,a,d)},a.fadeOut)):n(h,g,a,d)}function n(d,a,e,c){d.each(function(){this.parentNode&&this.parentNode.removeChild(this)});a&&a.el&&(a.el.style.display=a.display,a.el.style.position=a.position,a.parent&&a.parent.appendChild(a.el),b(c).removeData("blockUI.history"));
+if("function"==typeof e.onUnblock)e.onUnblock(c,e)}function s(d,a,e){var c=a==window,a=b(a);if(d||!(c&&!j||!c&&!a.data("blockUI.isBlocked")))c||a.data("blockUI.isBlocked",d),e.bindEvents&&(!d||e.showOverlay)&&(d?b(document).bind("mousedown mouseup keydown keypress",e,u):b(document).unbind("mousedown mouseup keydown keypress",u))}function u(d){if(d.keyCode&&9==d.keyCode&&j&&d.data.constrainTabKey){var a=l,e=d.shiftKey&&d.target===a[0];if(!d.shiftKey&&d.target===a[a.length-1]||e)return setTimeout(function(){t(e)},
+10),!1}a=d.data;return 0<b(d.target).parents("div."+a.blockMsgClass).length?!0:0==b(d.target).parents().children().filter("div.blockUI").length}function t(b){l&&(b=l[!0===b?l.length-1:0])&&b.focus()}function w(d,a,e){var c=d.parentNode,g=d.style,i=(c.offsetWidth-d.offsetWidth)/2-(parseInt(b.css(c,"borderLeftWidth"))||0),d=(c.offsetHeight-d.offsetHeight)/2-(parseInt(b.css(c,"borderTopWidth"))||0);a&&(g.left=0<i?i+"px":"0");e&&(g.top=0<d?d+"px":"0")}if(/1\.(0|1|2)\.(0|1|2)/.test(b.fn.jquery)||/^1.1/.test(b.fn.jquery))alert("blockUI requires jQuery v1.2.3 or later! You are using v"+
+b.fn.jquery);else{b.fn._fadeIn=b.fn.fadeIn;var q=function(){},o=document.documentMode||0,v=b.browser.msie&&(8>b.browser.version&&!o||8>o),r=b.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!o;b.blockUI=function(b){m(window,b)};b.unblockUI=function(b){p(window,b)};b.growlUI=function(d,a,e,c){var g=b('<div class="growlUI"></div>');d&&g.append("<h2>"+d+"</h2>");a&&g.append("<h4>"+a+"</h4>");void 0==e&&(e=3E3);b.blockUI({message:g,fadeIn:700,fadeOut:1E3,centerY:!1,timeout:e,showOverlay:!1,onUnblock:c,
+css:b.blockUI.defaults.growlCSS})};b.fn.block=function(d){return this.unblock({fadeOut:0}).each(function(){"static"==b.css(this,"position")&&(this.style.position="relative");b.browser.msie&&(this.style.zoom=1);m(this,d)})};b.fn.unblock=function(b){return this.each(function(){p(this,b)})};b.blockUI.version=2.39;b.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",
backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1E3,centerX:!0,centerY:!0,
allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,applyPlatformOpacityRules:!0,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var j=null,l=[]}})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.