This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .inputfile:focus + label { | |
| outline: 1px dotted #000; | |
| outline: -webkit-focus-ring-color auto 5px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <label for="file"><strong>Choose a file</strong></label> | |
| .inputfile + label * { | |
| pointer-events: none; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input type="file" name="file" id="file" class="inputfile" data-multiple-caption="{count} files selected" multiple /> | |
| var inputs = document.querySelectorAll( '.inputfile' ); | |
| Array.prototype.forEach.call( inputs, function( input ) | |
| { | |
| var label = input.nextElementSibling, | |
| labelVal = label.innerHTML; | |
| input.addEventListener( 'change', function( e ) | |
| { | |
| var fileName = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html class="no-js"> | |
| <head> | |
| <!-- remove this if you use Modernizr --> | |
| <script>(function(e,t,n){var r=e.querySelectorAll("html")[0];r.className=r.className.replace(/(^|\s)no-js(\s|$)/,"$1js$2")})(document,window,0);</script> | |
| </head> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .js .inputfile { | |
| width: 0.1px; | |
| height: 0.1px; | |
| opacity: 0; | |
| overflow: hidden; | |
| position: absolute; | |
| z-index: -1; | |
| } | |
| .no-js .inputfile + label { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input.addEventListener( 'focus', function(){ input.classList.add( 'has-focus' ); }); | |
| input.addEventListener( 'blur', function(){ input.classList.remove( 'has-focus' ); }); | |
| .inputfile:focus + label, | |
| .inputfile.has-focus + label { | |
| outline: 1px dotted #000; | |
| outline: -webkit-focus-ring-color auto 5px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyComponent extends React.Component { | |
| // when the component is added to the DOM... | |
| componentDidMount() { | |
| window.addEventListener(‘resize’, this.onResizeHandler); | |
| } | |
| // when the component is removed from the DOM... | |
| componentWillUnmount() { | |
| window.removeEventListener(‘resize’, this.onResizeHandler); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyComponent extends React.Component { | |
| // only re-render if the ID has changed! | |
| shouldComponentUpdate(nextProps, nextState) { | |
| return nextProps.id === this.props.id; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void checkinternet() | |
| { | |
| var connection = NetworkInformation.GetInternetConnectionProfile(); | |
| bool status = (connection != null && | |
| connection.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged; | |
| void NetworkInformation_NetworkStatusChanged(object sender) | |
| { | |
| if (DeviceNetworkInformation.IsNetworkAvailable) | |
| { | |
| //do you task | |
| } | |
| } |