Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('Gloot', ["GlootService"]).config(['$provide', function($provide) {
- $provide.decorator('$browser', ['$delegate', function($delegate) {
- var superUrl = $delegate.url;
- $delegate.url = function(url, replace) {
- if(url !== undefined) {
- return superUrl(url.replace(/\%20/g,"+"), replace);
- } else {
- return superUrl().replace(/\+/g,"%20");
- }
- }
- return $delegate;
- }]);
- //$translateProvider.preferredLanguage('en');
- }]).controller('GlootController', ['$scope', 'GlootService', '$q', '$timeout', function($scope, GlootService, $q, $timeout) {
- /* PRIVATE MEMBERS --------------------------------------------------------------------------------- */
- var GlootWrapper = new _GlootWrapper($q, Gloot);
- /* $SCOPED MEMBERS --------------------------------------------------------------------------------- */
- $scope.count = 0;
- $scope.respCount = 0;
- $scope.wrapper = GlootWrapper;
- $scope.r = GlootResponses;
- $scope.joel = "";
- /* GLOBAL LOADING ---------------------------------------------------------------------------------- */
- var loading = {};
- $scope.isLoading = function() {
- if (arguments.length > 0)
- for(var i=0;i<arguments.length;i++)
- if (loading[arguments[i]] === true)
- return true;
- return false;
- }
- /* TEST FORM ---------------------------------------------------------------------------------------- */
- $scope.testForm = {'name' : '', 'email' : '', 'pass' : '', error : {}, loading : false};
- $scope.submitTestForm = function() {
- console.log("KUK");
- $scope.testForm['error'] = {};
- var v = $scope.testForm;
- if(v['name'].length <= 3) {
- v['error']['name'] = 'Name must be at least three characters long!';
- return;
- }
- $scope.testForm['loading'] = true;
- $timeout(function() {
- $scope.testForm['loading'] = false;
- }, 2000);
- }
- /* -------------------------------------------------------------------------------------------------- */
- $scope.getGloot = function() {
- return Gloot;
- }
- $scope.onMouseMove = function() {
- try {
- $scope.count++;
- $scope.wrapper.updateMouse($scope.count, $scope.count).then(function(resp) {
- $scope.joel = resp[0] + " : " + resp[1];
- });
- } catch(e) {
- document.getElementById("kuk").innerHTML = e.toString();
- }
- }
- $scope.getDebugMarkup = function() {
- }
- }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement