Neues Initialrelease mit IonicMaterial

This commit is contained in:
Carsten Hilmer
2016-08-22 12:55:52 +02:00
parent 30a5df79aa
commit 45e482b14d
1249 changed files with 305225 additions and 68794 deletions

View File

@@ -0,0 +1,34 @@
//This is Controller for Dialog box.
appControllers.controller('DialogController', function ($scope, $mdDialog, displayOption) {
//This variable for display wording of dialog.
//object schema:
//displayOption: {
// title: "Confirm to remove all data?",
// content: "All data will remove from local storage.",
// ok: "Confirm",
// cancel: "Close"
//}
$scope.displayOption = displayOption;
$scope.cancel = function () {
$mdDialog.cancel(); //close dialog.
};
$scope.ok = function () {
$mdDialog.hide();//hide dialog.
};
});// End Controller for Dialog box.
//Controller for Toast.
appControllers.controller('toastController', function ($scope, displayOption) {
//this variable for display wording of toast.
//object schema:
// displayOption: {
// title: "Data Saved !"
//}
$scope.displayOption = displayOption;
});// End Controller for Toast.

View File

@@ -0,0 +1,25 @@
//Directive numbersOnly :
//Use for change input to have ability accept only number.
//Example : <input ng-model="contract.age" numbers-only type="tel">
//
appControllers.directive('numbersOnly', function () {
return {
require: 'ngModel',
link: function (scope, element, attr, ngModelCtrl) {
function fromUser(text) {
if (text) {
var transformedInput = text.replace(/[^0-9]/g, '');
if (transformedInput !== text) {
ngModelCtrl.$setViewValue(transformedInput);
ngModelCtrl.$render();
}
return transformedInput;
}
return undefined;
}
ngModelCtrl.$parsers.push(fromUser);
}
};
});// End Directive numbersOnly.

33
www/js/shared/filter.js Normal file
View File

@@ -0,0 +1,33 @@
//Filter epochToDate :
//Use for convert epoch date format to default date format.
//Example :
//<p>{{item.createdAt |epochToDate | date:"short"}}</p>
appControllers.filter('epochToDate', function ($filter) {
return function (input) {
return new Date(Date(input));
};
});// End Filter epochToDate.
//Filter numberSuffix :
//Use for convert number to have suffix 1,000 to 1K.
//Example :
//{{item.likes.summary.total_count | numberSuffix}}
//
appControllers.filter('numberSuffix', function () {
return function (input) {
var exp;
var suffixes = ['k', 'M', 'G', 'T', 'P', 'E'];
if (window.isNaN(input)) {
return 0;
}
if (input < 1000) {
return input;
}
exp = Math.floor(Math.log(input) / Math.log(1000));
return (input / Math.pow(1000, exp)).toFixed(1) + suffixes[exp - 1];
}
});// End Filter numberSuffix.