Ignore:
Timestamp:
Jul 26, 2014, 7:42:07 PM (10 years ago)
Author:
flop25
Message:

add new trigger loc_end_photo_add_direct
First Contact tour reviewed and reworked to change dynamically with the new uploader

Location:
trunk/plugins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins

    • Property svn:ignore
      •  

        old new  
        1 *
         1AMetaData
         2AdditionalPages
         3Autosize
         4Comments_on_Albums
         5ExtendedDescription
         6GMaps
         7GThumb
         8GrumPluginClasses
         9PWG_Stuffs
         10Panoramas
         11PersonalPlugin
         12SmartAlbums
         13automatic_size
         14dynareceperio
         15event_cats
         16lightbox
         17meta
         18piclens
         19rv_menutree
         20trash
         21user_tags
  • trunk/plugins/TakeATour/tours/first_contact/config.inc.php

    r29046 r29078  
    1010{
    1111/* first contact */
     12add_event_handler('loc_end_photo_add_direct', 'TAT_FC_6');
     13add_event_handler('loc_end_photo_add_direct', 'TAT_FC_7');
    1214add_event_handler('loc_end_element_set_global', 'TAT_FC_14');
    1315add_event_handler('loc_end_picture_modify', 'TAT_FC_16');
     
    1618add_event_handler('loc_end_themes_installed', 'TAT_FC_35');
    1719}
    18 
     20     
     21function TAT_FC_7()
     22{
     23  global $template;
     24  $template->set_prefilter('photos_add', 'TAT_FC_7_prefilter');
     25}
     26function TAT_FC_7_prefilter ($content, &$smarty)
     27{
     28  $search = 'UploadComplete: function(up, files) {';
     29  $replacement = 'UploadComplete: function(up, files) {
     30  if (tour.getCurrentStep()==5)
     31  {
     32    tour.goTo(6);
     33  }
     34';
     35  return str_replace($search, $replacement, $content);
     36}
     37function TAT_FC_6()
     38{
     39  global $template;
     40  $template->set_prefilter('photos_add', 'TAT_FC_6_prefilter');
     41}
     42function TAT_FC_6_prefilter ($content, &$smarty)
     43{
     44  $search = 'BeforeUpload:';
     45  $replacement = 'FilesAdded: function() {
     46    if (tour.getCurrentStep()==4)
     47    {
     48      tour.goTo(5);
     49    }
     50 
     51  },
     52  BeforeUpload:';
     53  return str_replace($search, $replacement, $content);
     54}
    1955function TAT_FC_14()
    2056{
  • trunk/plugins/TakeATour/tours/first_contact/tour.tpl

    r29046 r29078  
    1 {footer_script require='jquery.bootstrap-tour'}{literal}
     1{footer_script require='jquery.bootstrap-tour'  load="async"}{literal}
    22
    33var tour = new Tour({
     
    5757    title: "{/literal}{'first_contact_title7'|@translate|@escape:'javascript'}{literal}",
    5858    content: "{/literal}{'first_contact_stp7'|@translate|@escape:'javascript'}{literal}",
    59     prev:4
    60   },
    61   {
    62     path: "{/literal}{$TAT_path}{literal}admin.php?page=photos_add",
    63     placement: "top",
    64     element: "#batchLink",
     59    prev:3,
     60    onPrev: function (tour) {window.location.reload()}
     61  },
     62  {
     63    path: "{/literal}{$TAT_path}{literal}admin.php?page=photos_add",
     64    placement: "top",
     65    element: ".batchLink",
    6566    reflex:true,
    6667    title: "{/literal}{'first_contact_title8'|@translate|@escape:'javascript'}{literal}",
    6768    content: "{/literal}{'first_contact_stp8'|@translate|@escape:'javascript'}{literal}",
    68     prev:4
    69   },
    70   {
    71     path: /admin\.php\?page=(photos_add|batch_manager&filter=prefilter-last_import|prefilter-caddie)/,
    72     redirect:function (tour) {window.location = "admin.php?page=batch_manager&filter=prefilter-last_import";},
    73     placement: "top",
    74     element: "",
     69  },
     70  {
     71    path: /admin\.php\?page=(photos_add|batch_manager&filter=prefilter-last_import|batch_manager&filter=prefilter-caddie)/,
     72    redirect:function (tour) {window.location = "admin.php?page=batch_manager&filter=prefilter-last_import";},
     73    placement: "top",
     74    element: "select[name='filter_prefilter']",
    7575    title: "{/literal}{'first_contact_title9'|@translate|@escape:'javascript'}{literal}",
    76     content: "{/literal}{'first_contact_stp9'|@translate|@escape:'javascript'}{literal}"
    77   },
     76    content: "{/literal}{'first_contact_stp9'|@translate|@escape:'javascript'}{literal}",
     77    prev:3,
     78    onPrev: function (tour) {window.location = "{/literal}{$ABS_U_ADMIN}{literal}admin.php?page=photos_add"}
     79 },
    7880  {//10
    7981    path: /admin\.php\?page=batch_manager&filter=(prefilter-caddie|prefilter-last_import)/,
    8082    redirect:function (tour) {window.location = "admin.php?page=batch_manager&filter=prefilter-last_import";},
    8183    placement: "right",
    82     element: ".icon-flag",
     84    element: "a[href='./admin.php?page=batch_manager&filter=prefilter-caddie']",
    8385    title: "{/literal}{'first_contact_title10'|@translate|@escape:'javascript'}{literal}",
    8486    content: "{/literal}{'first_contact_stp10'|@translate|@escape:'javascript'}{literal}"
     
    151153  {
    152154    path: "{/literal}{$TAT_path}{literal}admin.php?page=cat_list",
    153     placement: "left",
    154     element: "#content",
    155155    title: "{/literal}{'first_contact_title19'|@translate|@escape:'javascript'}{literal}",
    156156    content: "{/literal}{if $TAT_FTP}{'first_contact_stp19'|@translate|@escape:'javascript'}{else}{'first_contact_stp19_b'|@translate|@escape:'javascript'}{/if}{literal}",
     
    173173  },
    174174  {
    175     path: /admin\.php\?page=album-/,
     175    path: /admin\.php\?page=album-[0-9]+(|-properties)$/,
    176176    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}";},
    177177    placement: "top",
     
    181181  },
    182182  {
    183     path: /admin\.php\?page=album-/,
     183    path: /admin\.php\?page=album-[0-9]+(|-properties)$/,
    184184    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}";},
    185185    placement: "top",
     
    189189  },
    190190  {
    191     path: /admin\.php\?page=album-/,
     191    path: /admin\.php\?page=album-[0-9]+(|-properties)$/,
    192192    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}";},
    193193    placement: "bottom",
    194     element: ".tabsheet",
     194    element: "li.normal_tab:nth-child(3) > a:nth-child(1)",
     195    reflex: true,
    195196    title: "{/literal}{'first_contact_title24'|@translate|@escape:'javascript'}{literal}",
    196197    content: "{/literal}{'first_contact_stp24'|@translate|@escape:'javascript'}{literal}"
     
    258259  {
    259260    path: "{/literal}{$TAT_path}{literal}admin.php?page=configuration",
    260     placement: "top",
    261     title: "{/literal}{'first_contact_stp33'|@translate|@escape:'javascript'}{literal}",
     261    placement: "bottom",
     262    element: "li.normal_tab:nth-child(6) > a:nth-child(1)",
     263    title: "{/literal}{'first_contact_title33'|@translate|@escape:'javascript'}{literal}",
    262264    content: "{/literal}{'first_contact_stp33'|@translate|@escape:'javascript'}{literal}",
    263265    prev:30
     
    325327  },
    326328  {
    327     path: "{/literal}{$TAT_path}{literal}admin.php?page=plugin-TakeATour",
    328     placement: "top",
    329     element: "",
     329    path: "{/literal}{$TAT_path}{literal}admin.php",
    330330    title: "{/literal}{'first_contact_title43'|@translate|@escape:'javascript'}{literal}",
    331331    content: "{/literal}{'first_contact_stp43'|@translate|@escape:'javascript'}{literal}"
     
    338338// Start the tour
    339339tour.start();
    340 
    341 jQuery( ".plupload_start" ).click(function() {
    342   if (tour.getCurrentStep()==5)
    343   {
    344     tour.goTo(6);
    345   }
    346 });
    347340{/literal}{/footer_script}
Note: See TracChangeset for help on using the changeset viewer.