<a href="http://www.omniture.com" mce_href="http://www.omniture.com" title='Web Analytics'><img alt='' border='0' height='1' src="http://mssto.112.2o7.net/b/ss/msstoextblogsnojs/1/H.20.2--NS/0" mce_src="http://mssto.112.2o7.net/b/ss/msstoextblogsnojs/1/H.20.2--NS/0" width='1' /></a>\r\n\r\n

\"SubscriptionSetup

There\r\n are two steps to using the Microsoft Translator service. The first is \r\nto create a subscription to the Microsoft Translator service on the \r\nAzure Data Marketplace. An Azure Data Marketplace account is free, and \r\nthe starter tier of the Microsoft Translator is free. So far, so good. \r\nThe second step is to register an application with your ADM account. \r\nThis registration is basically the credential your application will use \r\nto log into ADM and leverage the Microsoft Translator service.

Why\r\n register your app? If you ever lose control of your app credentials, \r\nyou can simply delete your app registration – you don’t have to delete \r\nyour whole ADM account. You can also register more than one app with \r\nyour ADM account. This let’s you manage at a granular level of \r\ncredential (which cannot conduct commerce), compared to your personal \r\nADM credentials (which can conduct commerce).

Here’s a video to make it super clear!

In\r\n the video above I step through the two-part process to use the \r\nMicrosoft Translator service. Subscribing to the service itself, and \r\nregistering your application – creating the credentials your app will \r\nuse to access the service.

  1. Subscribe here: http://datamarket.azure.com/dataset/bing/microsofttranslator
  2. Register here: https://datamarket.azure.com/applications/register

Implementation

So,\r\n I use two helpers in this demo. The first is my DelegateCommand. This \r\nit the command implementation for MVVM; I use this to create the \r\nTranslateCommand in my ViewModel. The second is my TranslatorHelper. \r\nThis handles the oauth to fetch the ADM access token and properly \r\nimplements the DetectAsync(), TranslateAsync(), and SpeakAsync() \r\nmethods.

  1. Get my DelegateCommand: http://codepaste.net/ho9s5a
  2. Get my TranslatorHelper: http://codepaste.net/hgrb91

Here’s a video to show a simple implementation!

In\r\n the video above, I create a simple demo app. Don’t be mislead, a demo \r\nlike this is far from a polished application – missing error handling \r\nand so much more. But it’s a great demonstration to show how easily you \r\ncan incorporate sophisticated functionality in your Windows 8 app.

  1. API reference: http://msdn.microsoft.com/en-us/library/ff512435.aspx
  2. Service Reference: http://api.microsofttranslator.com/V2/Soap.svc

The MediaElement

The <MediaElement\r\n /> element is a handy element to show video and play audio in your \r\nXAML application. This is what I use to play the audio of the spoken \r\ntext. If you would like to learn more about the MediaElement you can \r\nreview the QuickStart here.

QuickStart: To play audio and video media in your Windows Store app using C++, C#, or Visual Basic, use the MediaElement class. The MediaElement\r\n object exposes properties and methods for playing back media. It is the\r\n responsibility of the programmer to create the event handlers which \r\nenable this functionality. For example, if you wanted to expose the \r\nability to start the media in your application, you could create a Button and in the Button event handler you would call Play to start the media.

The Demo XAML

The\r\n whole demo only has four lines of XAML. This is because the bulk of the\r\n logic is rightfully in the ViewModel. This also means that I will be \r\nable to test my ViewModel and not worry about complications and UI \r\ndependencies if it was in the code behind. Check it out:

\"XAML

The Demo Code

Other\r\n than the property definitions, the few lines below represent the entire\r\n functionality of the demo. Most of this abbreviation is because of \r\nXAML’s native binding ability. But, to be fair, a lot of the cleanliness\r\n of the code is because of my TranslatorHelper that encapsulates the \r\nbulk of logic. In either case, it’s a dramatic demonstration of how \r\nsimply the service can be included in your app.

\"ViewModel

In\r\n the code above, the core logic is in the Execute of the \r\nTranslateCommand. This DelegateCommand is bound to the <Button /> \r\nthat, when clicked, invokes the Execute delegate. And stepping through \r\nit, we setup the TranslatorHelper, detect the language of the input \r\nstring, translate the input string to French, and then fetch the URL \r\nthat speaks the resulting text. It’s super cool.

Conclusion

The\r\n Microsoft Translator service is a powerful service available to \r\ndevelopers to add significant functionality to their Windows 8 \r\napplications. The service, hosted in the Azure Data Marketplace, has \r\nother APIs, too! There’s an Odata API and a REST API that opens it to \r\neven more potential client implementations. Either way, this is far too \r\ncool to not investigate more.

More resources:

  1. Azure Data Marketplace: https://datamarket.azure.com/
  2. Translator Dev Center: http://api.microsofttranslator.com
  3. Translator Service: http://datamarket.azure.com/dataset/bing/microsofttranslator
  4. SOAP Reference: http://go.microsoft.com/?linkid=9671507
  5. REST Reference: http://go.microsoft.com/?linkid=9671505
  6. AJAX Reference: http://go.microsoft.com/?linkid=9671506
  7. API reference: http://msdn.microsoft.com/en-us/library/ff512435.aspx
  8. Service Reference: http://api.microsofttranslator.com/V2/Soap.svc
  9. DelegateCommand: http://codepaste.net/ho9s5a
  10. TranslatorHelper: http://codepaste.net/hgrb91
  11. Bing Translator: http://www.bing.com/translator

Best of luck!

 

 

 

","bodyAsHTML":"The Microsoft Translator is a powerful service that developers can \r\nleverage in their Windows 8 apps. Its core functions are to detect the \r\nlanguage of some text. To translate text from one language to another. \r\nAnd, to read text to you – that’s right! The API is hosted on Azure’s \r\nData Marketplace. It has a pricing schedule, including a free tier that \r\ndevelopers can leverage to develop with the API.

ADM:\r\n Microsoft Translator delivers automatic translation (Machine \r\nTranslation) of a text into a specified language. It is a \r\nstate-of-the-art statistical machine translation system translating \r\nbetween any of the supported languages, and powering millions of \r\ntranslations every day. It also provides additional functionality such \r\nas detection of the language of a given text. For more technical \r\ninformation about Microsoft Translator, please visit \r\nhttp://api.microsofttranslator.com.

\r\n\r\n\r\n\r\n

\"SubscriptionSetup

There\r\n are two steps to using the Microsoft Translator service. The first is \r\nto create a subscription to the Microsoft Translator service on the \r\nAzure Data Marketplace. An Azure Data Marketplace account is free, and \r\nthe starter tier of the Microsoft Translator is free. So far, so good. \r\nThe second step is to register an application with your ADM account. \r\nThis registration is basically the credential your application will use \r\nto log into ADM and leverage the Microsoft Translator service.

Why\r\n register your app? If you ever lose control of your app credentials, \r\nyou can simply delete your app registration – you don’t have to delete \r\nyour whole ADM account. You can also register more than one app with \r\nyour ADM account. This let’s you manage at a granular level of \r\ncredential (which cannot conduct commerce), compared to your personal \r\nADM credentials (which can conduct commerce).

Here’s a video to make it super clear!

In\r\n the video above I step through the two-part process to use the \r\nMicrosoft Translator service. Subscribing to the service itself, and \r\nregistering your application – creating the credentials your app will \r\nuse to access the service.

  1. Subscribe here: http://datamarket.azure.com/dataset/bing/microsofttranslator
  2. Register here: https://datamarket.azure.com/applications/register

Implementation

So,\r\n I use two helpers in this demo. The first is my DelegateCommand. This \r\nit the command implementation for MVVM; I use this to create the \r\nTranslateCommand in my ViewModel. The second is my TranslatorHelper. \r\nThis handles the oauth to fetch the ADM access token and properly \r\nimplements the DetectAsync(), TranslateAsync(), and SpeakAsync() \r\nmethods.

  1. Get my DelegateCommand: http://codepaste.net/ho9s5a
  2. Get my TranslatorHelper: http://codepaste.net/hgrb91

Here’s a video to show a simple implementation!

In\r\n the video above, I create a simple demo app. Don’t be mislead, a demo \r\nlike this is far from a polished application – missing error handling \r\nand so much more. But it’s a great demonstration to show how easily you \r\ncan incorporate sophisticated functionality in your Windows 8 app.

  1. API reference: http://msdn.microsoft.com/en-us/library/ff512435.aspx
  2. Service Reference: http://api.microsofttranslator.com/V2/Soap.svc

The MediaElement

The <MediaElement\r\n /> element is a handy element to show video and play audio in your \r\nXAML application. This is what I use to play the audio of the spoken \r\ntext. If you would like to learn more about the MediaElement you can \r\nreview the QuickStart here.

QuickStart: To play audio and video media in your Windows Store app using C++, C#, or Visual Basic, use the MediaElement class. The MediaElement\r\n object exposes properties and methods for playing back media. It is the\r\n responsibility of the programmer to create the event handlers which \r\nenable this functionality. For example, if you wanted to expose the \r\nability to start the media in your application, you could create a Button and in the Button event handler you would call Play to start the media.

The Demo XAML

The\r\n whole demo only has four lines of XAML. This is because the bulk of the\r\n logic is rightfully in the ViewModel. This also means that I will be \r\nable to test my ViewModel and not worry about complications and UI \r\ndependencies if it was in the code behind. Check it out:

\"XAML

The Demo Code

Other\r\n than the property definitions, the few lines below represent the entire\r\n functionality of the demo. Most of this abbreviation is because of \r\nXAML’s native binding ability. But, to be fair, a lot of the cleanliness\r\n of the code is because of my TranslatorHelper that encapsulates the \r\nbulk of logic. In either case, it’s a dramatic demonstration of how \r\nsimply the service can be included in your app.

\"ViewModel

In\r\n the code above, the core logic is in the Execute of the \r\nTranslateCommand. This DelegateCommand is bound to the <Button /> \r\nthat, when clicked, invokes the Execute delegate. And stepping through \r\nit, we setup the TranslatorHelper, detect the language of the input \r\nstring, translate the input string to French, and then fetch the URL \r\nthat speaks the resulting text. It’s super cool.

Conclusion

The\r\n Microsoft Translator service is a powerful service available to \r\ndevelopers to add significant functionality to their Windows 8 \r\napplications. The service, hosted in the Azure Data Marketplace, has \r\nother APIs, too! There’s an Odata API and a REST API that opens it to \r\neven more potential client implementations. Either way, this is far too \r\ncool to not investigate more.

More resources:

  1. Azure Data Marketplace: https://datamarket.azure.com/
  2. Translator Dev Center: http://api.microsofttranslator.com
  3. Translator Service: http://datamarket.azure.com/dataset/bing/microsofttranslator
  4. SOAP Reference: http://go.microsoft.com/?linkid=9671507
  5. REST Reference: http://go.microsoft.com/?linkid=9671505
  6. AJAX Reference: http://go.microsoft.com/?linkid=9671506
  7. API reference: http://msdn.microsoft.com/en-us/library/ff512435.aspx
  8. Service Reference: http://api.microsofttranslator.com/V2/Soap.svc
  9. DelegateCommand: http://codepaste.net/ho9s5a
  10. TranslatorHelper: http://codepaste.net/hgrb91
  11. Bing Translator: http://www.bing.com/translator

Best of luck!

 

 

 

","author":{"id":954995,"username":"Jerry Nixon","realname":null,"emailHash":"1679f0ca80c657f1fca8fbcc74eeefe1","avatar":"https://secure.gravatar.com/avatar/1679f0ca80c657f1fca8fbcc74eeefe1?d=identicon&r=PG","reputation":0},"activeRevisionId":543145,"revisionIds":[543145],"lastActiveUserId":954995,"lastActiveDate":1350175218000,"parentId":null,"parentAuthor":null,"originalParentId":null,"childrenIds":[651114],"commentIds":[651114],"marked":true,"topics":["mobile","tips and tricks",".net & windows","windows 8"],"primaryContainerId":8,"containerIds":[7,8],"plug":"walkthrough-adding-text","wiki":false,"score":0,"depth":0},"enableThreadedComments":true,"portal":{"topic":{"id":"29","type":"topic","creationDate":1434655010000,"creationDateFormatted":"06/18/2015 07:16 PM","name":"mobile","createdBy":{"id":2,"username":"matt"},"parentTopics":[],"childTopics":[],"usedCount":36135},"blurb":"Mobile App developer news, tools and training resources from DZone, the trusted source for advanced software design, web development and devops best practices.","code":"mobile","id":9,"creationDate":1434673929000,"creationDateFormatted":"06/19/2015 12:32 AM","displayTitle":"Mobile Zone: Mobile app development news, tutorials & tools","title":"Mobile","new":false,"order":9,"shortTitle":"mobile-app-developer-tutorials-tools-news","color":"yellow","pageTitle":"Mobile App Development News, Tools & Training - DZone","active":true,"modificationDate":1437510259000,"modificationDateFormatted":"07/21/2015 08:24 PM"},"contentType":"article"}],"loadedStyles":[["/lib/bootstrap/bootstrap.less","/lib/font-awesome/font-awesome.less","/lib/fontello/css/fontello.css","/lib/fontello/css/animation.css","/lib/angular-ui/select.css","/lib/ngDialog/css/ngDialog.css","/less/ngDialog-theme.less","/lib/bootstrap-switch/bootstrap-switch.css","/less/dzone20.less","/less/fonts.less","/less/directives.less","/lib/slick/slick.css","/lib/bootstrap-slider/bootstrap-slider.css","/less/layout.less","/widgets/article/content/article-content.less","/widgets/article/infoBar/widget.less","/widgets/components/slider/widget.less","/widgets/content/commentsSlider/widget.less","/widgets/header/blackBar/widget.less","/widgets/header/main/header-common.less","/widgets/header/main/widget.less","/widgets/sidebar/content/list/list.less","/widgets/sidebar/tapBar/sidebar-list.less","/widgets/sidebar/tapBar/widget.less","/widgets/users/UserHomeMiniProfile/widget.less"]],"loadedScripts":[["/lib/jquery/jquery.js","/lib/lodash/lodash.js","/lib/moment/moment.js","/scripts/utils.js","/lib/angular/angular.js","/lib/angular/angular-sanitize.js","/lib/local-storage/angular-local-storage.js","/lib/bootstrap/bootstrap.js","/lib/angular-ui/bootstrap.js","/lib/angular-ui/select.js","/lib/bootstrap-switch/bootstrap-switch.js","/lib/ngDialog/js/ngDialog.js","/lib/angular-moment/angular-moment.js","/scripts/app.js","/scripts/socket.js","/scripts/services.js","/scripts/ui-services.js","/scripts/directives.js","/scripts/filters.js","/lib/angular-touch/angular-touch.min.js","/lib/elastic/elastic.js","/lib/ng-file-upload/angular-file-upload-all.js","/lib/angular-deckgrid/angular-deckgrid.js","/scripts/dzone.js","/scripts/ads.js","/scripts/head.js","/scripts/links.js","/scripts/utilities/directives.js","/scripts/utilities/services.js","/scripts/utilities/image-editor.js","/lib/bootstrap-slider/bootstrap-slider.js","/lib/bootstrap-slider/directive.js","/lib/angular-draganddrop/draganddrop.js","/widgets/article/content/utils.js","/widgets/article/infoBar/services.js","/widgets/components/slider/service.js","/widgets/header/main/angulartics-ga.js","/widgets/header/main/angulartics.js","/widgets/header/main/resize.js","/widgets/sidebar/content/list/service.js","/widgets/sidebar/tapBar/directive.js","/widgets/sidebar/tapBar/service.js"]],"TH_CSRF":"987939359502431236","botInfo":[{"isRenderBot":false}],"request":[{"site":{"id":7,"title":"DZone: Programming & DevOps news, tutorials & tools","keywords":"programming, software development, devops, java, agile, web, iot, database, mobile, big data, cloud","description":"Programming, Web Development, and DevOps news, tutorials and tools for beginners to experts. Hundreds of free publications, over 1M members, totally free.","name":"DZone.com"},"dev":false,"cdn":["dz2cdn1.dzone.com","dz2cdn2.dzone.com","dz2cdn3.dzone.com","dz2cdn4.dzone.com"],"theme":"dz20","context":"","user":{"id":2500002,"authenticated":false,"name":"Anonymous","realName":null,"avatar":"https://secure.gravatar.com/avatar/?d=identicon&r=PG","profile":"/users/2500002/anon-user.html"}}],"portals":[[{"topic":8,"id":2,"shortTitle":"agile-methodology-training-tools-news","color":"red","name":"Agile","code":"agile","url":"/agile-methodology-training-tools-news"},{"topic":6129,"id":3,"shortTitle":"big-data-analytics-tutorials-tools-news","color":"green","name":"Big Data","code":"big-data","url":"/big-data-analytics-tutorials-tools-news"},{"topic":30,"id":4,"shortTitle":"cloud-computing-tutorials-tools-news","color":"orange","name":"Cloud","code":"cloud","url":"/cloud-computing-tutorials-tools-news"},{"topic":59,"id":5,"shortTitle":"database-sql-nosql-tutorials-tools-news","color":"purple","name":"Database","code":"database","url":"/database-sql-nosql-tutorials-tools-news"},{"topic":31,"id":6,"shortTitle":"devops-tutorials-tools-news","color":"yellow","name":"DevOps","code":"devops","url":"/devops-tutorials-tools-news"},{"topic":1138,"id":7,"shortTitle":"enterprise-integration-training-tools-news","color":"green","name":"Integration","code":"integration","url":"/enterprise-integration-training-tools-news"},{"topic":48,"id":8,"shortTitle":"iot-developer-tutorials-tools-news-reviews","color":"orange","name":"IoT","code":"iot","url":"/iot-developer-tutorials-tools-news-reviews"},{"topic":1,"id":1,"shortTitle":"java-jdk-development-tutorials-tools-news","color":"purple","name":"Java","code":"java","url":"/java-jdk-development-tutorials-tools-news"},{"topic":29,"id":9,"shortTitle":"mobile-app-developer-tutorials-tools-news","color":"yellow","name":"Mobile","code":"mobile","url":"/mobile-app-developer-tutorials-tools-news"},{"topic":653,"id":10,"shortTitle":"apm-tools-performance-monitoring-optimization","color":"red","name":"Performance","code":"performance","url":"/apm-tools-performance-monitoring-optimization"},{"topic":35,"id":11,"shortTitle":"web-development-programming-tutorials-tools-news","color":"orange","name":"Web Dev","code":"webdev","url":"/web-development-programming-tutorials-tools-news"}]],"matchedUrl":{"name":"dzone:articles:view","mapping":"/articles/**","mappingPatterns":{}},"requiresModule":["angulartics","angulartics.google.analytics","dndLists","generalDirectives","monospaced.elastic","angularFileUpload","akoenig.deckgrid","ui.bootstrap-slider","ngSanitize","ui.select","ui.bootstrap","angularMoment","ngTouch","ngDialog","LocalStorageModule"]}; } catch(e) { console.error(e); }
4
Notification
  • Adam Van Grack started following you

  • Jessica Conaghan, Gumption Scott and 6 commented on a link you posted

    T-Mobile Unvells Cheaper, More Basic 'Simple Prepaid' Phone Plans

  • Jessica Conaghan replied on a comment you posted

    CSS counters are one of those "oh neat, didn't know CSS could do that" features with a lot of Xubuntu 14.10 Utopic Unicorn is the latest release of xubuntu based on Ubuntu 14.10

  • Jessica Conaghan started following you

See All
POWERED BY DZone TeamHub
\r\n\r\n

\"SubscriptionSetup

There\r\n are two steps to using the Microsoft Translator service. The first is \r\nto create a subscription to the Microsoft Translator service on the \r\nAzure Data Marketplace. An Azure Data Marketplace account is free, and \r\nthe starter tier of the Microsoft Translator is free. So far, so good. \r\nThe second step is to register an application with your ADM account. \r\nThis registration is basically the credential your application will use \r\nto log into ADM and leverage the Microsoft Translator service.

Why\r\n register your app? If you ever lose control of your app credentials, \r\nyou can simply delete your app registration – you don’t have to delete \r\nyour whole ADM account. You can also register more than one app with \r\nyour ADM account. This let’s you manage at a granular level of \r\ncredential (which cannot conduct commerce), compared to your personal \r\nADM credentials (which can conduct commerce).

Here’s a video to make it super clear!

In\r\n the video above I step through the two-part process to use the \r\nMicrosoft Translator service. Subscribing to the service itself, and \r\nregistering your application – creating the credentials your app will \r\nuse to access the service.

  1. Subscribe here: http://datamarket.azure.com/dataset/bing/microsofttranslator
  2. Register here: https://datamarket.azure.com/applications/register

Implementation

So,\r\n I use two helpers in this demo. The first is my DelegateCommand. This \r\nit the command implementation for MVVM; I use this to create the \r\nTranslateCommand in my ViewModel. The second is my TranslatorHelper. \r\nThis handles the oauth to fetch the ADM access token and properly \r\nimplements the DetectAsync(), TranslateAsync(), and SpeakAsync() \r\nmethods.

  1. Get my DelegateCommand: http://codepaste.net/ho9s5a
  2. Get my TranslatorHelper: http://codepaste.net/hgrb91

Here’s a video to show a simple implementation!

In\r\n the video above, I create a simple demo app. Don’t be mislead, a demo \r\nlike this is far from a polished application – missing error handling \r\nand so much more. But it’s a great demonstration to show how easily you \r\ncan incorporate sophisticated functionality in your Windows 8 app.

  1. API reference: http://msdn.microsoft.com/en-us/library/ff512435.aspx
  2. Service Reference: http://api.microsofttranslator.com/V2/Soap.svc

The MediaElement

The <MediaElement\r\n /> element is a handy element to show video and play audio in your \r\nXAML application. This is what I use to play the audio of the spoken \r\ntext. If you would like to learn more about the MediaElement you can \r\nreview the QuickStart here.

QuickStart: To play audio and video media in your Windows Store app using C++, C#, or Visual Basic, use the MediaElement class. The MediaElement\r\n object exposes properties and methods for playing back media. It is the\r\n responsibility of the programmer to create the event handlers which \r\nenable this functionality. For example, if you wanted to expose the \r\nability to start the media in your application, you could create a Button and in the Button event handler you would call Play to start the media.

The Demo XAML

The\r\n whole demo only has four lines of XAML. This is because the bulk of the\r\n logic is rightfully in the ViewModel. This also means that I will be \r\nable to test my ViewModel and not worry about complications and UI \r\ndependencies if it was in the code behind. Check it out:

\"XAML

The Demo Code

Other\r\n than the property definitions, the few lines below represent the entire\r\n functionality of the demo. Most of this abbreviation is because of \r\nXAML’s native binding ability. But, to be fair, a lot of the cleanliness\r\n of the code is because of my TranslatorHelper that encapsulates the \r\nbulk of logic. In either case, it’s a dramatic demonstration of how \r\nsimply the service can be included in your app.

\"ViewModel

In\r\n the code above, the core logic is in the Execute of the \r\nTranslateCommand. This DelegateCommand is bound to the <Button /> \r\nthat, when clicked, invokes the Execute delegate. And stepping through \r\nit, we setup the TranslatorHelper, detect the language of the input \r\nstring, translate the input string to French, and then fetch the URL \r\nthat speaks the resulting text. It’s super cool.

Conclusion

The\r\n Microsoft Translator service is a powerful service available to \r\ndevelopers to add significant functionality to their Windows 8 \r\napplications. The service, hosted in the Azure Data Marketplace, has \r\nother APIs, too! There’s an Odata API and a REST API that opens it to \r\neven more potential client implementations. Either way, this is far too \r\ncool to not investigate more.

More resources:

  1. Azure Data Marketplace: https://datamarket.azure.com/
  2. Translator Dev Center: http://api.microsofttranslator.com
  3. Translator Service: http://datamarket.azure.com/dataset/bing/microsofttranslator
  4. SOAP Reference: http://go.microsoft.com/?linkid=9671507
  5. REST Reference: http://go.microsoft.com/?linkid=9671505
  6. AJAX Reference: http://go.microsoft.com/?linkid=9671506
  7. API reference: http://msdn.microsoft.com/en-us/library/ff512435.aspx
  8. Service Reference: http://api.microsofttranslator.com/V2/Soap.svc
  9. DelegateCommand: http://codepaste.net/ho9s5a
  10. TranslatorHelper: http://codepaste.net/hgrb91
  11. Bing Translator: http://www.bing.com/translator

Best of luck!

 

 

 

","source":"blog.jerrynixon.com/2012/10/walkthrough-adding-text-translation-to.html","views":4060,"articleDate":1350175218000,"tldr":null,"originalSource":"http://blog.jerrynixon.com/2012/10/walkthrough-adding-text-translation-to.html","published":true,"nComments":0,"articleType":""}]; WMODEL_DATA.perms = {"canDecidePick":false,"canPublish":false}; WMODEL_DATA.isPreview = false; WMODEL_DATA.OPTIONS = {}; TH.installWidgetController('article.content', 'articleContent7', WMODEL_DATA, typeof controller == 'function' ? controller : null, [{name: 'partners', data: true},{name: 'DEFAULT', data: true}], ' oUhbblYOaqbcblYOaqbcC', null); })(); (function() { function controller($scope, $service, $location, SideBarService, TH$Request) { SideBarService.ctx.pageSize = $scope.pageSize; SideBarService.ctx.isPreview = $scope.isPreview; SideBarService.ctx.mode = $scope.mode; SideBarService.fn.loader = $service; SideBarService.fn.scrollCheck = function() { $scope.$emit('thIfScrollCheck'); }; var currentFilter; $scope.$on('$locationChangeSuccess', function() { if (!$location.search().filter) { $scope.filter = 'latest'; } else { $scope.filter = $location.search().filter; if ($scope.filter == 'latest') { $location.search('filter', null); } } if (currentFilter == $scope.filter) { return; } currentFilter = $scope.filter; SideBarService.ctx.filter = $scope.filter; }); $scope.display = SideBarService.getList(); $scope.$watchCollection(function() { return SideBarService.getList(); }, function (n) { $scope.display = n; }); $scope.isActive = SideBarService.isActive; $scope.isExcluded = SideBarService.isExcluded; $scope.loadMore = SideBarService.load; $scope.loading = function() { return SideBarService.ctx.loading; } } var WMODEL_DATA = {}; WMODEL_DATA.pageSize = 20; WMODEL_DATA.isPreview = false; WMODEL_DATA.OPTIONS = {}; WMODEL_DATA.mode = null; TH.installWidgetController('sidebar.content.list', 'sidebarContentList10', WMODEL_DATA, typeof controller == 'function' ? controller : null, [{name: 'DEFAULT', data: true}], ' oUhbkSMaaqbcdvVkcC', null); })(); (function() { var WMODEL_DATA = {}; WMODEL_DATA.OPTIONS = {}; TH.installWidgetController('sidebar.tapBar', 'sidebar', WMODEL_DATA, typeof controller == 'function' ? controller : null, null, ' oUhbkSMadabfWVcC oUhbkSMadabbWQbVkcC', null); })(); (function() { function controller($scope, shareThis, TH$Dialog, TH$Service) { $scope.getEditUrl = function(id, type) { if (!type || type == 'article') { return '/content/' + id + '/edit.html'; } else { return '/dzone/staff/' + type + (type == 'refcard' ? 'z' : 's') + '/' + id + '/edit.html'; } } $scope.share = function(socialNet, url, title){ shareThis.shareThis(socialNet, url, title); }; $scope.canDelete = function(article) { return article.canDelete; } $scope.edit = function(link) { TH$Dialog.open({ loadWidget: 'links.postPreview', widgetArgs: { edit: link.id }, size: 'xbig' }).then(function (result) { $scope.link.title = result.title; $scope.link.linkDescription = result.content; $scope.link.thumb = result.thumb; $scope.link.tags = result.topics; }); }; $scope.deleteLink = function(article) { var title = article.title; var type = 'link'; if(article.header){ title = (article.header.type == 'article') ? article.header.title : article.title; type = (article.header.type == 'article') ? 'article' : 'link'; } TH$Dialog.confirm('Do you want to delete "' + title + '"?').then(function() { return TH$Service.action('delete', {type: type, id: article.id}); }).then(function() { article.deleted = true; }); }; } var WMODEL_DATA = {}; WMODEL_DATA.OPTIONS = {}; TH.installWidgetController('content.commentsSlider', 'contentCommentsSlider9', WMODEL_DATA, typeof controller == 'function' ? controller : null, null, ' oUhbaqbcaibvnWffWVcC', null); })(); (function() { var WMODEL_DATA = {}; WMODEL_DATA.name = "commentsSlider"; WMODEL_DATA.slot = null; WMODEL_DATA.OPTIONS = {"name":"commentsSlider"}; TH.installWidgetController('components.slider', 'componentsSlider8', WMODEL_DATA, typeof controller == 'function' ? controller : null, null, ' oUhballbvbdSaoUhM', null); })();