This commit is contained in:
telangpu
2026-05-10 22:39:11 +08:00
parent bc675f5e4d
commit 91fd7ffcf0
395 changed files with 309652 additions and 0 deletions

View File

@@ -0,0 +1,208 @@
/*
angular-md5 - v0.1.8
2015-11-17
*/
/* commonjs package manager support (eg componentjs) */
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports) {
module.exports = "angular-md5";
}
(function(angular) {
angular.module("angular-md5", [ "gdi2290.md5" ]);
angular.module("ngMd5", [ "gdi2290.md5" ]);
angular.module("gdi2290.md5", [ "gdi2290.gravatar-filter", "gdi2290.md5-service", "gdi2290.md5-filter" ]);
"use strict";
angular.module("gdi2290.gravatar-filter", []).filter("gravatar", [ "md5", function(md5) {
var cache = {};
return function(text, defaultText) {
if (!cache[text]) {
defaultText = defaultText ? md5.createHash(defaultText.toString().toLowerCase()) : "";
cache[text] = text ? md5.createHash(text.toString().toLowerCase()) : defaultText;
}
return cache[text];
};
} ]);
"use strict";
angular.module("gdi2290.md5-filter", []).filter("md5", [ "md5", function(md5) {
return function(text) {
return text ? md5.createHash(text.toString().toLowerCase()) : text;
};
} ]);
"use strict";
angular.module("gdi2290.md5-service", []).factory("md5", [ function() {
var md5 = {
createHash: function(str) {
if (null === str) {
return null;
}
var xl;
var rotateLeft = function(lValue, iShiftBits) {
return lValue << iShiftBits | lValue >>> 32 - iShiftBits;
};
var addUnsigned = function(lX, lY) {
var lX4, lY4, lX8, lY8, lResult;
lX8 = lX & 2147483648;
lY8 = lY & 2147483648;
lX4 = lX & 1073741824;
lY4 = lY & 1073741824;
lResult = (lX & 1073741823) + (lY & 1073741823);
if (lX4 & lY4) {
return lResult ^ 2147483648 ^ lX8 ^ lY8;
}
if (lX4 | lY4) {
if (lResult & 1073741824) {
return lResult ^ 3221225472 ^ lX8 ^ lY8;
} else {
return lResult ^ 1073741824 ^ lX8 ^ lY8;
}
} else {
return lResult ^ lX8 ^ lY8;
}
};
var _F = function(x, y, z) {
return x & y | ~x & z;
};
var _G = function(x, y, z) {
return x & z | y & ~z;
};
var _H = function(x, y, z) {
return x ^ y ^ z;
};
var _I = function(x, y, z) {
return y ^ (x | ~z);
};
var _FF = function(a, b, c, d, x, s, ac) {
a = addUnsigned(a, addUnsigned(addUnsigned(_F(b, c, d), x), ac));
return addUnsigned(rotateLeft(a, s), b);
};
var _GG = function(a, b, c, d, x, s, ac) {
a = addUnsigned(a, addUnsigned(addUnsigned(_G(b, c, d), x), ac));
return addUnsigned(rotateLeft(a, s), b);
};
var _HH = function(a, b, c, d, x, s, ac) {
a = addUnsigned(a, addUnsigned(addUnsigned(_H(b, c, d), x), ac));
return addUnsigned(rotateLeft(a, s), b);
};
var _II = function(a, b, c, d, x, s, ac) {
a = addUnsigned(a, addUnsigned(addUnsigned(_I(b, c, d), x), ac));
return addUnsigned(rotateLeft(a, s), b);
};
var convertToWordArray = function(str) {
var lWordCount;
var lMessageLength = str.length;
var lNumberOfWords_temp1 = lMessageLength + 8;
var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - lNumberOfWords_temp1 % 64) / 64;
var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
var lWordArray = new Array(lNumberOfWords - 1);
var lBytePosition = 0;
var lByteCount = 0;
while (lByteCount < lMessageLength) {
lWordCount = (lByteCount - lByteCount % 4) / 4;
lBytePosition = lByteCount % 4 * 8;
lWordArray[lWordCount] = lWordArray[lWordCount] | str.charCodeAt(lByteCount) << lBytePosition;
lByteCount++;
}
lWordCount = (lByteCount - lByteCount % 4) / 4;
lBytePosition = lByteCount % 4 * 8;
lWordArray[lWordCount] = lWordArray[lWordCount] | 128 << lBytePosition;
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
return lWordArray;
};
var wordToHex = function(lValue) {
var wordToHexValue = "", wordToHexValue_temp = "", lByte, lCount;
for (lCount = 0; lCount <= 3; lCount++) {
lByte = lValue >>> lCount * 8 & 255;
wordToHexValue_temp = "0" + lByte.toString(16);
wordToHexValue = wordToHexValue + wordToHexValue_temp.substr(wordToHexValue_temp.length - 2, 2);
}
return wordToHexValue;
};
var x = [], k, AA, BB, CC, DD, a, b, c, d, S11 = 7, S12 = 12, S13 = 17, S14 = 22, S21 = 5, S22 = 9, S23 = 14, S24 = 20, S31 = 4, S32 = 11, S33 = 16, S34 = 23, S41 = 6, S42 = 10, S43 = 15, S44 = 21;
x = convertToWordArray(str);
a = 1732584193;
b = 4023233417;
c = 2562383102;
d = 271733878;
xl = x.length;
for (k = 0; k < xl; k += 16) {
AA = a;
BB = b;
CC = c;
DD = d;
a = _FF(a, b, c, d, x[k + 0], S11, 3614090360);
d = _FF(d, a, b, c, x[k + 1], S12, 3905402710);
c = _FF(c, d, a, b, x[k + 2], S13, 606105819);
b = _FF(b, c, d, a, x[k + 3], S14, 3250441966);
a = _FF(a, b, c, d, x[k + 4], S11, 4118548399);
d = _FF(d, a, b, c, x[k + 5], S12, 1200080426);
c = _FF(c, d, a, b, x[k + 6], S13, 2821735955);
b = _FF(b, c, d, a, x[k + 7], S14, 4249261313);
a = _FF(a, b, c, d, x[k + 8], S11, 1770035416);
d = _FF(d, a, b, c, x[k + 9], S12, 2336552879);
c = _FF(c, d, a, b, x[k + 10], S13, 4294925233);
b = _FF(b, c, d, a, x[k + 11], S14, 2304563134);
a = _FF(a, b, c, d, x[k + 12], S11, 1804603682);
d = _FF(d, a, b, c, x[k + 13], S12, 4254626195);
c = _FF(c, d, a, b, x[k + 14], S13, 2792965006);
b = _FF(b, c, d, a, x[k + 15], S14, 1236535329);
a = _GG(a, b, c, d, x[k + 1], S21, 4129170786);
d = _GG(d, a, b, c, x[k + 6], S22, 3225465664);
c = _GG(c, d, a, b, x[k + 11], S23, 643717713);
b = _GG(b, c, d, a, x[k + 0], S24, 3921069994);
a = _GG(a, b, c, d, x[k + 5], S21, 3593408605);
d = _GG(d, a, b, c, x[k + 10], S22, 38016083);
c = _GG(c, d, a, b, x[k + 15], S23, 3634488961);
b = _GG(b, c, d, a, x[k + 4], S24, 3889429448);
a = _GG(a, b, c, d, x[k + 9], S21, 568446438);
d = _GG(d, a, b, c, x[k + 14], S22, 3275163606);
c = _GG(c, d, a, b, x[k + 3], S23, 4107603335);
b = _GG(b, c, d, a, x[k + 8], S24, 1163531501);
a = _GG(a, b, c, d, x[k + 13], S21, 2850285829);
d = _GG(d, a, b, c, x[k + 2], S22, 4243563512);
c = _GG(c, d, a, b, x[k + 7], S23, 1735328473);
b = _GG(b, c, d, a, x[k + 12], S24, 2368359562);
a = _HH(a, b, c, d, x[k + 5], S31, 4294588738);
d = _HH(d, a, b, c, x[k + 8], S32, 2272392833);
c = _HH(c, d, a, b, x[k + 11], S33, 1839030562);
b = _HH(b, c, d, a, x[k + 14], S34, 4259657740);
a = _HH(a, b, c, d, x[k + 1], S31, 2763975236);
d = _HH(d, a, b, c, x[k + 4], S32, 1272893353);
c = _HH(c, d, a, b, x[k + 7], S33, 4139469664);
b = _HH(b, c, d, a, x[k + 10], S34, 3200236656);
a = _HH(a, b, c, d, x[k + 13], S31, 681279174);
d = _HH(d, a, b, c, x[k + 0], S32, 3936430074);
c = _HH(c, d, a, b, x[k + 3], S33, 3572445317);
b = _HH(b, c, d, a, x[k + 6], S34, 76029189);
a = _HH(a, b, c, d, x[k + 9], S31, 3654602809);
d = _HH(d, a, b, c, x[k + 12], S32, 3873151461);
c = _HH(c, d, a, b, x[k + 15], S33, 530742520);
b = _HH(b, c, d, a, x[k + 2], S34, 3299628645);
a = _II(a, b, c, d, x[k + 0], S41, 4096336452);
d = _II(d, a, b, c, x[k + 7], S42, 1126891415);
c = _II(c, d, a, b, x[k + 14], S43, 2878612391);
b = _II(b, c, d, a, x[k + 5], S44, 4237533241);
a = _II(a, b, c, d, x[k + 12], S41, 1700485571);
d = _II(d, a, b, c, x[k + 3], S42, 2399980690);
c = _II(c, d, a, b, x[k + 10], S43, 4293915773);
b = _II(b, c, d, a, x[k + 1], S44, 2240044497);
a = _II(a, b, c, d, x[k + 8], S41, 1873313359);
d = _II(d, a, b, c, x[k + 15], S42, 4264355552);
c = _II(c, d, a, b, x[k + 6], S43, 2734768916);
b = _II(b, c, d, a, x[k + 13], S44, 1309151649);
a = _II(a, b, c, d, x[k + 4], S41, 4149444226);
d = _II(d, a, b, c, x[k + 11], S42, 3174756917);
c = _II(c, d, a, b, x[k + 2], S43, 718787259);
b = _II(b, c, d, a, x[k + 9], S44, 3951481745);
a = addUnsigned(a, AA);
b = addUnsigned(b, BB);
c = addUnsigned(c, CC);
d = addUnsigned(d, DD);
}
var temp = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
return temp.toLowerCase();
}
};
return md5;
} ]);
})(angular);

View File

@@ -0,0 +1 @@
.ngrateit{cursor:pointer;display:inline-block}.ngrateit-readonly{cursor:default}.ngrateit-star_wrapper{position:relative;display:inline-block;overflow:hidden}.ngrateit-background,.ngrateit-hover,.ngrateit-value{position:absolute;top:0;left:0;background:url(data:image/gif;base64,R0lGODlhEABgAPf9AK2trbW1tb29vd7e3sXFxeZXS8JKSsVSUsdaWufn59Bzc9/f381sbJmZmaWlpe92KexeU+/FKexrIuW2OOVxOMlgYOy8IvaDa79CQtN8fO/v7+2MSZSUlN9pMfX19e7u7u3OSeu9ROt6RPeSfd+vMfvr695qaelgG/WhXemzG/b29vXeXe+IT+/IT/F/L+qJRurLRvHNL/SbWt2oKeVnOO3QWunGQdSEhO2SjfWupO6DfOWtON1gKfOmouSvr/HOU/LQRb1bP75TOeNtYvGPU897e/KLRfTZWu2VWumDQfz478ZqU+a/OdiMjPLWVfLVWOzPeeZ6Oe12MOh5dPXm4fWinvfUvO7DQfzz7/v15tuUlPnu7uZ7Qtqpqe/VTPqciuN3ePfp6cNkS+liWu5lUefEuc5hU/fn5fi1p/3c2Oyhec1nV9ullbhEROzHx/bPz/m4rvKXVfKXWOCqn/CLdvGcle5+QffsvPHcmt54c+7Iw+3CMNlVJfC0te/KxvqqnOa9Qvvt5u+TTNmdJfG5mu7DS+qwrOfCWu6CS/Lc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DJED8eZXkU0QVBiIH8zQiR7oYAyU0EE4bsGKMiBED2sgxhRwgANhNCMIDkzIGeawhCAIQQxsCOBAAgIAOw==);background-repeat:repeat-x;height:100%}.ngrateit-background{width:100%}.ngrateit-reset{display:inline-block;background-repeat:no-repeat;position:relative}.ngrateit-value{background-repeat:repeat-x}

View File

@@ -0,0 +1,149 @@
var module = angular.module('ngRateIt', ['ng']);
module
.directive('ngRateIt', ["$q", function( $q ) {
'use strict';
/*jslint unparam:true */
var link = function ($scope, $element, $attrs) {
if(!$attrs.readOnly){
$scope.readOnly = function(){return false;};
}
if(!$attrs.resetable){
$scope.resetable = function(){return true;};
}
if(!$attrs.beforeRated){
$scope.beforeRated = function(){var d = $q.defer(); d.resolve(); return d.promise;};
}
if(!$attrs.rated){
$scope.rated = function(){return;};
}
if(!$attrs.beforeReset){
$scope.beforeReset = function(){var d = $q.defer(); d.resolve(); return d.promise;};
}
if(!$attrs.reset){
$scope.reset = function(){return;};
}
if(!$attrs.over){
$scope.over = function(){return;};
}
};
/*jslint unparam:false */
return {
scope:{
ngModel : '=',
min : '=?min',
max : '=?max',
step : '=?step',
readOnly : '&?readOnly',
pristine : '=?pristine',
resetable : '&?resetable',
starWidth : '=?starWidth',
starHeight : '=?starHeight',
rated : '=?rated',
reset : '=?reset',
over : '=?over',
beforeRated: '=?beforeRated',
beforeReset: '=?beforeReset'
},
templateUrl: 'ngRateIt/ng-rate-it.html',
require: 'ngModel',
replace: true,
link: link,
controller: 'ngRateItController'
};
}])
.controller('ngRateItController', ["$scope", "$timeout", function ( $scope, $timeout ) {
'use strict';
$scope.isHovering = false;
$scope.offsetLeft = 0;
$scope.orgValue = angular.copy($scope.ngModel);
$scope.hoverValue = 0;
$scope.min = $scope.min || 0;
$scope.max = $scope.max || 5;
$scope.step = $scope.step || 0.5;
$scope.pristine = $scope.orgValue === $scope.ngModel;
$scope.starWidth = $scope.starWidth || 16;
$scope.starHeight = $scope.starHeight || 16;
$scope.resetCssOffset = 4;
var garbage = $scope.$watch('ngModel', function () {
$scope.pristine = $scope.orgValue === $scope.ngModel;
});
$scope.removeRating = function () {
if($scope.resetable() && !$scope.readOnly()){
$scope.beforeReset().then(function() {
$scope.ngModel = $scope.min;
$scope.reset();
});
}
};
$scope.setValue = function () {
if($scope.isHovering && !$scope.readOnly()){
var tmpValue = angular.copy($scope.min+$scope.hoverValue);
$scope.beforeRated(tmpValue).then(function() {
$scope.ngModel = tmpValue;
$scope.isHovering = false;
$timeout(function(){
$scope.rated();
});
});
}
};
$scope.onEnter = function (event) {
$scope.isHovering = true;
$scope.offsetLeft = 0;
var el = event.originalTarget || event.srcElement;
// $scope.offsetLeft = el.getBoundingClientRect().left;
};
// $scope.onHover = function (event) {
// $scope.isHovering = true;
// $scope.hoverValue = Math.round((event.clientX-$scope.offsetLeft)/$scope.starWidth/$scope.step) * $scope.step;
// $scope.over(event, $scope.hoverValue);
// };
// $scope.onLeave = function () {
// $scope.isHovering = false;
// $scope.hoverValue = 0;
// };
// $scope.$on('$destroy', function () {
// garbage();
// });
}])
.run(['$templateCache', function ($templateCache) {
'use strict';
$templateCache.put('ngRateIt/ng-rate-it.html',
'<div class="ngrateit" ng-class="{\'ngrateit-readonly\': readOnly()}">' +
'<div class="ngrateit-star_wrapper" ng-click="setValue()" ng-style="{\'width\': ((max-min)*starWidth)+\'px\', \'height\': starHeight+\'px\'}">' +
'<div class="ngrateit-background"></div>' +
'<div class="ngrateit-value" ng-hide="!readOnly() && hoverValue>0 && hoverValue!==(ngModel-min)" ng-style="{\'width\': (ngModel-min)*starWidth+\'px\', \'background-position\': \'0 \'+(-2*starHeight)+\'px\'}"></div>' +
'<div class="ngrateit-hover" ng-if="!readOnly() && hoverValue!==(ngModel-min)" ng-style="{\'width\': hoverValue*starWidth+\'px\', \'background-position\': \'0 \'+(-3*starHeight)+\'px\'}" ></div>' +
'</div>' +
'</div>'
);
}]);