To have a gulp workflow that with a single process,
- watches for any sass changes, then compiles sass source into css
- watches for any changes in the public directory, triggers live-reload
- serves your static content in
public/
| $(document).ready(function() { | |
| // Загрузка из localStorage сохранённого пункта меню и открытие его | |
| var storage = localStorage.getItem('item'); | |
| if (storage && storage !== "#") { | |
| $('.nav-tabs a[href="' + storage + '"]').tab('show'); | |
| } | |
| // Функция клика на произвольный пункт меню | |
| $('ul.nav').on('click', 'li:not(.active, .dropdown, .disabled, .divider)', function() { |
| <script type="text/javascript"> | |
| (function () { | |
| "use strict"; | |
| // once cached, the css file is stored on the client forever unless | |
| // the URL below is changed. Any change will invalidate the cache | |
| var css_href = './index_files/web-fonts.css'; | |
| // a simple event handler wrapper | |
| function on(el, ev, callback) { | |
| if (el.addEventListener) { | |
| el.addEventListener(ev, callback, false); |
| var gulp = require("gulp"); | |
| var gutil = require("gulp-util"); | |
| var notify = require('gulp-notify'); | |
| var source = require("vinyl-source-stream"); | |
| var buffer = require('vinyl-buffer'); | |
| var browserify = require("browserify"); | |
| var watchify = require("watchify"); | |
| var babelify = require("babelify"); | |
| var browserSync = require("browser-sync").create(); |
| var gulp = require("gulp"); | |
| var browserify = require("browserify"); | |
| var source = require("vinyl-source-stream"); | |
| gulp.task("es6", function() { | |
| return browserify("./src/app.js") | |
| .transform("babelify") | |
| .bundle() | |
| .pipe(source("bundle.js")) | |
| .pipe(gulp.dest("dist")); |
| 'use strict'; | |
| var gulp = require('gulp'); | |
| var sass = require('gulp-sass'); | |
| var ts = require('gulp-typescript'); | |
| var tsProject = ts.createProject('tsconfig.json', {typescript: require('typescript')}); | |
| var paths = { | |
| sass: ['./resources/sass/**/*.scss'], | |
| ts: ['./resources/app/**/*.ts'], |
| Best is Homero Barbosa's answer below: | |
| history.pushState("", document.title, window.location.pathname); | |
| ... or, if you want to maintain the search parameters: | |
| history.pushState("", document.title, window.location.pathname + window.location.search); | |
| EDITED, old, do not use, badwrongfun: | |
| var loc = window.location.href, |
| $('#yearfilter').parent().append('<ul id="newyearfilter" name="yearfilter"></ul>'); | |
| $('#yearfilter option').each(function(){ | |
| $('#newyearfilter').append('<li value="' + $(this).val() + '">'+$(this).text()+'</li>'); | |
| }); | |
| $('#yearfilter').remove(); | |
| $('#newyearfilter').attr('id', 'yearfilter'); | |
| function constructselect(id, name, newId, newName) { | |
| var $id = $('#' + id); |
| var $string = $string.charAt(0).toUpperCase() + $string.slice(1); |
| function getSwipeEvent(deltaX, deltaY) { | |
| switch(true) { | |
| case deltaX >= 50: return new Event('swipeLeft'); | |
| case deltaX <= -50: return new Event('swipeRight'); | |
| case deltaY >= 50: return new Event('swipeUp'); | |
| case deltaY <= -50: return new Event('swipeDown'); | |
| } | |
| } | |
| function swipeEvents() { |