@@ -21,32 +21,32 @@ var title = 'my title';
21
21
function Snippets ( ) { }
22
22
23
23
Snippets . prototype . createPresentation = function ( ) {
24
- // [START create_presentation ]
24
+ // [START slides_create_presentation ]
25
25
var presentation = Slides . Presentations . create ( {
26
26
title : title ,
27
27
} ) ;
28
28
console . log ( 'Created presentation with ID: %s' , presentation . presentationId ) ;
29
- // [END create_presentation ]
29
+ // [END slides_create_presentation ]
30
30
return presentation ;
31
31
} ;
32
32
33
33
Snippets . prototype . copyPresentation = function ( ) {
34
34
var presentationId = this . createPresentation ( ) . presentationId ;
35
35
var copyTitle = 'Copy Title' ;
36
- // [START copy_presentation ]
36
+ // [START slides_copy_presentation ]
37
37
var request = {
38
38
name : copyTitle ,
39
39
} ;
40
40
var driveResponse = Drive . Files . copy ( {
41
41
resource : request ,
42
42
} , presentationId ) ;
43
43
var presentationCopyId = driveResponse . id ;
44
- // [END copy_presentation ]
44
+ // [END slides_copy_presentation ]
45
45
return presentationCopyId ;
46
46
} ;
47
47
48
48
Snippets . prototype . createSlide = function ( presentationId , pageId ) {
49
- // [START create_slide ]
49
+ // [START slides_create_slide ]
50
50
var requests = [ {
51
51
createSlide : {
52
52
objectId : pageId ,
@@ -65,12 +65,12 @@ Snippets.prototype.createSlide = function(presentationId, pageId) {
65
65
requests : requests ,
66
66
} , presentationId ) ;
67
67
console . log ( 'Created slide with ID: %s' , createSlideResponse . replies [ 0 ] . createSlide . objectId ) ;
68
- // [END create_slide ]
68
+ // [END slides_create_slide ]
69
69
return createSlideResponse ;
70
70
} ;
71
71
72
72
Snippets . prototype . createTextboxWithText = function ( presentationId , pageId ) {
73
- // [START create_textbox_with_text ]
73
+ // [START slides_create_textbox_with_text ]
74
74
// Create a new square textbox, using the supplied element ID.
75
75
var elementId = 'MyTextBox_01' ;
76
76
var pt350 = {
@@ -113,13 +113,13 @@ Snippets.prototype.createTextboxWithText = function(presentationId, pageId) {
113
113
} , presentationId ) ;
114
114
var createShapeResponse = createTextboxWithTextResponse . replies [ 0 ] . createShape ;
115
115
console . log ( 'Created textbox with ID: %s' , createShapeResponse . objectId ) ;
116
- // [END create_textbox_with_text ]
116
+ // [END slides_create_textbox_with_text ]
117
117
return createTextboxWithTextResponse ;
118
118
} ;
119
119
120
120
Snippets . prototype . createImage = function ( presentationId , pageId ) {
121
121
var imageFileId = '0B2P_aO_vjnJ4aERnX2ZzbUtMZXc' ;
122
- // [START create_image ]
122
+ // [START slides_create_image ]
123
123
// Add a new image to the presentation page. The image is assumed to exist in
124
124
// the user's Drive, and have 'imageFileId' as its file ID.
125
125
var requests = [ ] ;
@@ -158,13 +158,13 @@ Snippets.prototype.createImage = function(presentationId, pageId) {
158
158
159
159
var createImageResponse = response . replies ;
160
160
console . log ( 'Created image with ID: %s' , createImageResponse [ 0 ] . createImage . objectId ) ;
161
- // [END create_image ]
161
+ // [END slides_create_image ]
162
162
return createImageResponse ;
163
163
} ;
164
164
165
165
Snippets . prototype . textMerging = function ( templatePresentationId , dataSpreadsheetId ) {
166
166
var responses = [ ] ;
167
- // [START text_merging ]
167
+ // [START slides_text_merging ]
168
168
// Use the Sheets API to load data, one record per row.
169
169
var dataRangeNotation = 'Customers!A2:M6' ;
170
170
var values = SpreadsheetApp . openById ( dataSpreadsheetId ) . getRange ( dataRangeNotation ) . getValues ( ) ;
@@ -231,14 +231,14 @@ Snippets.prototype.textMerging = function(templatePresentationId, dataSpreadshee
231
231
}
232
232
// [END_EXCLUDE]
233
233
}
234
- // [END text_merging ]
234
+ // [END slides_text_merging ]
235
235
} ;
236
236
237
237
Snippets . prototype . imageMerging = function ( templatePresentationId , imageUrl , customerName ) {
238
238
var logoUrl = imageUrl ;
239
239
var customerGraphicUrl = imageUrl ;
240
240
241
- // [START image_merging ]
241
+ // [START slides_image_merging ]
242
242
// Duplicate the template presentation using the Drive API.
243
243
var copyTitle = customerName + ' presentation' ;
244
244
var driveResponse = Drive . Files . copy ( {
@@ -279,7 +279,7 @@ Snippets.prototype.imageMerging = function(templatePresentationId, imageUrl, cus
279
279
} ) ;
280
280
console . log ( 'Created merged presentation with ID: %s' , presentationCopyId ) ;
281
281
console . log ( 'Replaced %s shapes with images.' , numReplacements ) ;
282
- // [END image_merging ]
282
+ // [END slides_image_merging ]
283
283
return batchUpdateResponse ;
284
284
} ;
285
285
@@ -310,7 +310,7 @@ Snippets.prototype.simpleTextReplace = function(presentationId, shapeId, replace
310
310
} ;
311
311
312
312
Snippets . prototype . textStyleUpdate = function ( presentationId , shapeId ) {
313
- // [START text_style_update ]
313
+ // [START slides_text_style_update ]
314
314
// Update the text style so that the first 5 characters are bolded
315
315
// and italicized, the next 5 are displayed in blue 14 pt Times
316
316
// New Roman font, and the next 5 are hyperlinked.
@@ -376,12 +376,12 @@ Snippets.prototype.textStyleUpdate = function(presentationId, shapeId) {
376
376
requests : requests ,
377
377
} , presentationId ) ;
378
378
console . log ( 'Updated the text style for shape with ID: %s' , shapeId ) ;
379
- // [END text_style_update ]
379
+ // [END slides_text_style_update ]
380
380
return batchUpdateResponse ;
381
381
} ;
382
382
383
383
Snippets . prototype . createBulletedText = function ( presentationId , shapeId ) {
384
- // [START create_bulleted_text ]
384
+ // [START slides_create_bulleted_text ]
385
385
// Add arrow-diamond-disc bullets to all text in the shape.
386
386
var requests = [ {
387
387
createParagraphBullets : {
@@ -398,12 +398,12 @@ Snippets.prototype.createBulletedText = function(presentationId, shapeId) {
398
398
requests : requests ,
399
399
} , presentationId ) ;
400
400
console . log ( 'Added bullets to text in shape with ID: %s' , shapeId ) ;
401
- // [END create_bulleted_text ]
401
+ // [END slides_create_bulleted_text ]
402
402
return batchUpdateResponse ;
403
403
} ;
404
404
405
405
Snippets . prototype . createSheetsChart = function ( presentationId , pageId , shapeId , sheetChartId ) {
406
- // [START create_sheets_chart ]
406
+ // [START slides_create_sheets_chart ]
407
407
// Embed a Sheets chart (indicated by the spreadsheetId and sheetChartId) onto
408
408
// a page in the presentation. Setting the linking mode as 'LINKED' allows the
409
409
// chart to be refreshed if the Sheets version is updated.
@@ -440,12 +440,12 @@ Snippets.prototype.createSheetsChart = function(presentationId, pageId, shapeId,
440
440
requests : requests ,
441
441
} , presentationId ) ;
442
442
console . log ( 'Added a linked Sheets chart with ID: %s' , presentationChartId ) ;
443
- // [END create_sheets_chart ]
443
+ // [END slides_create_sheets_chart ]
444
444
return batchUpdateResponse ;
445
445
} ;
446
446
447
447
Snippets . prototype . refreshSheetsChart = function ( presentationId , presentationChartId ) {
448
- // [START refresh_sheets_chart ]
448
+ // [START slides_refresh_sheets_chart ]
449
449
var requests = [ {
450
450
refreshSheetsChart : {
451
451
objectId : presentationChartId ,
@@ -457,6 +457,6 @@ Snippets.prototype.refreshSheetsChart = function(presentationId, presentationCha
457
457
requests : requests ,
458
458
} , presentationId ) ;
459
459
console . log ( 'Refreshed a linked Sheets chart with ID: %s' , presentationChartId ) ;
460
- // [END refresh_sheets_chart ]
460
+ // [END slides_refresh_sheets_chart ]
461
461
return batchUpdateResponse ;
462
462
} ;
0 commit comments