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
| (function ($) { | |
| $.fn.inlineStyle = function (prop) { | |
| var styles = this.attr("style"), | |
| value; | |
| styles && styles.split(";").forEach(function (e) { | |
| var style = e.split(":"); | |
| if ($.trim(style[0]) === prop) { | |
| value = style[1]; | |
| } | |
| }); |
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
| var MYAPP = MYAPP || {}; //isolated namespace | |
| //общий для всех страниц модуль Функционал общий для всех страниц | |
| MYAPP.mainPage = (function() { | |
| // variables | |
| var that = {}; | |
| that.settings = {}; //свойства по умолчанию | |
| //dependences | |
| var common = MYAPP.common; | |
| //private |
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
| HLP.whatBrowser({'browser name [browser version]':'string to return by function', ...}); |
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
| HLP.whatDevice.iOS(); // returns true on iOS Devices | |
| HLP.whatDevice.Android(); // returns true on Android Devices | |
| HLP.whatDevice.BlackBerry(); // returns true on BlackBerry Devices | |
| HLP.whatDevice.Opera(); // returns true on any Devices with Opera Mini or Opera Mobile browser | |
| HLP.whatDevice.Windows(); // returns true on Devices with IE Mobile browser | |
| HLP.whatDevice.any(); // returns true on any mobile device |
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
| var inlineStyleElement = document.querySelector("#inlineStyleExample"), | |
| inlineOutputElement = document.querySelector("#resultInline"); | |
| inlineOutputElement.innerHTML = HLP.inlineStyle(inlineStyleElement, 'color'); |
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
| //reload 1 iframe | |
| $('#iframe')[0].contentWindow.location.reload(true); | |
| //reload all iFrames | |
| $('iframe').each(function() { | |
| this.contentWindow.location.reload(true); | |
| }); | |
| //Another way to reload all iFrames | |
| $('iframe').attr('src', $('iframe').attr('src')); |
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
| -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4); | |
| -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4); | |
| -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, .4); | |
| -o-box-shadow: 0 1px 3px rgba(0, 0, 0, .4); | |
| box-shadow: 0 1px 3px rgba(0, 0, 0, .4); |
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
| .sprite(@x:0, @y:0){ | |
| background: url(../images/sprites.png) @x @y no-repeat; | |
| } |
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
| .png(@name, @x:0, @y:0, @repeat:no-repeat){ | |
| background: url('../images/@{name}.png') @x @y @repeat; | |
| } | |
| .jpg(@name, @x:0, @y:0, @repeat:no-repeat){ | |
| background: url('../images/@{name}.jpg') @x @y @repeat; | |
| } |
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
| Object.prototype.renameProperty = function (oldName, newName) { | |
| // Check for the old property name to avoid a ReferenceError in strict mode. | |
| if (this.hasOwnProperty(oldName)) { | |
| this[newName] = this[oldName]; | |
| delete this[oldName]; | |
| } | |
| return this; | |
| }; |