Difference between revisions of "Patch Launcher Add or Delete Pages"

From WebOS Internals
Jump to navigation Jump to search
(Pasting in the old wiki source, unedited)
(Add description of how to rearrange order of menu items in launcher menu)
 
(22 intermediate revisions by 7 users not shown)
Line 1: Line 1:
Add/Delete Pages in the Launcher
+
{{template:patch}}
 +
[[Image:Launcher_AddDeletePages.jpg|border|right|Add/Delete Pages]]
 +
==Introduction==
  
[[module Redirect destination="http://www.webos-internals.org/wiki/Add/Delete_Pages_In_The_Launcher"]]
+
Someone in the forum talked about being able to add and delete pages in the Launcher app and I thought I would look into it further. They stated that they were able to add new pages and delete existing pages. Upon further investigation, they were correct. There is existing code, commented out, that will allow you to create a new launcher page or delete the current launcher page. There is a variable for the max number of pages palm set to 10. This value can probably be increased, but I don't recommend it and seriously, who would need more that 10 pages anyway, right?
  
<!DOCTYPE html
+
===Usage===
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
  
<head>
+
*The new page and delete page functions will appear in the launcher menu.
<title>pre dev wiki: Add / Delete Pages in the Launcher</title>
+
**New Page
+
***This will create a new page and move whatever page you were on to the right. There is nothing special to this page besides the fact that you now have a new page. You can drag icons to it just like any other page.
<script type="text/javascript" src="http://static.wikidot.com/v--63/common--javascript/init.combined.js"></script>
 
<script  type="text/javascript">
 
var URL_HOST = 'www.wikidot.com';
 
var URL_DOMAIN = 'wikidot.com';
 
// global request information
 
 
var WIKIREQUEST = {};
 
WIKIREQUEST.info = {};
 
 
WIKIREQUEST.info.domain = "predev.wikidot.com";
 
WIKIREQUEST.info.siteId = 113910;
 
WIKIREQUEST.info.categoryId = 629503;
 
WIKIREQUEST.info.themeId = 2437;
 
WIKIREQUEST.info.requestPageName = "add-delete-pages-in-the-launcher";
 
OZONE.request.timestamp = 1248056362;
 
OZONE.request.date = new Date();
 
WIKIREQUEST.info.lang = 'en';
 
WIKIREQUEST.info.pageUnixName = "add-delete-pages-in-the-launcher";
 
WIKIREQUEST.info.pageId = 3543419;
 
WIKIREQUEST.info.lang = "en";
 
OZONE.lang = "en";
 
// window.onload = WikidotInit();
 
</script>
 
 
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
 
        <meta http-equiv="content-language" content="en"/>
 
  
<script type="text/javascript" src="http://static.wikidot.com/v--63/common--javascript/WIKIDOT.combined.js"></script>
+
**Delete Page
+
***This will delete the current launcher page. Any icons on the page will automatically move to the page to the left of the page being deleted. If there is no page to the left of the page being deleted icons are automatically moved to the default page of the Web Browser.
 
 
 
 
<style type="text/css">
 
body {
 
  background-position: center 24px;
 
}
 
</style>
 
<style type="text/css" id="internal-style">
 
@import url(http://static.wikidot.com/v--63/common--modules/css/monetize/textlinkads/MonetizeTextLinkAdsModule.css);
 
 
 
 
 
    @import url(http://static.wikidot.com/v--63/common--theme/base/css/style.css?0);
 
    @import url(http://static.wikidot.com/v--63/common--theme/webbish2/css/style.css?0);
 
   
 
    </style>
 
   
 
    <link rel="shortcut icon" href="/local--favicon/favicon.gif"/>
 
    <link rel="icon" type="image/gif" href="/local--favicon/favicon.gif"/>
 
   
 
            <link rel="alternate" type="application/wiki" title="Edit this page!" href="javascript:WIKIDOT.page.listeners.editClick()"/>
 
   
 
</head>
 
  
  <body id="html-body">
+
==Editing Process==
  <div id="navi-bar">
 
  <a class="logo" href="http://www.wikidot.com">
 
    <span>Wikidot.com</span>
 
  </a>
 
 
 
 
 
 
 
  <div class="new-site">
 
    <form method="get" action="http://www.wikidot.com/new-site">
 
      <input class="text empty" type="text" name="address" value="Your-free-web-project"/>.wikidot.com
 
    </form>
 
  
  </div>
+
<pre>
 
+
/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
    <div class="share">
+
</pre>
    <span>Share on</span>
+
*Uncomment the following
    <a class="twitter" target="_blank" rel="nofollow" href="http://twitter.com/home?status=TITLE+URI"
+
**Look for "appMenuModel" (line 29) a few lines below you will see a line that has "newpage" in it. On the line that remove the "/*" and on the line that has "deletepage" remove the "*/"
      title="Share on Twitter"
+
**Look further in the file (line 120) for "switch" again remove the "/* and "*/" that surrounds the cases for newpage and deletepage.
    ><img src="http://static.wikidot.com/v--63/common--images/social/twitter.png" alt="twitter"/></a>
+
*Perform a restart and the new page and delete page options will be in the launcher menu.
    <a class="facebook" target="_blank" rel="nofollow" href="http://www.facebook.com/share.php?u=URI&amp;t=TITLE"
 
      title="Share on Facebook"><img src="http://static.wikidot.com/v--63/common--images/social/facebook.gif" alt="Facebook"
 
      /></a
 
    <a class="delicious" target="_blank" rel="nofollow" href="http://delicious.com/save"
 
      title="Share on Delicious"
 
      ><img src="http://static.wikidot.com/v--63/common--images/social/delicious.png" alt="Delicious"/></a>
 
    <a class="digg" target="_blank" rel="nofollow" href="http://digg.com/submit?url=URI&amp;title=TITLE"
 
      title="Post to Digg"
 
      ><img src="http://static.wikidot.com/v--63/common--images/social/digg.png" alt="Digg"/></a>
 
    <a class="reddit" href="http://www.reddit.com/submit?url=URI" rel="nofollow" target="_blank"
 
      title="Post to Reddit"
 
      ><img src="http://static.wikidot.com/v--63/common--images/social/reddit.png" alt="Reddit" border="0" /></a>
 
  </div>
 
  
   
+
Original discovery credit is unknown. Pyrognome tested and confirmed the new page and delete page functionality.
  <a class="random-site" href="/random-site.php">Random site &raquo;</a>
 
  </div>
 
<div id="navi-bar-shadow">&nbsp;</div>
 
  
  
<script type="text/javascript">
+
'''Rearrange Order of Menu Items'''
  $j(function(){
 
    var uri = window.location.href;
 
    var title = document.title
 
   
 
    $j('#navi-bar .share a').each(function(){
 
      $t = $j(this);
 
      var u = $t.attr('href');
 
      u = u.replace(/TITLE/, encodeURIComponent(title)).replace(/URI/, encodeURIComponent(uri));
 
      $t.attr('href', u);
 
    });
 
   
 
    $j('#navi-bar .share .facebook').click(function(e){
 
      window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(uri)+'&t='+encodeURIComponent(title),'sharer','toolbar=0,status=0,width=626,height=436');
 
      e.preventDefault();
 
    });
 
    $j('#navi-bar .share .delicious').click(function(e){
 
      window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550');
 
      e.preventDefault();
 
    });
 
  });
 
 
 
$j('#navi-bar .new-site form').submit(function(e){
 
  e.preventDefault();
 
  var $i = $j('#navi-bar .new-site form input.text');
 
  if($i.hasClass('empty')){
 
    var w = new OZONE.dialogs.ErrorDialog();
 
  w.content = "You need to enter a valid web address for your new wiki.";
 
  w.show();
 
  return;
 
    }
 
    var siteName = $i.attr('value');
 
    siteName = siteName.replace(/^\s+/, '').replace(/\s+$/,'');
 
// validate a bit
 
if(siteName.length <3){
 
var w = new OZONE.dialogs.ErrorDialog();
 
w.content = "You need to provide the web address for you wiki and it should be at least 3 characters long.";
 
w.show();
 
return;
 
}
 
var p = {};
 
p.action = 'wiki/special/NewWikiWidgetAction';
 
p.event = 'newWiki';
 
p.siteName = siteName;
 
OZONE.ajax.requestModule(null, p, function(r){
 
  if(!WIKIDOT.utils.handleError(r)) {return;}
 
  // seems fine.
 
  window.location.href='http://'+URL_HOST+'/new-site/address/'+r.unixName;
 
});
 
});
 
$j('#navi-bar .new-site form input.text').focus(function(){
 
  var $t = $j(this);
 
  if($t.hasClass('empty')){
 
    $t.removeClass('empty');
 
    $t.attr('value', '');
 
  }
 
});
 
 
</script>
 
  
 +
This is a fantastic patch that makes the launcher much more useful (along with the 4x4 icon patches), but I kept hitting Delete Page because it was second on the list when I was trying to List Apps.  Then, the page that I was currently on would be deleted and I would have to go back through and move all the icons to a new page - frustrating for me.  Therefore, I simply rearranged the order of the menu items to what was more intuitive for me.  This is a small change to this great patch, and does not add or subtract any functionality.
  
  <div id="container-wrap-wrap">
+
<pre>
<div id="container-wrap">
+
Login via SSH
<div id="container">
 
  
  <div id="header">
+
sudo -i
  <h1><a href="/"><span>pre dev wiki</span></a></h1>
+
//enter password to become root
    <h2><span>Let&#039;s open this beast up</span></h2>
 
   
 
  <!-- google_ad_section_start(weight=ignore) -->
 
 
 
  <div id="search-top-box">
 
  <form id="search-top-box-form" action="dummy">
 
  <input id="search-top-box-input" class="text empty" type="text" size="15" name="query" value="search this site" onfocus="if(YAHOO.util.Dom.hasClass(this, 'empty')){YAHOO.util.Dom.removeClass(this,'empty'); this.value='';}"/><input class="button" type="submit" name="search" value="search"/>
 
  
</form>
+
cd /
  </div>
 
 
 
    <div id="top-bar">
 
 
 
  
<ul><li><a href="javascript:;">This is the old wiki, Please go to the NEW wiki!</a><ul><li><a href="/http:www-webos-internals-org">//www.webos-internals.org</a></li></ul></li><li><a href="javascript:;">News</a><ul><li><a href="/newwiki">New Wiki Info</a></li></ul></li></ul>
+
mount -o remount,rw /
  
  </div>
+
vi /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
    <div id="login-status"><a href="http://www.wikidot.com/auth:newaccount?origUrl=http%3A%2F%2Fpredev.wikidot.com%2Fadd-delete-pages-in-the-launcher">create account</a> or <a href="http://www.wikidot.com/auth:login?origUrl=http%3A%2F%2Fpredev.wikidot.com%2Fadd-delete-pages-in-the-launcher">login</a> </div>
+
//go to lines 26 and 27 and comment them out by adding '//' in front of them...to do this, hit 'i' to enter edit mode (you will see a capital i on the
 +
//bottom left-hand corner of the screen) and scroll over to the beginning of the lines and type '//'. Then, rearrange the five menu items to whatever
 +
//order you want...what I like best is below:
  
  <div id="header-extra-div-1"><span></span></div><div id="header-extra-div-2"><span></span></div><div id="header-extra-div-3"><span></span></div>
+
        items: [
  </div>
+
                        //{ label: $L('New page'), command: 'newpage' },
 
+
                        //{ label: $L('Delete page'), command: 'deletepage' },
<div id="content-wrap">
+
                        Mojo.Menu.editItem,
<div id="side-bar">
+
                        { label: $L('List Apps...'), command: 'listapps' },
+
                        { label: $L('New page'), command: 'newpage' },
 +
                        { label: $L('Delete page'), command: 'deletepage' },
 +
                        Mojo.Menu.helpItem
 +
                ]
  
+
//This puts Edit first, then List Apps, New Page, Delete Page, and Help last in the menu
 +
//hit ESC to exit edit mode, and then type ':wq' to save the file (launcher-assistant.js) that we just modified...
  
<ul><li><a href="/start">Welcome Page</a></li></ul><h1 ><span>NOTICE</span></h1><h2 ><span>Please use the new wiki</span></h2><ul><li><a href="/http:www-webos-internals-org">New webOS Internals Wiki link</a></li></ul><h3 ><span>If pages take you to the new wiki, don't be suprised. We <em>meant</em> for that to happen.</span></h3><h2 ><span>User Controls</span></h2><ul><li><a href="/system:list-all-pages">All Pages</a></li><li><a href="/system:recent-changes">Recent Changes</a></li></ul><h2 ><span>Getting Started</span></h2><ul><li><a href="/pre-not-booting-webos-doctor-how-to">How To Recover</a></li><li><a href="/basic-linux-use">Basic Linux Use</a></li><li><a href="/rooting">Enable Root Access</a></li><li><a href="/next-steps-after-rooting">Next steps: Enable the Optware package feed</a></li><li><a href="/applying-patches">Applying Patches</a></li><li><a href="/sftp-access">Setup SFTP</a></li><li><a href="/ddns-update">DDNS for EV-DO</a></li></ul><h2 ><span>IRC Channel</span></h2><p>Brainstorm with us at #webos-internals on FreeNode - obey the <a href="/webos-internals-irc-channel-policy">IRC Channel Policy</a> - all chat logged.</p><p><a href="/admin:manage">site manager</a></p>
+
mount -o remount,ro /
  
+
stop LunaSysMgr && start LunaSysMgr
 +
</pre>
  
+
All credit for this patch goes to original developer!
</div>
 
 
<!-- google_ad_section_end -->
 
 
<div id="main-content">
 
<div id="action-area-top"></div>
 
 
<!-- google_ad_section_start -->
 
 
<div id="page-title">
 
Add / Delete Pages in the Launcher </div>
 
 
 
  
+
Enjoy! jmartino2011, 11-10-09
<div id="page-content">
 
  
+
==Patch Process==
 
  
+
The patch is also located in the webos-internals gitorious repository. Click [[Applying Patches]] for info on patching from it.
 
  
+
I'm trying to make most of my modifications into patches --[[User:HattCzech|HattCzech]]
 
  
<h2 id="toc0"><span>This is a quick tutorial on how to add or delete pages in the Launcher.</span></h2>
+
*Run the following commands:
<hr />
 
<p>Someone in the forum talked about being able to add and delete pages in the Launcher app and I thought I would look into it further. They stated that they were able to add new pages and delete existing pages.</p>
 
<p>Upon further investigation, they were correct. There is existing code in a particular js file that has been commented out that will allow you to create a new page and delete the current page you are on in the Launcher. There is a variable that stores the max number of pages to 10. This value can probably be increased, but I don't recommend it and seriously, who would need more that 10 pages anyway, right?</p>
 
<p>After I uncommented these said lines and rebooted, I was able to perform these functions. So I tested the new page function.</p>
 
<p>The new page and delete page functions will appear in the launcher app menu.</p>
 
<p><strong>Creating/adding a page:</strong></p>
 
<p>This will create a new page and move whatever page you were on to the right. There is nothing special to this page besides the fact that you now have a new page. I was able to drag icons to it just like any other page. To test this new page out I added a contact to that page.</p>
 
<p><strong>Deleting/Removing a page:</strong></p>
 
  
<p>The code is already set up to automagically move any icons to the page to the left of the page you are deleting. What I mean is if the page you delete is in the middle of other pages it will toss whatever was on your current page to the page to the left of it.</p>
+
''In this example, I have the patch file located in my home directory under '''patches'''''
<p>When I deleted a page that was to the left of the apps page that had web app defaulted to it, it tossed the icons to that page because there is no page to the left of the one I just deleted.</p>
+
<source lang="bash">
<p><strong>Creating/adding multiple pages:</strong></p>
+
cd /
<p>So I was on page 1 and created a new page. Then I moved over to the page where device info, backup, screen &amp; lock was at and created a new page there. It tossed the page to the right and made a new page.</p>
+
sudo patch -p0 --backup-if-mismatch < ~/patches/adddelpages.patch
<hr />
+
</source>
<h1 id="toc1"><span>Uncomment the Following</span></h1>
 
<hr />
 
<p>/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js</p>
 
<p>Look for "appMenuModel" (line 27) a few lines below you will see a line that has "newpage" in it.<br />
 
  
On the line that remove the "/*" and on the line that has "deletepage" remove the "*/"</p>
+
*This is what you should see if it ran properly:
<p>Next look further in the file (line 119) for "switch" again remove the "/* and "*/" that surrounds the cases for newpage and deletepage.</p>
+
<source lang="text">
<p>reboot and now you'll have new page and delete page in the launcher app menu.</p>
+
patching file /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
<p>Note that you can download a patch for this at <a href="http://gitorious.org/webos-internals/modifications/blobs/raw/master/applauncher/add-delete-pages-in-the-launcher.patch">http://gitorious.org/webos-internals/modifications/blobs/raw/master/applauncher/add-delete-pages-in-the-launcher.patch</a></p>
+
</source>
<img src="http://img195.imageshack.us/img195/7636/unknown20091306141631.png" alt="unknown20091306141631.png" class="image" />
 
<p>-PS I moved the location of the edit menu down…</p>
 
<p>-Enjoy</p>
 
<hr />
 
<p>The credit to this goes to someone in the forums, at the time this was written I wasn't able to find out who exactly was it who wrote about it first (purely I don't have the time to look.) Pyrognome tested and confirmed the new page and delete page functionality.</p>
 
  
</div>
+
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:
+
<source lang="bash">
+
pkill LunaSysMgr
 +
</source>
  
 
<div class="page-tags">
 
<span>
 
page tags:
 
<a href="/system:page-tags/tag/hidden-functionality#pages">hidden-functionality</a>
 
<a href="/system:page-tags/tag/launcher#pages">launcher</a>
 
<a href="/system:page-tags/tag/luna#pages">luna</a>
 
  
<a href="/system:page-tags/tag/tweak#pages">tweak</a>
+
===Patch Source (adddelpages.patch)===
<a href="/system:page-tags/tag/ui#pages">ui</a>
 
<a href="/system:page-tags/tag/webos#pages">webos</a>
 
</span>
 
</div>
 
 
<!-- google_ad_section_end -->
 
 
<!-- google_ad_section_start(weight=ignore) -->
 
  
+
<source lang="diff">
<div style="clear:both; height:1px; font-size:1px;"></div>
+
diff -ur /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js
<div id="page-info">page_revision: 5, last_edited: <span class="odate">1245847491|%e %b %Y, %H:%M %Z (%O ago)</span></div>
+
--- /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-18 00:21:37.000000000 -0500
<div id="page-options-bottom"  class="page-options-bottom">
+
+++ /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-24 11:03:32.000000000 -0500
<a href="javascript:;" id="edit-button">edit</a><a href="javascript:;" id="tags-button">tags</a>
+
@@ -30,8 +30,8 @@
<a href="javascript:;" id="history-button">history</a>
+
visible: true,
<a href="javascript:;" id="files-button">files</a> <a href="javascript:;" id="print-button">print</a> <a href="javascript:;" id="site-tools-button">site tools</a><a href="javascript:;" id="more-options-button">+&nbsp;options</a>  
+
label: $L('Launcher'),
 +
        items: [
 +
- /*{ label: $L('New page'), command: 'newpage' },
 +
- { label: $L('Delete page'), command: 'deletepage' },*/
 +
+ { label: $L('New page'), command: 'newpage' },
 +
+ { label: $L('Delete page'), command: 'deletepage' },
 +
Mojo.Menu.editItem,
 +
{ label: $L('List Apps...'), command: 'listapps' },
 +
Mojo.Menu.helpItem
 +
@@ -124,7 +124,6 @@
 +
case 'listapps':
 +
ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.params);
 +
break;
 +
- /*
 +
case 'newpage':
 +
if (this.pageDivs.length < 10) {
 +
this.insertPage(this.activePageIndex, true);
 +
@@ -138,7 +137,6 @@
 +
}
 +
}
 +
break;
 +
- */
 +
}
 +
}
 +
},
 +
</source>
  
</div>
+
== 1.2 Update ==
<div id="page-options-bottom-2" class="page-options-bottom" style="display:none">
+
In 1.2, you'll need to uncomment lines 26-27, 120-134.
<a href="javascript:;" id="edit-sections-button">edit sections</a>
 
<a href="javascript:;" id="edit-append-button">append</a>
 
<a href="javascript:;" id="edit-meta-button">edit meta</a>
 
<a href="javascript:;" id="watchers-button">who watches</a>
 
<a href="javascript:;" id="backlinks-button">backlinks</a>
 
<a href="javascript:;" id="view-source-button">view source</a>
 
<a href="javascript:;" id="parent-page-button">parent</a>
 
<a href="javascript:;" id="page-block-button">block</a>
 
<a href="javascript:;" id="rename-move-button">rename</a>
 
<a href="javascript:;" id="delete-button">delete</a>
 
 
 
</div>
 
<div id="page-options-area-bottom">
 
</div>
 
 
 
<div id="action-area" style="display: none"></div>
 
</div>
 
</div>
 
 
 
 
<div id="footer" style="display: block; visibility: visible;">
 
<div class="options" style="display: block; visibility: visible;">
 
<a href="http://www.wikidot.com/doc" id="wikidot-help-button">
 
help </a>
 
 
 
|
 
<a href="http://www.wikidot.com/legal:terms-of-service"  id="wikidot-tos-button">
 
terms of service </a>
 
|
 
<a href="http://www.wikidot.com/legal:privacy-policy"  id="wikidot-privacy-button">
 
privacy </a>
 
|
 
<a href="javascript:;" id="bug-report-button"
 
onclick="WIKIDOT.page.listeners.pageBugReport(event)">
 
report a bug </a>
 
 
 
|
 
<a href="javascript:;" id="abuse-report-button"
 
onclick="WIKIDOT.page.listeners.flagPageObjectionable(event)">
 
flag as objectionable </a>
 
</div>
 
Hosted by <a href="http://www.wikidot.com">Wikidot.com</a> &#8212;
 
professional wiki solutions
 
</div>
 
<div id="license-area" class="license-area">
 
 
 
Unless stated otherwise Content of this page is licensed under <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 License</a>
 
</div>
 
 
 
 
 
 
 
<div id="extrac-div-1"><span></span></div><div id="extrac-div-2"><span></span></div><div id="extrac-div-3"><span></span></div>
 
 
  <div id="footer-bar">
 
  <div>
 
    </div>
 
  <h2>Other remarkable sites from Wikidot</h2>
 
 
 
 
 
      <div class="unit">
 
      <div class="inner">
 
        <a target="_blank" class="image" href="http://chi2.wikidot.com">
 
          <img class="thumbnail" alt="" src="http://www.wikidot.com/site_thumbnail.php?site=chi2"/>
 
        </a>
 
        <h3><a target="_blank" href="http://chi2.wikidot.com">CHI-JHUMC</a></h3>
 
        <div class="desc">         
 
         
 
        </div>
 
      </div>
 
 
 
    </div>
 
      <div class="unit">
 
      <div class="inner">
 
        <a target="_blank" class="image" href="http://felipemayworm.com">
 
          <img class="thumbnail" alt="" src="http://www.wikidot.com/site_thumbnail.php?site=felipemayworm"/>
 
        </a>
 
        <h3><a target="_blank" href="http://felipemayworm.com">Felipe Mayworm</a></h3>
 
        <div class="desc">         
 
         
 
        </div>
 
 
 
      </div>
 
    </div>
 
      <div class="unit">
 
      <div class="inner">
 
        <a target="_blank" class="image" href="http://jaaga.wikidot.com">
 
          <img class="thumbnail" alt="" src="http://www.wikidot.com/site_thumbnail.php?site=jaaga"/>
 
        </a>
 
        <h3><a target="_blank" href="http://jaaga.wikidot.com">Jaaga</a></h3>
 
 
 
        <div class="desc">         
 
         
 
        </div>
 
      </div>
 
    </div>
 
      <div class="unit">
 
      <div class="inner">
 
        <a target="_blank" class="image" href="http://city.info-4.me">
 
          <img class="thumbnail" alt="" src="http://www.wikidot.com/site_thumbnail.php?site=site-1"/>
 
        </a>
 
 
 
        <h3><a target="_blank" href="http://city.info-4.me">City.Info-4.Me</a></h3>
 
        <div class="desc">         
 
         
 
        </div>
 
      </div>
 
    </div>
 
  </div>
 
 
 
  </div>
 
 
</div>
 
 
 
<!-- These extra divs/spans may be used as catch-alls to add extra imagery. -->
 
<div id="extra-div-1"><span></span></div><div id="extra-div-2"><span></span></div><div id="extra-div-3"><span></span></div>
 
<div id="extra-div-4"><span></span></div><div id="extra-div-5"><span></span></div><div id="extra-div-6"><span></span></div>
 
</div>
 
 
 
<div id="page-options-bottom-tips" style="display: none">
 
<div id="edit-button-hovertip">
 
Click here to edit contents of this page. </div>
 
</div>
 
 
 
<div id="page-options-bottom-2-tips"  style="display: none">
 
<div id="edit-sections-button-hovertip">
 
Click here to toggle editing of individual sections of the page (if possible).
 
Watch headings for an "edit" link when available. </div>
 
<div id="edit-append-button-hovertip">
 
Append content without editing the whole page source. </div>
 
<div id="history-button-hovertip">
 
Check out how this page has evolved in the past. </div>
 
 
 
<div id="discuss-button-hovertip">
 
If you want to discuss contents of this page - this is the easiest way to do it. </div>
 
<div id="files-button-hovertip">
 
View and manage file attachments for this page. </div>
 
<div id="site-tools-button-hovertip">
 
A few useful tools to manage this Site. </div>
 
<div id="backlinks-button-hovertip">
 
 
 
See pages that link to and include this page. </div>
 
<div id="rename-move-button-hovertip">
 
Change the name (also URL address, possibly the category) of the page. </div>
 
<div id="view-source-button-hovertip">
 
View wiki source for this page without editing. </div>
 
<div id="parent-page-button-hovertip">
 
View/set parent page (used for creating breadcrumbs and structured layout). </div>
 
 
 
<div id="abuse-report-button-hovertip">
 
Notify administrators if there is objectionable content in this page. </div>
 
<div id="bug-report-button-hovertip">
 
Something does not work as expected? Find out what you can do. </div>
 
<div id="wikidot-help-button-hovertip">
 
General Wikidot.com documentation and help section. </div>
 
<div id="wikidot-tos-button-hovertip">
 
 
 
Wikidot.com Terms of Service - what you can, what you should not etc. </div>
 
<div id="wikidot-privacy-button-hovertip">
 
Wikidot.com Privacy Policy.
 
</div>
 
</div>
 
 
<!-- google_ad_section_end -->
 
 
<div id="account-notifications-dummy" style="display:none"></div>
 
 
<div style="display:none" id="dummy-ondomready-block"></div>
 
 
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
 
 
 
<script type="text/javascript">
 
_uacct = "UA-9343099-1";
 
 
 
urchinTracker();
 
</script>
 
 
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
 
<script type="text/javascript">
 
_uff = false;
 
_uacct = "UA-68540-5";
 
_udn="wikidot.com";
 
urchinTracker();
 
</script>
 
 
 
<!-- Start Quantcast tag -->
 
<script type="text/javascript">
 
_qoptions={
 
qacct:"p-edL3gsnUjJzw-"
 
};
 
</script>
 
<script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
 
<noscript>
 
<img src="http://pixel.quantserve.com/pixel/p-edL3gsnUjJzw-.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>
 
</noscript>
 
 
 
<!-- End Quantcast tag -->
 
 
 
 
 
 
  </body>
 
 
 
</html>
 

Latest revision as of 20:58, 10 November 2009


Add/Delete Pages

Introduction

Someone in the forum talked about being able to add and delete pages in the Launcher app and I thought I would look into it further. They stated that they were able to add new pages and delete existing pages. Upon further investigation, they were correct. There is existing code, commented out, that will allow you to create a new launcher page or delete the current launcher page. There is a variable for the max number of pages palm set to 10. This value can probably be increased, but I don't recommend it and seriously, who would need more that 10 pages anyway, right?

Usage

  • The new page and delete page functions will appear in the launcher menu.
    • New Page
      • This will create a new page and move whatever page you were on to the right. There is nothing special to this page besides the fact that you now have a new page. You can drag icons to it just like any other page.
    • Delete Page
      • This will delete the current launcher page. Any icons on the page will automatically move to the page to the left of the page being deleted. If there is no page to the left of the page being deleted icons are automatically moved to the default page of the Web Browser.

Editing Process

/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
  • Uncomment the following
    • Look for "appMenuModel" (line 29) a few lines below you will see a line that has "newpage" in it. On the line that remove the "/*" and on the line that has "deletepage" remove the "*/"
    • Look further in the file (line 120) for "switch" again remove the "/* and "*/" that surrounds the cases for newpage and deletepage.
  • Perform a restart and the new page and delete page options will be in the launcher menu.

Original discovery credit is unknown. Pyrognome tested and confirmed the new page and delete page functionality.


Rearrange Order of Menu Items

This is a fantastic patch that makes the launcher much more useful (along with the 4x4 icon patches), but I kept hitting Delete Page because it was second on the list when I was trying to List Apps. Then, the page that I was currently on would be deleted and I would have to go back through and move all the icons to a new page - frustrating for me. Therefore, I simply rearranged the order of the menu items to what was more intuitive for me. This is a small change to this great patch, and does not add or subtract any functionality.

Login via SSH

sudo -i
//enter password to become root

cd /

mount -o remount,rw /

vi /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
//go to lines 26 and 27 and comment them out by adding '//' in front of them...to do this, hit 'i' to enter edit mode (you will see a capital i on the
//bottom left-hand corner of the screen) and scroll over to the beginning of the lines and type '//'. Then, rearrange the five menu items to whatever
//order you want...what I like best is below:

         items: [
                        //{ label: $L('New page'), command: 'newpage' },
                        //{ label: $L('Delete page'), command: 'deletepage' },
                        Mojo.Menu.editItem,
                        { label: $L('List Apps...'), command: 'listapps' },
                        { label: $L('New page'), command: 'newpage' },
                        { label: $L('Delete page'), command: 'deletepage' },
                        Mojo.Menu.helpItem
                ]

//This puts Edit first, then List Apps, New Page, Delete Page, and Help last in the menu
//hit ESC to exit edit mode, and then type ':wq' to save the file (launcher-assistant.js) that we just modified...

mount -o remount,ro /

stop LunaSysMgr && start LunaSysMgr

All credit for this patch goes to original developer!

Enjoy! jmartino2011, 11-10-09

Patch Process

The patch is also located in the webos-internals gitorious repository. Click Applying Patches for info on patching from it.

I'm trying to make most of my modifications into patches --HattCzech

  • Run the following commands:

In this example, I have the patch file located in my home directory under patches <source lang="bash"> cd / sudo patch -p0 --backup-if-mismatch < ~/patches/adddelpages.patch </source>

  • This is what you should see if it ran properly:

<source lang="text"> patching file /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js </source>

These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command: <source lang="bash"> pkill LunaSysMgr </source>


Patch Source (adddelpages.patch)

<source lang="diff"> diff -ur /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js --- /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-18 00:21:37.000000000 -0500 +++ /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-24 11:03:32.000000000 -0500 @@ -30,8 +30,8 @@

		visible: true,
		label: $L('Launcher'),
        items: [

- /*{ label: $L('New page'), command: 'newpage' }, - { label: $L('Delete page'), command: 'deletepage' },*/ + { label: $L('New page'), command: 'newpage' }, + { label: $L('Delete page'), command: 'deletepage' },

			Mojo.Menu.editItem,
			{ label: $L('List Apps...'), command: 'listapps' },
			Mojo.Menu.helpItem

@@ -124,7 +124,6 @@

				case 'listapps':
					ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.params);
					break;

- /*

				case 'newpage':
					if (this.pageDivs.length < 10) {
						this.insertPage(this.activePageIndex, true);

@@ -138,7 +137,6 @@

						}
					}
					break;

- */

			}
		}
	},

</source>

1.2 Update

In 1.2, you'll need to uncomment lines 26-27, 120-134.