Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean head tags, change doctype to html5 and merge inlinejs.php with pp-ui-behavior.js #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 40 additions & 75 deletions javascript/pp-ui-behavior.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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});
}
}
128 changes: 128 additions & 0 deletions layouts/account.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?php $owner_company_name = clean(owner_company()->getName()); ?>
<?php $site_name = config_option('site_name', $owner_company_name); ?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo get_page_title(); ?> | <?php echo $site_name; ?></title>

<?php echo meta_tag('content-type', 'text/html; charset=utf-8', true); ?>
<?php echo render_page_meta(); ?>

<?php echo link_tag(ROOT_URL.'favicon.ico', 'rel', 'shortcut icon', array("type"=>"image/x-icon")); ?>
<?php echo link_tag(ROOT_URL.'favicon.ico', 'rel', 'icon', array("type"=>"image/x-icon")); ?>
<?php echo link_tag(logged_user()->getRecentActivitiesFeedUrl(), 'rel', 'alternate', array("type"=>"application/rss+xml", "title"=>lang('recent activities feed'))); ?>
<?php echo render_page_links(); ?>

<?php echo stylesheet_tag('project_website.css'); ?>
<?php echo stylesheet_tag('colorbox/colorbox.css'); ?>
<?php echo render_page_inline_css(); ?>

<?php echo javascript_tag('pp.js'); ?>
<?php echo javascript_tag('jquery.min.js'); ?>
<?php echo javascript_tag('jquery-ui.min.js'); ?>
<?php include('inlinejs.php'); ?>
<?php echo javascript_tag('jquery.colorbox-min.js'); ?>
<?php echo javascript_tag('jquery.imgareaselect.dev.js'); ?>
<?php echo javascript_tag('pp-ui-behavior.js'); ?>
<?php echo render_page_javascript(); ?>
<?php echo render_page_inline_js(); ?>
</head>
<body>
<?php echo render_system_notices(logged_user()); ?>
<div id="wrapper">

<!-- header -->
<div id="headerWrapper">
<div id="header">
<h1><a href="<?php echo get_url('dashboard', 'index') ?>"><?php echo $site_name ?></a> | <a href="<?php echo get_url('account', 'index') ?>"><?php echo lang('my account') ?></a></h1>
<div id="userboxWrapper"><?php echo render_user_box(logged_user()) ?></div>
</div>
</div>
<!-- /header -->

<div id="tabsWrapper">
<div id="tabs">
<?php if (is_array(tabbed_navigation_items())) { ?>
<ul>
<?php foreach (tabbed_navigation_items() as $tabbed_navigation_item) { ?>
<li id="tabbed_navigation_item_<?php echo $tabbed_navigation_item->getID() ?>" <?php if ($tabbed_navigation_item->getSelected()) { ?> class="active" <?php } ?>><a href="<?php echo $tabbed_navigation_item->getUrl() ?>"><?php echo clean($tabbed_navigation_item->getTitle()) ?></a></li>
<?php } // foreach ?>
</ul>
<?php } // if ?>
</div>
</div>

<div id="crumbsWrapper">
<div id="crumbsBlock">
<div id="crumbs">
<?php if (is_array(bread_crumbs())) { ?>
<ul>
<?php foreach (bread_crumbs() as $bread_crumb) { ?>
<?php if ($bread_crumb->getUrl()) { ?>
<li><a href="<?php echo $bread_crumb->getUrl() ?>"><?php echo clean($bread_crumb->getTitle()) ?></a></li>
<?php } else {?>
<li><span><?php echo clean($bread_crumb->getTitle()) ?></span></li>
<?php } // if {?>
<?php } // foreach ?>
</ul>
<?php } // if ?>
</div>
</div>
</div>

<!-- content wrapper -->
<div id="outerContentWrapper">
<?php if (is_array(page_actions())) { ?>
<div id="page_actionsWrapper">
<div id="page_actionsBlock">
<div id="page_actions">
<ul>
<?php foreach (page_actions() as $page_action) { ?>
<li><a href="<?php echo $page_action->getURL() ?>"><?php echo clean($page_action->getTitle()) ?></a></li>
<?php } // foreach ?>
</ul>
</div>
</div>
</div>
<?php } else { // if ?>
<div style="height:1px"></div>
<?php } // if ?>
<div id="innerContentWrapper">
<?php if (!is_null(flash_get('success'))) { ?>
<div id="success"><?php echo clean(flash_get('success')) ?></div>
<?php } ?>
<?php if (!is_null(flash_get('error'))) { ?>
<div id="error"><?php echo clean(flash_get('error')) ?></div>
<?php } ?>

<h1 id="pageTitle"><?php echo get_page_title() ?></h1>
<div id="pageContent">
<div id="content">
<!-- Content -->
<?php echo $content_for_layout ?>
<!-- /Content -->
</div>
<?php if (isset($content_for_sidebar)) { ?>
<div id="sidebar"><?php echo $content_for_sidebar ?></div>
<?php } // if ?>
<div class="clear"></div>
</div>
</div>

<!--Footer -->
<div id="footer">
<div id="copy">
<?php if (is_valid_url($owner_company_homepage = owner_company()->getHomepage())) { ?>
<?php echo lang('footer copy with homepage', date('Y'), $owner_company_homepage, clean(owner_company()->getName())) ?>
<?php } else { ?>
<?php echo lang('footer copy without homepage', date('Y'), clean(owner_company()->getName())) ?>
<?php } // if ?>
</div>
<div id="productSignature"><?php echo product_signature() ?><span id="request_duration"><?php printf(' in %.3f seconds', (microtime(true) - $GLOBALS['request_start_time']) ); ?></span> <span id="current_datetime"><?php echo date('c [W]'); ?></span></div>
</div>
</div>
<!-- /content wrapper -->

</div>
</body>
</html>
50 changes: 30 additions & 20 deletions layouts/administration.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
<?php $owner_company_name = (owner_company()->getName()) ?>
<?php $site_name = config_option('site_name', $owner_company_name) ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo get_page_title() ?> | <?php echo clean(owner_company()->getName()) ?></title>
<?php echo stylesheet_tag('project_website.css') ?>
<?php echo stylesheet_tag('colorbox/colorbox.css') ?>
<?php echo meta_tag('content-type', 'text/html; charset=utf-8', true) ?>
<?php echo link_tag(ROOT_URL.'favicon.ico', 'rel', 'Shortcut Icon', array("type"=>"image/x-icon")) ?>
<?php add_javascript_to_page('pp.js') ?>
<?php add_javascript_to_page('jquery.min.js') ?>
<?php add_javascript_to_page('jquery-ui.min.js') ?>
<?php add_javascript_to_page('jquery.colorbox-min.js') ?>
<?php add_javascript_to_page('jquery.imgareaselect.dev.js') ?>
<?php echo render_page_head() ?>
</head>
<body>
<?php include('inlinejs.php'); ?>
<?php echo render_system_notices(logged_user()) ?>
<?php $owner_company_name = clean(owner_company()->getName()); ?>
<?php $site_name = config_option('site_name', $owner_company_name); ?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo get_page_title(); ?> | <?php echo $site_name; ?></title>

<?php echo meta_tag('content-type', 'text/html; charset=utf-8', true); ?>
<?php echo render_page_meta(); ?>

<?php echo link_tag(ROOT_URL.'favicon.ico', 'rel', 'shortcut icon', array("type"=>"image/x-icon")); ?>
<?php echo link_tag(ROOT_URL.'favicon.ico', 'rel', 'icon', array("type"=>"image/x-icon")); ?>
<?php echo render_page_links(); ?>

<?php echo stylesheet_tag('project_website.css'); ?>
<?php echo stylesheet_tag('colorbox/colorbox.css'); ?>
<?php echo render_page_inline_css(); ?>

<?php echo javascript_tag('pp.js'); ?>
<?php echo javascript_tag('jquery.min.js'); ?>
<?php echo javascript_tag('jquery-ui.min.js'); ?>
<?php include('inlinejs.php'); ?>
<?php echo javascript_tag('jquery.colorbox-min.js'); ?>
<?php echo javascript_tag('jquery.imgareaselect.dev.js'); ?>
<?php echo javascript_tag('pp-ui-behavior.js'); ?>
<?php echo render_page_javascript(); ?>
<?php echo render_page_inline_js(); ?>
</head>
<body>
<?php echo render_system_notices(logged_user()); ?>
<div id="wrapper">

<!-- header -->
Expand Down
Loading