This file contains 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
// FROM http://stackoverflow.com/a/14837021/20595 | |
angular.module("app").directive("focusOn", function($timeout, $parse) | |
{ | |
return { | |
restrict: "A", | |
link: function(scope, element, attrs) | |
{ | |
var model = $parse(attrs.focusOn); | |
var focusListener = scope.$watch(model, function(value) | |
{ |
This file contains 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
angular.module("app").directive("toggleClass", function() | |
{ | |
return { | |
restrict: "A", | |
link: function(scope, element, attrs) | |
{ | |
element.bind("click", function() | |
{ | |
element.toggleClass(attrs.toggleClass); | |
}); |
This file contains 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
angular.module("hedge").directive("toggleClassSingularly", function() | |
{ | |
return { | |
restrict: "A", | |
link: function(scope, element, attrs) | |
{ | |
scope.$root.$on("singular-class-toggled", function(event, args) | |
{ | |
if (args.class === attrs.toggleClassSingularly && args.element !== element) | |
{ |
This file contains 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
angular.module("app").filter("meta", function($filter) | |
{ | |
return function() | |
{ | |
var filterName = [].splice.call(arguments, 1, 1)[0] || "filter"; | |
var filter = filterName.split(":"); | |
if (filter.length > 1) | |
{ | |
filterName = filter[0]; | |
for (var i = 1, k = filter.length; i < k; i++) |
This file contains 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
// FROM https://github.com/lorenzofox3/Smart-Table/issues/235#issuecomment-64878223 | |
angular.module("app").directive("expose", function() | |
{ | |
return { | |
require:"stTable", | |
link: function(scope, element, attr, ctrl) | |
{ | |
if (attr["expose"].length > 0) | |
{ | |
if (!scope.$parent.smartTable) |
This file contains 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
{"searchEngine":"http://www.google.com/search?q=","commandEngine":"yubnub","quixUrl":"http://quixapp.com/quix.txt","searchBookmarks":true,"scrollingSpeed":"500","outsideScrolling":false,"shortcutKey":"90","upScrollingKey":"87","downScrollingKey":"83","tabManager":true,"tabManagerShortcutKey":"190","hyper":false,"size":"medium","theme":"GleeThemeDefault","disabledUrls":["mail.google.com","wave.google.com","mail.yahoo.com"],"esp":true,"espVisions":[{"url":"google.com/search","selector":"h3:not(ol.nobr>li>h3),a:contains(Next)"},{"url":"bing.com/search","selector":"div.sb_tlst"},{"url":"pinboard.in","selector":"a.bookmark_title"},{"url":"instapaper.com","selector":"a.article_title"}],"scrapers":[{"command":"?","nullMessage":"Could not find any input elements on the page.","selector":"input:enabled:not(#gleeSearchField),textarea","cssStyle":"GleeReaped"},{"command":"img","nullMessage":"Could not find any linked images on the page.","selector":"a > img","cssStyle":"GleeReaped"},{"command":"h","nullMessage":"Could n |
This file contains 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
angular.module("app").directive("validateDateGreaterThan", function() | |
{ | |
return { | |
require: "ngModel", | |
scope: | |
{ | |
firstDate: "=validateDateGreaterThan" | |
}, | |
link: function(scope, element, attrs, ngModel) | |
{ |
This file contains 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
angular.module("app").directive("clickToEdit", function() | |
{ | |
return { | |
restrict: "A", | |
link: function link(scope, element) | |
{ | |
var LEFT = 37, UP = 38, RIGHT = 39, DOWN = 40, ENTER = 13; | |
var navKeys = [ LEFT, UP, RIGHT, DOWN, ENTER ]; | |
element.attr("contenteditable", true); | |
element.on("focus", function(e) |
This file contains 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
angular.module("app").directive("setPrintToLandscape", function($document) | |
{ | |
return { | |
restrict: "AE", | |
link: function link(scope) | |
{ | |
// Currently only supported in Chrome. | |
// FF - https://bugzilla.mozilla.org/show_bug.cgi?id=851441 | |
// Safari - https://bugs.webkit.org/show_bug.cgi?id=63575 | |
var newSheet = angular.element("<style/>").attr({ "type":"text/css", "media":"print" }); |