2015-05-01 09:48:52 -04:00
|
|
|
/*
|
2015-12-10 14:27:54 -05:00
|
|
|
* Application Controller
|
2015-10-15 17:16:35 -04:00
|
|
|
*
|
|
|
|
*/
|
2015-05-01 09:48:52 -04:00
|
|
|
|
2015-05-31 03:14:55 -04:00
|
|
|
angularIO.controller('AppCtrl', ['$mdDialog', '$timeout', '$http', '$sce', function ($mdDialog, $timeout, $http, $sce) {
|
|
|
|
var vm = this;
|
2015-11-03 11:41:38 -05:00
|
|
|
|
2015-05-31 03:14:55 -04:00
|
|
|
vm.showDocsNav = false;
|
|
|
|
vm.showMainNav = false;
|
|
|
|
vm.showMenu = false;
|
2015-05-01 09:48:52 -04:00
|
|
|
|
|
|
|
// TOGGLE MAIN NAV (TOP) ON MOBILE
|
2015-05-31 03:14:55 -04:00
|
|
|
vm.toggleDocsMenu = function () {
|
|
|
|
vm.showDocsNav = !vm.showDocsNav;
|
2015-05-01 09:48:52 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// TOGGLE DOCS NAV
|
2015-05-31 03:14:55 -04:00
|
|
|
vm.toggleMainMenu = function () {
|
|
|
|
vm.showMainNav = !vm.showMainNav;
|
2015-05-01 09:48:52 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// TOGGLE DOCS VERSION & LANGUAGE
|
2015-05-31 03:14:55 -04:00
|
|
|
vm.toggleVersionMenu = function () {
|
|
|
|
vm.showMenu = !vm.showMenu;
|
2015-05-01 09:48:52 -04:00
|
|
|
};
|
|
|
|
|
2015-12-09 15:51:39 -05:00
|
|
|
vm.openFeedback = function() {
|
|
|
|
var configuration = {
|
|
|
|
'productId': '410509',
|
|
|
|
'authuser': '1',
|
|
|
|
'bucket': 'angulario'
|
|
|
|
};
|
|
|
|
userfeedback.api.startFeedback(configuration);
|
|
|
|
};
|
|
|
|
|
2015-05-03 22:09:25 -04:00
|
|
|
/*
|
2015-10-15 17:16:35 -04:00
|
|
|
* Prettify Code
|
|
|
|
*
|
|
|
|
* Finish Rendereding code directives then prettify code
|
|
|
|
*/
|
2015-05-03 22:09:25 -04:00
|
|
|
|
2015-05-03 23:28:21 -04:00
|
|
|
// GRAB ALL TAGS NOT USING DIRECTIVES
|
|
|
|
var preTags = angular.element(document.body).find('pre');
|
|
|
|
|
|
|
|
// LOOP THROUGH AND ADD PRETTIFY CLASS
|
2015-10-15 17:16:35 -04:00
|
|
|
_.each(preTags, function (element) {
|
2015-05-03 23:28:21 -04:00
|
|
|
var preTag = angular.element(element);
|
|
|
|
|
|
|
|
// IF NOT FORMATTED, ADD PRETTY PRINT
|
2015-10-15 17:16:35 -04:00
|
|
|
if (!preTag.hasClass('prettyprint')) {
|
2015-05-03 23:29:54 -04:00
|
|
|
preTag.addClass('prettyprint linenums');
|
2015-05-03 23:28:21 -04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// TRIGGER PRETTYPRINT AFTER DIGEST LOOP COMPLETE
|
2015-05-03 22:09:25 -04:00
|
|
|
$timeout(prettyPrint, 1);
|
2015-10-15 17:16:35 -04:00
|
|
|
} ]);
|