Browse Source

Fixes JSONP conditions and rebuilds next #2713

pull/2717/head
jlukic 9 years ago
parent
commit
25b5e716de
13 changed files with 64 additions and 38 deletions
  1. 26
      dist/components/api.js
  2. 2
      dist/components/api.min.js
  3. 8
      dist/components/button.css
  4. 2
      dist/components/button.min.css
  5. 1
      dist/components/checkbox.css
  6. 2
      dist/components/checkbox.min.css
  7. 5
      dist/components/dropdown.js
  8. 2
      dist/components/dropdown.min.js
  9. 9
      dist/semantic.css
  10. 31
      dist/semantic.js
  11. 2
      dist/semantic.min.css
  12. 6
      dist/semantic.min.js
  13. 6
      src/definitions/behaviors/api.js

26
dist/components/api.js

@ -115,6 +115,20 @@ $.api = $.fn.api = function(parameters) {
}
},
decode: {
json: function(response) {
if(response !== undefined && typeof response == 'string') {
try {
response = JSON.parse(response);
}
catch(e) {
// isnt json string
}
}
return response;
}
},
read: {
cachedResponse: function(url) {
var
@ -126,15 +140,7 @@ $.api = $.fn.api = function(parameters) {
}
response = sessionStorage.getItem(url);
module.debug('Using cached response', url, response);
if(response !== undefined) {
try {
response = JSON.parse(response);
}
catch(e) {
// didnt store object
}
return response;
}
response = module.decode.json(response);
return false;
}
},
@ -516,7 +522,7 @@ $.api = $.fn.api = function(parameters) {
var
// pull response from xhr if available
response = $.isPlainObject(xhr)
? (xhr.responseText)
? module.decode.json(xhr.responseText)
: false,
errorMessage = ($.isPlainObject(response) && response.error !== undefined)
? response.error // use json error message

2
dist/components/api.min.js
File diff suppressed because it is too large
View File

8
dist/components/button.css

@ -773,11 +773,13 @@
position: absolute;
height: 100%;
line-height: 1;
border-radius: 0px;
border-top-left-radius: inherit;
border-bottom-left-radius: inherit;
width: 2.57142857em;
background-color: rgba(0, 0, 0, 0.05);
text-align: center;
color: '';
border-radius: 0.28571429rem 0px 0px 0.28571429rem;
box-shadow: -1px 0px 0px 0px transparent inset;
}
@ -796,7 +798,9 @@
.ui[class*="right labeled"].icon.button > .icon {
left: auto;
right: 0em;
border-radius: 0em 0.28571429rem 0.28571429rem 0em;
border-radius: 0px;
border-top-right-radius: inherit;
border-bottom-right-radius: inherit;
box-shadow: 1px 0px 0px 0px transparent inset;
}
.ui.labeled.icon.buttons > .button > .icon:before,

2
dist/components/button.min.css
File diff suppressed because it is too large
View File

1
dist/components/checkbox.css

@ -26,6 +26,7 @@
backface-visibility: hidden;
outline: none;
vertical-align: baseline;
font-style: normal;
min-height: 17px;
font-size: 1rem;
line-height: 17px;

2
dist/components/checkbox.min.css
File diff suppressed because it is too large
View File

5
dist/components/dropdown.js

@ -895,7 +895,7 @@ $.fn.dropdown = function(parameters) {
toggleBehavior = (module.is.multiple())
? module.show
: module.toggle
;
;
if( module.determine.eventOnElement(event, toggleBehavior) ) {
event.preventDefault();
}
@ -1297,7 +1297,8 @@ $.fn.dropdown = function(parameters) {
eventOnElement: function(event, callback) {
var
$target = $(event.target),
notOnLabel = ($target.closest(selector.siblingLabel).length === 0),
$label = $target.closest(selector.siblingLabel),
notOnLabel = ($module.find($label).length === 0),
notInMenu = ($target.closest($menu).length === 0)
;
callback = $.isFunction(callback)

2
dist/components/dropdown.min.js
File diff suppressed because it is too large
View File

9
dist/semantic.css

@ -1530,11 +1530,13 @@ input::selection {
position: absolute;
height: 100%;
line-height: 1;
border-radius: 0px;
border-top-left-radius: inherit;
border-bottom-left-radius: inherit;
width: 2.57142857em;
background-color: rgba(0, 0, 0, 0.05);
text-align: center;
color: '';
border-radius: 0.28571429rem 0px 0px 0.28571429rem;
box-shadow: -1px 0px 0px 0px transparent inset;
}
@ -1556,7 +1558,9 @@ input::selection {
.ui[class*="right labeled"].icon.button > .icon {
left: auto;
right: 0em;
border-radius: 0em 0.28571429rem 0.28571429rem 0em;
border-radius: 0px;
border-top-right-radius: inherit;
border-bottom-right-radius: inherit;
box-shadow: 1px 0px 0px 0px transparent inset;
}
@ -26173,6 +26177,7 @@ a.ui.card:hover,
backface-visibility: hidden;
outline: none;
vertical-align: baseline;
font-style: normal;
min-height: 17px;
font-size: 1rem;
line-height: 17px;

31
dist/semantic.js

@ -4716,7 +4716,7 @@ $.fn.dropdown = function(parameters) {
toggleBehavior = (module.is.multiple())
? module.show
: module.toggle
;
;
if( module.determine.eventOnElement(event, toggleBehavior) ) {
event.preventDefault();
}
@ -5118,7 +5118,8 @@ $.fn.dropdown = function(parameters) {
eventOnElement: function(event, callback) {
var
$target = $(event.target),
notOnLabel = ($target.closest(selector.siblingLabel).length === 0),
$label = $target.closest(selector.siblingLabel),
notOnLabel = ($module.find($label).length === 0),
notInMenu = ($target.closest($menu).length === 0)
;
callback = $.isFunction(callback)
@ -17983,6 +17984,20 @@ $.api = $.fn.api = function(parameters) {
}
},
decode: {
json: function(response) {
if(response !== undefined && typeof response == 'string') {
try {
response = JSON.parse(response);
}
catch(e) {
// isnt json string
}
}
return response;
}
},
read: {
cachedResponse: function(url) {
var
@ -17994,15 +18009,7 @@ $.api = $.fn.api = function(parameters) {
}
response = sessionStorage.getItem(url);
module.debug('Using cached response', url, response);
if(response !== undefined) {
try {
response = JSON.parse(response);
}
catch(e) {
// didnt store object
}
return response;
}
response = module.decode.json(response);
return false;
}
},
@ -18384,7 +18391,7 @@ $.api = $.fn.api = function(parameters) {
var
// pull response from xhr if available
response = $.isPlainObject(xhr)
? (xhr.responseText)
? module.decode.json(xhr.responseText)
: false,
errorMessage = ($.isPlainObject(response) && response.error !== undefined)
? response.error // use json error message

2
dist/semantic.min.css
File diff suppressed because it is too large
View File

6
dist/semantic.min.js
File diff suppressed because it is too large
View File

6
src/definitions/behaviors/api.js

@ -293,7 +293,7 @@ $.api = $.fn.api = function(parameters) {
}
},
validResponse: function(response) {
if( settings.dataType !== 'json' || !$.isFunction(settings.successTest) ) {
if( (settings.dataType !== 'json' && settings.dataType !== 'jsonp') || !$.isFunction(settings.successTest) ) {
module.verbose('Response is not JSON, skipping validation', settings.successTest, response);
return true;
}
@ -522,7 +522,9 @@ $.api = $.fn.api = function(parameters) {
var
// pull response from xhr if available
response = $.isPlainObject(xhr)
? module.decode.json(xhr.responseText)
? (settings.dataType == 'json' || settings.dataType == 'jsonp')
? module.decode.json(xhr.responseText)
: xhr.responseText
: false,
errorMessage = ($.isPlainObject(response) && response.error !== undefined)
? response.error // use json error message

Loading…
Cancel
Save