Bonjour j'utilise un framework qui me permet d'ouvrir les liens dans un iframe en javascript mais j'ai un lien sur une page php et j'aimerai que ce lien s'ouvre aussi dans un iframe sauf que je n'arrive pas a déterminer ma fonction. Les autres liens sont renseignés directement dans un .js et la fonction iframe est appelée avec appUrl, mais dans le php je n'ai aucune idée de la façon dont il faut l'appelée j'ai utilisé:

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
<li><a onclick="url(appUrl);" href="http://www.ledecalagehoraire.com/" ><i class="icon-white icon-time"></i>&nbsp;<span id="date_heure"></span></a></li>
<script type="text/javascript">window.onload = date_heure('date_heure');</script>
Ce qui me permet d'afficher la date et l'heure (qui fonctionne bien) mais la fonction iframe aucune idée. Pourriez vous m'aider svp?


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
/// <reference path="jquery-1.7.2.min.js" />
/// <reference path="TheCore.js" />
/// <reference path="Underscore.js" />
/* ======================================
    Droptiles - Dashboard javascript
    Copyright 2012, Omar AL Zabir
 
    Builds the Dashboad experience. It offers the Drag & Drop feature,
    clicking on a tile to launch a full screen app, showing Settings, Login etc
    modules, sliding through tile slides etc. 
 
======================================*/
 
 
// Configuration of UI elements for the Dashboard and all the UI behaviors including
// drag & drop, clicking on tile, launch app, in tile behavior etc. Basically all jQuery
// stuff.
var ui = {
    subcontent_height: 50,
    metro_sections_selector: '.metro-sections',
    metro_section_selector: '.metro-section',
    metro_section: 'metro-section',
    hover_metro_section: 'hover-metro-section',
    metro_section_overflow: 'metro-section-overflow',
    app_iframe_id: 'app_iframe',
    app_iframe_zindex: 60000,
    navbar: '#navbar',
    navbar_zindex: '60001',
    tile: 'tile',
    tile_content_main_selector: '.tile-content-main',
    tile_selector: '.tile',
    tile_color: 'bg-color-blue',
    tile_icon_size: 'tile-icon-large',
    tile_icon_src: 'img/update.png',
    tile_subContent_color: 'bg-color-blueDark',
    tile_multi_content_selector: '.tile-multi-content',
    tile_multi_content: 'tile-multi-content',
    tile_content_slide_delay: 5000,
    tile_content_sub_selector: '.tile-content-sub',
    tile_content_sub: 'tile-content-sub',
    trash: '#trash',
    position_cookie: 'tiles',
    splash_screen_zindex: 65000,
    splash_screen_icon_class: 'tile-icon-large',
    signin_splash_color: 'bg-color-green',
    signin_splash_icon: 'img/User No-Frame.png',
    settings_splash_color: 'bg-color-purple',
    settings_splash_icon: 'img/configure.png',
    appStore_splash_color: 'bg-color-blue',
    appStore_splash_icon: 'img/App Store.png',
    anon_first_name: 'John',
    anon_last_name: 'Anonymous',
    anon_photo: 'img/User No-Frame.png',
 
    login_page: "ServerStuff/Login.aspx",
    logout_page: "ServerStuff/Logout.ashx",
    settings_page: "ServerStuff/Settings.aspx",
 
    appRunning: false,
    currentApp: "",
 
    /*
        Go through all the sections and tiles and hook the dynamic
        behavior to the tiles.
    */
    attachTiles: function () {
        ko.utils.arrayForEach(viewModel.sections(), function (section) {
            ko.utils.arrayForEach(section.tiles(), function (tile) {
                tile.init($('#' + tile.uniqueId));
                ui.attach(tile);
            });
        });
    },
 
    /*
        Attach the Tile DIV to a single Tile object and provide all the UI behaviors
        like click, mouse over etc.
    */
    attach: function (tile) {
        var el = $('#' + tile.uniqueId);
        el.unbind("mouseenter mouseleave click");
 
        el.mouseenter(function () {
            el = $(this);
            if (el.hasClass(ui.tile_multi_content_selector)) {
                var c_sub = $(ui.tile_content_sub, el);
                c_sub.animate({ "height": ui.subcontent_height, "opacity": 1 }, 200);
            }
        }).mouseleave(function () {
            el = $(this);
            if (el.hasClass(ui.tile_multi_content_selector)) {
                var c_sub = $(ui.tile_content_sub_selector, el);
                c_sub.animate({ "height": 0, "opacity": 0 }, 200);
            }
        });
 
        //el.find("a.metro-tile-link").click(function (event) {
        //    $(this).parent().click();
        //});
        // On click, launch the app either inside dashboard or in a new browser tab
        //el.find("a.metro-tile-link").click(function (event) {
        el.click(function(event) {
            // Drag & drop just happened. Prevent incorrect click event.
            if ($(this).parent().data("noclick") == true)
                return;
 
            // If the item clicked on the tile is a link or inside a link, don't
            // lauch app. Let browser do the hyperlink click behavior.
            /*if (event.target.tagName == "A" ||
                !$(event.target).closest("a").hasClass("metro-tile-link"))
                return;*/
 
            if (!_.isEmpty(tile.appUrl)) {
 
                // Open app in new browser window. Not all websites like IFRAMEing.
                if (tile.appInNewWindow) {
                    var open_link = window.open('', '_blank');
                    open_link.location = tile.appUrl;
                }
                else {
                    // Make the tile div explode into full screen
 
                    ui.hideAllIframes();
 
                    var clone = $("<div/>")
                        .addClass(tile.tileClasses())
                        .css({
                            'position': 'absolute',
                            'left': el.offset().left,
                            'top': el.offset().top,
                            'width': el.width() + "px",
                            'height': el.height() + "px",
                            'z-index': ui.splash_screen_zindex
                        })
                        .appendTo(document.body)
                        .animate({
                            left: $(window).scrollLeft(),
                            top: $(window).scrollTop(),
                            width: "100%",
                            height: "100%"
                        }, 500, function () {
                            // Launch the full screen app inside an IFRAME. ViewModel has
                            // this feature.
                            ui.launchApp(tile.name, tile.appTitle, tile.appUrl, function () {
                                clone.fadeOut();
                                ui.restoreAllIframes();
                            });
                        })
                        .append(
                            $('<img />')
                                .attr('src', tile.appIcon)
                                .addClass(tile.iconClasses())
                                .css({
                                    'position': 'absolute',
                                    'left': ($(window).width() - 512) / 2,
                                    'top': ($(window).height() - 512) / 2
                                })
                        );
 
                }
            }
        });        
    },
 
    /*
        Hide all sections and tiles.
    */
    hideMetroSections: function () {
        $(ui.metro_sections_selector).hide();
    },
 
    /*
        Transition sections and tiles into view
    */
    showMetroSections: function (callback) {
 
        $(ui.metro_sections_selector)
            .css({
                'margin-left': 50,
                'margin-top': 20,
                'opacity': 0
            })
            .show()
            .animate({
                'margin-left': 0,
                'opacity': 1
            }, 500, 'swing', callback);
    },
 
    /*
        Hide all iframe on the screen so that fullscreen DIVs can appear
        without having IFRAMEs peeking through them.
    */
    hideAllIframes: function(){
        $("iframe:visible")
                .hide()
                .data("hidden_during_launch", true);                
 
    },
 
    /*
        Restore visibility of the iframes that were hidden by calling hideAllIFrame
    */
    restoreAllIframes: function () {
        $("iframe:hidden").each(function (index, iframe) {
            if ($(iframe).data("hidden_during_launch") == true) {
                $(iframe)
                    .show()
                    .data("hidden_during_launch", false);
            }
        });
    },
 
    /*
        Launch a full screen app. It creates a full screen IFRAME to host the appUrl.
    */
    launchApp: function (id, title, url, loaded) {
 
        ui.hideMetroSections();
 
        ui.appRunning = true;
        ui.currentApp = url;
 
        var iframe = $('<iframe id="' + ui.app_iframe_id + '" frameborder="no" />')
           .css({
               'position': 'absolute',
               'left': "0",
               'top': "0px",
               'width': '100%',
               'height': '100%',
               'z-index': ui.app_iframe_zindex,
               'visibility': 'hidden',
               'background-color': 'white'
           })
           .appendTo(document.body)
           .attr({ 'src': url })
           .load(function () {
               ui.hideNavBar();
               loaded();
               $(this).css('visibility', 'visible');
           });
 
 
        location.hash = id;
    },
 
    /*
        Closes the fullscreen app.
    */
    closeApp: function () {
        $('#' + ui.app_iframe_id).remove();
        ui.showNavBar();
 
        this.appRunning = false;
        this.currentApp = "";
 
        ui.showMetroSections(function () { });
 
        location.hash = "";
    },
 
    /*
        Hide the top nav bar and keep a small part visible so that when user hovers
        or clicks on that part, the whole nav bar appears.
    */
    hideNavBar: function () {
        var navbar = $(ui.navbar);
        navbar
            .css("z-index", ui.navbar_zindex)
            .delay(3000)
            .animate({
                top: -(navbar.height() - 5) + "px"
            }, function () {
                $('#navbar').tooltip('show');
                _.delay(function () {
                    $('#navbar').tooltip('hide');
                }, 10000);
            }).bind("mouseenter click", function () {
                navbar
                    .stop(true, true)
                    .animate({
                        top: "0px"
                    });
            }).bind("mouseleave", function () {
                navbar
                    .stop(true, true)
                    .delay(3000)
                    .animate({
                        top: -(navbar.height() - 5) + "px"
                    });
            });
    },
 
    showNavBar: function () {
        var navbar = $(ui.navbar);
        navbar
            .unbind("mouseenter mouseleave")
            .animate({
                top: "0px"
            });
    },
 
    fullscreenAppClosed: function () {
        ui.showMetroSections(function () { });
    },
 
    /*
        Tiles can have multiple slides in them. This will run a timer to slide
        through the slides.
    */
    animateTiles: function () {
        //ui.animateTilesOneAfterAnother();
        ui.animateTilesAllAtOnce();
    },
 
    animateTilesOneAfterAnother: function () {
        window.clearInterval(ui.timerId);
        window.lastTileIndex = 0;
        ui.timerId = window.setInterval(function () {
            var tilesWithSlides = $(ui.tile_selector).has(ui.tile_content_main_selector);
            if (window.lastTileIndex == tilesWithSlides.length)
                window.lastTileIndex = 0;
 
            if (tilesWithSlides.length > window.lastTileIndex) {
                var el = $(tilesWithSlides[window.lastTileIndex]);
                window.lastTileIndex++;
                var slides = $(ui.tile_content_main_selector, el);
                if (slides.length > 0) {
                    var slideIndex = el.data("slideIndex") || 1;
                    if (slideIndex == slides.length) {
                        slideIndex = 0;
                    }
                    var firstPage = slides.first();
                    firstPage.animate({ marginTop: -(slideIndex * firstPage.height()) }, 500);
                    el.data("slideIndex", ++slideIndex);
                }
            }
        }, ui.tile_content_slide_delay);
    },
 
    animateTilesAllAtOnce: function () {
        window.clearInterval(ui.timerId);
        window.lastTileIndex = 0;
        ui.timerId = window.setInterval(function () {
            $(ui.tile_selector).each(function (index, tile) {
                var el = $(tile);
                var slides = $(ui.tile_content_main_selector, el);
                if (slides.length > 0) {
                    var slideIndex = el.data("slideIndex") || 1;
                    if (slideIndex == slides.length) {
                        slideIndex = 0;
                    }
                    var firstPage = slides.first();
                    firstPage.animate({ marginTop: -(slideIndex * firstPage.height()) }, 500);
                    el.data("slideIndex", ++slideIndex);
                }
            });
        }, ui.tile_content_slide_delay);
    },
 
    /*
        Enable the drag & drop behavior of tiles and dropping of tiles on the trash can.
    */
    //makeSortable: function () {
    //    $(ui.trash).droppable({
    //        tolerance: 'touch',
    //        hoverClass: 'trashcash_highlight',
    //        over: function (event, o) {
    //            //$(this).animate({ "zoom": "1.5" });
    //        },
    //        out: function (event, o) {
    //            //$(this).animate({ "zoom": "1.0" });
    //        },
    //        drop: function (event, o) {
    //            //$(this).animate({ "zoom": "1.0" });
    //            var tileId = o.draggable[0].id;
    //            $(ui.trash).fadeOut();
    //            _.defer(function () {
    //                viewModel.removeTile(tileId);
    //            });
 
    //        }
    //    });
 
    //    $(ui.metro_section_selector).sortable({
    //        connectWith: ui.metro_section_selector,
    //        revert: true,
    //        distance: 10,
    //        tolerance: "pointer",
    //        delay: 500,
    //        "opacity": 0.6,
    //        start: function (event, o) {
    //            console.log(o);
    //            window.dragging = true;
    //            o.item.data("noclick", true);
    //            $(ui.trash).fadeIn();
    //            //$('#body').kinetic("stop");
    //        },
    //        stop: function (event, o) {
    //            console.log(o);
    //            window.dragging = false;
    //            o.item.data("noclick", false);                
    //            $(ui.trash).fadeOut();
 
    //            //_.delay(function () {
    //            //    ui.recalcIndex();
    //            //}, 1000);
    //        }
    //    });
    //},
 
    /*
        When a tile is dragged & dropped, take the tile DIV position and use that
        to calculate the index of tile objects in the viewModel. A special case is when
        a tile is moved from a section to another. In that case, remove the tile from
        the originating section and add it on the dropped section.
    */
    //recalcIndex: function () {
    //    $(ui.metro_section_selector).each(function (sectionIndex, sectionDiv) {
    //        var section = viewModel.getSection(sectionDiv.id);
    //        $(ui.tile_selector, sectionDiv).each(function (index, tileDiv) {
    //            var tileId = tileDiv.id;
    //            var tileObject = section.getTile(tileId);
    //            if (tileObject != null) {
    //                if (tileObject.index() != index) {
    //                    console.log(tileId + ":" + tileObject.index() + "->" + index);
    //                    tileObject.index(index);
    //                }
    //            }
    //            else {
    //                var tileFromSomewhere;
    //                var containingSection = ko.utils.arrayFirst(viewModel.sections(), function (s) {
    //                    tileFromSomewhere = ko.utils.arrayFirst(s.tiles(), function (t) {
    //                        return t.uniqueId == tileId;
    //                    });
    //                    return tileFromSomewhere != null;
    //                });
    //                if (containingSection != null) {
    //                    console.log(containingSection.uniqueId()+":remove:" + tileFromSomewhere.uniqueId);
    //                    containingSection.tiles.remove(tileFromSomewhere);
    //                    if (tileFromSomewhere != null) {
    //                        console.log(tileFromSomewhere.uniqueId + ":" + tileFromSomewhere.index() + "->" + index);
    //                        tileFromSomewhere.index(index);
    //                        console.log(containingSection.uniqueId + "->" + section.uniqueId);
    //                        section.tiles.splice(index, 0, tileFromSomewhere);
 
    //                        //_.defer(function () {
    //                        //    $(tileDiv).remove();
    //                        //});
    //                    }
    //                }
    //            }
    //        });
    //    });
    //},
 
    //resetTiles: function () {
    //    var dynamicSection = $(ui.metro_section_selector + '+.' + ui.metro_section_overflow).each(function () {
    //        var section = $(this);
    //        var prevSection = section.prev();
    //        $(ui.tile_selector, section).appendTo(prevSection);
    //        section.remove();
    //    });
    //},
 
    //reflow: function (fromIndex) {
    //    var metroSectionHeight = $(window).height(); 
 
    //    $(ui.tile_selector).slice(fromIndex | 0).each(function (index, item) {
    //        var tile = $(item);
    //        var pos = tile.offset();
 
    //        if (tile.index() > 0 && (pos.top + tile.height()) > metroSectionHeight) {
    //            var mySection = tile.parents(ui.metro_section_selector);
    //            var nextSection = mySection.next();
 
    //            // If the next section isn't a dynamically created section especially
    //            // made to hold overflowing tiles, then move the tiles to that section.
    //            // otherwise make a new dynamic section.
    //            if (nextSection.length > 0 && nextSection.hasClass(ui.metro_section_overflow)) {
    //                nextSection.prepend(tile);
    //                return _.delay(function () {
    //                    reflow(index + 1)
    //                }, 100);
    //            }
    //            else {
    //                nextSection = $('<div />').addClass(ui.metro_section).addClass(ui.metro_section_overflow);
    //                nextSection.insertAfter(mySection);
    //                //nextSection.appendTo(mySection.parent());
    //                nextSection.prepend(tile);
 
    //                return _.delay(function () {
    //                    reflow(index + 1)
    //                }, 100);
    //            }
    //        }
    //    });
 
    //    ui.makeSortable();
    //},
 
    /*
        Animate a full screen splash
    */
    splashScreen: function (colorClass, icon, complete) {
        ui.hideAllIframes();
 
        return $("<div/>")
            .addClass(colorClass)
            .css({
                'position': 'absolute',
                'left': -($(window).width() / 4) + 'px',
                'top': $(window).height() / 4,
                'width': $(window).width() / 4 + 'px',
                'height': $(window).height() / 4 + 'px',
                'z-index': ui.splash_screen_zindex,
                'opacity': 0.3
            })
            .appendTo(document.body)
            .animate({
                left: '50px',
                top: '50px',
                'width': $(window).width() - 100 + 'px',
                'height': $(window).height() - 100 + 'px',
                'opacity': 1.0
            }, 500, function () {
                $(this).animate({
                    left: '0px',
                    top: '0px',
                    width: '100%',
                    height: '100%'
                }, 500, function () {
                    complete($(this));
                    ui.restoreAllIframes();
                });
            })
            .append(
                $('<img />')
                    .attr('src', icon)
                    .addClass(ui.splash_screen_icon_class)
                    .css({
                        'position': 'absolute',
                        'left': ($(window).width() - 512) / 2,
                        'top': ($(window).height() - 512) / 2
                    })
            );
    },
 
    login: function () {
        ui.splashScreen(ui.signin_splash_color, ui.signin_splash_icon, function (div) {
            ui.launchApp("Login", "Login", ui.login_page, function () {
                div.fadeOut();
            });
        });
    },
 
    logout: function () {
        ui.splashScreen(ui.signin_splash_color, ui.signin_splash_icon, function (div) {
            ui.launchApp("Logout", "Logout", ui.logout_page, function () {
                div.fadeOut();
            });
        });
    },
 
    settings: function () {
        if (viewModel.user().isAnonymous)
            ui.login();
        else {
            ui.splashScreen(ui.settings_splash_color, ui.settings_splash_icon, function (div) {
                ui.launchApp("Settings", "Settings", ui.settings_page, function () {
                    div.fadeOut();
                });
            });
        }
    },
 
    apps: function () {
        ui.splashScreen(ui.appStore_splash_color, ui.appStore_splash_icon, function (div) {
            ui.launchApp("AppStore", "App Store", "AppStore.html", function () {
                div.fadeOut();
            });
        });
    },
 
    switchTheme: function (themename) {
        var classes = $("body").prop("class").split(" ");
        _.each(classes, function (c) {
            if (_.string.startsWith(c, 'theme-'))
                $("body").removeClass(c);
        });
 
        $("body").addClass(themename);
    },
 
    reload: function () {
        document.location.href = _.string.strLeft(document.location.href, '#');
    }
};
 
 
// This is the viewModel for the entire Dashboard. The starting point.
// It takes the currentUser (defined in the Droptiles.master), the UI config (as above)
// and the TileBuilders that comes from Tiles.js.
var viewModel = new DashboardModel("Welcome", [], window.currentUser, ui);
 
$(document).ready(function () {
    // Hide the body area until it is fully loaded in order to prevent flickrs
    $('#content').css('visibility', 'visible');
 
    ko.bindingHandlers.sortable.options.start = function (arg) {
        $(ui.trash).show();
    }
    ko.bindingHandlers.sortable.afterMove = function (arg) {
        $(ui.trash).hide();
        console.log(arg);
    }
 
    ko.applyBindings(viewModel);
 
    ui.hideMetroSections();
 
    // See if user has a previous session where page setup was stored
    var cookie = window.currentUser.profileData || readCookie("p");
    if (cookie != null && cookie.length > 0) {
        try {
            viewModel.loadSectionsFromString(cookie, window.TileBuilders);
        } catch (e) {
            // Failed to load saved tiles. Load the default tiles.
            viewModel.loadSectionsFromString(DefaultTiles, window.TileBuilders);
        }
    }
    else {
        // No cookie, load default tiles. Defined in Tiles.js
        viewModel.loadSectionsFromString(DefaultTiles, window.TileBuilders);
    }
 
    ui.showMetroSections(function () {
        ui.attachTiles();
        ui.animateTiles();        
    });
 
    // If we have the "add" cookie, then it means user went to app store
    // and then added some apps. The name of the apps are passed as a 
    // comma delimited cookie. So, add those tiles on the Dashboard.
    _.delay(function(){
        var addedApps = readCookie("add");
        if (!_.isEmpty(addedApps)) {
            var sections = viewModel.sections();
            var lastSection = sections[sections.length - 1];
            var sectionTiles = lastSection.tiles();
            //lastSection.show();
            window.scrollTo($("." + ui.metro_section).last().offset().left - 100, 0);
 
            var tileNames = addedApps.split(",");
            _.each(tileNames, function (name) {
                if (!_.isEmpty(name)) {
                    var builder = TileBuilders[name];
                    var newTileDef = builder(_.uniqueId(name));
                    var newTile = new Tile(newTileDef, ui, viewModel);
 
                    //newTile.index(sectionTiles.length);
 
                    lastSection.addTile(newTile);
                    ui.attach(newTile);
                }
            });
 
            createCookie("p", viewModel.toSectionString(), 2);
            createCookie("add", "");
        }
    }, 1000);
 
    // Subscribe again to detect changes made after the sections and tiles are 
    // created on the screen so that we can save the changes in section/tile
    viewModel.subscribeToChange(function (section, tiles) {
        _.defer(function () {
            console.log("viewModel subscribe notification");
            ui.attachTiles();
 
            var newOrder = viewModel.toSectionString();
            if (newOrder !== DefaultTiles) {
                console.log(newOrder);
                createCookie("p", newOrder, 2);
 
                if (!window.currentUser.isAnonymous) {
                    $.get("ServerStuff/SaveTiles.aspx");
                }
            }
        });
    });
 
    // Mouse wheel behavior for side scrolling.
    $("body").on("mousewheel", function (event, delta, deltaX, deltaY) {
        if ($(document).height() <= $(window).height())
            window.scrollBy(-delta * 50, 0);
    });
 
    $("#navbar").tooltip({
        title: "I am still here. Come here to go back to Dashboard",
        animate: true,
        placement: 'bottom',
        trigger: 'manual'
    });
 
 
    // Handles browser back button. When user presses the back button,
    // it detects it and closes the current app.
    $(window).hashchange(function () {
        var hash = location.hash;
 
        if (hash == "" || hash == "#") {
            if (ui.appRunning)
                ui.closeApp();
        }
    })
 
    // The google search bar behavior on the navigation bar.
    $('#googleSearchText').keypress(function (e) {
        if (e.keyCode == 13)
            $('#googleForm').submit();
    });
 
    // Supports only IE 9+, Chrome, Firefox, Safari
    if ($.browser.msie && parseInt($.browser.version) < 8)
        $("#browser_incompatible").show();
 
    // Implement drag & scroll the window behavior
    if ($.browser.msie == null) {
        //$('#body').kinetic({
        //    moved: function (settings) {
        //        if (!window.dragging) {
        //            $(window).scrollLeft($(window).scrollLeft() + settings.scrollLeft);
        //            $(window).scrollTop($(window).scrollTop() + settings.scrollTop);
        //        }
        //    }
        //});
    }    
});
Voici mon js qui normalement permet l'ouverture de l'iframe