pull/850/head
commit
e02f7c6b9f
@ -0,0 +1,24 @@ |
||||
app/assets/javascripts/raphael.js |
||||
app/assets/javascripts/raphael-min.js |
||||
app/assets/javascripts/date-de-DE.js |
||||
app/assets/javascripts/date-en-US.js |
||||
app/assets/javascripts/jstoolbar/**/* |
||||
app/assets/javascripts/jquery_noconflict.js |
||||
app/assets/javascripts/pages/**/* |
||||
app/assets/javascripts/project/**/* |
||||
app/assets/javascripts/jquery.menu_expand.js |
||||
app/assets/javascripts/jquery-ui-i18n.js |
||||
|
||||
#we sould fix this ones |
||||
app/assets/javascripts/select_list_move.js |
||||
app/assets/javascripts/context_menu.js |
||||
app/assets/javascripts/breadcrumb.js |
||||
app/assets/javascripts/keyboard_shortcuts.js |
||||
app/assets/javascripts/openproject.js |
||||
app/assets/javascripts/top-shelf.js |
||||
app/assets/javascripts/top_menu.js |
||||
app/assets/javascripts/findDomElement.js |
||||
app/assets/javascripts/application.js |
||||
app/assets/javascripts/action_menu.js |
||||
app/assets/javascripts/accessibility.js |
||||
app/assets/javascripts/repository_navigation.js |
@ -0,0 +1,100 @@ |
||||
module.exports = function(grunt) { |
||||
|
||||
var jsPath = "app/assets/javascripts/"; |
||||
var testSource = "mocha/index.html"; |
||||
// Project configuration.
|
||||
grunt.initConfig({ |
||||
pkg: grunt.file.readJSON('package.json'), |
||||
jshint: { |
||||
all: { |
||||
files: { |
||||
src: [jsPath] |
||||
} |
||||
} |
||||
}, |
||||
mocha_phantomjs: { |
||||
all: [testSource], |
||||
small: { |
||||
src:[testSource], |
||||
options: { |
||||
reporter: "dot" |
||||
} |
||||
}, |
||||
cov: { |
||||
src:[testSource], |
||||
options: { |
||||
output: "coverage.json", |
||||
reporter: "json-cov" |
||||
} |
||||
}, |
||||
jenkins: { |
||||
src:[testSource], |
||||
options: { |
||||
reporter: "XUnit" |
||||
} |
||||
} |
||||
}, |
||||
jscoverage: { |
||||
options: { |
||||
inputDirectory: 'app/assets/javascripts/', |
||||
outputDirectory: 'app/assets/javascripts_cov/' |
||||
} |
||||
}, |
||||
watch: { |
||||
scripts: { |
||||
files: [jsPath] , |
||||
tasks: ['jshint', 'mocha_phantomjs:small'], |
||||
options: { |
||||
spawn: false, |
||||
}, |
||||
}, |
||||
}, |
||||
}); |
||||
|
||||
grunt.loadNpmTasks("grunt-jscoverage"); |
||||
grunt.loadNpmTasks('grunt-contrib-jshint'); |
||||
grunt.loadNpmTasks('grunt-contrib-watch'); |
||||
grunt.loadNpmTasks('grunt-mocha-phantomjs'); |
||||
|
||||
// Default task(s).
|
||||
grunt.registerTask('default', ['jshint']); |
||||
|
||||
var tempPath = "app/assets/javascripts_temp/"; |
||||
var covPath = "app/assets/javascripts_cov/"; |
||||
|
||||
grunt.registerTask('moveFiles', 'switch directories for coverage-enabled files and normal files', function () { |
||||
var fs = require("fs"); |
||||
fs.renameSync(jsPath, tempPath); |
||||
fs.renameSync(covPath, jsPath); |
||||
|
||||
|
||||
fs.renameSync(tempPath + "date-en-US.js", jsPath + "date-en-US.js"); |
||||
}); |
||||
|
||||
grunt.registerTask('cleanUpCoverage', 'undo moveFiles', function () { |
||||
var done = this.async(); |
||||
|
||||
var fs = require("fs"); |
||||
if (fs.existsSync(tempPath)) { |
||||
fs.renameSync(jsPath, covPath); |
||||
fs.renameSync(tempPath, jsPath); |
||||
} |
||||
|
||||
if (fs.existsSync("coverage.json")) { |
||||
fs.unlinkSync("coverage.json"); |
||||
} |
||||
|
||||
rmdir = require("rimraf"); |
||||
rmdir(covPath, function (e) { |
||||
done(e); |
||||
}); |
||||
}); |
||||
|
||||
grunt.registerTask('jsonCov2Html', 'convert coverage to html', function () { |
||||
var exec = require("exec"); |
||||
exec("cat coverage.json | node_modules/json2htmlcov/bin/json2htmlcov > coverage.html"); |
||||
}); |
||||
|
||||
grunt.registerTask('coverage', ['jscoverage', 'moveFiles', 'mocha_phantomjs:cov', 'jsonCov2Html', 'cleanUpCoverage']); |
||||
|
||||
}; |
@ -0,0 +1,202 @@ |
||||
/*! |
||||
Copyright (c) 2011, 2012 Julien Wajsberg <felash@gmail.com> |
||||
All rights reserved. |
||||
|
||||
Official repository: https://github.com/julienw/jquery-trap-input
|
||||
License is there: https://github.com/julienw/jquery-trap-input/blob/master/LICENSE
|
||||
This is version 1.2.0. |
||||
*/ |
||||
|
||||
(function( $, undefined ){ |
||||
|
||||
/* |
||||
(this comment is after the first line of code so that uglifyjs removes it) |
||||
|
||||
Redistribution and use in source and binary forms, with or without |
||||
modification, are permitted without condition. |
||||
|
||||
Although that's not an obligation, I would appreciate that you provide a |
||||
link to the official repository. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS |
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED. |
||||
*/ |
||||
|
||||
/*jshint boss: true, bitwise: true, curly: true, expr: true, newcap: true, noarg: true, nonew: true, latedef: true, regexdash: true */ |
||||
|
||||
var DATA_ISTRAPPING_KEY = "trap.isTrapping"; |
||||
|
||||
function onkeypress(e) { |
||||
if (e.keyCode === 9) { |
||||
var goReverse = !!(e.shiftKey); |
||||
if (processTab(this, e.target, goReverse)) { |
||||
e.preventDefault(); |
||||
e.stopPropagation(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
// will return true if we could process the tab event
|
||||
// otherwise, return false
|
||||
function processTab(container, elt, goReverse) { |
||||
var $focussable = getFocusableElementsInContainer(container), |
||||
curElt = elt, |
||||
index, nextIndex, prevIndex, lastIndex; |
||||
|
||||
do { |
||||
|
||||
index = $focussable.index(curElt); |
||||
nextIndex = index + 1; |
||||
prevIndex = index - 1; |
||||
lastIndex = $focussable.length - 1; |
||||
|
||||
switch(index) { |
||||
case -1: |
||||
return false; // that's strange, let the browser do its job
|
||||
case 0: |
||||
prevIndex = lastIndex; |
||||
break; |
||||
case lastIndex: |
||||
nextIndex = 0; |
||||
break; |
||||
} |
||||
|
||||
if (goReverse) { |
||||
nextIndex = prevIndex; |
||||
} |
||||
|
||||
curElt = $focussable.get(nextIndex); |
||||
// IE sometimes throws when an element is not visible
|
||||
try { |
||||
curElt.focus(); |
||||
} catch(e) { |
||||
} |
||||
|
||||
} while (elt === elt.ownerDocument.activeElement); |
||||
|
||||
return true;
|
||||
} |
||||
|
||||
function filterKeepSpeciallyFocusable() { |
||||
return this.tabIndex > 0; |
||||
} |
||||
|
||||
function filterKeepNormalElements() { |
||||
return !this.tabIndex; // true if no tabIndex or tabIndex == 0
|
||||
} |
||||
|
||||
function sortFocusable(a, b) { |
||||
return (a.t - b.t) || (a.i - b.i); |
||||
} |
||||
|
||||
function getFocusableElementsInContainer(container) { |
||||
var $container = $(container); |
||||
var result = [], |
||||
cnt = 0; |
||||
|
||||
fixIndexSelector.enable && fixIndexSelector.enable(); |
||||
|
||||
// leaving away command and details for now
|
||||
$container.find("a[href], link[href], [draggable=true], [contenteditable=true], :input:enabled, [tabindex=0]") |
||||
.filter(":visible") |
||||
.filter(filterKeepNormalElements) |
||||
.each(function(i, val) { |
||||
result.push({ |
||||
v: val, // value
|
||||
t: 0, // tabIndex
|
||||
i: cnt++ // index for stable sort
|
||||
}); |
||||
}); |
||||
|
||||
$container |
||||
.find("[tabindex]") |
||||
.filter(":visible") |
||||
.filter(filterKeepSpeciallyFocusable) |
||||
.each(function(i, val) { |
||||
result.push({ |
||||
v: val, // value
|
||||
t: val.tabIndex, // tabIndex
|
||||
i: cnt++ // index
|
||||
}); |
||||
}); |
||||
|
||||
fixIndexSelector.disable && fixIndexSelector.disable(); |
||||
|
||||
result = $.map(result.sort(sortFocusable), // needs stable sort
|
||||
function(val) { |
||||
return val.v; |
||||
} |
||||
); |
||||
|
||||
|
||||
return $(result); |
||||
|
||||
} |
||||
|
||||
function trap() { |
||||
this.keydown(onkeypress); |
||||
this.data(DATA_ISTRAPPING_KEY, true); |
||||
return this; |
||||
} |
||||
|
||||
function untrap() { |
||||
this.unbind('keydown', onkeypress); |
||||
this.removeData(DATA_ISTRAPPING_KEY); |
||||
return this; |
||||
} |
||||
|
||||
function isTrapping() { |
||||
return !!this.data(DATA_ISTRAPPING_KEY); |
||||
} |
||||
|
||||
$.fn.extend({ |
||||
trap: trap, |
||||
untrap: untrap, |
||||
isTrapping: isTrapping |
||||
}); |
||||
|
||||
// jQuery 1.6.x tabindex attr hooks management
|
||||
// this triggers problems for tabindex attribute
|
||||
// selectors in IE7-
|
||||
// see https://github.com/julienw/jquery-trap-input/issues/3
|
||||
|
||||
var fixIndexSelector = {}; |
||||
|
||||
if ($.find.find && $.find.attr !== $.attr) { |
||||
// jQuery uses Sizzle (this is jQuery >= 1.3)
|
||||
// sizzle uses its own attribute handling (in jq 1.6.x and below)
|
||||
(function() { |
||||
var tabindexKey = "tabindex"; |
||||
var sizzleAttrHandle = $.expr.attrHandle; |
||||
|
||||
// this function comes directly from jQuery 1.7.2 (propHooks.tabIndex.get)
|
||||
// we have to put it here if we want to support jQuery < 1.6 which
|
||||
// doesn't have an attrHooks object to reference.
|
||||
function getTabindexAttr(elem) { |
||||
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
|
||||
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
||||
var attributeNode = elem.getAttributeNode(tabindexKey); |
||||
|
||||
return attributeNode && attributeNode.specified ? |
||||
parseInt( attributeNode.value, 10 ) : |
||||
undefined; |
||||
} |
||||
|
||||
function fixSizzleAttrHook() { |
||||
// in jQ <= 1.6.x, we add to Sizzle the attrHook from jQuery's attr method
|
||||
sizzleAttrHandle[tabindexKey] = sizzleAttrHandle.tabIndex = getTabindexAttr; |
||||
} |
||||
|
||||
function unfixSizzleAttrHook() { |
||||
delete sizzleAttrHandle[tabindexKey]; |
||||
delete sizzleAttrHandle.tabIndex; |
||||
} |
||||
|
||||
|
||||
fixIndexSelector = { |
||||
enable: fixSizzleAttrHook, |
||||
disable: unfixSizzleAttrHook |
||||
}; |
||||
})(); |
||||
} |
||||
})( jQuery ); |
@ -0,0 +1,143 @@ |
||||
//-- copyright
|
||||
// OpenProject is a project management system.
|
||||
// Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License version 3.
|
||||
//
|
||||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
// Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
// Copyright (C) 2010-2013 the ChiliProject Team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
// See doc/COPYRIGHT.rdoc for more details.
|
||||
//++
|
||||
|
||||
(function($) { |
||||
var TypesCheckboxes = function () { |
||||
this.init(); |
||||
}; |
||||
|
||||
TypesCheckboxes.prototype = $.extend(TypesCheckboxes.prototype, { |
||||
init: function () { |
||||
this.append_checkbox_listeners(); |
||||
this.append_check_uncheck_all_listeners(); |
||||
if (this.everything_unchecked()) { |
||||
this.check_and_disable_standard_type(); |
||||
} |
||||
}, |
||||
|
||||
append_checkbox_listeners: function () { |
||||
var self = this; |
||||
this.all_checkboxes().on("change", function () { |
||||
if (self.everything_unchecked()) { |
||||
self.check_and_disable_standard_type(); |
||||
self.display_explanation(); |
||||
} else { |
||||
self.hide_explanation(); |
||||
self.enable_standard_type(); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
append_check_uncheck_all_listeners: function () { |
||||
var self = this; |
||||
$("#project_types #check_all_types").click(function (event) { |
||||
self.enable_all_checkboxes(); |
||||
self.check(self.all_checkboxes()); |
||||
self.hide_explanation(); |
||||
event.preventDefault(); |
||||
}); |
||||
$("#project_types #uncheck_all_types").click(function (event) { |
||||
self.enable_all_checkboxes(); |
||||
self.uncheck(self.all_except_standard()); |
||||
self.check_and_disable_standard_type(); |
||||
self.display_explanation(); |
||||
event.preventDefault(); |
||||
}); |
||||
}, |
||||
|
||||
everything_unchecked: function () { |
||||
return !(this.all_except_standard().filter(":checked").length > 0); |
||||
}, |
||||
|
||||
check_and_disable_standard_type: function () { |
||||
var standard = this.standard_check_boxes(); |
||||
this.check($(standard)); |
||||
this.disable($(standard)); |
||||
}, |
||||
|
||||
enable_standard_type: function () { |
||||
this.enable(this.standard_check_boxes()); |
||||
}, |
||||
|
||||
enable_all_checkboxes: function () { |
||||
this.enable(this.all_checkboxes()) |
||||
}, |
||||
|
||||
check: function (boxes) { |
||||
$(boxes).prop("checked", true); |
||||
}, |
||||
|
||||
uncheck: function (boxes) { |
||||
$(boxes).prop("checked", false); |
||||
}, |
||||
|
||||
disable: function (boxes) { |
||||
var self = this; |
||||
$(boxes).prop('disabled', true); |
||||
$(boxes).each(function (ix, item) { |
||||
self.hidden_type_field($(item)).prop("value", $(item).prop("value")); |
||||
}); |
||||
}, |
||||
|
||||
enable: function (boxes) { |
||||
var self = this; |
||||
$(boxes).prop('disabled', false); |
||||
$(boxes).each(function (ix, item) { |
||||
self.hidden_type_field($(item)).prop("value", ""); |
||||
}); |
||||
}, |
||||
|
||||
display_explanation: function () { |
||||
$("#types_flash_notice").show(); |
||||
}, |
||||
|
||||
hide_explanation: function () { |
||||
$("#types_flash_notice").hide(); |
||||
}, |
||||
|
||||
all_checkboxes: function () { |
||||
return $(".types :input[type='checkbox']"); |
||||
}, |
||||
|
||||
all_except_standard: function () { |
||||
return $(".types :input[type='checkbox'][data-standard='false']"); |
||||
}, |
||||
|
||||
standard_check_boxes: function () { |
||||
return $(".types :input[type='checkbox'][data-standard='true']"); |
||||
}, |
||||
|
||||
hidden_type_field: function (for_box) { |
||||
return $(".types :input[type='hidden'][data-for='" + $(for_box).prop("id") + "']"); |
||||
} |
||||
}); |
||||
|
||||
$('document').ready(function () { |
||||
new TypesCheckboxes(); |
||||
}); |
||||
})(jQuery); |
@ -0,0 +1,52 @@ |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
# resolves either a given status (show) or returns a list of available statuses |
||||
# if the controller is called nested inside a project, it returns only the |
||||
# statuses that can be reached by the workflows of the project |
||||
module Api |
||||
module V2 |
||||
class WorkPackagePrioritiesController < ApplicationController |
||||
include PaginationHelper |
||||
|
||||
include ::Api::V2::ApiController |
||||
|
||||
unloadable |
||||
|
||||
accept_key_auth :index |
||||
|
||||
def index |
||||
@priorities = IssuePriority.all |
||||
|
||||
respond_to do |format| |
||||
format.api |
||||
end |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,32 @@ |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
collection @priorities => :work_package_priorities |
||||
attributes :id, |
||||
:name, |
||||
:position, |
||||
:is_default |
@ -0,0 +1,61 @@ |
||||
<%#-- copyright |
||||
OpenProject is a project management system. |
||||
Copyright (C) 2012-2013 the OpenProject Foundation (OPF) |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License version 3. |
||||
|
||||
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
Copyright (C) 2006-2013 Jean-Philippe Lang |
||||
Copyright (C) 2010-2013 the ChiliProject Team |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program; if not, write to the Free Software |
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
See doc/COPYRIGHT.rdoc for more details. |
||||
|
||||
++#%> |
||||
|
||||
<% responsible = WorkPackage.visible.open.find(:all, |
||||
:conditions => {:responsible_id => User.current.id}, |
||||
:limit => 10, |
||||
:include => [ :status, :project, :type, :priority ], |
||||
:order => "#{IssuePriority.table_name}.position DESC, #{WorkPackage.table_name}.updated_at DESC") %> |
||||
|
||||
<% responsible_count = WorkPackage.visible.open.count(:conditions => { |
||||
:responsible_id => User.current.id |
||||
}) %> |
||||
|
||||
<h3><%=l(:label_responsible_for_work_packages)%> (<%= responsible_count %>)</h3> |
||||
|
||||
<%= render :partial => 'work_packages/list_simple', :locals => { :work_packages => responsible } %> |
||||
|
||||
<% if responsible.length > 0 %> |
||||
<p class="small"> |
||||
<%= link_to l(:label_work_package_view_all_responsible_for), |
||||
{controller: :work_packages, |
||||
action: :index, |
||||
set_filter: 1, |
||||
responsible_id: 'me', |
||||
sort: 'priority:desc,updated_at:desc'}, |
||||
:class => 'button' %> |
||||
</p> |
||||
<% end %> |
||||
|
||||
<% content_for :header_tags do %> |
||||
<%= auto_discovery_link_tag(:atom, |
||||
{controller: :work_packages, action: :index, set_filter: 1, |
||||
responsible_id: 'me', format: 'atom', key: User.current.rss_key}, |
||||
{title: l(:label_responsible_for_work_packages)}) %> |
||||
<% end %> |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue