11
22
3- var BookmarkDemoState = {
3+ var BookmarkShowcaseState = {
44 bookmarksArray : null ,
55 bookmarksReport : null ,
66
@@ -50,13 +50,13 @@ function embedBookmarksReport() {
5050 var embedContainer = $ ( '#embedContainer' ) [ 0 ] ;
5151
5252 // Embed the report and display it within the div container
53- BookmarkDemoState . bookmarksReport = powerbi . embed ( embedContainer , config ) ;
53+ BookmarkShowcaseState . bookmarksReport = powerbi . embed ( embedContainer , config ) ;
5454
5555 // Report.on will add an event handler for report loaded event.
56- BookmarkDemoState . bookmarksReport . on ( "loaded" , function ( ) {
56+ BookmarkShowcaseState . bookmarksReport . on ( "loaded" , function ( ) {
5757
5858 // Get report's existing bookmarks
59- BookmarkDemoState . bookmarksReport . bookmarksManager . getBookmarks ( ) . then ( function ( bookmarks ) {
59+ BookmarkShowcaseState . bookmarksReport . bookmarksManager . getBookmarks ( ) . then ( function ( bookmarks ) {
6060
6161 // Create bookmarks list from the existing report bookmarks
6262 createBookmarksList ( bookmarks ) ;
@@ -116,22 +116,22 @@ function embedSharedBookmark(enableFilterPane, bookmarkState) {
116116 var embedContainer = $ ( '#embedContainer' ) [ 0 ] ;
117117
118118 // Embed the report and display it within the div container
119- BookmarkDemoState . bookmarksReport = powerbi . embed ( embedContainer , config ) ;
119+ BookmarkShowcaseState . bookmarksReport = powerbi . embed ( embedContainer , config ) ;
120120 } ) ;
121121}
122122
123123// Create a bookmarks list from the existing report bookmarks and update the HTML
124124function createBookmarksList ( bookmarks ) {
125125
126126 // Reset next bookmark ID
127- BookmarkDemoState . nextBookmarkId = 1 ;
127+ BookmarkShowcaseState . nextBookmarkId = 1 ;
128128
129129 // Set bookmarks array to the report's fetched bookmarks
130- BookmarkDemoState . bookmarksArray = bookmarks ;
130+ BookmarkShowcaseState . bookmarksArray = bookmarks ;
131131
132132 // Build the bookmarks list HTML code
133133 var bookmarksList = $ ( '#bookmarksList' ) ;
134- for ( let bookmark of BookmarkDemoState . bookmarksArray ) {
134+ for ( let bookmark of BookmarkShowcaseState . bookmarksArray ) {
135135 bookmarksList . append ( buildBookmarkElement ( bookmark ) ) ;
136136 }
137137}
@@ -142,21 +142,21 @@ function onBookmarkCaptureClicked() {
142142 elementClicked ( '#btnCaptureBookmark' ) ;
143143
144144 // Capture the report's current state
145- BookmarkDemoState . bookmarksReport . bookmarksManager . capture ( ) . then ( function ( capturedBookmark ) {
145+ BookmarkShowcaseState . bookmarksReport . bookmarksManager . capture ( ) . then ( function ( capturedBookmark ) {
146146
147147 // Build bookmark element
148148 let bookmark = {
149- name : "bookmark_" + BookmarkDemoState . nextBookmarkId ,
150- displayName : "Bookmark " + BookmarkDemoState . nextBookmarkId ,
149+ name : "bookmark_" + BookmarkShowcaseState . nextBookmarkId ,
150+ displayName : "Bookmark " + BookmarkShowcaseState . nextBookmarkId ,
151151 state : capturedBookmark . state
152152 }
153153
154154 // Add and set the captured bookmark as active
155155 setCapturedBookmarkActive ( bookmark ) ;
156156
157157 // Add the bookmark to the bookmarks array and increase the bookmarks number counter
158- BookmarkDemoState . bookmarksArray . push ( bookmark ) ;
159- BookmarkDemoState . nextBookmarkId ++ ;
158+ BookmarkShowcaseState . bookmarksArray . push ( bookmark ) ;
159+ BookmarkShowcaseState . nextBookmarkId ++ ;
160160 } ) ;
161161}
162162
@@ -168,13 +168,13 @@ function setCapturedBookmarkActive(bookmark) {
168168 $ ( '#bookmarkShare' ) . remove ( ) ;
169169
170170 // Find bookmark parent node
171- let parentNode = ( $ ( '#bookmark_' + BookmarkDemoState . nextBookmarkId ) [ 0 ] ) . parentNode ;
171+ let parentNode = ( $ ( '#bookmark_' + BookmarkShowcaseState . nextBookmarkId ) [ 0 ] ) . parentNode ;
172172
173173 // Add share bookmark icon to bookmark's line
174174 $ ( parentNode ) . append ( buildShareElement ( ) ) ;
175175
176176 // Set bookmark radio button to checked
177- $ ( '#bookmark_' + BookmarkDemoState . nextBookmarkId ) . attr ( 'checked' , true ) ;
177+ $ ( '#bookmark_' + BookmarkShowcaseState . nextBookmarkId ) . attr ( 'checked' , true ) ;
178178}
179179
180180function onCloseDialogClicked ( ) {
@@ -202,10 +202,10 @@ function onBookmarkClicked(element) {
202202 const bookmarkId = $ ( element ) . attr ( 'id' ) ;
203203
204204 // Find the bookmark in the bookmarks array
205- let currentBookmark = BookmarkDemoState . bookmarksArray . find ( bookmark => { return bookmark . name === bookmarkId } ) ;
205+ let currentBookmark = BookmarkShowcaseState . bookmarksArray . find ( bookmark => { return bookmark . name === bookmarkId } ) ;
206206
207207 // Apply the bookmark state
208- BookmarkDemoState . bookmarksReport . bookmarksManager . applyState ( currentBookmark . state ) ;
208+ BookmarkShowcaseState . bookmarksReport . bookmarksManager . applyState ( currentBookmark . state ) ;
209209}
210210
211211// Open bookmark share dialog
@@ -215,10 +215,10 @@ function shareBookmark(element) {
215215 const bookmarkId = $ ( $ ( element ) . siblings ( 'input' ) ) . attr ( 'id' ) ;
216216
217217 // Find the bookmark in the bookmarks array
218- let currentBookmark = BookmarkDemoState . bookmarksArray . find ( bookmark => { return bookmark . name === bookmarkId } ) ;
218+ let currentBookmark = BookmarkShowcaseState . bookmarksArray . find ( bookmark => { return bookmark . name === bookmarkId } ) ;
219219
220220 // Build the share bookmark URL
221- let shareUrl = location . href . substring ( 0 , location . href . lastIndexOf ( "/" ) ) + '/shareBookmark' + '?state=' + currentBookmark . state ;
221+ let shareUrl = location . href . substring ( 0 , location . href . lastIndexOf ( "/" ) ) + '/shareBookmark.html ' + '?state=' + currentBookmark . state ;
222222
223223 // Set bookmark display name and share URL on dialog HTML code
224224 var displayNameElement = document . createTextNode ( currentBookmark . displayName ) ;
0 commit comments