angular-colorbox
Advanced tools
Comparing version 1.1.3 to 1.1.5
{ | ||
"name": "angular-colorbox", | ||
"version": "1.1.3", | ||
"version": "1.1.5", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Igor Lino", |
@@ -9,2 +9,3 @@ (function () { | ||
colorboxService.$inject = []; | ||
function colorboxService() { | ||
@@ -22,3 +23,5 @@ | ||
resize: resize,//This allows Colorbox to be resized based on it's own auto-calculations, or to a specific size. This must be called manually after Colorbox's content has loaded. The optional parameters object can accept width or innerWidth and height or innerHeight. Without specifying a width or height, Colorbox will attempt to recalculate the height of it's current content. | ||
remove: remove//Removes all traces of Colorbox from the document. Not the same as $.colorbox.close(), which tucks colorbox away for future use. | ||
remove: remove,//Removes all traces of Colorbox from the document. Not the same as $.colorbox.close(), which tucks colorbox away for future use. | ||
getCurrentPhoto: getCurrentPhoto //Gets the current photo being shown, if any | ||
}; | ||
@@ -29,3 +32,2 @@ return service; | ||
function colorbox() { | ||
@@ -71,6 +73,13 @@ return $.colorbox; | ||
} | ||
/**Gets the current photo being shown, if any.*/ | ||
function getCurrentPhoto() { | ||
var anyPhoto = $('#cboxLoadedContent .cboxPhoto'); | ||
var photo = anyPhoto.length > 0 ? anyPhoto[0] : null; | ||
return photo; | ||
} | ||
} | ||
colorboxableDirective.$inject = ['$compile', '$rootScope', '$http', '$parse', '$timeout', 'colorboxService']; | ||
function colorboxableDirective($compile, $rootScope, $http, $parse, $timeout, colorboxService) { | ||
colorboxableDirective.$inject = ['$compile', '$rootScope', '$parse', '$timeout']; | ||
function colorboxableDirective($compile, $rootScope, $parse, $timeout) { | ||
var service = { | ||
@@ -87,3 +96,3 @@ restrict: 'A', | ||
colorboxableLink.$inject = ['$scope', '$element', '$attributes']; | ||
function colorboxableLink($scope, $element, $attributes, controller) { | ||
function colorboxableLink($scope, $element, $attributes) { | ||
var cb = null; | ||
@@ -106,3 +115,3 @@ | ||
//generic way that sets all (non-function) parameters of colorbox. | ||
if ($attributes.colorboxable && $attributes.colorboxable.length>0) { | ||
if ($attributes.colorboxable && $attributes.colorboxable.length > 0) { | ||
var cbOptionsFunc = $parse($attributes.colorboxable); | ||
@@ -134,11 +143,11 @@ var cbOptions = cbOptionsFunc($scope); | ||
//$element.bind('load', function() { | ||
/*$scope.$apply(function () { | ||
options.href = $attributes.src ? $attributes.src : $attributes.href; | ||
cb = $.colorbox(options); | ||
});*/ | ||
//wait for the DOM view to be ready | ||
$timeout(function () { | ||
options.href = $attributes.src ? $attributes.src : $attributes.href; | ||
cb = $($element).colorbox(options); | ||
}, 300); | ||
/*$scope.$apply(function () { | ||
options.href = $attributes.src ? $attributes.src : $attributes.href; | ||
cb = $.colorbox(options); | ||
});*/ | ||
//wait for the DOM view to be ready | ||
$timeout(function () { | ||
options.href = $attributes.src ? $attributes.src : $attributes.href; | ||
cb = $($element).colorbox(options); | ||
}, 300); | ||
//}); | ||
@@ -162,4 +171,4 @@ } | ||
colorboxDirective.$inject = ['$compile', '$rootScope', '$http', '$parse', '$timeout', 'colorboxService']; | ||
function colorboxDirective($compile, $rootScope, $http, $parse, $timeout, colorboxService) { | ||
colorboxDirective.$inject = ['$compile', '$rootScope', '$timeout', 'colorboxService']; | ||
function colorboxDirective($compile, $rootScope, $timeout, colorboxService) { | ||
var service = { | ||
@@ -179,5 +188,3 @@ restrict: 'E', | ||
}, | ||
require: 'colorbox', | ||
link: link, | ||
controller: controller, | ||
controllerAs: 'vm' | ||
@@ -189,9 +196,4 @@ }; | ||
controller.$inject = ['$scope']; | ||
function controller($scope) { | ||
} | ||
link.$inject = ['$scope', '$element', '$attributes']; | ||
function link($scope, $element, $attributes, controller) { | ||
function link($scope, $element, $attributes) { | ||
var cb = null; | ||
@@ -292,60 +294,4 @@ | ||
} | ||
} | ||
/* | ||
app.directive('xhrModal', ['$http','$compile', | ||
function ($http, $compile) { | ||
function compile (elem, cAtts) { | ||
var template, | ||
$element, | ||
loader; | ||
loader = $http.get(cAtts.template).success(function (resp) { | ||
template = resp; | ||
}); | ||
return function (scope, elem, lAtts) { | ||
loader.then(function () { | ||
$element = $compile(template)(scope); | ||
}); | ||
scope.close = function() { | ||
jQuery.colorbox.close(); | ||
}; | ||
scope.submit = function() { | ||
var result = scope.formSubmit(); | ||
if (Object.isObject(result)) { | ||
result.success(function() { | ||
jQuery.colorbox.close(); | ||
}); | ||
} else if (result === false) { | ||
//noop | ||
} else { | ||
jQuery.colorbox.close(); | ||
} | ||
}; | ||
elem.on('click', function(e) { | ||
e.preventDefault(); | ||
jQuery.colorbox({inline: true, href: $element}); | ||
}); | ||
} | ||
} | ||
return { | ||
scope: { | ||
formObject: '=', | ||
formErrors: '=', | ||
title: '@', | ||
template: '@', | ||
okButtonText: '@', | ||
formSubmit: '&' | ||
}, | ||
compile: compile | ||
} | ||
} | ||
]); | ||
*/ | ||
}) | ||
(); |
{ | ||
"name": "angular-colorbox", | ||
"version": "1.1.3", | ||
"version": "1.1.5", | ||
"title": "Angular Colorbox", | ||
@@ -5,0 +5,0 @@ "description": "Angular directive for Colorbox, the jQuery lightbox and modal window plugin.", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3875202
213
43320
3
4