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
var index = $scope.Agents.indexOf(agent); | |
$scope.Agents.splice(index, 1); |
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
//Get the url parameters | |
NameValueCollection nvc = HttpUtility.ParseQueryString(Request.RequestUri.Query); | |
var qcBsTypeId = nvc["bsType"] ?? String.Empty; //查詢條件 : 作業類別 | |
var qcCustId = nvc["customer"] ?? String.Empty; //查詢條件 : 客戶 | |
var qcScheduleDateFrom = nvc["scheduleDateFrom"] ?? String.Empty; //查詢條件 : 運送日期(From) | |
var qcScheduleDateTo = nvc["scheduleDateTo"] ?? String.Empty; //查詢條件 : 運送日期(To) |
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
setTimeout(function () { | |
// Whatever you want to do after the wait | |
}, 1000); |
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
/** | |
* @see https://github.com/siongui/palidictionary/blob/master/static/js/draggable.js | |
* @see http://docs.angularjs.org/guide/compiler | |
*/ | |
angular.module('draggableModule', []). | |
directive('draggable', ['$document' , function($document) { | |
return { | |
restrict: 'A', | |
link: function(scope, elm, attrs) { |
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
Array.prototype.move = function (old_index, new_index) { | |
if (new_index >= this.length) { | |
var k = new_index - this.length; | |
while ((k--) + 1) { | |
this.push(undefined); | |
} | |
} | |
this.splice(new_index, 0, this.splice(old_index, 1)[0]); | |
return this; // for testing purposes | |
}; |
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
/** | |
* Returns a random number between min (inclusive) and max (exclusive) | |
*/ | |
function getRandomArbitrary(min, max) { | |
return Math.random() * (max - min) + min; | |
} | |
/** | |
* Returns a random integer between min (inclusive) and max (inclusive) | |
* Using Math.round() will give you a non-uniform distribution! |
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
{ | |
"name": "welfare.website", | |
"version": "1.0.0", | |
"license": "MIT", | |
"angular-cli": {}, | |
"scripts": { | |
"start": "ng serve", | |
"build": "ng build --prod", | |
"lint": "tslint \"src/**/*.ts\"", | |
"test": "ng test", |
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
function multiple(x,y){ | |
return x/(1/y) | |
} | |
//Demo | |
//[1,2,3,4,5].forEach(x=>{console.log(multiple(x,8))}) | |
//>8,16,24,32,40 |
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
private countSort( | |
rangeMin: number, rangeMax: number, arr: number[]) { | |
let mappingArr: boolean[] = []; | |
//Initial | |
for (let i = rangeMin; i <= rangeMax; i++) { | |
mappingArr[i] = false; |
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
var grid = $("#" + jqGridID); | |
var rows = grid.jqGrid('getGridParam', 'data'); //var rows = grid.getGridParam('data'); | |
var indexes = grid.jqGrid('getGridParam', '_index'); | |
var rowid; | |
for (rowid in indexes) { | |
if (indexes.hasOwnProperty(rowid)) { |
OlderNewer