And example app to demonstrate the issue in chromium.
clone this sources and run npm install && npm start, then go to localhost:1337.
And example app to demonstrate the issue in chromium.
clone this sources and run npm install && npm start, then go to localhost:1337.
| //update class on route change | |
| angular.module('myApp', ['ngRoute']).run(function($rootScope, $rootElement) { | |
| var view = angular.element($rootElement[0].querySelector('[ng-view]')); | |
| $rootScope.$on('$routeChangeSuccess', function(event, to, from) { | |
| view.removeClass(from.viewClass).addClass(to.viewClass); | |
| }); | |
| }); | |
| //define classes while define routes | |
| angular.module('myApp').config(function($routeProvider) { |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-resources-plugin</artifactId> | |
| <configuration> | |
| <outputDirectory>target/package/</outputDirectory> | |
| <resources> | |
| <resource> | |
| <directory>src</directory> | |
| <includes> | |
| <include>config/**</include> |
| function PageFactory(config) { | |
| function Page(element) { | |
| this.element = element; | |
| this.config = config; | |
| this.get = function(key) { | |
| var item = config[key]; | |
| if(!item) { | |
| throw new Error('No item named "'+key+'" provided') | |
| } | |
| if(typeof item === 'string') { |
| (function() { | |
| var bear = '<img src="http://placebear.com/g/400/200">'; | |
| if(typeof modules !== 'undefined') { | |
| modules.define("bear", function(provide) { | |
| provide(bear); | |
| }); | |
| } else { | |
| define('bear', bear); | |
| } | |
| })(); |
| @block: widget-a; | |
| .@{block} { | |
| color: red; | |
| } |
| <!DOCTYPE html> | |
| <html> | |
| <head lang="en"> | |
| <meta charset="UTF-8"> | |
| <title>CDN or not</title> | |
| <script> | |
| if(location.search.indexOf('cdn') > -1) { | |
| document.write(unescape("%3Cscript src='http://yastatic.net/jquery/2.1.3/jquery.min.js' type='text/javascript'%3E%3C/script%3E")); | |
| } else { | |
| document.write(unescape("%3Cscript src='jquery.min.js' type='text/javascript'%3E%3C/script%3E")); |
| angular.module('directive.ionSlider', []).directive('ionSlider', ['$document', function($document) { | |
| "use strict"; | |
| return { | |
| restrict: 'EA', | |
| require: 'ngModel', | |
| template: '<input type="text" />', | |
| link: function(scope, element, attrs, ngModel) { | |
| var input = element.find('input'), | |
| isDouble = attrs.type === 'double'; | |
| input.ionRangeSlider({ |
| /** | |
| * Wrap gulp streams into fail-safe function for better error reporting | |
| * Usage: | |
| * gulp.task('less', wrapPipe(function(success, error) { | |
| * return gulp.src('less/*.less') | |
| * .pipe(less().on('error', error)) | |
| * .pipe(gulp.dest('app/css')); | |
| * })); | |
| */ |
Недавно я предлагал идею, как можно проверить разницу в исполнении одного и того же кода в разных браузерах.
Теперь эта идея реализована и доступна по адресу multieval.it. Выбираем интересующие браузеры, вводим код, жмем "Evaluate", сравниваем результат.
С помощью этого иструмента можно узнать ответы на разные интересные вопросы.
document.currentScript?offsetX у событий мыши?