@@ -53,7 +53,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
53
53
* ax5 version
54
54
* @member {String} ax5.info.version
55
55
*/
56
- var version = "1.3.24 " ;
56
+ var version = "${VERSION} " ;
57
57
58
58
/**
59
59
* ax5 library path
@@ -2006,6 +2006,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
2006
2006
* "&" represents the & sign.
2007
2007
* "" represents the " mark.
2008
2008
* [Character entity references](https://www.w3.org/TR/html401/charset.html#h-5.3)
2009
+ * @method ax5.util.escapeHtml
2009
2010
* @param {String } s
2010
2011
* @returns {string }
2011
2012
* @example
@@ -2036,6 +2037,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
2036
2037
/**
2037
2038
* HTML 문자열을 unescape 처리합니다.
2038
2039
* escapeHtml를 참고하세요.
2040
+ * @method ax5.util.unescapeHtml
2039
2041
* @param {String } s
2040
2042
* @returns {string }
2041
2043
* @example
@@ -2063,6 +2065,99 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
2063
2065
} ) ;
2064
2066
}
2065
2067
2068
+ /**
2069
+ * @method ax5.util.string
2070
+ * @param {String } tmpl
2071
+ * @param {* } args
2072
+ * @return {ax5string }
2073
+ * @example
2074
+ * ```js
2075
+ * ax5.util.string("{0} is dead, but {1} is alive! {0} {2}").format("ASP", "ASP.NET");
2076
+ * ax5.util.string("{0} is dead, but {1} is alive! {0} {2}").format(["ASP", "ASP.NET"]);
2077
+ * ax5.util.stinrg("{0} counts").format(100);
2078
+ * ```
2079
+ */
2080
+ function string ( _string ) {
2081
+ function ax5string ( _string ) {
2082
+ this . value = _string ;
2083
+ this . toString = function ( ) {
2084
+ return this . value ;
2085
+ } ;
2086
+ /**
2087
+ * @method ax5.util.string.format
2088
+ * @returns {* }
2089
+ */
2090
+ this . format = function ( ) {
2091
+ var args = [ ] ;
2092
+ for ( var i = 0 , l = arguments . length ; i < l ; i ++ ) {
2093
+ args = args . concat ( arguments [ i ] ) ;
2094
+ }
2095
+ return this . value . replace ( / { ( \d + ) } / g, function ( match , number ) {
2096
+ return typeof args [ number ] != 'undefined' ? args [ number ] : match ;
2097
+ } ) ;
2098
+ } ;
2099
+ /**
2100
+ * @method ax5.util.string.escape
2101
+ * @returns {* }
2102
+ */
2103
+ this . escape = function ( ) {
2104
+ return escapeHtml ( this . value ) ;
2105
+ } ;
2106
+ /**
2107
+ * @method ax5.util.string.unescape
2108
+ * @returns {* }
2109
+ */
2110
+ this . unescape = function ( ) {
2111
+ return unescapeHtml ( this . value ) ;
2112
+ } ;
2113
+ /**
2114
+ * @method ax5.util.string.encode
2115
+ * @returns {* }
2116
+ */
2117
+ this . encode = function ( ) {
2118
+ return encode ( this . value ) ;
2119
+ } ;
2120
+ /**
2121
+ * @method ax5.util.string.decode
2122
+ * @returns {* }
2123
+ */
2124
+ this . decode = function ( ) {
2125
+ return decode ( this . value ) ;
2126
+ } ;
2127
+ /**
2128
+ * @method ax5.util.string.left
2129
+ * @param {String|Number } pos - 찾을 문자열 또는 포지션
2130
+ * @returns {* }
2131
+ */
2132
+ this . left = function ( _pos ) {
2133
+ return left ( this . value , _pos ) ;
2134
+ } ;
2135
+ /**
2136
+ * @method ax5.util.string.right
2137
+ * @param {String|Number } pos - 찾을 문자열 또는 포지션
2138
+ * @returns {* }
2139
+ */
2140
+ this . right = function ( _pos ) {
2141
+ return right ( this . value , _pos ) ;
2142
+ } ;
2143
+ /**
2144
+ * @method ax5.util.string.camelCase
2145
+ * @returns {* }
2146
+ */
2147
+ this . camelCase = function ( ) {
2148
+ return camelCase ( this . value ) ;
2149
+ } ;
2150
+ /**
2151
+ * @method ax5.util.string.snakeCase
2152
+ * @returns {* }
2153
+ */
2154
+ this . snakeCase = function ( ) {
2155
+ return snakeCase ( this . value ) ;
2156
+ } ;
2157
+ }
2158
+ return new ax5string ( _string ) ;
2159
+ }
2160
+
2066
2161
return {
2067
2162
alert : alert ,
2068
2163
each : each ,
@@ -2116,7 +2211,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
2116
2211
selectRange : selectRange ,
2117
2212
debounce : debounce ,
2118
2213
escapeHtml : escapeHtml ,
2119
- unescapeHtml : unescapeHtml
2214
+ unescapeHtml : unescapeHtml ,
2215
+
2216
+ string : string
2120
2217
} ;
2121
2218
} ( ) ;
2122
2219
@@ -2428,14 +2525,148 @@ ax5.info.errorMsg["ax5combobox"] = {
2428
2525
}
2429
2526
} ) ( window . console || { } ) ; // Using `this` for web workers.
2430
2527
2528
+
2529
+ // Modernizr style test
2530
+ if ( ! ( window . webkitMatchMedia || window . mozMatchMedia || window . oMatchMedia || window . msMatchMedia || window . matchMedia ) ) {
2531
+ var root = document . getElementsByTagName ( 'html' ) [ 0 ] ;
2532
+ root . className += ' no-matchmedia' ;
2533
+ }
2534
+
2535
+ /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
2536
+ window . matchMedia || ( window . matchMedia = function ( ) {
2537
+ "use strict" ;
2538
+
2539
+ // For browsers that support matchMedium api such as IE 9 and webkit
2540
+
2541
+ var styleMedia = window . styleMedia || window . media ;
2542
+
2543
+ // For those that don't support matchMedium
2544
+ if ( ! styleMedia ) {
2545
+ var style = document . createElement ( 'style' ) ,
2546
+ script = document . getElementsByTagName ( 'script' ) [ 0 ] ,
2547
+ info = null ;
2548
+
2549
+ style . type = 'text/css' ;
2550
+ style . id = 'matchmediajs-test' ;
2551
+
2552
+ script . parentNode . insertBefore ( style , script ) ;
2553
+
2554
+ // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
2555
+ info = 'getComputedStyle' in window && window . getComputedStyle ( style , null ) || style . currentStyle ;
2556
+
2557
+ styleMedia = {
2558
+ matchMedium : function matchMedium ( media ) {
2559
+ var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }' ;
2560
+
2561
+ // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
2562
+ if ( style . styleSheet ) {
2563
+ style . styleSheet . cssText = text ;
2564
+ } else {
2565
+ style . textContent = text ;
2566
+ }
2567
+
2568
+ // Test if media query is true or false
2569
+ return info . width === '1px' ;
2570
+ }
2571
+ } ;
2572
+ }
2573
+
2574
+ return function ( media ) {
2575
+ return {
2576
+ matches : styleMedia . matchMedium ( media || 'all' ) ,
2577
+ media : media || 'all'
2578
+ } ;
2579
+ } ;
2580
+ } ( ) ) ;
2581
+
2582
+ /*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */
2583
+ ( function ( ) {
2584
+ // Bail out for browsers that have addListener support
2585
+ if ( window . matchMedia && window . matchMedia ( 'all' ) . addListener ) {
2586
+ return false ;
2587
+ }
2588
+
2589
+ var localMatchMedia = window . matchMedia ,
2590
+ hasMediaQueries = localMatchMedia ( 'only all' ) . matches ,
2591
+ isListening = false ,
2592
+ timeoutID = 0 ,
2593
+ // setTimeout for debouncing 'handleChange'
2594
+ queries = [ ] ,
2595
+ // Contains each 'mql' and associated 'listeners' if 'addListener' is used
2596
+ handleChange = function handleChange ( evt ) {
2597
+ // Debounce
2598
+ clearTimeout ( timeoutID ) ;
2599
+
2600
+ timeoutID = setTimeout ( function ( ) {
2601
+ for ( var i = 0 , il = queries . length ; i < il ; i ++ ) {
2602
+ var mql = queries [ i ] . mql ,
2603
+ listeners = queries [ i ] . listeners || [ ] ,
2604
+ matches = localMatchMedia ( mql . media ) . matches ;
2605
+
2606
+ // Update mql.matches value and call listeners
2607
+ // Fire listeners only if transitioning to or from matched state
2608
+ if ( matches !== mql . matches ) {
2609
+ mql . matches = matches ;
2610
+
2611
+ for ( var j = 0 , jl = listeners . length ; j < jl ; j ++ ) {
2612
+ listeners [ j ] . call ( window , mql ) ;
2613
+ }
2614
+ }
2615
+ }
2616
+ } , 30 ) ;
2617
+ } ;
2618
+
2619
+ window . matchMedia = function ( media ) {
2620
+ var mql = localMatchMedia ( media ) ,
2621
+ listeners = [ ] ,
2622
+ index = 0 ;
2623
+
2624
+ mql . addListener = function ( listener ) {
2625
+ // Changes would not occur to css media type so return now (Affects IE <= 8)
2626
+ if ( ! hasMediaQueries ) {
2627
+ return ;
2628
+ }
2629
+
2630
+ // Set up 'resize' listener for browsers that support CSS3 media queries (Not for IE <= 8)
2631
+ // There should only ever be 1 resize listener running for performance
2632
+ if ( ! isListening ) {
2633
+ isListening = true ;
2634
+ window . addEventListener ( 'resize' , handleChange , true ) ;
2635
+ }
2636
+
2637
+ // Push object only if it has not been pushed already
2638
+ if ( index === 0 ) {
2639
+ index = queries . push ( {
2640
+ mql : mql ,
2641
+ listeners : listeners
2642
+ } ) ;
2643
+ }
2644
+
2645
+ listeners . push ( listener ) ;
2646
+ } ;
2647
+
2648
+ mql . removeListener = function ( listener ) {
2649
+ for ( var i = 0 , il = listeners . length ; i < il ; i ++ ) {
2650
+ if ( listeners [ i ] === listener ) {
2651
+ listeners . splice ( i , 1 ) ;
2652
+ }
2653
+ }
2654
+ } ;
2655
+
2656
+ return mql ;
2657
+ } ;
2658
+ } ) ( ) ;
2659
+
2431
2660
// extend innerWidth ..
2432
2661
var html = document . getElementsByTagName ( 'html' ) [ 0 ] ;
2433
2662
var body = document . getElementsByTagName ( 'body' ) [ 0 ] ;
2434
2663
2664
+ /*
2435
2665
if (!window.innerWidth) window.innerWidth = html.clientWidth;
2436
2666
if (!window.innerHeight) window.innerHeight = html.clientHeight;
2437
2667
if (!window.scrollX) window.scrollX = window.pageXOffset || html.scrollLeft;
2438
2668
if (!window.scrollY) window.scrollY = window.pageYOffset || html.scrollTop;
2669
+ */
2439
2670
} ) . call ( window ) ;
2440
2671
/**
2441
2672
* Refer to this by {@link ax5}.
0 commit comments