Skip to content

Commit 1609f1a

Browse files
committed
fix: #66 - no IE browser version information in webview (#67)
* fix: #66 - no IE browser version information in webview * refactor: change variable * feat: v1.3.0 fix: edit annotation in broswer api chore: update README fix: version
1 parent 54c2c7f commit 1609f1a

14 files changed

+106
-90
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ temp
5151
tmp
5252
doc
5353
report
54-
dist
5554
*.swp
5655
karma.local.conf.js
5756
*.vim

Gruntfile.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ module.exports = function(grunt) {
1313
},
1414
dist: {
1515
src: ['src/*.js'],
16-
dest: 'code-snippet.js'
16+
dest: 'dist/code-snippet.js'
1717
}
1818
},
1919
uglify: {
2020
options: {
21-
banner: '/*!code-snippet v<%=pkg.version%> | NHN Entertainment*/\n'
21+
banner: '/*!code-snippet v<%=pkg.version%> | NHN Entertainment*/\n',
22+
screwIE8: false
2223
},
2324
dist: {
2425
files: {
25-
'code-snippet.min.js': ['<%= concat.dist.dest %>']
26+
'dist/code-snippet.min.js': ['<%= concat.dist.dest %>']
2627
}
2728
}
2829
}
@@ -32,5 +33,4 @@ module.exports = function(grunt) {
3233
grunt.loadNpmTasks('grunt-contrib-concat');
3334

3435
grunt.registerTask('default', ['concat', 'uglify']);
35-
3636
};

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Toast UI CodeSnippet
55

66
It includes several features like `class simulation`, `browser detecting`, `type checking` and +30 more.
77

8-
`tui-code-snippet` supports IE7+ and modern browsers and already has been used for [open source javascript components](http://github.com/nhnent/) and many commercial projects in [NHNEnt](http://www.nhnent.com/en/index.nhn) corporation.
8+
`tui-code-snippet` supports IE8+ and modern browsers and already has been used for [open source javascript components](http://github.com/nhnent/) and many commercial projects in [NHNEnt](http://www.nhnent.com/en/index.nhn) corporation.
99

1010
## Feature
1111
* browser.js
@@ -59,17 +59,17 @@ It includes several features like `class simulation`, `browser detecting`, `type
5959
* Use build file as you can
6060

6161
## Documentation
62-
* **API** - https://nhnent.github.io/tui.code-snippet/latest/
63-
* **Tutorial** - https://github.com/nhnent/fe.javascript/wiki/FE-CodeSnippet
62+
* API: https://nhnent.github.io/tui.code-snippet/latest/
63+
* Tutorial: https://github.com/nhnent/fe.javascript/wiki/FE-CodeSnippet
6464

65-
## Tested browsers
66-
* browser :
67-
* IE7+
65+
## Tested Browsers
66+
* browser:
67+
* IE8+
6868
* Chrome
6969
* Firefox
7070

7171
## Download/Install
7272
* Bower:
73-
* latest : `bower install tui-code-snippet`
74-
* each version : `bower install tui-code-snippet[#tag]`
75-
* Download : https://github.com/nhnent/tui.code-snippet
73+
* Latest: `bower install tui-code-snippet`
74+
* Each Version: `bower install tui-code-snippet[#tag]`
75+
* Download: https://github.com/nhnent/tui.code-snippet

code-snippet.min.js

-2
This file was deleted.

conf.json

-23
This file was deleted.

code-snippet.js dist/code-snippet.js

+18-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*!code-snippet v1.2.2 | NHN Entertainment*/
1+
/*!code-snippet v1.2.3 | NHN Entertainment*/
22
/**********
33
* array.js
44
**********/
@@ -186,7 +186,7 @@
186186
* tui.util.browser.safari === true; // safari
187187
* tui.util.browser.msie === true; // IE
188188
* tui.util.browser.edge === true; // edge
189-
* tui.util.browser.other === true; // other browser
189+
* tui.util.browser.others === true; // other browser
190190
* tui.util.browser.version; // browser version
191191
*/
192192
var browser = {
@@ -216,9 +216,14 @@
216216

217217
var detector = {
218218
'Microsoft_Internet_Explorer': function() {
219-
// ie8 ~ ie10
220-
browser.msie = true;
221-
browser.version = parseFloat(userAgent.match(rIE)[1]);
219+
var detectedVersion = userAgent.match(rIE);
220+
221+
if (detectedVersion) { // ie8 ~ ie10
222+
browser.msie = true;
223+
browser.version = parseFloat(detectedVersion[1]);
224+
} else { // no version information
225+
browser.others = true;
226+
}
222227
},
223228
'Netscape': function() {
224229
var detected = false;
@@ -703,6 +708,7 @@
703708
/**
704709
* Get context array safely
705710
* @returns {array} context array
711+
* @private
706712
*/
707713
CustomEvents.prototype._safeContext = function() {
708714
var context = this.contexts;
@@ -718,6 +724,7 @@
718724
* Get index of context
719725
* @param {object} ctx - context that used for bind custom event
720726
* @returns {number} index of context
727+
* @private
721728
*/
722729
CustomEvents.prototype._indexOfContext = function(ctx) {
723730
var context = this._safeContext(),
@@ -738,6 +745,7 @@
738745
* Memorize supplied context for recognize supplied object is context or
739746
* name: handler pair object when off()
740747
* @param {object} ctx - context object to memorize
748+
* @private
741749
*/
742750
CustomEvents.prototype._memorizeContext = function(ctx) {
743751
var context, index;
@@ -759,6 +767,7 @@
759767
/**
760768
* Forget supplied context object
761769
* @param {object} ctx - context object to forget
770+
* @private
762771
*/
763772
CustomEvents.prototype._forgetContext = function(ctx) {
764773
var context, contextIndex;
@@ -1959,6 +1968,7 @@ tui.util.Enum = Enum;
19591968
* @param {Object} [obj] A initial data for creation.
19601969
* @constructor
19611970
* @memberof tui.util
1971+
* @deprecated since version 1.3.0
19621972
* @example
19631973
* var hm = new tui.util.HashMap({
19641974
* 'mydata': {
@@ -2685,6 +2695,8 @@ tui.util.Enum = Enum;
26852695
/**
26862696
* Removes the specified element from a Map object.
26872697
* @param {*} key - The key of the element to remove
2698+
* @memberof tui.util.Map.prototype
2699+
* @method delete
26882700
*/
26892701
// cannot use reserved keyword as a property name in IE8 and under.
26902702
Map.prototype['delete'] = function(key) {
@@ -3137,9 +3149,6 @@ tui.util.Enum = Enum;
31373149
* @author NHN Ent. FE Development Team <e0242.nhnent.com>
31383150
*/
31393151

3140-
/** @namespace tui */
3141-
/** @namespace tui.util */
3142-
31433152
(function(tui) {
31443153
'use strict';
31453154
var aps = Array.prototype.slice;
@@ -3266,7 +3275,7 @@ tui.util.Enum = Enum;
32663275
// pass array directly because `debounce()`, `tick()` are already use
32673276
// `apply()` method to invoke developer's `fn` handler.
32683277
//
3269-
// also, this `debounced` line invoked every time for implements
3278+
// also, this `debounced` line invoked every time for implements
32703279
// `trailing` features.
32713280
debounced(args);
32723281

@@ -3289,7 +3298,6 @@ tui.util.Enum = Enum;
32893298
tui.util.throttle = throttle;
32903299
})(window.tui);
32913300

3292-
32933301
/**********
32943302
* type.js
32953303
**********/

dist/code-snippet.min.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsdoc-conf.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"source": {
3+
"include": ["src", "README.md"],
4+
"exclude": [],
5+
"includePattern": ".+\\.js(doc)?$",
6+
"excludePattern": "(^|\\/|\\\\)_"
7+
},
8+
"plugins": ["plugins/markdown"],
9+
"templates": {
10+
"name": "CodeSnippet",
11+
"logo": {
12+
"url": "https://cloud.githubusercontent.com/assets/12269563/20029815/01133928-a39a-11e6-80f3-12500a91c755.png",
13+
"width": "150px"
14+
}
15+
},
16+
"opts": {
17+
"recurse": true,
18+
"destination": "doc",
19+
"template": "./node_modules/tui-jsdoc-template"
20+
}
21+
}

package.json

+35-32
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
{
2-
"name": "tui-code-snippet",
3-
"version": "1.2.2",
4-
"description": "useful code snippets from frontend development team",
5-
"main": "code-snippet.js",
6-
"scripts": {
7-
"doc": "./node_modules/.bin/jsdoc -c conf.json"
8-
},
9-
"repository": {
10-
"type": "git",
11-
"url": "https://github.com/nhnent/tui.code-snippet.git"
12-
},
13-
"author": "FE",
14-
"license": "MIT",
15-
"devDependencies": {
16-
"fedoc-template": "git+https://14bfd38a036366f7ca90355d202038126127bd01:x-oauth-basic@github.nhnent.com/fe/share-fedoc-template.git#snippet",
17-
"grunt": "^0.4.5",
18-
"grunt-contrib-concat": "^0.5.0",
19-
"grunt-contrib-uglify": "^0.6.0",
20-
"jasmine-ajax": "latest",
21-
"jasmine-core": "latest",
22-
"jasmine-jquery": "latest",
23-
"jsdoc": "git+https://github.com/jsdoc3/jsdoc.git",
24-
"karma": "0.13.22",
25-
"karma-chrome-launcher": "latest",
26-
"karma-coverage": "latest",
27-
"karma-jasmine": "0.3.8",
28-
"karma-junit-reporter": "latest",
29-
"karma-mocha-reporter": "latest",
30-
"karma-phantomjs-launcher": "latest",
31-
"karma-webdriver-launcher": "git+https://github.com/everedifice/karma-webdriver-launcher.git",
32-
"phantomjs-prebuilt": "latest"
33-
}
2+
"name": "tui-code-snippet",
3+
"version": "1.2.3",
4+
"description": "useful code snippets from frontend development team",
5+
"main": "code-snippet.js",
6+
"scripts": {
7+
"test": "karma start karma.conf.js",
8+
"bundle": "grunt",
9+
"cpy-dist2doc": "mkdir -p doc/dist && cp -f dist/code-snippet.js doc/dist",
10+
"doc": "./node_modules/.bin/jsdoc -c jsdoc-conf.json && npm run cpy-dist2doc"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/nhnent/tui.code-snippet.git"
15+
},
16+
"author": "FE",
17+
"license": "MIT",
18+
"devDependencies": {
19+
"grunt": "^1.0.1",
20+
"grunt-contrib-concat": "^0.5.0",
21+
"grunt-contrib-uglify": "^2.2.0",
22+
"jasmine-ajax": "latest",
23+
"jasmine-core": "latest",
24+
"jasmine-jquery": "latest",
25+
"jsdoc": "git+https://github.com/jsdoc3/jsdoc.git",
26+
"karma": "1.3.0",
27+
"karma-chrome-launcher": "latest",
28+
"karma-coverage": "latest",
29+
"karma-jasmine": "1.0.2",
30+
"karma-junit-reporter": "latest",
31+
"karma-mocha-reporter": "latest",
32+
"karma-phantomjs-launcher": "latest",
33+
"karma-webdriver-launcher": "git+https://github.com/everedifice/karma-webdriver-launcher.git",
34+
"phantomjs-prebuilt": "latest",
35+
"tui-jsdoc-template": "^1.0.4"
36+
}
3437
}

src/browser.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* tui.util.browser.safari === true; // safari
3232
* tui.util.browser.msie === true; // IE
3333
* tui.util.browser.edge === true; // edge
34-
* tui.util.browser.other === true; // other browser
34+
* tui.util.browser.others === true; // other browser
3535
* tui.util.browser.version; // browser version
3636
*/
3737
var browser = {
@@ -61,9 +61,14 @@
6161

6262
var detector = {
6363
'Microsoft_Internet_Explorer': function() {
64-
// ie8 ~ ie10
65-
browser.msie = true;
66-
browser.version = parseFloat(userAgent.match(rIE)[1]);
64+
var detectedVersion = userAgent.match(rIE);
65+
66+
if (detectedVersion) { // ie8 ~ ie10
67+
browser.msie = true;
68+
browser.version = parseFloat(detectedVersion[1]);
69+
} else { // no version information
70+
browser.others = true;
71+
}
6772
},
6873
'Netscape': function() {
6974
var detected = false;

src/customEvent.js

+4
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
/**
115115
* Get context array safely
116116
* @returns {array} context array
117+
* @private
117118
*/
118119
CustomEvents.prototype._safeContext = function() {
119120
var context = this.contexts;
@@ -129,6 +130,7 @@
129130
* Get index of context
130131
* @param {object} ctx - context that used for bind custom event
131132
* @returns {number} index of context
133+
* @private
132134
*/
133135
CustomEvents.prototype._indexOfContext = function(ctx) {
134136
var context = this._safeContext(),
@@ -149,6 +151,7 @@
149151
* Memorize supplied context for recognize supplied object is context or
150152
* name: handler pair object when off()
151153
* @param {object} ctx - context object to memorize
154+
* @private
152155
*/
153156
CustomEvents.prototype._memorizeContext = function(ctx) {
154157
var context, index;
@@ -170,6 +173,7 @@
170173
/**
171174
* Forget supplied context object
172175
* @param {object} ctx - context object to forget
176+
* @private
173177
*/
174178
CustomEvents.prototype._forgetContext = function(ctx) {
175179
var context, contextIndex;

src/hashMap.js

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* @param {Object} [obj] A initial data for creation.
3131
* @constructor
3232
* @memberof tui.util
33+
* @deprecated since version 1.3.0
3334
* @example
3435
* var hm = new tui.util.HashMap({
3536
* 'mydata': {

src/map.js

+2
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@
315315
/**
316316
* Removes the specified element from a Map object.
317317
* @param {*} key - The key of the element to remove
318+
* @memberof tui.util.Map.prototype
319+
* @method delete
318320
*/
319321
// cannot use reserved keyword as a property name in IE8 and under.
320322
Map.prototype['delete'] = function(key) {

src/tricks.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
* @author NHN Ent. FE Development Team <e0242.nhnent.com>
44
*/
55

6-
/** @namespace tui */
7-
/** @namespace tui.util */
8-
96
(function(tui) {
107
'use strict';
118
var aps = Array.prototype.slice;
@@ -132,7 +129,7 @@
132129
// pass array directly because `debounce()`, `tick()` are already use
133130
// `apply()` method to invoke developer's `fn` handler.
134131
//
135-
// also, this `debounced` line invoked every time for implements
132+
// also, this `debounced` line invoked every time for implements
136133
// `trailing` features.
137134
debounced(args);
138135

@@ -154,4 +151,3 @@
154151
tui.util.debounce = debounce;
155152
tui.util.throttle = throttle;
156153
})(window.tui);
157-

0 commit comments

Comments
 (0)