From b35e127d61f351752f290ad7c2bd669564d43aa4 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 13 Nov 2011 15:29:20 +0100 Subject: [PATCH] Clean heads, change Doctype to HTML5, change inlinejs.php to only specify internationalised or url-based properties, use scripts from pp-ui-behavior.js --- javascript/pp-ui-behavior.js | 115 +++++++++++-------------------- layouts/account.php | 128 +++++++++++++++++++++++++++++++++++ layouts/administration.php | 50 ++++++++------ layouts/dashboard.php | 128 +++++++++++++++++++++++++++++++++++ layouts/inlinejs.php | 9 +++ layouts/project_website.php | 58 ++++++++-------- 6 files changed, 366 insertions(+), 122 deletions(-) create mode 100644 layouts/account.php create mode 100644 layouts/dashboard.php create mode 100644 layouts/inlinejs.php diff --git a/javascript/pp-ui-behavior.js b/javascript/pp-ui-behavior.js index e084ab4..8e45605 100644 --- a/javascript/pp-ui-behavior.js +++ b/javascript/pp-ui-behavior.js @@ -1,4 +1,20 @@ -$(function() { +var dragover = false; + +function expand_or_collapse(obj,match_class,speedshow,speedhide){ + var children = $(obj).children(); + for(var i = 0; i < children.length; i++){ + if($(children[i]).hasClass(match_class)){ + if ($(children[i]).css("display") == 'none'){ + $(children[i]).slideDown(speedshow); + } else { + $(children[i]).slideUp(speedhide); + } + //break; + } + } +} + +$(function(){ $('.selectall').click(function() { var checked_status = this.checked; @@ -9,111 +25,60 @@ $(function() { }); $('input.datepicker').datepicker({ - dateFormat: 'M j, Y', + dateFormat: i18n.dateFormat, showOn: 'button', - buttonImage: '/Project-Pier/public/assets/themes/kampPro2/images/icons/calendar.png', buttonImageOnly: true, constrainInput: false }); - $( 'a.add-to-task-list' ).click( function() { - $( this ).next().slideToggle(); + $('a.add-to-task-list').click(function() { + $(this).next().slideToggle(); return false; - } ); - -}); - -var dragover = false; -expand_or_collapse = function(obj,match_class,speedshow,speedhide){ - var children = $(obj).children(); - for(var i = 0; i < children.length; i++){ - if($(children[i]).hasClass(match_class)){ - if ($(children[i]).css("display") == 'none'){ - $(children[i]).show(speedshow); - } else { - $(children[i]).hide(speedhide); - } - //break; - } - } -} + }); -$(function() { $(".block .header").click( - function(e){ + $(".block .header").click(function(e) { expand_or_collapse($(this).parent(),'content','fast','fast'); e.stopPropagation(); }); -}); -$(function() { $(".block .complete").click( - function(){ + $(".block .complete").click(function() { expand_or_collapse(this,'content','fast','slow'); }); -}); -$(function(){ setTimeout(function(){ - s = $("#success"); - if (s.css("display") != 'none'){ + var s = $("#success"); + if (s.css("display") != 'none') { $("#success").fadeTo("slow", 0.25, function () { - $("#success").hide(1000); - }); + $("#success").hide(1000); + }); } }, 5000); -}); -$(function(){ - $("#success").click(function () { - $("#success").hide(1000); + $("#success, #error, #formErrors").click(function () { + $(this).hide(1000); }); -}); -$(function(){ - $("#error").click(function () { - $("#error").hide(1000); - }); -}); -$(function(){ - $("#formErrors").click(function () { - $("#formErrors").hide(1000); - }); -}); - -$(function(){ - $(".block a").click(function(e) { + $(".block a, .block .checkbox").click(function(e) { e.stopPropagation(); }); -}); -$(function(){ - $(".block .checkbox").click(function(e) { - e.stopPropagation(); - }); -}); - -$(function(){ + // Colorbox $("a[rel='gallery'][href*='mime=image']").colorbox({photo:true}); -}); - -$(function(){ $("a[rel='gallery']").not(["href*='mime=image'"]).colorbox({width:"80%", height:"80%", iframe:true}); -}); - -$(function(){ $("textarea .autosize").each(function(index){ - $(this).css({'resize':'vertical','overflow-y':'hidden'}); - var p = $(this).parent('div'); - if (p) { - $(this).css({'width':p.css('width')}); - } - }); + $(this).css({'resize':'vertical','overflow-y':'hidden'}); + var p = $(this).parent('div'); + if (p) { + $(this).css({'width':p.css('width')}); + } + }); }); -post = function(url, d){ - postdata = 'data=' + d; +function post (url, d){ + var postdata = 'data=' + d; //ajax call html for action $.ajaxSetup({url:url,global:false,async:false,type:"POST"}); $.ajax({data: postdata}); -} +} \ No newline at end of file diff --git a/layouts/account.php b/layouts/account.php new file mode 100644 index 0000000..675575d --- /dev/null +++ b/layouts/account.php @@ -0,0 +1,128 @@ +getName()); ?> + + + + + <?php echo get_page_title(); ?> | <?php echo $site_name; ?> + + + + + "image/x-icon")); ?> + "image/x-icon")); ?> + getRecentActivitiesFeedUrl(), 'rel', 'alternate', array("type"=>"application/rss+xml", "title"=>lang('recent activities feed'))); ?> + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ + +
+
+ + + +
+
+ +
+
+
+ + + +
+
+
+ + +
+ +
+
+
+ +
+
+
+ +
+ +
+ +
+ + +
+ + +

+
+
+ + + +
+ + + +
+
+
+ + + +
+ + +
+ + \ No newline at end of file diff --git a/layouts/administration.php b/layouts/administration.php index 69b0640..c6031d7 100644 --- a/layouts/administration.php +++ b/layouts/administration.php @@ -1,23 +1,33 @@ -getName()) ?> - - - - - <?php echo get_page_title() ?> | <?php echo clean(owner_company()->getName()) ?> - - - -"image/x-icon")) ?> - - - - - - - - - - +getName()); ?> + + + + + <?php echo get_page_title(); ?> | <?php echo $site_name; ?> + + + + + "image/x-icon")); ?> + "image/x-icon")); ?> + + + + + + + + + + + + + + + + + +
diff --git a/layouts/dashboard.php b/layouts/dashboard.php new file mode 100644 index 0000000..9940d34 --- /dev/null +++ b/layouts/dashboard.php @@ -0,0 +1,128 @@ +getName()); ?> + + + + + <?php echo get_page_title(); ?> | <?php echo $site_name; ?> + + + + + + "image/x-icon")); ?> + "image/x-icon")); ?> + getRecentActivitiesFeedUrl(), 'rel', 'alternate', array("type"=>"application/rss+xml", "title"=>lang('recent activities feed'))); ?> + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ +
+
+ + + +
+
+ +
+
+
+ + + +
+
+
+ + +
+ +
+
+
+ +
+
+
+ +
+ +
+ +
+ + +
+ +
+

+
+
+ + + +
+ + + +
+
+
+ + + + +
+ +
+ + \ No newline at end of file diff --git a/layouts/inlinejs.php b/layouts/inlinejs.php new file mode 100644 index 0000000..13007dc --- /dev/null +++ b/layouts/inlinejs.php @@ -0,0 +1,9 @@ + - - - - <?php echo get_page_title() ?> | - <?php if (active_project() instanceof Project) echo clean(active_project()->getName()); ?> - | <?php echo clean(owner_company()->getName()) ?> - - - - - - - - "image/x-icon")) ?> - getRecentActivitiesFeedUrl(), 'rel', 'alternate', array("type"=>"application/rss+xml", "title"=>lang('recent activities feed'))) ?> - +getName()); ?> + + + + + <?php echo get_page_title(); ?> | <?php if (active_project() instanceof Project) echo clean(active_project()->getName()); ?> | <?php echo $site_name; ?> - - + + + + + "image/x-icon")); ?> + "image/x-icon")); ?> + getRecentActivitiesFeedUrl(), 'rel', 'alternate', array("type"=>"application/rss+xml", "title"=>lang('recent activities feed'))); ?> + + + + + + + + + + + + + + + + + - +