Re: Panorama module for G3

Mike Miller <[email protected]> Tue, 15 Jan 2013 08:42:32 +0200
Newsgroups gmane.comp.web.gallery.devel
Message-ID <CAGYq59c=Ppio2r24LhV6AmUmgyk0G98DSCn-ksWj1MM8+ejX-w@mail.gmail.com>
On Mon, Jan 14, 2013 at 10:43 PM, Bharat Mediratta <[email protected]> wrote:
> You can probably do some git magic to keep the two in sync, but my git fu is
> not good enough to tell you offhand.  Or you can just copy stuff over and
> submit pull requests every once in a while.

There're few better motivators than being told by someone with more
experience that they don't know something :)

The key appears to be subtrees; here's what I did (within my fork of
gallery3-contrib):

git remote add -f panorama git-9UaJU3cA/F/[email protected]:mikeage/panorama.git
git merge  --squash -s ours --no-commit  panorama/master # The initial
commit should squash all of my development into one commit
git read-tree --prefix 3.0/modules/panorama -u panorama/master
git commit -m "Add panorama as a subtree"

Subsequent development that I do in my repository can be taken into my fork via:

git pull -s subtree --squash  panorama master # Or without --squash;
then the default is to commit unless --no-commit is specified

It's not yet clear to me how I would merge a change that someone makes
in gallery3-contrib to my repo, but that's my problem, not yours :)

In any case, the pull request was sent.

>> I _think_ I understood that, at least in general, though I'll need to
>> re-read it a few times to make sure. Another option I considered
>> before I tried this approach was to rewrite the tag using JavaScript
>> (or is that what you were proposing by a custom view?)
>
> Rewriting it with JS is clunky because it means that we know we're
> generating the wrong thing first.  Take a look at the code for movie_img -
> it should be clear enough.

Ok. I was looking at the embed_videos module, as that seemed like a
good example of overriding the renderer (to borrow a G2 term). In
embed_videos/views/embed_video_js.html.php, they use the following:

<? if (isset($embed_code)): ?>
<script type="text/javascript">
$(document).ready(function() {
$("#g-photo").replaceWith("<div id=\"g-movie\"
class=\"ui-helper-clearfix\"><?= $embed_code ?></div>");
});
</script>

I didn't originally think of movie_img since, well, it's not a movie!
But looking at the code, I see what you mean about it being suitable.

> Unfortunately I don't understand the panorama constraints well enough here
> to provide informed guidance.  Let's do this incrementally - get it working
> and in decent enough shape that I can pull it in and play with it and then
> hopefully I'll have time to learn enough about it to push on it.

Ok.

Regarding the resizes, I can probably resize them in Flash, but it's a
bit of a waste to download a large image if I know ahead of time it
will be shrunk. OTOH, I see the future moving towards HTML5 and not
Flash, so maybe investing too much at this point (especially when G3
doesn't natively support multiple resizes) is a bit of a waste of
time.

Thanks

-- Mike

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]