diff --git a/Gruntfile.js b/Gruntfile.js index c9f2605..d356ff1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -53,10 +53,6 @@ module.exports = (grunt) => { { src: ['./less/index.less'], dest: `${buildStaticPath}/css/index.css` - }, - { - src: ['./less/indigo.less'], - dest: `${buildStaticPath}/css/indigo.css` } ] } diff --git a/igo/radiogroup/radiogroup.js b/igo/radiogroup/radiogroup.js index 557699d..3fe3298 100644 --- a/igo/radiogroup/radiogroup.js +++ b/igo/radiogroup/radiogroup.js @@ -4,7 +4,7 @@ function igoRadiogroup($) { return { preinit: function(el) { - this.getRadios(el).filter('[value=' + el.text() + ']').prop('checked', true); + this.getRadios(el).filter('[value="' + el.text() + '"]').prop('checked', true); }, init: function(el, self) { @@ -35,7 +35,7 @@ function igoRadiogroup($) { }, getRadios: function(el) { - return $('[cid=radio]>label>input[name="' + el.attr('id') + '"]'); + return $('[_=igoRadio]>label>input[name="' + el.attr('id') + '"]'); }, class: function(name, isAdd) { diff --git a/index.html b/index.html index dec08ae..57a4489 100644 --- a/index.html +++ b/index.html @@ -23,8 +23,8 @@ DEBUG: false, INFO: false, contextPath: './build', //application URI - staticPath: '/static', //URI to static files (images, fonts, PDF, vendor files etc.) - componentPath: '/components', //URI to components source files + staticPath: '/static', //virtual path prefix to static files (images, fonts, PDF, vendor files etc.) + componentPath: '/components', //virtual path prefix to the components source files }; function printSource(id) { diff --git a/js/loader.js b/js/loader.js index 45c9fbc..5b7e508 100644 --- a/js/loader.js +++ b/js/loader.js @@ -2,7 +2,12 @@ (function(top) { var ig = top.indigoJS = top.indigoJS || {}, - console = window.console; + win = window, console = win.console; + + win.indigoMain = function(callback) { + callback(win.$, win.indigoJS, win.indigoLocales); + }; + ig.rootScope = ig.rootScope || {}; ig.wins = ig.wins || []; ig.cssPath = ig.cssPath || function(uri, type, pkg, cls) { @@ -74,7 +79,7 @@ el[key] = attrs[key]; } el.onload = function() { - (onload || loadHandler)(url, type); + (onload || loadHandler)(url, type, el); }; head.appendChild(el); } @@ -142,16 +147,20 @@ }); } for (var j = 0; j < mains.length; j++) { - addAsset('script', {type: 'text/javascript', src: mains[j].value}); + addAsset('script', {type: 'text/javascript', src: mains[j].value}, null, function(url, type, el) { + document.head.removeChild(el); + }); } } }; - if (ig.wins.indexOf(window) === -1) { - ig.wins.push(window); + if (ig.wins.indexOf(win) === -1) { + ig.wins.push(win); } if (mains.length) { - addAsset('script', {type: 'text/javascript', src: ig.corePath(uri)}); + addAsset('script', {type: 'text/javascript', src: ig.corePath(uri)}, null, function(url, type, el) { + document.head.removeChild(el); + }); } addAsset('script', {type: 'text/javascript', src: ig.jqPath(uri)}, null, function(url, type) { ig.wins.forEach(function(win) { @@ -166,27 +175,29 @@ }); loadHandler(url, type); if (ig.jqueryReady) { - ig.jqueryReady(window.$); + ig.jqueryReady(win.$); } }); libs.forEach(function(lib) { - var type = lib.replace('!', ''), - pair = type.split(/(?=[A-Z])/); - var pkg = pair[0], - cls = pair[1].toLowerCase(); - if (loadedJs[type] === undefined) { - if (lib.charAt(0) !== '!') { //exclude script - loadedJs[type] = 0; - addAsset('script', {type: 'text/javascript', src: ig.jsPath(uri, type, pkg, cls)}, type); + if (lib.length) { + var type = lib.replace('!', ''), + pair = type.split(/(?=[A-Z])/); + var pkg = pair[0], + cls = pair[1].toLowerCase(); + if (loadedJs[type] === undefined) { + if (lib.charAt(0) !== '!') { //exclude script + loadedJs[type] = 0; + addAsset('script', {type: 'text/javascript', src: ig.jsPath(uri, type, pkg, cls)}, type); + } } - } - if (loadedCss[type] === undefined) { - if (lib.charAt(lib.length - 1) !== '!') { //exclude link - loadedCss[type] = 0; - addAsset('link', {rel: 'stylesheet', type: 'text/css', href: ig.cssPath(uri, type, pkg, cls)}, type); - } else { - loadedCss[type] = 1; + if (loadedCss[type] === undefined) { + if (lib.charAt(lib.length - 1) !== '!') { //exclude link + loadedCss[type] = 0; + addAsset('link', {rel: 'stylesheet', type: 'text/css', href: ig.cssPath(uri, type, pkg, cls)}, type); + } else { + loadedCss[type] = 1; + } } } }); diff --git a/less/common.less b/less/common.less index 114fc42..b0ddb9e 100644 --- a/less/common.less +++ b/less/common.less @@ -27,6 +27,33 @@ button, input, select, textarea { font: inherit; } +.clearfix::after { + display: block; + content: ''; + clear: both; +} + +.pull-right { + float: right!important; +} + +.pull-left { + float: left!important; +} + +.hide { + display: none!important; +} + +.show { + display: block!important; +} + +.container { + margin-right: auto; + margin-left: auto; +} + .headers(); c { @@ -59,29 +86,4 @@ c[disabled] { c.init { opacity: 0 !important; -} - -.headers() { - h1, h2, h3, h4, h5, h6 { - margin: 5px; - font-weight: 500; - } - h1 { - font-size: 2em; - } - h2 { - font-size: 1.5em; - } - h3 { - font-size: 1.33em; - } - h4 { - font-size: 1.17em; - } - h5 { - font-size: 0.83em; - } - h6 { - font-size: 0.67em; - } } \ No newline at end of file diff --git a/less/constant.less b/less/constant.less index f6a3518..df8569f 100644 --- a/less/constant.less +++ b/less/constant.less @@ -95,4 +95,44 @@ .disabledColor() { color: #aaa !important; +} + +.headers() { + h1, h2, h3, h4, h5, h6 { + margin: 5px; + font-weight: 500; + } + h1 { + font-size: 2em; + } + h2 { + font-size: 1.5em; + } + h3 { + font-size: 1.33em; + } + h4 { + font-size: 1.17em; + } + h5 { + font-size: 0.83em; + } + h6 { + font-size: 0.67em; + } +} + +.widthLoop(@clsName: '.col-', @total: 12) { + @prefix: ~"@{clsName}"; + @width: 100 / @total; + + .loop (@i) when (@i <= @total) { + @{prefix}@{i} { + width: unit(@width * @i, %); + } + + .loop(@i + 1); + } + + .loop(1); } \ No newline at end of file diff --git a/less/index.less b/less/index.less index c45548e..b4eb912 100644 --- a/less/index.less +++ b/less/index.less @@ -23,7 +23,7 @@ body { font-weight: bold; } - [cid=menu] { + [_=igoMenu] { height: 100%; border: 1px #fff; border-left-style: solid; diff --git a/less/indigo.less b/less/indigo.less deleted file mode 100644 index 78d0b29..0000000 --- a/less/indigo.less +++ /dev/null @@ -1,104 +0,0 @@ -@import './constant.less'; - -.clearfix::after { - display: block; - content: ''; - clear: both; -} - -.pull-right { - float: right!important; -} - -.pull-left { - float: left!important; -} - -.hide { - display: none!important; -} - -.show { - display: block!important; -} - -.container { - margin-right: auto; - margin-left: auto; -} - -@media (min-width: 768px) { - .container { - width: 750px; - } -} -@media (min-width: 992px) { - .container { - width: 970px; - } -} -@media (min-width: 1200px) { - .container { - width: 1170px; - } -} - -@media (max-width: 768px) { - .screen { - display: none; - } -} - -@media (min-width: 768px) { - .container &>div { - float: left; - } - - .col-1 { - width: 8.33333333%; - } - - .col-2 { - width: 16.66666667%; - } - - .col-3 { - width: 25%; - } - - .col-4 { - width: 33.33333333%; - } - - .col-5 { - width: 41.66666667%; - } - - .col-6 { - width: 50%; - } - - .col-7 { - width: 58.33333333%; - } - - .col-8 { - width: 66.66666667%; - } - - .col-9 { - width: 75%; - } - - .col-10 { - width: 83.33333333%; - } - - .col-11 { - width: 91.66666667%; - } - - .col-12 { - width: 100%; - } -} \ No newline at end of file diff --git a/package.json b/package.json index 3d2abf7..7ced4c9 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "indigojs-components", - "version": "v3.5.5", + "version": "v3.5.6", "config": { - "old_tag": "v3.5.4", - "new_tag": "v3.5.5" + "old_tag": "v3.5.5", + "new_tag": "v3.5.6" }, "scripts": { "start": "node server.js",