Skip to content
Permalink
Browse files
Merge branch 'JENKINS-31162' of https://github.com/recena/jenkins int…
…o JENKINS-31162
  • Loading branch information
recena committed Mar 23, 2016
2 parents e3b11ae + 03a3528 commit 323efb144e8ca930cc7ecc74d7781553b0741359
Showing 6 changed files with 41 additions and 38 deletions.
@@ -32,7 +32,7 @@ THE SOFTWARE.
<l:layout norefresh="true" cssclass="add-item" permission="${permission}" title="${%NewJob(it.newPronoun)}">

<l:js src="jsbundles/add-item.js" />
<l:css src="jsbundles/config-scrollspy.css" />
<l:css src="jsbundles/add-item.css" />

<st:include page="sidepanel.jelly" />
<l:main-panel>
@@ -42,5 +42,5 @@ builder.bundle('src/main/js/config-scrollspy.js')

builder.bundle('src/main/js/add-item.js')
.withExternalModuleMapping('jquery-detached', 'core-assets/jquery-detached:jquery2')
.less('src/main/js/widgets/config-scrollspy.less')
.less('src/main/js/add-item.less')
.inDir('src/main/webapp/jsbundles');
@@ -48,11 +48,11 @@ $.when(getItems()).done(function(data){

checkFormReady();

$subBtn.on('click',function(e){
var $this = $(this).addClass('yui-button-disabled yui-submit-button-disabled')
$subBtn.on('click',function() {
$(this).addClass('yui-button-disabled yui-submit-button-disabled')
.find('button')
.attr('disabled','disabled')
.text('. . .')
.text('. . .');
});

}
@@ -144,7 +144,9 @@ $.when(getItems()).done(function(data){
return newData;
}
function checkForLink(desc){
if(desc.indexOf('&lt;a href="') === -1) return false;
if(desc.indexOf('&lt;a href="') === -1) {
return false;
}
var newDesc = desc.replace(/\&lt;/g,'<').replace(/\&gt;/g,'>');
return newDesc;
}
@@ -157,13 +159,6 @@ $.when(getItems()).done(function(data){
return itemTypes.sort(sortByOrder);
}

function hideAllTabsIfUnnecesary(sectionsToShow){
if(sectionsToShow.length < 2){
$tabs.find('.tab').hide();
$categories.find('.category-header').hide();
}
}

function checkCatCount(elem){
var minToShow = (typeof elem.minToShow === 'number')? elem.minToShow : defaultMinToShow;
var showIt = ($.isArray(elem.items) && elem.items.length >= minToShow);
@@ -273,7 +268,9 @@ $.when(getItems()).done(function(data){

function drawCategory(i,elem){
// categories are smart, so this is a little tricky....
if (!elem) elem = i;
if (!elem) {
elem = i;
}
var $category = $('<div/>').addClass('category jenkins-config hide-cat').attr('id', 'j-add-item-type-'+cleanClassName(elem.id));
var $items = $('<ul/>').addClass('j-item-options').appendTo($category);

@@ -313,7 +310,7 @@ $.when(getItems()).done(function(data){
}

var $this = $(this).closest('li');
var $radios = $this.closest('.categories').find('input[type="radio"][name="mode"]').removeAttr('checked');
$this.closest('.categories').find('input[type="radio"][name="mode"]').removeAttr('checked');
//if this is a hyperlink, don't move the selection.
if($this.find('a:focus').length === 1) {return false;}
$this.closest('.categories').find('.active').removeClass('active');
@@ -336,7 +333,6 @@ $.when(getItems()).done(function(data){
var $icn = $('<div class="icn">');
if (!elem.iconFilePathPattern) {
var colors = ['c-49728B','c-335061','c-D33833','c-6D6B6D','c-DCD9D8','other'];
var id = elem.class;
var desc = elem.description || '';
var name = elem.displayName;
var colorClass= colors[(desc.length) % 6];
@@ -345,15 +341,15 @@ $.when(getItems()).done(function(data){
var b = ((aName.length === 1)?
name.substring(1,2):
aName[1].substring(0,1));
var $defIcon = $([
$([
'<span class="dfIcn"><span class="a">',a,'</span><span class="b">',b,'</span></span>'
].join(''))
.appendTo($icn);
return $icn.addClass('df').addClass(colorClass);
}

var iconFilePath = jRoot + '/' + elem.iconFilePathPattern.replace(":size", "48x48");
var iconDom = $(['<span class="img" style="background:url(', iconFilePath, ')"></span>'].join(''))
$(['<span class="img" style="background:url(', iconFilePath, ')"></span>'].join(''))
.appendTo($icn);

return $icn;
@@ -0,0 +1,27 @@
@import "widgets/variables";

/*
* Mixins
* http://lesscss.org/features/#mixins-feature
*/
@import "widgets/layout-mixins";

/*
* Widget styles
*/
@import "widgets/config/tabbar";
@import "widgets/add/addform";

/*
* ----------------------------------------------------------------------------------------
* Add Item specific styles.
* ----------------------------------------------------------------------------------------
*/

.jenkins-config-widgets {
.find-container {
.find {
display: none;
}
}
}
@@ -11,8 +11,6 @@
* Widget styles
*/
@import "widgets/config/tabbar";
@import "widgets/add/addform";


/*
* ----------------------------------------------------------------------------------------

This file was deleted.

0 comments on commit 323efb1

Please sign in to comment.