Skip to content

Commit d4dd191

Browse files
committed
Fixed bug introduced when cleaning code
1 parent 5d9df00 commit d4dd191

File tree

6 files changed

+166
-5
lines changed

6 files changed

+166
-5
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
1.3.1
2+
=====
3+
4+
* Fixed bug introduced when cleaning code
5+
16
1.3.0
27
=====
38

Gruntfile.js

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
module.exports = function (grunt) {
2+
require('load-grunt-tasks')(grunt);
3+
require('time-grunt')(grunt);
4+
require('grunt-karma')(grunt);
5+
6+
//cant load this with require
7+
grunt.loadNpmTasks('grunt-contrib-jshint');
8+
9+
if (grunt.option('target') && !grunt.file.isDir(grunt.option('target'))) {
10+
grunt.fail.warn('The --target option specified is not a valid directory');
11+
}
12+
13+
grunt.initConfig({
14+
pkg: grunt.file.readJSON('package.json'),
15+
dest: grunt.option('target') || 'dist',
16+
basePath: 'src/RJP.MultiUrlPicker/App_Plugins/RJP.MultiUrlPicker',
17+
18+
watch: {
19+
options: {
20+
atBegin: true
21+
},
22+
23+
testControllers: {
24+
files: [
25+
'<%= basePath %>/**/*.js',
26+
'src/RJP.MultiUrlPicker/test/specs/**/*.spec.js'
27+
],
28+
tasks: ['jshint', 'test']
29+
},
30+
},
31+
32+
copy: {
33+
nuget: {
34+
expand: true,
35+
cwd: '<%= basePath %>',
36+
src: '<%= basePath %>',
37+
dest: 'tmp/nuget/content/'
38+
},
39+
40+
umbraco: {
41+
expand: true,
42+
cwd: '<%= basePath %>/',
43+
src: '<%= basePath %>',
44+
dest: 'tmp/umbraco/'
45+
},
46+
47+
testAssets: {
48+
expand: true,
49+
cwd: '<%= dest %>',
50+
src: ['js/umbraco.*.js', 'lib/**/*.js'],
51+
dest: 'src/RJP.MultiUrlPicker/test/assets/'
52+
}
53+
},
54+
55+
template: {
56+
nuspec: {
57+
options: {
58+
data: {
59+
name: '<%= pkg.name %>',
60+
version: '<%= pkg.version %>',
61+
author: '<%= pkg.author.name %>',
62+
description: '<%= pkg.description %>'
63+
}
64+
},
65+
files: {
66+
'tmp/nuget/<%%= pkg.name %>.nuspec': 'package.nuspec'
67+
}
68+
}
69+
},
70+
71+
mkdir: {
72+
pkg: {
73+
options: {
74+
create: ['pkg/nuget', 'pkg/umbraco']
75+
},
76+
},
77+
},
78+
79+
nugetpack: {
80+
dist: {
81+
src: 'tmp/nuget/<%= pkg.name %>.nuspec',
82+
dest: 'pkg/nuget/'
83+
}
84+
},
85+
86+
umbracoPackage: {
87+
options: {
88+
name: '<%= pkg.name %>',
89+
version: '<%= pkg.version %>',
90+
url: '<%= pkg.url %>',
91+
license: '<%= pkg.license %>',
92+
licenseUrl: '<%= pkg.licenseUrl %>',
93+
author: '<%= pkg.author %>',
94+
authorUrl: '<%= pkg.authorUrl %>',
95+
manifest: 'config/package.xml',
96+
readme: 'config/readme.txt',
97+
sourceDir: 'tmp/umbraco',
98+
outputDir: 'pkg/umbraco',
99+
}
100+
},
101+
102+
clean: {
103+
dist: '<%= dest %>',
104+
test: 'src/RJP.MultiUrlPicker/test/assets'
105+
},
106+
107+
karma: {
108+
unit: {
109+
configFile: 'src/RJP.MultiUrlPicker/test/karma.conf.js'
110+
}
111+
},
112+
113+
jshint: {
114+
dev: {
115+
files: {
116+
src: ['<%= basePath %>/**/*.js']
117+
},
118+
options: {
119+
curly: true,
120+
eqeqeq: true,
121+
immed: true,
122+
latedef: true,
123+
newcap: true,
124+
noarg: true,
125+
sub: true,
126+
boss: true,
127+
eqnull: true,
128+
//NOTE: we need to use eval sometimes so ignore it
129+
evil: true,
130+
//NOTE: we need to check for strings such as "javascript:" so don't throw errors regarding those
131+
scripturl: true,
132+
//NOTE: we ignore tabs vs spaces because enforcing that causes lots of errors depending on the text editor being used
133+
smarttabs: true,
134+
globals: {}
135+
}
136+
}
137+
}
138+
});
139+
140+
grunt.registerTask('default', ['jshint']);
141+
grunt.registerTask('nuget', ['clean', 'default', 'copy:nuget', 'template:nuspec', 'mkdir:pkg', 'nugetpack']);
142+
grunt.registerTask('package', ['clean', 'default', 'copy:umbraco', 'mkdir:pkg', 'umbracoPackage']);
143+
144+
grunt.registerTask('test', 'Clean, copy test assets, test', function () {
145+
var assetsDir = grunt.config.get('dest');
146+
//copies over umbraco assets from --target, this must point at the /umbraco/ directory
147+
if (assetsDir !== 'dist') {
148+
grunt.task.run(['clean:test', 'copy:testAssets', 'karma']);
149+
} else if (grunt.file.isDir('src/RJP.MultiUrlPicker/test/assets/js/')) {
150+
grunt.log.oklns('Test assets found, running tests');
151+
grunt.task.run(['karma']);
152+
} else {
153+
grunt.log.errorlns('Tests assets not found, skipping tests. Run with --target option to copy assets.');
154+
}
155+
});
156+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "umbraco-multi-url-picker",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Multi Url Picker for Umbraco 7",
55
"repository": {
66
"type": "git",

src/RJP.MultiUrlPicker/App_Plugins/RJP.MultiUrlPicker/MultiUrlPicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
$scope.onContentSelected = function(e) {
104104
var link = new Link(e);
105105

106-
if( e.index !== null ) {
106+
if( e.index !== undefined && e.index !== null ) {
107107
$scope.renderModel[ e.index ] = link;
108108
} else {
109109
$scope.renderModel.push( link );

src/RJP.MultiUrlPicker/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyFileVersion("1.3.0.*")]
36-
[assembly: AssemblyInformationalVersion("1.3.0")]
35+
[assembly: AssemblyFileVersion("1.3.1.*")]
36+
[assembly: AssemblyInformationalVersion("1.3.1")]

src/TestSite/App_Data/packages/created/createdPackages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="1" version="1.3.0" url="https://github.com/rasmusjp/umbraco-multi-url-picker/" name="RJP.MultiUrlPicker" folder="682e8562-9d45-4d8a-bc21-b1327f7f9932" packagepath="~/media/created-packages/RJP.MultiUrlPicker_1.3.0.zip" repositoryGuid="" packageGuid="c4d8ddf1-7eb3-4cc6-bd09-bee24edc40f0" hasUpdate="False" enableSkins="False" skinRepoGuid="00000000-0000-0000-0000-000000000000">
3+
<package id="1" version="1.3.1" url="https://github.com/rasmusjp/umbraco-multi-url-picker/" name="RJP.MultiUrlPicker" folder="682e8562-9d45-4d8a-bc21-b1327f7f9932" packagepath="~/media/created-packages/RJP.MultiUrlPicker_1.3.1.zip" repositoryGuid="" packageGuid="c4d8ddf1-7eb3-4cc6-bd09-bee24edc40f0" hasUpdate="False" enableSkins="False" skinRepoGuid="00000000-0000-0000-0000-000000000000">
44
<license url="https://github.com/rasmusjp/umbraco-multi-url-picker/blob/master/LICENSE">MIT License</license>
55
<author url="http://www.rjp.dk">Rasmus John Pedersen</author>
66
<readme><![CDATA[Allows editors to pick and sort multiple urls, it uses Umbraco's link picker which supports internal and external links and media. ]]></readme>

0 commit comments

Comments
 (0)